From d5c3ec8b93296987b443efb45fe1d7726c268183 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 3 Sep 2017 02:53:28 -0500 Subject: Changes to make timers within the library monotonic. --- examples/Makefile.am | 12 +- examples/h5_debug_trace.c | 144 +++++++++++ examples/run-c-ex.sh.in | 5 + src/H5Eprivate.h | 2 +- src/H5FDlog.c | 432 +++++++++++++++----------------- src/H5T.c | 35 ++- src/H5Tdbg.c | 25 +- src/H5Tpkg.h | 2 +- src/H5Z.c | 195 ++++++++------- src/H5private.h | 37 ++- src/H5system.c | 117 ++++++++- src/H5timer.c | 608 ++++++++++++++++++++++++++++++++++++---------- src/H5trace.c | 51 ++-- test/Makefile.am | 3 +- test/timer.c | 415 +++++++++++++++++++++++++++++++ 15 files changed, 1563 insertions(+), 520 deletions(-) create mode 100644 examples/h5_debug_trace.c create mode 100644 test/timer.c diff --git a/examples/Makefile.am b/examples/Makefile.am index 8c6540f..6665574 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -35,9 +35,9 @@ EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \ h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \ h5_crtatt h5_crtgrp h5_crtdat \ h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \ - h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \ - h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \ - h5_vds-percival-unlim h5_vds-percival-unlim-maxmin + h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg h5_debug_trace \ + h5_vds h5_vds-exc h5_vds-exclim h5_vds-eiger h5_vds-simpleIO \ + h5_vds-percival h5_vds-percival-unlim h5_vds-percival-unlim-maxmin TEST_SCRIPT=testh5cc.sh TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES) @@ -48,9 +48,9 @@ INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \ h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \ h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \ h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \ - h5_ref2reg.c h5_shared_mesg.c ph5example.c h5_vds.c h5_vds-exc.c \ - h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c h5_vds-percival.c \ - h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c + h5_ref2reg.c h5_shared_mesg.c h5_debug_trace.c ph5example.c \ + h5_vds.c h5_vds-exc.c h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c \ + h5_vds-percival.c h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c diff --git a/examples/h5_debug_trace.c b/examples/h5_debug_trace.c new file mode 100644 index 0000000..3d89ba4 --- /dev/null +++ b/examples/h5_debug_trace.c @@ -0,0 +1,144 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This example demonstrates debug trace output. + * + * Debug/trace/performance output is not tested as a regular part of our + * testing so this program gives a quick check that it's all working. + * + * Preconditions: + * + * You need to set an environment variable named HDF5_DEBUG to have a value + * of "+all trace ttimes". In the bash shell, you'd use: + * + * export HDF5_DEBUG="+all trace ttimes" + * + * When you are done with this test program, you can set the variable back + * to "-all" to suppress trace output. + * + * Usage: + * + * Compile and run the test program, then inspect the output. You should see + * trace information for each HDF5 function call that increase over time. + * Each time stamp is in seconds and designated with an '@' sign. The + * elapsed time for the function call is given in seconds in the [dt= ] + * part. + * + * You will also get summary output for the shuffle filter performance and + * data type conversion performance. These will include the elapsed time + * (always) and the system and user times (if available on your system). On + * fast machines, these numbers may be 0.0. Adjust the loop variables in + * the program as needed to generate reasonable output. + */ + +#include +#include + +#include "hdf5.h" + +#define BUF_SIZE 1048576 +#define N_LOOPS 64 + +#define TESTFILE "h5_debug_trace_out.h5" + +int +main(int argc, char **argv) +{ + int i, j; + int *data; + + hid_t fid; + hid_t pid; + hid_t did; + hid_t sid; + + hsize_t dims[1] = { BUF_SIZE }; + hsize_t chunk_sizes[1] = { 1024 }; + + herr_t err; + + /*************************************************************************/ + + /* Warn the user about trace deluge to come */ + + printf("Testing debug/trace/performance data generation\n"); + printf("\n"); + printf("This test should generate a large amount of trace data\n"); + printf("\n"); + printf("*** BEGIN TRACE OUTPUT ***\n"); + printf("\n"); + fflush(stdout); + + /* This will emit H5Tconvert() performance information */ + + for(i = 0; i < N_LOOPS; i++) { + + /* The buffer has to be large enough to hold the conversion output */ + data = (int *)malloc(BUF_SIZE * sizeof(double)); + + for(j = 0; j < BUF_SIZE; j++) { + data[j] = j; + } + + err = H5Tconvert(H5T_NATIVE_INT, H5T_NATIVE_DOUBLE, BUF_SIZE, data, + NULL, H5P_DEFAULT); + + if(err < 0) { + fprintf(stderr, "ERROR: Conversion failed\n"); + free(data); + return err; + } + + free(data); + + } + + + /* This will emit H5Z performance information */ + + data = (int *)malloc(BUF_SIZE * sizeof(int)); + + for(i = 0; i < BUF_SIZE; i++) { + data[i] = i; + } + + fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + pid = H5Pcreate(H5P_DATASET_CREATE); + err = H5Pset_chunk(pid, 1, chunk_sizes); + err = H5Pset_shuffle(pid); + + sid = H5Screate_simple(1, dims, dims); + did = H5Dcreate(fid, "somedata", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); + err = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data); + + H5Sclose(sid); + H5Dclose(did); + H5Pclose(pid); + H5Fclose(fid); + + free(data); + + /* Finished */ + fflush(stdout); + printf("\n"); + printf("*** END TRACE OUTPUT ***\n"); + printf("\n"); + + remove(TESTFILE); + + return 0; +} + diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in index 4d5d594..f550992 100644 --- a/examples/run-c-ex.sh.in +++ b/examples/run-c-ex.sh.in @@ -122,6 +122,11 @@ then rm h5_extlink &&\ RunTest h5_elink_unix2win &&\ rm h5_elink_unix2win &&\ + OLD_DEBUG_STRING=$HDF5_DEBUG &&\ + export HDF5_DEBUG="+all +trace +ttimes" &&\ + RunTest h5_debug_trace &&\ + HDF5_DEBUG=$OLD_DEBUG_STRING &&\ + rm h5_debug_trace &&\ RunTest h5_shared_mesg &&\ rm h5_shared_mesg &&\ RunTest h5_vds-eiger &&\ diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 57e7485..d75c43d 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -184,7 +184,7 @@ H5_DLL herr_t H5E_init(void); H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func, - unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...)H5_ATTR_FORMAT(printf, 8, 9); + unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...) H5_ATTR_FORMAT(printf, 8, 9); H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(hbool_t is_api); diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 7c2297a..b7b2421 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -479,11 +479,8 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) #ifdef H5_HAVE_WIN32_API struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif -#ifdef H5_HAVE_GETTIMEOFDAY - struct timeval timeval_start; - struct timeval open_timeval_diff; - struct timeval stat_timeval_diff; -#endif /* H5_HAVE_GETTIMEOFDAY */ + H5_timer_t open_timer; /* Timer for open() call */ + H5_timer_t stat_timer; /* Timer for stat() call */ h5_stat_t sb; H5FD_t *ret_value = NULL; /* Return value */ @@ -515,54 +512,36 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) if(NULL == (fa = (const H5FD_log_fapl_t *)H5P_peek_driver_info(plist))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info") -#ifdef H5_HAVE_GETTIMEOFDAY - if(fa->flags & H5FD_LOG_TIME_OPEN) - HDgettimeofday(&timeval_start, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Start timer for open() call */ + if(fa->flags & H5FD_LOG_TIME_OPEN) { + H5_timer_init(&open_timer); + H5_timer_start(&open_timer); + } /* end if */ + /* Open the file */ if((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) { int myerrno = errno; HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file: name = '%s', errno = %d, error message = '%s', flags = %x, o_flags = %x", name, myerrno, HDstrerror(myerrno), flags, (unsigned)o_flags); } /* end if */ -#ifdef H5_HAVE_GETTIMEOFDAY - if(fa->flags & H5FD_LOG_TIME_OPEN) { - struct timeval timeval_stop; - HDgettimeofday(&timeval_stop, NULL); + /* Stop timer for open() call */ + if(fa->flags & H5FD_LOG_TIME_OPEN) + H5_timer_stop(&open_timer); - /* Calculate the elapsed gettimeofday time */ - open_timeval_diff.tv_usec = timeval_stop.tv_usec - timeval_start.tv_usec; - open_timeval_diff.tv_sec = timeval_stop.tv_sec - timeval_start.tv_sec; - if(open_timeval_diff.tv_usec < 0) { - open_timeval_diff.tv_usec += 1000000; - open_timeval_diff.tv_sec--; - } /* end if */ + /* Start timer for stat() call */ + if(fa->flags & H5FD_LOG_TIME_STAT) { + H5_timer_init(&stat_timer); + H5_timer_start(&stat_timer); } /* end if */ -#endif /* H5_HAVE_GETTIMEOFDAY */ -#ifdef H5_HAVE_GETTIMEOFDAY - if(fa->flags & H5FD_LOG_TIME_STAT) - HDgettimeofday(&timeval_start, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ /* Get the file stats */ if(HDfstat(fd, &sb) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") -#ifdef H5_HAVE_GETTIMEOFDAY - if(fa->flags & H5FD_LOG_TIME_STAT) { - struct timeval timeval_stop; - HDgettimeofday(&timeval_stop, NULL); - - /* Calculate the elapsed gettimeofday time */ - stat_timeval_diff.tv_usec = timeval_stop.tv_usec - timeval_start.tv_usec; - stat_timeval_diff.tv_sec = timeval_stop.tv_sec - timeval_start.tv_sec; - if(stat_timeval_diff.tv_usec < 0) { - stat_timeval_diff.tv_usec += 1000000; - stat_timeval_diff.tv_sec--; - } /* end if */ - } /* end if */ -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Stop timer for stat() call */ + if(fa->flags & H5FD_LOG_TIME_STAT) + H5_timer_stop(&stat_timer); /* Create the new file struct */ if(NULL == (file = H5FL_CALLOC(H5FD_log_t))) @@ -623,13 +602,19 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) else file->logfp = stderr; -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_OPEN) - HDfprintf(file->logfp, "Open took: (%f s)\n", (double)open_timeval_diff.tv_sec + ((double)open_timeval_diff.tv_usec / (double)1000000.0f)); - if(file->fa.flags & H5FD_LOG_TIME_STAT) - HDfprintf(file->logfp, "Stat took: (%f s)\n", (double)stat_timeval_diff.tv_sec + ((double)stat_timeval_diff.tv_usec / (double)1000000.0f)); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Log the timer values */ + if(file->fa.flags & H5FD_LOG_TIME_OPEN) { + H5_timevals_t open_times; /* Elapsed time for open() call */ + H5_timer_get_times(open_timer, &open_times); + HDfprintf(file->logfp, "Open took: (%f s)\n", open_times.elapsed); + } /* end if */ + if(file->fa.flags & H5FD_LOG_TIME_STAT) { + H5_timevals_t stat_times; /* Elapsed time for stat() call */ + + H5_timer_get_times(stat_timer, &stat_times); + HDfprintf(file->logfp, "Stat took: (%f s)\n", stat_times.elapsed); + } /* end if */ } /* end if */ /* Check for non-default FAPL */ @@ -676,27 +661,27 @@ static herr_t H5FD_log_close(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; -#ifdef H5_HAVE_GETTIMEOFDAY - struct timeval timeval_start, timeval_stop; -#endif /* H5_HAVE_GETTIMEOFDAY */ - herr_t ret_value = SUCCEED; /* Return value */ + H5_timer_t close_timer; /* Timer for close() call */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(file); -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags&H5FD_LOG_TIME_CLOSE) - HDgettimeofday(&timeval_start, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Start timer for close() call */ + if(file->fa.flags & H5FD_LOG_TIME_CLOSE) { + H5_timer_init(&close_timer); + H5_timer_start(&close_timer); + } /* end if */ + /* Close the underlying file */ if(HDclose(file->fd) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") -#ifdef H5_HAVE_GETTIMEOFDAY + + /* Stop timer for close() call */ if(file->fa.flags&H5FD_LOG_TIME_CLOSE) - HDgettimeofday(&timeval_stop, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + H5_timer_stop(&close_timer); /* Dump I/O information */ if(file->fa.flags != 0) { @@ -704,20 +689,12 @@ H5FD_log_close(H5FD_t *_file) haddr_t last_addr; unsigned char last_val; -#ifdef H5_HAVE_GETTIMEOFDAY if(file->fa.flags & H5FD_LOG_TIME_CLOSE) { - struct timeval timeval_diff; - - /* Calculate the elapsed gettimeofday time */ - timeval_diff.tv_usec = timeval_stop.tv_usec - timeval_start.tv_usec; - timeval_diff.tv_sec = timeval_stop.tv_sec - timeval_start.tv_sec; - if(timeval_diff.tv_usec < 0) { - timeval_diff.tv_usec += 1000000; - timeval_diff.tv_sec--; - } /* end if */ - HDfprintf(file->logfp, "Close took: (%f s)\n", (double)timeval_diff.tv_sec + ((double)timeval_diff.tv_usec / (double)1000000.0f)); + H5_timevals_t close_times; /* Elapsed time for close() call */ + + H5_timer_get_times(close_timer, &close_times); + HDfprintf(file->logfp, "Close took: (%f s)\n", close_times.elapsed); } /* end if */ -#endif /* H5_HAVE_GETTIMEOFDAY */ /* Dump the total number of seek/read/write operations */ if(file->fa.flags & H5FD_LOG_NUM_READ) @@ -1160,10 +1137,11 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd H5FD_log_t *file = (H5FD_log_t *)_file; size_t orig_size = size; /* Save the original size for later */ haddr_t orig_addr = addr; -#ifdef H5_HAVE_GETTIMEOFDAY - struct timeval timeval_start, timeval_stop; -#endif /* H5_HAVE_GETTIMEOFDAY */ - herr_t ret_value = SUCCEED; /* Return value */ + H5_timer_t read_timer; /* Timer for read operation */ + H5_timer_t seek_timer; /* Timer for seek operation */ + H5_timevals_t read_times; /* Elapsed time for read operation */ + H5_timevals_t seek_times; /* Elapsed time for seek operation */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1191,58 +1169,55 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd /* Seek to the correct location */ if(addr != file->pos || OP_READ != file->op) { -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_SEEK) - HDgettimeofday(&timeval_start, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Start timer for seek() call */ + if(file->fa.flags & H5FD_LOG_TIME_SEEK) { + H5_timer_init(&seek_timer); + H5_timer_start(&seek_timer); + } /* end if */ + if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") -#ifdef H5_HAVE_GETTIMEOFDAY + + /* Stop timer for seek() call */ if(file->fa.flags & H5FD_LOG_TIME_SEEK) - HDgettimeofday(&timeval_stop, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + H5_timer_stop(&seek_timer); - /* Log information about the seek */ + /* Add to the number of seeks, when tracking that */ if(file->fa.flags & H5FD_LOG_NUM_SEEK) file->total_seek_ops++; + + /* Add to the total seek time, when tracking that */ + if(file->fa.flags & H5FD_LOG_TIME_SEEK) { + H5_timer_get_times(seek_timer, &seek_times); + file->total_seek_time += seek_times.elapsed; + } /* end if */ + + /* Emit log string if we're tracking individual seek events. */ if(file->fa.flags & H5FD_LOG_LOC_SEEK) { HDfprintf(file->logfp, "Seek: From %10a To %10a", file->pos, addr); -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_SEEK) { - struct timeval timeval_diff; - double time_diff; - - /* Calculate the elapsed gettimeofday time */ - timeval_diff.tv_usec = timeval_stop.tv_usec - timeval_start.tv_usec; - timeval_diff.tv_sec = timeval_stop.tv_sec - timeval_start.tv_sec; - if(timeval_diff.tv_usec < 0) { - timeval_diff.tv_usec += 1000000; - timeval_diff.tv_sec--; - } /* end if */ - time_diff = (double)timeval_diff.tv_sec + ((double)timeval_diff.tv_usec / (double)1000000.0f); - HDfprintf(file->logfp, " (%fs @ %.6lu.%.6llu)\n", time_diff, (unsigned long long)timeval_start.tv_sec, (unsigned long long)timeval_start.tv_usec); - /* Add to total seek time */ - file->total_seek_time += time_diff; - } /* end if */ - else - HDfprintf(file->logfp, "\n"); -#else /* H5_HAVE_GETTIMEOFDAY */ - HDfprintf(file->logfp, "\n"); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Add the seek time, if we're tracking that. + * Note that the seek time is NOT emitted for when just H5FD_LOG_TIME_SEEK + * is set. + */ + if(file->fa.flags & H5FD_LOG_TIME_SEEK) + HDfprintf(file->logfp, " (%fs @ %f)\n", seek_times.elapsed, seek_timer.initial.elapsed); + else + HDfprintf(file->logfp, "\n"); } /* end if */ } /* end if */ + /* Start timer for read operation */ + if(file->fa.flags & H5FD_LOG_TIME_READ) { + H5_timer_init(&read_timer); + H5_timer_start(&read_timer); + } /* end if */ + /* * Read data, being careful of interrupted system calls, partial results, * and the end of the file. */ -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_READ) - HDgettimeofday(&timeval_start, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ while(size > 0) { - h5_posix_io_t bytes_in = 0; /* # of bytes to read */ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ @@ -1283,14 +1258,22 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd buf = (char *)buf + bytes_read; } /* end while */ -#ifdef H5_HAVE_GETTIMEOFDAY + + /* Stop timer for read operation */ if(file->fa.flags & H5FD_LOG_TIME_READ) - HDgettimeofday(&timeval_stop, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + H5_timer_stop(&read_timer); - /* Log information about the read */ + /* Add to the number of reads, when tracking that */ if(file->fa.flags & H5FD_LOG_NUM_READ) file->total_read_ops++; + + /* Add to the total read time, when tracking that */ + if(file->fa.flags & H5FD_LOG_TIME_READ) { + H5_timer_get_times(read_timer, &read_times); + file->total_read_time += read_times.elapsed; + } /* end if */ + + /* Log information about the read */ if(file->fa.flags & H5FD_LOG_LOC_READ) { HDfprintf(file->logfp, "%10a-%10a (%10Zu bytes) (%s) Read", orig_addr, (orig_addr + orig_size) - 1, orig_size, flavors[type]); @@ -1300,30 +1283,14 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd HDassert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] || (H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] == H5FD_MEM_DEFAULT); } /* end if */ - -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_READ) { - struct timeval timeval_diff; - double time_diff; - - /* Calculate the elapsed gettimeofday time */ - timeval_diff.tv_usec = timeval_stop.tv_usec - timeval_start.tv_usec; - timeval_diff.tv_sec = timeval_stop.tv_sec - timeval_start.tv_sec; - if(timeval_diff.tv_usec < 0) { - timeval_diff.tv_usec += 1000000; - timeval_diff.tv_sec--; - } /* end if */ - time_diff = (double)timeval_diff.tv_sec + ((double)timeval_diff.tv_usec / (double)1000000.0f); - HDfprintf(file->logfp, " (%fs @ %.6lu.%.6llu)\n", time_diff, (unsigned long long)timeval_start.tv_sec, (unsigned long long)timeval_start.tv_usec); - - /* Add to total read time */ - file->total_read_time += time_diff; - } /* end if */ + /* Add the read time, if we're tracking that. + * Note that the read time is NOT emitted for when just H5FD_LOG_TIME_READ + * is set. + */ + if(file->fa.flags & H5FD_LOG_TIME_READ) + HDfprintf(file->logfp, " (%fs @ %f)\n", read_times.elapsed, read_timer.initial.elapsed); else HDfprintf(file->logfp, "\n"); -#else /* H5_HAVE_GETTIMEOFDAY */ - HDfprintf(file->logfp, "\n"); -#endif /* H5_HAVE_GETTIMEOFDAY */ } /* end if */ /* Update current position */ @@ -1362,10 +1329,11 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had H5FD_log_t *file = (H5FD_log_t *)_file; size_t orig_size = size; /* Save the original size for later */ haddr_t orig_addr = addr; -#ifdef H5_HAVE_GETTIMEOFDAY - struct timeval timeval_start, timeval_stop; -#endif /* H5_HAVE_GETTIMEOFDAY */ - herr_t ret_value = SUCCEED; /* Return value */ + H5_timer_t write_timer; /* Timer for write operation */ + H5_timer_t seek_timer; /* Timer for seek operation */ + H5_timevals_t write_times; /* Elapsed time for write operation */ + H5_timevals_t seek_times; /* Elapsed time for seek operation */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1398,58 +1366,55 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had /* Seek to the correct location */ if(addr != file->pos || OP_WRITE != file->op) { -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_SEEK) - HDgettimeofday(&timeval_start, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Start timer for seek() call */ + if(file->fa.flags & H5FD_LOG_TIME_SEEK) { + H5_timer_init(&seek_timer); + H5_timer_start(&seek_timer); + } /* end if */ + if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") -#ifdef H5_HAVE_GETTIMEOFDAY + + /* Stop timer for seek() call */ if(file->fa.flags & H5FD_LOG_TIME_SEEK) - HDgettimeofday(&timeval_stop, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + H5_timer_stop(&seek_timer); - /* Log information about the seek */ + /* Add to the number of seeks, when tracking that */ if(file->fa.flags & H5FD_LOG_NUM_SEEK) file->total_seek_ops++; + + /* Add to the total seek time, when tracking that */ + if(file->fa.flags & H5FD_LOG_TIME_SEEK) { + H5_timer_get_times(seek_timer, &seek_times); + file->total_seek_time += seek_times.elapsed; + } /* end if */ + + /* Emit log string if we're tracking individual seek events. */ if(file->fa.flags & H5FD_LOG_LOC_SEEK) { HDfprintf(file->logfp, "Seek: From %10a To %10a", file->pos, addr); -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_SEEK) { - struct timeval timeval_diff; - double time_diff; - - /* Calculate the elapsed gettimeofday time */ - timeval_diff.tv_usec = timeval_stop.tv_usec - timeval_start.tv_usec; - timeval_diff.tv_sec = timeval_stop.tv_sec - timeval_start.tv_sec; - if(timeval_diff.tv_usec < 0) { - timeval_diff.tv_usec += 1000000; - timeval_diff.tv_sec--; - } /* end if */ - time_diff = (double)timeval_diff.tv_sec + ((double)timeval_diff.tv_usec / (double)1000000.0f); - HDfprintf(file->logfp, " (%fs @ %.6lu.%.6llu)\n", time_diff, (unsigned long long)timeval_start.tv_sec, (unsigned long long)timeval_start.tv_usec); - /* Add to total seek time */ - file->total_seek_time += time_diff; - } /* end if */ - else - HDfprintf(file->logfp, "\n"); -#else /* H5_HAVE_GETTIMEOFDAY */ - HDfprintf(file->logfp, "\n"); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Add the seek time, if we're tracking that. + * Note that the seek time is NOT emitted for when just H5FD_LOG_TIME_SEEK + * is set. + */ + if(file->fa.flags & H5FD_LOG_TIME_SEEK) + HDfprintf(file->logfp, " (%fs @ %f)\n", seek_times.elapsed, seek_timer.initial.elapsed); + else + HDfprintf(file->logfp, "\n"); } /* end if */ } /* end if */ + /* Start timer for write operation */ + if(file->fa.flags&H5FD_LOG_TIME_WRITE) { + H5_timer_init(&write_timer); + H5_timer_start(&write_timer); + } /* end if */ + /* * Write the data, being careful of interrupted system calls and partial * results */ -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags&H5FD_LOG_TIME_WRITE) - HDgettimeofday(&timeval_start, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ while(size > 0) { - h5_posix_io_t bytes_in = 0; /* # of bytes to write */ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ @@ -1483,14 +1448,22 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had addr += (haddr_t)bytes_wrote; buf = (const char *)buf + bytes_wrote; } /* end while */ -#ifdef H5_HAVE_GETTIMEOFDAY + + /* Stop timer for write operation */ if(file->fa.flags & H5FD_LOG_TIME_WRITE) - HDgettimeofday(&timeval_stop, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + H5_timer_stop(&write_timer); - /* Log information about the write */ + /* Add to the number of writes, when tracking that */ if(file->fa.flags & H5FD_LOG_NUM_WRITE) file->total_write_ops++; + + /* Add to the total write time, when tracking that */ + if(file->fa.flags & H5FD_LOG_TIME_WRITE) { + H5_timer_get_times(write_timer, &write_times); + file->total_write_time += write_times.elapsed; + } /* end if */ + + /* Log information about the write */ if(file->fa.flags & H5FD_LOG_LOC_WRITE) { HDfprintf(file->logfp, "%10a-%10a (%10Zu bytes) (%s) Written", orig_addr, (orig_addr + orig_size) - 1, orig_size, flavors[type]); @@ -1502,29 +1475,14 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had } /* end if */ } /* end if */ -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_WRITE) { - struct timeval timeval_diff; - double time_diff; - - /* Calculate the elapsed gettimeofday time */ - timeval_diff.tv_usec = timeval_stop.tv_usec - timeval_start.tv_usec; - timeval_diff.tv_sec = timeval_stop.tv_sec - timeval_start.tv_sec; - if(timeval_diff.tv_usec < 0) { - timeval_diff.tv_usec += 1000000; - timeval_diff.tv_sec--; - } /* end if */ - time_diff = (double)timeval_diff.tv_sec + ((double)timeval_diff.tv_usec / (double)1000000.0f); - HDfprintf(file->logfp, " (%fs @ %.6lu.%.6llu)\n", time_diff, (unsigned long long)timeval_start.tv_sec, (unsigned long long)timeval_start.tv_usec); - - /* Add to total write time */ - file->total_write_time += time_diff; - } /* end if */ - else - HDfprintf(file->logfp, "\n"); -#else /* H5_HAVE_GETTIMEOFDAY */ - HDfprintf(file->logfp, "\n"); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Add the write time, if we're tracking that. + * Note that the write time is NOT emitted for when just H5FD_LOG_TIME_WRITE + * is set. + */ + if(file->fa.flags & H5FD_LOG_TIME_WRITE) + HDfprintf(file->logfp, " (%fs @ %f)\n", write_times.elapsed, write_timer.initial.elapsed); + else + HDfprintf(file->logfp, "\n"); } /* end if */ /* Update current position and eof */ @@ -1569,23 +1527,22 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U /* Extend the file to make sure it's large enough */ if(!H5F_addr_eq(file->eoa, file->eof)) { -#ifdef H5_HAVE_GETTIMEOFDAY - struct timeval timeval_start, timeval_stop; -#endif /* H5_HAVE_GETTIMEOFDAY */ + H5_timer_t trunc_timer; /* Timer for truncate operation */ + H5_timevals_t trunc_times; /* Elapsed time for truncate operation */ + + /* Start timer for truncate operation */ + if(file->fa.flags & H5FD_LOG_TIME_TRUNCATE) { + H5_timer_init(&trunc_timer); + H5_timer_start(&trunc_timer); + } /* end if */ + #ifdef H5_HAVE_WIN32_API +{ LARGE_INTEGER li; /* 64-bit (union) integer for SetFilePointer() call */ DWORD dwPtrLow; /* Low-order pointer bits from SetFilePointer() * Only used as an error code here. */ - DWORD dwError; /* DWORD error code from GetLastError() */ - BOOL bError; /* Boolean error flag */ -#endif /* H5_HAVE_WIN32_API */ -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_TRUNCATE) - HDgettimeofday(&timeval_start, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ -#ifdef H5_HAVE_WIN32_API /* Windows uses this odd QuadPart union for 32/64-bit portability */ li.QuadPart = (__int64)file->eoa; @@ -1596,51 +1553,48 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U */ dwPtrLow = SetFilePointer(file->hFile, li.LowPart, &li.HighPart, FILE_BEGIN); if(INVALID_SET_FILE_POINTER == dwPtrLow) { + DWORD dwError; /* DWORD error code from GetLastError() */ + dwError = GetLastError(); if(dwError != NO_ERROR ) HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to set file pointer") - } + } /* end if */ - bError = SetEndOfFile(file->hFile); - if(0 == bError) + if(0 == SetEndOfFile(file->hFile)) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") +} #else /* H5_HAVE_WIN32_API */ + /* Truncate/extend the file */ if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ -#ifdef H5_HAVE_GETTIMEOFDAY + + /* Stop timer for truncate operation */ if(file->fa.flags & H5FD_LOG_TIME_TRUNCATE) - HDgettimeofday(&timeval_stop, NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ + H5_timer_stop(&trunc_timer); - /* Log information about the truncate */ + /* Add to the number of truncates, when tracking that */ if(file->fa.flags & H5FD_LOG_NUM_TRUNCATE) file->total_truncate_ops++; + + /* Add to the total truncate time, when tracking that */ + if(file->fa.flags & H5FD_LOG_TIME_TRUNCATE) { + H5_timer_get_times(trunc_timer, &trunc_times); + file->total_truncate_time += trunc_times.elapsed; + } /* end if */ + + /* Emit log string if we're tracking individual truncate events. */ if(file->fa.flags & H5FD_LOG_TRUNCATE) { HDfprintf(file->logfp, "Truncate: To %10a", file->eoa); -#ifdef H5_HAVE_GETTIMEOFDAY - if(file->fa.flags & H5FD_LOG_TIME_TRUNCATE) { - struct timeval timeval_diff; - double time_diff; - - /* Calculate the elapsed gettimeofday time */ - timeval_diff.tv_usec = timeval_stop.tv_usec - timeval_start.tv_usec; - timeval_diff.tv_sec = timeval_stop.tv_sec - timeval_start.tv_sec; - if(timeval_diff.tv_usec < 0) { - timeval_diff.tv_usec += 1000000; - timeval_diff.tv_sec--; - } /* end if */ - time_diff = (double)timeval_diff.tv_sec + ((double)timeval_diff.tv_usec / (double)1000000.0f); - HDfprintf(file->logfp, " (%fs @ %.6lu.%.6llu)\n", time_diff, (unsigned long long)timeval_start.tv_sec, (unsigned long long)timeval_start.tv_usec); - /* Add to total truncate time */ - file->total_truncate_time += time_diff; - } /* end if */ - else - HDfprintf(file->logfp, "\n"); -#else /* H5_HAVE_GETTIMEOFDAY */ - HDfprintf(file->logfp, "\n"); -#endif /* H5_HAVE_GETTIMEOFDAY */ + /* Add the truncate time, if we're tracking that. + * Note that the truncate time is NOT emitted for when just H5FD_LOG_TIME_TRUNCATE + * is set. + */ + if(file->fa.flags & H5FD_LOG_TIME_TRUNCATE) + HDfprintf(file->logfp, " (%fs @ %f)\n", trunc_times.elapsed, trunc_timer.initial.elapsed); + else + HDfprintf(file->logfp, "\n"); } /* end if */ /* Update the eof value */ diff --git a/src/H5T.c b/src/H5T.c index a525cd5..4f0c700 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -4806,34 +4806,47 @@ done: */ herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist) + size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, + hid_t dset_xfer_plist) { #ifdef H5T_DEBUG - H5_timer_t timer; + H5_timer_t timer; /* Timer for conversion */ #endif - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) #ifdef H5T_DEBUG - if (H5DEBUG(T)) H5_timer_begin(&timer); + if(H5DEBUG(T)) { + /* Initialize and start timer */ + H5_timer_init(&timer); + H5_timer_start(&timer); + } /* end if */ #endif + + /* Call the appropriate conversion callback */ tpath->cdata.command = H5T_CONV_CONV; - if ((tpath->func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, - bkg_stride, buf, bkg, dset_xfer_plist)<0) + if((tpath->func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, + bkg_stride, buf, bkg, dset_xfer_plist) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "data type conversion failed"); + #ifdef H5T_DEBUG - if (H5DEBUG(T)) { - H5_timer_end(&(tpath->stats.timer), &timer); + if(H5DEBUG(T)) { + /* Stop timer */ + H5_timer_stop(&timer); + + /* Record elapsed timer info */ + H5_timer_get_times(timer, &tpath->stats.times); + + /* Increment # of calls and # of elements converted */ tpath->stats.ncalls++; tpath->stats.nelmts += nelmts; - } + } /* end if */ #endif done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T_convert() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index f434543..e20113e 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -102,15 +102,13 @@ herr_t H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/*in,out*/) { -#ifdef H5T_DEBUG - hsize_t nbytes; - char bandwidth[32]; -#endif - FUNC_ENTER_PACKAGE_NOERR #ifdef H5T_DEBUG if(H5DEBUG(T) && path->stats.ncalls > 0) { + hsize_t nbytes; + char bandwidth[32]; + if(nprint && 0 == (*nprint)++) { HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", @@ -119,7 +117,8 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", "----------", "-----", "-----", "----", "------", "-------", "---------"); - } + } /* end if */ + if(path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); else if(path->src) @@ -128,18 +127,20 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* nbytes = H5T_get_size(path->dst); else nbytes = 0; + nbytes *= path->stats.nelmts; - H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); - HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", + H5_bandwidth(bandwidth, (double)nbytes, path->stats.times.elapsed); + HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8T %8T %8T %10s\n", path->name, path->stats.nelmts, path->stats.ncalls, - path->stats.timer.utime, - path->stats.timer.stime, - path->stats.timer.etime, + path->stats.times.user, + path->stats.times.system, + path->stats.times.elapsed, bandwidth); - } + } /* end if */ #endif + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T__print_stats() */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index d075127..fe54ce1 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -146,7 +146,7 @@ struct H5T_stats_t { unsigned ncalls; /*num calls to conversion function */ hsize_t nelmts; /*total data points converted */ - H5_timer_t timer; /*total time for conversion */ + H5_timevals_t times; /*total time for conversion */ }; /* The datatype conversion database */ diff --git a/src/H5Z.c b/src/H5Z.c index ef34d7c..04624a6 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -34,10 +34,10 @@ #ifdef H5Z_DEBUG typedef struct H5Z_stats_t { struct { - hsize_t total; /*total number of bytes processed */ - hsize_t errors; /*bytes of total attributable to errors */ - H5_timer_t timer; /*execution time including errors */ - } stats[2]; /*0=output, 1=input */ + hsize_t total; /* total number of bytes processed */ + hsize_t errors; /* bytes of total attributable to errors */ + H5_timevals_t times; /* execution time including errors */ + } stats[2]; /* 0 = output, 1 = input */ } H5Z_stats_t; #endif /* H5Z_DEBUG */ @@ -136,9 +136,9 @@ H5Z_term_package(void) if(H5_PKG_INIT_VAR) { #ifdef H5Z_DEBUG - char comment[16], bandwidth[32]; - int dir, nprint = 0; - size_t i; + char comment[16], bandwidth[32]; + int dir, nprint = 0; + size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -169,27 +169,27 @@ H5Z_term_package(void) * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or * the word `Inf' if the elapsed time is zero. */ - H5_bandwidth(bandwidth, - (double)(H5Z_stat_table_g[i].stats[dir].total), - H5Z_stat_table_g[i].stats[dir].timer.etime); + H5_bandwidth(bandwidth, (double)(H5Z_stat_table_g[i].stats[dir].total), + H5Z_stat_table_g[i].stats[dir].times.elapsed); /* Print the statistics */ - HDfprintf(H5DEBUG(Z), - " %s%-15s %10Hd %10Hd %8.2f %8.2f %8.2f " - "%10s\n", dir?"<":">", comment, - H5Z_stat_table_g[i].stats[dir].total, - H5Z_stat_table_g[i].stats[dir].errors, - H5Z_stat_table_g[i].stats[dir].timer.utime, - H5Z_stat_table_g[i].stats[dir].timer.stime, - H5Z_stat_table_g[i].stats[dir].timer.etime, - bandwidth); + HDfprintf(H5DEBUG(Z), " %s%-15s %10Hd %10Hd %8T %8T %8T %10s\n", + (dir ? "<" : ">"), comment, + H5Z_stat_table_g[i].stats[dir].total, + H5Z_stat_table_g[i].stats[dir].errors, + H5Z_stat_table_g[i].stats[dir].times.user, + H5Z_stat_table_g[i].stats[dir].times.system, + H5Z_stat_table_g[i].stats[dir].times.elapsed, + bandwidth); } /* end for */ } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ + /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); + #ifdef H5Z_DEBUG H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g); #endif /* H5Z_DEBUG */ @@ -1281,26 +1281,26 @@ done: * Programmer: Robb Matzke * Tuesday, August 4, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, - unsigned *filter_mask/*in,out*/, H5Z_EDC_t edc_read, - H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, - size_t *buf_size/*in,out*/, void **buf/*in,out*/) + unsigned *filter_mask/*in,out*/, H5Z_EDC_t edc_read, H5Z_cb_t cb_struct, + size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/) { - size_t i, idx, new_nbytes; - int fclass_idx; /* Index of filter class in global table */ - H5Z_class2_t *fclass=NULL; /* Filter class pointer */ + size_t idx; + size_t new_nbytes; + int fclass_idx; /* Index of filter class in global table */ + H5Z_class2_t *fclass = NULL; /* Filter class pointer */ #ifdef H5Z_DEBUG - H5Z_stats_t *fstats=NULL; /* Filter stats pointer */ - H5_timer_t timer; + H5Z_stats_t *fstats = NULL; /* Filter stats pointer */ + H5_timer_t timer; /* Timer for filter operations */ + H5_timevals_t times; /* Elapsed time for each operation */ #endif - unsigned failed = 0; - unsigned tmp_flags; - herr_t ret_value=SUCCEED; /* Return value */ + unsigned failed = 0; + unsigned tmp_flags; + size_t i; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1311,14 +1311,17 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HDassert(buf && *buf); HDassert(!pline || pline->nusednused; i>0; --i) { - idx = i-1; +#ifdef H5Z_DEBUG + H5_timer_init(&timer); +#endif - if (*filter_mask & ((unsigned)1<nused; i > 0; --i) { + idx = i - 1; + if(*filter_mask & ((unsigned)1 << idx)) { failed |= (unsigned)1 << idx; - continue;/*filter excluded*/ - } + continue; /* filter excluded */ + } /* end if */ /* If the filter isn't registered and the application doesn't * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), @@ -1326,20 +1329,20 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - const H5Z_class2_t *filter_info; + const H5Z_class2_t *filter_info; - /* Try loading the filter */ - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { - /* Register the filter we loaded */ - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + /* Try loading the filter */ + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + /* Register the filter we loaded */ + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") - /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) - issue_error = TRUE; - } /* end if */ - else - issue_error = TRUE; + /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + issue_error = TRUE; + } /* end if */ + else + issue_error = TRUE; /* Check for error */ if(issue_error) { @@ -1352,76 +1355,96 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, } /* end if */ } /* end if */ - fclass=&H5Z_table_g[fclass_idx]; + fclass = &H5Z_table_g[fclass_idx]; + #ifdef H5Z_DEBUG - fstats=&H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif + tmp_flags=flags|(pline->filter[idx].flags); tmp_flags|=(edc_read== H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; - new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); + new_nbytes = (fclass->filter)(tmp_flags, + pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, + *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[1].timer), &timer); + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[1].times.elapsed += times.elapsed; + fstats->stats[1].times.system += times.system; + fstats->stats[1].times.user += times.user; + fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0==new_nbytes) fstats->stats[1].errors += *nbytes; + if(0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif if(0==new_nbytes) { - if((cb_struct.func && (H5Z_CB_FAIL==cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) - || !cb_struct.func) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") + if((cb_struct.func + && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) + || !cb_struct.func) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - } else { + } /* end if */ + else *nbytes = new_nbytes; - } - } + } /* end for */ } else if (pline) { /* Write */ - for (idx=0; idxnused; idx++) { - if (*filter_mask & ((unsigned)1<nused; idx++) { + if(*filter_mask & ((unsigned)1 << idx)) { failed |= (unsigned)1 << idx; - continue; /*filter excluded*/ - } - if ((fclass_idx=H5Z_find_idx(pline->filter[idx].id))<0) { + continue; /* filter excluded */ + } /* end if */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { /* Check if filter is optional -- If it isn't, then error */ - if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + if((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") - failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - continue; /*filter excluded*/ - } - fclass=&H5Z_table_g[fclass_idx]; + continue; /* filter excluded */ + } /* end if */ + + fclass = &H5Z_table_g[fclass_idx]; + #ifdef H5Z_DEBUG - fstats=&H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + fstats = &H5Z_stat_table_g[fclass_idx]; + H5_timer_start(&timer); #endif - new_nbytes = (fclass->filter)(flags|(pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); + + new_nbytes = (fclass->filter)(flags|(pline->filter[idx].flags), + pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, + *nbytes, buf_size, buf); + #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[0].timer), &timer); + H5_timer_stop(&timer); + H5_timer_get_times(timer, ×); + fstats->stats[0].times.elapsed += times.elapsed; + fstats->stats[0].times.system += times.system; + fstats->stats[0].times.user += times.user; + fstats->stats[0].total += MAX(*nbytes, new_nbytes); - if (0==new_nbytes) fstats->stats[0].errors += *nbytes; + if(0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif - if(0==new_nbytes) { - if (0==(pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { + + if(0 == new_nbytes) { + if(0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { if((cb_struct.func && (H5Z_CB_FAIL==cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; - } - + } /* end if */ failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - } else { + } /* end if */ + else *nbytes = new_nbytes; - } - } + } /* end for */ } *filter_mask = failed; diff --git a/src/H5private.h b/src/H5private.h index ca4ebcf..557eeba 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -573,21 +573,37 @@ #define LOCK_UN 0x08 #endif /* H5_HAVE_FLOCK */ -/* - * Data types and functions for timing certain parts of the library. +/* Typedefs and functions for timing certain parts of the library. */ + +/* A set of elapsed/user/system times emitted as a time point by the + * platform-independent timers. */ typedef struct { - double utime; /*user time */ - double stime; /*system time */ - double etime; /*elapsed wall-clock time */ + double user; /* User time in seconds */ + double system; /* System time in seconds */ + double elapsed; /* Elapsed (wall clock) time in seconds */ +} H5_timevals_t; + +/* Timer structure for platform-independent timers */ +typedef struct { + H5_timevals_t initial; /* Current interval start time */ + H5_timevals_t final_interval; /* Last interval elapsed time */ + H5_timevals_t total; /* Total elapsed time for all intervals */ + hbool_t is_running; /* Whether timer is running */ } H5_timer_t; -H5_DLL void H5_timer_reset (H5_timer_t *timer); -H5_DLL void H5_timer_begin (H5_timer_t *timer); -H5_DLL void H5_timer_end (H5_timer_t *sum/*in,out*/, - H5_timer_t *timer/*in,out*/); +/* Returns library bandwidth as a pretty string */ H5_DLL void H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds); + +/* Timer functionality */ H5_DLL time_t H5_now(void); +H5_DLL uint64_t H5_now_usec(void); +H5_DLL herr_t H5_timer_init(H5_timer_t *timer /*in,out*/); +H5_DLL herr_t H5_timer_start(H5_timer_t *timer /*in,out*/); +H5_DLL herr_t H5_timer_stop(H5_timer_t *timer /*in,out*/); +H5_DLL herr_t H5_timer_get_times(H5_timer_t timer, H5_timevals_t *times /*in,out*/); +H5_DLL herr_t H5_timer_get_total_times(H5_timer_t timer, H5_timevals_t *times /*in,out*/); +H5_DLL char *H5_timer_get_time_string(double seconds); /* Depth of object copy */ typedef enum { @@ -703,6 +719,9 @@ typedef struct { #ifndef HDclock #define HDclock() clock() #endif /* HDclock */ +#ifndef HDclock_gettime + #define HDclock_gettime(CID, TS) clock_gettime(CID, TS) +#endif /* HDclock_gettime */ #ifndef HDclose #define HDclose(F) close(F) #endif /* HDclose */ diff --git a/src/H5system.c b/src/H5system.c index a1cdf19..cff2d71 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5system.c - * Aug 21 2006 - * Quincey Koziol + * Created: H5system.c + * Aug 21 2006 + * Quincey Koziol * - * Purpose: System call wrapper implementations. + * Purpose: System call wrapper implementations. * *------------------------------------------------------------------------- */ @@ -30,10 +30,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -372,7 +372,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) if(fwidth) len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%d", fwidth); HDstrncat(format_templ, "s", (sizeof(format_templ) - (size_t)(len + 1))); - fprintf(stream, format_templ, "UNDEF"); + n = fprintf(stream, format_templ, "UNDEF"); } } break; @@ -402,11 +402,25 @@ HDfprintf(FILE *stream, const char *fmt, ...) htri_t tri_var = va_arg(ap, htri_t); if(tri_var > 0) - fprintf(stream, "TRUE"); + n = fprintf(stream, "TRUE"); else if(!tri_var) - fprintf(stream, "FALSE"); + n = fprintf(stream, "FALSE"); else - fprintf(stream, "FAIL(%d)", (int)tri_var); + n = fprintf(stream, "FAIL(%d)", (int)tri_var); + } + break; + + case 'T': /* Elapsed time, in seconds */ + { + double seconds = va_arg(ap, double); + char *time_string = H5_timer_get_time_string(seconds); + + if(time_string) { + n = fprintf(stream, format_templ, time_string); + HDfree(time_string); + } /* end if */ + else + n = fprintf(stream, format_templ, "(error)"); } break; @@ -822,11 +836,88 @@ Wsetenv(const char *name, const char *value, int overwrite) #pragma comment(lib, "advapi32.lib") #endif + +/*------------------------------------------------------------------------- + * Function: H5_get_win32_times + * + * Purpose: Gets the elapsed, system and user times on Windows platforms. + * All time values are in seconds. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +#ifdef H5_HAVE_WIN32_API +int +H5_get_win32_times(H5_timevals_t *tvs /*in,out*/) +{ + static HANDLE process_handle; + ULARGE_INTEGER kernel_start; + ULARGE_INTEGER user_start; + FILETIME KernelTime; + FILETIME UserTime; + FILETIME CreationTime; + FILETIME ExitTime; + LARGE_INTEGER counts_start; + static LARGE_INTEGER counts_freq; + static hbool_t is_initialized = FALSE; + BOOL err; + + HDassert(tvs); + + if(!is_initialized) { + /* NOTE: This is just a pseudo handle and does not need to be closed. */ + process_handle = GetCurrentProcess(); + err = QueryPerformanceFrequency(&counts_freq); + if(0 == err) + return -1; + is_initialized = TRUE; + } /* end if */ + + /************************* + * System and user times * + *************************/ + + err = GetProcessTimes(process_handle, &CreationTime, &ExitTime, &KernelTime, + &UserTime); + if(0 == err) + return -1; + + /* The 1.0E7 factor seems strange but it's due to the clock + * ticking in 100 ns increments. + */ + kernel_start.HighPart = KernelTime.dwHighDateTime; + kernel_start.LowPart = KernelTime.dwLowDateTime; + tvs->system = (double)(kernel_start.QuadPart / 1.0E7F); + + user_start.HighPart = UserTime.dwHighDateTime; + user_start.LowPart = UserTime.dwLowDateTime; + tvs->user = (double)(user_start.QuadPart / 1.0E7F); + + /**************** + * Elapsed time * + ****************/ + + err = QueryPerformanceCounter(&counts_start); + if(0 == err) + return -1; + + tvs->elapsed = (double)(counts_start.QuadPart) / (double)counts_freq.QuadPart; + + return 0; +} /* end H5_get_win32_times() */ +#endif + #define WloginBuffer_count 256 static char Wlogin_buffer[WloginBuffer_count]; + char* -Wgetlogin() +Wgetlogin(void) { #ifdef H5_HAVE_WINSOCK2_H diff --git a/src/H5timer.c b/src/H5timer.c index 0ba8bd1..2cb8cea 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -12,12 +12,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- - * * Created: H5timer.c * Aug 21 2006 * Quincey Koziol * - * Purpose: Internal 'timer' routines & support routines. + * Purpose: Internal, platform-independent 'timer' support routines. * *------------------------------------------------------------------------- */ @@ -32,20 +31,22 @@ /***********/ #include "H5private.h" /* Generic Functions */ -/* We need this for the struct rusage declaration */ -#if defined(H5_HAVE_GETRUSAGE) && defined(H5_HAVE_SYS_RESOURCE_H) -# include -#endif - -#if defined(H5_HAVE_GETTIMEOFDAY) && defined(H5_HAVE_SYS_TIME_H) -#include -#endif - /****************/ /* Local Macros */ /****************/ +/* Size of a generated time string. + * Most time strings should be < 20 or so characters (max!) so this should be a + * safe size. Dynamically allocating the correct size would be painful. + */ +#define H5TIMER_TIME_STRING_LEN 256 + +/* Conversion factors */ +#define H5_SEC_PER_DAY (double)(24.0F * 60.0F * 60.0F) +#define H5_SEC_PER_HOUR (double)(60.0F * 60.0F) +#define H5_SEC_PER_MIN (double)(60.0F) + /******************/ /* Local Typedefs */ @@ -76,104 +77,6 @@ /* Local Variables */ /*******************/ - -/*------------------------------------------------------------------------- - * Function: H5_timer_reset - * - * Purpose: Resets the timer struct to zero. Use this to reset a timer - * that's being used as an accumulator for summing times. - * - * Return: void - * - * Programmer: Robb Matzke - * Thursday, April 16, 1998 - * - *------------------------------------------------------------------------- - */ -void -H5_timer_reset (H5_timer_t *timer) -{ - HDassert(timer); - HDmemset(timer, 0, sizeof *timer); -} /* end H5_timer_reset() */ - - -/*------------------------------------------------------------------------- - * Function: H5_timer_begin - * - * Purpose: Initialize a timer to time something. - * - * Return: void - * - * Programmer: Robb Matzke - * Thursday, April 16, 1998 - * - *------------------------------------------------------------------------- - */ -void -H5_timer_begin (H5_timer_t *timer) -{ -#ifdef H5_HAVE_GETRUSAGE - struct rusage rusage; -#endif -#ifdef H5_HAVE_GETTIMEOFDAY - struct timeval etime; -#endif - - HDassert(timer); - -#ifdef H5_HAVE_GETRUSAGE - HDgetrusage (RUSAGE_SELF, &rusage); - timer->utime = (double)rusage.ru_utime.tv_sec + - ((double)rusage.ru_utime.tv_usec / (double)1e6F); - timer->stime = (double)rusage.ru_stime.tv_sec + - ((double)rusage.ru_stime.tv_usec / (double)1e6F); -#else - timer->utime = 0.0F; - timer->stime = 0.0F; -#endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday (&etime, NULL); - timer->etime = (double)etime.tv_sec + ((double)etime.tv_usec / (double)1e6F); -#else - timer->etime = 0.0F; -#endif -} /* end H5_timer_begin() */ - - -/*------------------------------------------------------------------------- - * Function: H5_timer_end - * - * Purpose: This function should be called at the end of a timed region. - * The SUM is an optional pointer which will accumulate times. - * TMS is the same struct that was passed to H5_timer_start(). - * On return, TMS will contain total times for the timed region. - * - * Return: void - * - * Programmer: Robb Matzke - * Thursday, April 16, 1998 - * - *------------------------------------------------------------------------- - */ -void -H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) -{ - H5_timer_t now; - - HDassert(timer); - H5_timer_begin(&now); - - timer->utime = MAX((double)0.0F, now.utime - timer->utime); - timer->stime = MAX((double)0.0F, now.stime - timer->stime); - timer->etime = MAX((double)0.0F, now.etime - timer->etime); - - if (sum) { - sum->utime += timer->utime; - sum->stime += timer->stime; - sum->etime += timer->etime; - } -} /* end H5_timer_end() */ /*------------------------------------------------------------------------- @@ -209,32 +112,35 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds) if(nseconds <= (double)0.0F) HDstrcpy(buf, " NaN"); else { - bw = nbytes/nseconds; + bw = nbytes / nseconds; if(H5_DBL_ABS_EQUAL(bw, (double)0.0F)) HDstrcpy(buf, "0.000 B/s"); else if(bw < (double)1.0F) - sprintf(buf, "%10.4e", bw); + HDsprintf(buf, "%10.4e", bw); else if(bw < (double)H5_KB) { - sprintf(buf, "%05.4f", bw); - HDstrcpy(buf+5, " B/s"); + HDsprintf(buf, "%05.4f", bw); + HDstrcpy(buf + 5, " B/s"); } else if(bw < (double)H5_MB) { - sprintf(buf, "%05.4f", bw / (double)H5_KB); - HDstrcpy(buf+5, " kB/s"); + HDsprintf(buf, "%05.4f", bw / (double)H5_KB); + HDstrcpy(buf + 5, " kB/s"); } else if(bw < (double)H5_GB) { - sprintf(buf, "%05.4f", bw / (double)H5_MB); - HDstrcpy(buf+5, " MB/s"); + HDsprintf(buf, "%05.4f", bw / (double)H5_MB); + HDstrcpy(buf + 5, " MB/s"); } else if(bw < (double)H5_TB) { - sprintf(buf, "%05.4f", bw / (double)H5_GB); - HDstrcpy(buf+5, " GB/s"); + HDsprintf(buf, "%05.4f", bw / (double)H5_GB); + HDstrcpy(buf + 5, " GB/s"); } else if(bw < (double)H5_PB) { - sprintf(buf, "%05.4f", bw / (double)H5_TB); - HDstrcpy(buf+5, " TB/s"); + HDsprintf(buf, "%05.4f", bw / (double)H5_TB); + HDstrcpy(buf + 5, " TB/s"); + } else if(bw < (double)H5_EB) { + HDsprintf(buf, "%05.4f", bw / (double)H5_PB); + HDstrcpy(buf + 5, " PB/s"); } else { - sprintf(buf, "%10.4e", bw); + HDsprintf(buf, "%10.4e", bw); if(HDstrlen(buf) > 10) - sprintf(buf, "%10.3e", bw); - } - } + HDsprintf(buf, "%10.3e", bw); + } /* end else-if */ + } /* end else */ } /* end H5_bandwidth() */ @@ -269,3 +175,455 @@ H5_now(void) return(now); } /* end H5_now() */ + +/*------------------------------------------------------------------------- + * Function: H5_now_usec + * + * Purpose: Retrieves the current time, as microseconds after the UNIX epoch. + * + * Return: # of microseconds from the epoch (can't fail) + * + * Programmer: Quincey Koziol + * Tuesday, November 28, 2006 + * + *------------------------------------------------------------------------- + */ +uint64_t +H5_now_usec(void) +{ + uint64_t now; /* Current time, in microseconds */ + +#ifdef H5_HAVE_GETTIMEOFDAY + { + struct timeval now_tv; + + HDgettimeofday(&now_tv, NULL); + now = (uint64_t)(now_tv.tv_sec * (1000 * 1000)) + (uint64_t)now_tv.tv_usec; + } +#else /* H5_HAVE_GETTIMEOFDAY */ + now = (uint64_t)(HDtime(NULL) * (1000 * 1000)); +#endif /* H5_HAVE_GETTIMEOFDAY */ + + return(now); +} /* end H5_now_usec() */ + + +/*------------------------------------------------------------------------- + * Function: H5__timer_get_timevals + * + * Purpose: Internal platform-specific function to get time system, + * user and elapsed time values. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5__timer_get_timevals(H5_timevals_t *times /*in,out*/) +{ + /* Sanity check */ + HDassert(times); + + /* Windows call handles both system/user and elapsed times */ +#ifdef H5_HAVE_WIN32_API + if(H5_get_win32_times(times) < 0) { + times->elapsed = -1; + times->system = -1; + times->user = -1; + + return -1; + } /* end if */ +#else /* H5_HAVE_WIN32_API */ + + /************************* + * System and user times * + *************************/ +#if defined(H5_HAVE_GETRUSAGE) +{ + struct rusage res; + + if(HDgetrusage(RUSAGE_SELF, &res) < 0) + return -1; + times->system = (double)res.ru_stime.tv_sec + ((double)res.ru_stime.tv_usec / (double)1.0E6F); + times->user = (double)res.ru_utime.tv_sec + ((double)res.ru_utime.tv_usec / (double)1.0E6F); +} +#else + /* No suitable way to get system/user times */ + /* This is not an error condition, they just won't be available */ + times->system = -1.0; + times->user = -1.0; +#endif + + /**************** + * Elapsed time * + ****************/ + + /* NOTE: Not having a way to get elapsed time IS an error, unlike + * the system and user times. + */ + +#if defined(H5_HAVE_CLOCK_GETTIME) +{ + struct timespec ts; + + if(HDclock_gettime(CLOCK_MONOTONIC, &ts) != 0) + return -1; + times->elapsed = (double)ts.tv_sec + ((double)ts.tv_nsec / (double)1.0E9F); +} +#else + /* Die here. We'd like to know about this so we can support some + * other time functionality. + */ + HDassert(0); +#endif +#endif /* H5_HAVE_WIN32_API */ + + return 0; +} /* end H5__timer_get_timevals() */ + + +/*------------------------------------------------------------------------- + * Function: H5_timer_init + * + * Purpose: Initialize a platform-independent timer. + * + * Timer usage is as follows: + * + * 1) Call H5_timer_init(), passing in a timer struct, to set + * up the timer. + * + * 2) Wrap any code you'd like to time with calls to + * H5_timer_start/stop(). For accurate timing, place these + * calls as close to the code of interest as possible. You + * can call start/stop multiple times on the same timer - + * when you do this, H5_timer_get_times() will return time + * values for the current/last session and + * H5_timer_get_total_times() will return the summed times + * of all sessions (see #3 and #4, below). + * + * 3) Use H5_timer_get_times() to get the current system, user + * and elapsed times from a running timer. If called on a + * stopped timer, this will return the time recorded at the + * stop point. + * + * 4) Call H5_timer_get_total_times() to get the total system, + * user and elapsed times recorded across multiple start/stop + * sessions. If called on a running timer, it will return the + * time recorded up to that point. On a stopped timer, it + * will return the time recorded at the stop point. + * + * NOTE: Obtaining a time point is not free! Keep in mind that + * the time functions make system calls and can have + * non-trivial overhead. If you call one of the get_time + * functions on a running timer, that overhead will be + * added to the reported times. + * + * 5) All times recorded will be in seconds. These can be + * converted into human-readable strings with the + * H5_timer_get_time_string() function. + * + * 6) A timer can be reset using by calling H5_timer_init() on + * it. This will set its state to 'stopped' and reset all + * accumulated times to zero. + * + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5_timer_init(H5_timer_t *timer /*in,out*/) +{ + /* Sanity check */ + HDassert(timer); + + /* Initialize everything */ + HDmemset(timer, 0, sizeof(H5_timer_t)); + + return 0; +} /* end H5_timer_init() */ + + +/*------------------------------------------------------------------------- + * Function: H5_timer_start + * + * Purpose: Start tracking time in a platform-independent timer. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5_timer_start(H5_timer_t *timer /*in,out*/) +{ + /* Sanity check */ + HDassert(timer); + + /* Start the timer + * This sets the "initial" times to the system-defined start times. + */ + if(H5__timer_get_timevals(&(timer->initial)) < 0) + return -1; + + timer->is_running = TRUE; + + return 0; +} /* end H5_timer_start() */ + + +/*------------------------------------------------------------------------- + * Function: H5_timer_stop + * + * Purpose: Stop tracking time in a platform-independent timer. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5_timer_stop(H5_timer_t *timer /*in,out*/) +{ + /* Sanity check */ + HDassert(timer); + + /* Stop the timer */ + if(H5__timer_get_timevals(&(timer->final_interval)) < 0) + return -1; + + /* The "final" times are stored as intervals (final - initial) + * for more useful reporting to the user. + */ + timer->final_interval.elapsed = timer->final_interval.elapsed - timer->initial.elapsed; + timer->final_interval.system = timer->final_interval.system - timer->initial.system; + timer->final_interval.user = timer->final_interval.user - timer->initial.user; + + /* Add the intervals to the elapsed time */ + timer->total.elapsed += timer->final_interval.elapsed; + timer->total.system += timer->final_interval.system; + timer->total.user += timer->final_interval.user; + + timer->is_running = FALSE; + + return 0; +} /* end H5_timer_stop() */ + + +/*------------------------------------------------------------------------- + * Function: H5_timer_get_times + * + * Purpose: Get the system, user and elapsed times from a timer. These + * are the times since the timer was last started and will be + * 0.0 in a timer that has not been started since it was + * initialized. + * + * This function can be called either before or after + * H5_timer_stop() has been called. If it is called before the + * stop function, the timer will continue to run. + * + * The system and user times will be -1.0 if those times cannot + * be computed on a particular platform. The elapsed time will + * always be present. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5_timer_get_times(H5_timer_t timer, H5_timevals_t *times /*in,out*/) +{ + /* Sanity check */ + HDassert(times); + + if(timer.is_running) { + H5_timevals_t now; + + /* Get the current times and report the current intervals without + * stopping the timer. + */ + if(H5__timer_get_timevals(&now) < 0) + return -1; + + times->elapsed = now.elapsed - timer.initial.elapsed; + times->system = now.system - timer.initial.system; + times->user = now.user - timer.initial.user; + } /* end if */ + else { + times->elapsed = timer.final_interval.elapsed; + times->system = timer.final_interval.system; + times->user = timer.final_interval.user; + } /* end else */ + + return 0; +} /* end H5_timer_get_times() */ + + +/*------------------------------------------------------------------------- + * Function: H5_timer_get_total_times + * + * Purpose: Get the TOTAL system, user and elapsed times recorded by + * the timer since its initialization. This is the sum of all + * times recorded while the timer was running. + * + * These will be 0.0 in a timer that has not been started + * since it was initialized. Calling H5_timer_init() on a + * timer will reset these values to 0.0. + * + * This function can be called either before or after + * H5_timer_stop() has been called. If it is called before the + * stop function, the timer will continue to run. + * + * The system and user times will be -1.0 if those times cannot + * be computed on a particular platform. The elapsed time will + * always be present. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5_timer_get_total_times(H5_timer_t timer, H5_timevals_t *times /*in,out*/) +{ + /* Sanity check */ + HDassert(times); + + if(timer.is_running) { + H5_timevals_t now; + + /* Get the current times and report the current totals without + * stopping the timer. + */ + if(H5__timer_get_timevals(&now) < 0) + return -1; + + times->elapsed = timer.total.elapsed + (now.elapsed - timer.initial.elapsed); + times->system = timer.total.system + (now.system - timer.initial.system); + times->user = timer.total.user + (now.user - timer.initial.user); + } /* end if */ + else { + times->elapsed = timer.total.elapsed; + times->system = timer.total.system; + times->user = timer.total.user; + } /* end else */ + + return 0; +} /* end H5_timer_get_total_times() */ + + +/*------------------------------------------------------------------------- + * Function: H5_timer_get_time_string + * + * Purpose: Converts a time (in seconds) into a human-readable string + * suitable for log messages. + * + * Return: Success: The time string. + * + * The general format of the time string is: + * + * "N/A" time < 0 (invalid time) + * "%.f ns" time < 1 microsecond + * "%.1f us" time < 1 millisecond + * "%.1f ms" time < 1 second + * "%.2f s" time < 1 minute + * "%.f m %.f s" time < 1 hour + * "%.f h %.f m %.f s" longer times + * + * Failure: NULL + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +char * +H5_timer_get_time_string(double seconds) +{ + char *s; /* output string */ + + /* Used when the time is greater than 59 seconds */ + double days; + double hours; + double minutes; + double remainder_sec; + + /* Extract larger time units from count of seconds */ + if(seconds > (double)60.0F) { + /* Set initial # of seconds */ + remainder_sec = seconds; + + /* Extract days */ + days = HDfloor(remainder_sec / H5_SEC_PER_DAY); + remainder_sec -= (days * H5_SEC_PER_DAY); + + /* Extract hours */ + hours = HDfloor(remainder_sec / H5_SEC_PER_HOUR); + remainder_sec -= (hours * H5_SEC_PER_HOUR); + + /* Extract minutes */ + minutes = HDfloor(remainder_sec / H5_SEC_PER_MIN); + remainder_sec -= (minutes * H5_SEC_PER_MIN); + + /* The # of seconds left is in remainder_sec */ + } /* end if */ + + /* Allocate */ + if(NULL == (s = (char *)HDcalloc(H5TIMER_TIME_STRING_LEN, sizeof(char)))) + return NULL; + + /* Do we need a format string? Some people might like a certain + * number of milliseconds or s before spilling to the next highest + * time unit. Perhaps this could be passed as an integer. + * (name? round_up_size? ?) + */ + if(seconds < (double)0.0F) + HDsprintf(s, "N/A"); + else if(H5_DBL_ABS_EQUAL((double)0.0F, seconds)) + HDsprintf(s, "0.0 s"); + else if(seconds < (double)1.0E-6F) + /* t < 1 us, Print time in ns */ + HDsprintf(s, "%.f ns", seconds * (double)1.0E9F); + else if(seconds < (double)1.0E-3F) + /* t < 1 ms, Print time in us */ + HDsprintf(s, "%.1f us", seconds * (double)1.0E6F); + else if(seconds < (double)1.0F) + /* t < 1 s, Print time in ms */ + HDsprintf(s, "%.1f ms", seconds * (double)1.0E3F); + else if(seconds < H5_SEC_PER_MIN) + /* t < 1 m, Print time in s */ + HDsprintf(s, "%.2f s", seconds); + else if(seconds < H5_SEC_PER_HOUR) + /* t < 1 h, Print time in m and s */ + HDsprintf(s, "%.f m %.f s", minutes, remainder_sec); + else if(seconds < H5_SEC_PER_DAY) + /* t < 1 d, Print time in h, m and s */ + HDsprintf(s, "%.f h %.f m %.f s", hours, minutes, remainder_sec); + else + /* Print time in d, h, m and s */ + HDsprintf(s, "%.f d %.f h %.f m %.f s", days, hours, minutes, remainder_sec); + + return s; +} /* end H5_timer_get_time_string() */ + diff --git a/src/H5trace.c b/src/H5trace.c index 9fb8a72..c21aa6f 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -125,8 +125,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) hssize_t i; void *vp = NULL; FILE *out = H5_debug_g.trace; - H5_timer_t event_time; - static H5_timer_t first_time = {0.0F, 0.0F, 0.0F}; + static hbool_t is_first_invocation = TRUE; + H5_timer_t function_timer; + H5_timevals_t function_times; + static H5_timer_t running_timer; + H5_timevals_t running_times; static int current_depth = 0; static int last_call_depth = 0; @@ -152,13 +155,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end else */ } /* end if */ - /* Get time for event */ - if(H5_DBL_ABS_EQUAL(first_time.etime, H5_DOUBLE(0.0))) - H5_timer_begin(&first_time); - if(H5_debug_g.ttimes) - H5_timer_begin(&event_time); - else - HDmemset(&event_time, 0, sizeof event_time); + /* Get time for event if the trace times flag is set */ + if(is_first_invocation && H5_debug_g.ttimes) { + /* start the library-wide timer */ + is_first_invocation = FALSE; + H5_timer_init(&running_timer); + H5_timer_start(&running_timer); + } /* end if */ + if(H5_debug_g.ttimes) { + /* start the timer for this function */ + H5_timer_init(&function_timer); + H5_timer_start(&function_timer); + } /* end if */ /* Print the first part of the line. This is the indication of the * nesting depth followed by the function name and either start of @@ -174,7 +182,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) if(H5_debug_g.ttimes) { char tmp[128]; - sprintf(tmp, "%.6f", event_time.etime-first_time.etime); + H5_timer_get_times(function_timer, &function_times); + H5_timer_get_times(running_timer, &running_times); + sprintf(tmp, "%.6f", (function_times.elapsed - running_times.elapsed)); fprintf(out, " %*s ", (int)HDstrlen(tmp), ""); } /* end if */ for(i = 0; i < current_depth; i++) @@ -189,8 +199,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { if(current_depth>last_call_depth) HDfputs(" = \n", out); - if(H5_debug_g.ttimes) - fprintf(out, "@%.6f ", event_time.etime - first_time.etime); + if(H5_debug_g.ttimes) { + H5_timer_get_times(function_timer, &function_times); + H5_timer_get_times(running_timer, &running_times); + fprintf(out, "@%.6f ", (function_times.elapsed - running_times.elapsed)); + } /* end if */ for(i = 0; i < current_depth; i++) HDfputc('+', out); fprintf(out, "%*s%s(", 2*current_depth, "", func); @@ -2639,9 +2652,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end for */ /* Display event time for return */ - if(returning && H5_debug_g.ttimes) - fprintf(out, " @%.6f [dt=%.6f]", (event_time.etime - first_time.etime), - (event_time.etime - *returning)); + if(returning && H5_debug_g.ttimes) { + H5_timer_get_times(function_timer, &function_times); + H5_timer_get_times(running_timer, &running_times); + fprintf(out, " @%.6f [dt=%.6f]", (function_times.elapsed - running_times.elapsed), + (function_times.elapsed - *returning)); + } /* end if */ error: va_end(ap); @@ -2653,6 +2669,9 @@ error: } /* end else */ HDfflush(out); - return event_time.etime; + if(H5_debug_g.ttimes) + return function_times.elapsed; + else + return 0.0F; } /* end H5_trace() */ diff --git a/test/Makefile.am b/test/Makefile.am index 53dbf0d..610c619 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -58,7 +58,8 @@ TEST_PROG= testhdf5 \ twriteorder big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe enc_dec_plist enc_dec_plist_cross_platform\ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf vds file_image unregister cache_logging cork swmr + freespace mf vds file_image unregister cache_logging cork swmr \ + timer # List programs to be built when testing here. # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. diff --git a/test/timer.c b/test/timer.c new file mode 100644 index 0000000..3a82b82 --- /dev/null +++ b/test/timer.c @@ -0,0 +1,415 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Dana Robinson + * May, 2011 + * + * Purpose: Tests the operation of the platform-independent timers. + */ + +#include "h5test.h" + + + + +/*------------------------------------------------------------------------- + * Function: test_time_formatting + * + * Purpose: Tests time string creation. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_time_formatting(void) +{ + char *s = NULL; + + TESTING("Time string formats"); + + /* < 0, N/A */ + s = H5_timer_get_time_string(-1.0F); + if(NULL == s || HDstrcmp(s, "N/A") != 0) + TEST_ERROR; + HDfree(s); + + /* 0 0 */ + s = H5_timer_get_time_string(0.0F); + if(NULL == s || HDstrcmp(s, "0.0 s") != 0) + TEST_ERROR; + HDfree(s); + + /* < 1 us nanoseconds */ + s = H5_timer_get_time_string(123.0E-9F); + if(NULL == s || HDstrcmp(s, "123 ns") != 0) + TEST_ERROR; + HDfree(s); + + /* < 1 ms microseconds */ + s = H5_timer_get_time_string(23.456E-6F); + if(NULL == s || HDstrcmp(s, "23.5 us") != 0) + TEST_ERROR; + HDfree(s); + + /* < 1 s milliseconds */ + s = H5_timer_get_time_string(4.56789E-3); + if(NULL == s || HDstrcmp(s, "4.6 ms") != 0) + TEST_ERROR; + HDfree(s); + + /* < 1 min seconds */ + s = H5_timer_get_time_string(3.14); + if(NULL == s || HDstrcmp(s, "3.14 s") != 0) + TEST_ERROR; + HDfree(s); + + /* < 1 hr mins, secs */ + s = H5_timer_get_time_string(2521.0F); + if(NULL == s || HDstrcmp(s, "42 m 1 s") != 0) + TEST_ERROR; + HDfree(s); + + /* < 1 d hrs, mins, secs */ + s = H5_timer_get_time_string(9756.0F); + if(NULL == s || HDstrcmp(s, "2 h 42 m 36 s") != 0) + TEST_ERROR; + HDfree(s); + + /* > 1 d days, hrs, mins, secs */ + s = H5_timer_get_time_string(280802.0F); + if(NULL == s || HDstrcmp(s, "3 d 6 h 0 m 2 s") != 0) + TEST_ERROR; + HDfree(s); + + PASSED(); + return 0; + +error: + if(s) + HDfree(s); + return -1; + +} + + +/*------------------------------------------------------------------------- + * Function: test_timer_system_user + * + * Purpose: Tests the ability to get system and user times from the + * timers. + * Some platforms may require special code to get system and + * user times. If we do not support that particular platform + * dependent functionality, this test is skipped. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_timer_system_user(void) +{ + int i; + char *buf = NULL; + H5_timer_t timer; + H5_timevals_t times; + herr_t err; + + TESTING("system/user times"); + + err = H5_timer_init(&timer); + if(err < 0) + TEST_ERROR; + + err = H5_timer_start(&timer); + if(err < 0) + TEST_ERROR; + + /* The system and user times may not be present on some systems. They + * will be -1.0 if they are not. + */ + if(timer.initial.system < 0.0 || timer.initial.user < 0.0) { + SKIPPED(); + printf("NOTE: No suitable way to get system/user times on this platform.\n"); + return 0; + } + + /* Do some fake work */ + for(i=0; i < 1024; i++) { + buf = (char *)HDmalloc(1024 * i * sizeof(char)); + HDfree(buf); + } + + err = H5_timer_stop(&timer); + if(err < 0) + TEST_ERROR; + + err = H5_timer_get_times(timer, ×); + if(err < 0) + TEST_ERROR; + + /* System and user times should be non-negative. */ + if(times.system < 0.0 || times.user < 0.0) + TEST_ERROR; + + PASSED(); + return 0; + +error: + return -1; +} + + +/*------------------------------------------------------------------------- + * Function: test_timer_elapsed + * + * Purpose: Tests the ability to get elapsed times from the timers. + * We should always be able to get an elapsed time, + * regardless of the time libraries or platform. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Dana Robinson + * May 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_timer_elapsed(void) +{ + int i; + char *buf = NULL; + H5_timer_t timer; + H5_timevals_t times; + herr_t err; + + TESTING("elapsed times"); + + err = H5_timer_init(&timer); + if(err < 0) + TEST_ERROR; + + err = H5_timer_start(&timer); + if(err < 0) + TEST_ERROR; + + /* Do some fake work */ + for(i=0; i < 1024; i++) { + buf = (char *)HDmalloc(1024 * i * sizeof(char)); + HDfree(buf); + } + + err = H5_timer_stop(&timer); + if(err < 0) + TEST_ERROR; + + err = H5_timer_get_times(timer, ×); + if(err < 0) + TEST_ERROR; + + /* Elapsed time should be non-negative. */ + if(times.elapsed < 0.0) + TEST_ERROR; + + PASSED(); + return 0; + +error: + return -1; +} + + + +static herr_t +test_timer_functionality(void) +{ + int i; + char *buf = NULL; + H5_timer_t timer; + + H5_timevals_t times; + double prev_etime; + double prev_total_etime; + + herr_t err; + + TESTING("timer functionality"); + + /***************** + * CHECK STARTUP * + *****************/ + + /* Timer should be running after start */ + err = H5_timer_init(&timer); + if(err < 0 || timer.is_running) + TEST_ERROR; + + /* Times should be initialized to zero */ + err = H5_timer_get_times(timer, ×); + if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) + TEST_ERROR; + + err = H5_timer_get_total_times(timer, ×); + if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) + TEST_ERROR; + + + /******************** + * CHECK START/STOP * + ********************/ + + /* Running state should change after start */ + err = H5_timer_start(&timer); + if(err < 0 || !timer.is_running) + TEST_ERROR; + + /* Do some fake work */ + for(i=0; i < 1024; i++) { + buf = (char *)HDmalloc(1024 * i * sizeof(char)); + HDfree(buf); + } + + /* Running state should change after stop */ + err = H5_timer_stop(&timer); + if(err < 0 || timer.is_running) + TEST_ERROR; + + /* Times should be positive and non-negative */ + err = H5_timer_get_times(timer, ×); + if(err < 0 || times.elapsed < 0.0) + TEST_ERROR; + + err = H5_timer_get_total_times(timer, ×); + if(err < 0 || times.elapsed < 0.0) + TEST_ERROR; + + + /********************** + * CHECK INTERRUPTING * + **********************/ + + /* Timer should change stat and refresh to 0s */ + err = H5_timer_init(&timer); + if(err < 0 || timer.is_running) + TEST_ERROR; + + err = H5_timer_get_times(timer, ×); + if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) + TEST_ERROR; + + err = H5_timer_get_total_times(timer, ×); + if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) + TEST_ERROR; + + /* Timer state should flip */ + err = H5_timer_start(&timer); + if(err < 0 || !timer.is_running) + TEST_ERROR; + + /* Do some fake work */ + for(i=0; i < 1024; i++) { + buf = (char *)HDmalloc(1024 * i * sizeof(char)); + HDfree(buf); + } + + /* Times should be non-negative */ + err = H5_timer_get_times(timer, ×); + if(err < 0 || times.elapsed < 0.0) + TEST_ERROR; + prev_etime = times.elapsed; + + err = H5_timer_get_total_times(timer, ×); + if(err < 0 || times.elapsed < 0.0) + TEST_ERROR; + prev_total_etime = times.elapsed; + + /* Do some fake work */ + for(i=0; i < 1024; i++) { + buf = (char *)HDmalloc(1024 * i * sizeof(char)); + HDfree(buf); + } + + /* State should flip on stop */ + err = H5_timer_stop(&timer); + if(err < 0 || timer.is_running) + TEST_ERROR; + + /* Times should be >= than the cached intermediate times */ + err = H5_timer_get_times(timer, ×); + if(err < 0 || times.elapsed < prev_etime) + TEST_ERROR; + + err = H5_timer_get_total_times(timer, ×); + if(err < 0 || times.elapsed < prev_total_etime) + TEST_ERROR; + + + PASSED(); + return 0; + +error: + return -1; +} + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Tests the basic functionality of the platform-independent + * timers + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Dana Robinson + * May, 2011 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + int nerrors = 0; + + h5_reset(); + + printf("Testing platform-independent timer functionality.\n"); + + nerrors += test_time_formatting() < 0 ? 1 : 0; + nerrors += test_timer_system_user() < 0 ? 1 : 0; + nerrors += test_timer_elapsed() < 0 ? 1 : 0; + nerrors += test_timer_functionality() < 0 ? 1 : 0; + + + if(nerrors) { + printf("***** %d platform-independent timer TEST%s FAILED! *****\n", + nerrors, nerrors > 1 ? "S" : ""); + return 1; + } else { + printf("All platform-independent timer tests passed.\n"); + return 0; + } +} + -- cgit v0.12 From e70dc43d6bfea81a565e3b420795bd351112458e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 23 Sep 2017 21:47:07 -0500 Subject: Update H5_now_usec to prefer using clock_gettime. --- src/H5timer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/H5timer.c b/src/H5timer.c index 2cb8cea..4a1f3f0 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -193,7 +193,14 @@ H5_now_usec(void) { uint64_t now; /* Current time, in microseconds */ -#ifdef H5_HAVE_GETTIMEOFDAY +#if defined(H5_HAVE_CLOCK_GETTIME) + { + struct timespec ts; + + HDclock_gettime(CLOCK_MONOTONIC, &ts); + now = (uint64_t)(ts.tv_sec * (1000 * 1000)) + (uint64_t)(ts.tv_nsec * 1000); + } +#elif defined(H5_HAVE_GETTIMEOFDAY) { struct timeval now_tv; -- cgit v0.12 From 395473b2f4b5f03733aab9a785ac23c59ea84d0b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 23 Sep 2017 21:47:36 -0500 Subject: Remove detection for mach/mach/time.h, since we're no longer using the time routines from that header. --- config/cmake/H5pubconf.h.in | 3 --- config/cmake_ext_mod/ConfigureChecks.cmake | 3 --- configure.ac | 2 -- 3 files changed, 8 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 8c01dba..b427254 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -258,9 +258,6 @@ /* Define to 1 if you have the `lstat' function. */ #cmakedefine H5_HAVE_LSTAT @H5_HAVE_LSTAT@ -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_MACH_MACH_TIME_H @H5_HAVE_MACH_MACH_TIME_H@ - /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_MEMORY_H @H5_HAVE_MEMORY_H@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 56d45f9..88cd77b 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -234,9 +234,6 @@ if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) endif () endif () -# Darwin -CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) - # Windows CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) if (NOT CYGWIN) diff --git a/configure.ac b/configure.ac index 91800e7..ea4e4bd 100644 --- a/configure.ac +++ b/configure.ac @@ -1050,8 +1050,6 @@ AC_CHECK_HEADERS([stdint.h], [C9x=yes]) AC_CHECK_HEADERS([stdbool.h]) ## Darwin -AC_CHECK_HEADERS([mach/mach_time.h]) -## Also need to detect Darwin for pubconf case $host_os in darwin*) AC_DEFINE([HAVE_DARWIN], [1], [Define if Darwin or Mac OS X]) -- cgit v0.12 From 949649a2b6e00297cbdc49437e70a27e455e92d2 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 24 Sep 2017 14:08:40 -0500 Subject: Correct mistake in H5_now_usec calculation for clock_gettime. --- src/H5timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5timer.c b/src/H5timer.c index 4a1f3f0..8603b1c 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -198,7 +198,7 @@ H5_now_usec(void) struct timespec ts; HDclock_gettime(CLOCK_MONOTONIC, &ts); - now = (uint64_t)(ts.tv_sec * (1000 * 1000)) + (uint64_t)(ts.tv_nsec * 1000); + now = (uint64_t)(ts.tv_sec * (1000 * 1000)) + (uint64_t)(ts.tv_nsec / 1000); } #elif defined(H5_HAVE_GETTIMEOFDAY) { -- cgit v0.12 From 5c87b06d9d101306ff7ac956ff34798c539ca3fc Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 20 Apr 2020 16:03:08 -0500 Subject: Don't add general warnings flags for unsupported old versions of gcc and g++ (older than gcc/g++ 4.2). Correct gnu-cxxflags to determine warnings flags to be added based on C++ compiler version instead of C compiler version. --- config/cmake/HDFCXXCompilerFlags.cmake | 19 +++++++------ config/cmake/HDFCompilerFlags.cmake | 19 ++++++++----- config/gnu-cxxflags | 50 ++++++++++++++++++---------------- config/gnu-flags | 6 ++-- 4 files changed, 53 insertions(+), 41 deletions(-) diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 6aa8784..721fca4 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -103,8 +103,10 @@ if (NOT MSVC) list (APPEND H5_CXXFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings") endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - # autotools always add the C flags with the CXX flags + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED + AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2) + # autotools always add the C flags with the CXX flags, except for + # with older versions that are no longer supported ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") endif () @@ -141,16 +143,17 @@ if (NOT MSVC) endif () if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # Append warning flags that only gcc 4.3+ knows about - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") - # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... Only needed for gcc 4.X - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") endif () + # Append warning flags that only gcc 4.3+ knows about + # autotools always add the C flags with the CXX flags + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") + endif() # Append more extra warning flags that only gcc 4.4+ know about if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) @@ -172,7 +175,7 @@ if (NOT MSVC) endif () # Append more extra warning flags that only gcc 4.6 and less know about - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 72141c0..a40b525 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -111,8 +111,11 @@ if (NOT MSVC) list (APPEND H5_CFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings") endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") + # Add general CFlags except for older versions that are no longer supported + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") + endif () # gcc automatically inlines based on the optimization level # this is just a failsafe list (APPEND H5_CFLAGS0 "-finline-functions") @@ -149,14 +152,16 @@ if (NOT MSVC) if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - # Append warning flags that only gcc 4.3+ knows about - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") - # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... Only needed for gcc 4.X - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") endif () + # Append warning flags that only gcc 4.3+ knows about + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") + endif () + # Append more extra warning flags that only gcc 4.4+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) @@ -174,7 +179,7 @@ if (NOT MSVC) endif () # Append more extra warning flags that only gcc 4.6 and less know about - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") endif () diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index e177aef..b3b082d 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -79,9 +79,9 @@ if test "X-" = "X-$cxx_flags_set"; then cxx_vers_major=`echo $cxx_version | cut -f1 -d.` cxx_vers_minor=`echo $cxx_version | cut -f2 -d.` cxx_vers_patch=`echo $cxx_version | cut -f3 -d.` - test -n "$cc_vers_major" || cxx_vers_major=0 - test -n "$cc_vers_minor" || cxx_vers_minor=0 - test -n "$cc_vers_patch" || cxx_vers_patch=0 + test -n "$cxx_vers_major" || cxx_vers_major=0 + test -n "$cxx_vers_minor" || cxx_vers_minor=0 + test -n "$cxx_vers_patch" || cxx_vers_patch=0 cxx_vers_all=`expr $cxx_vers_major '*' 1000000 + $cxx_vers_minor '*' 1000 + $cxx_vers_patch` fi @@ -180,10 +180,12 @@ if test "X-g++" = "X-$cxx_vendor"; then # General # ########### - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments general)" - H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-general)" - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)" - #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-cxx-general)" + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -gt 4; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments general)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-general)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)" + #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-cxx-general)" + fi ###################### # Developer warnings # @@ -197,27 +199,27 @@ if test "X-g++" = "X-$cxx_vendor"; then ####################### # GCC 4.2 through 4.6 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 6; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.6)" fi # GCC 4.2 through 4.3 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 3; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.3)" fi # GCC 4.5 through 4.6 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 6; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5-4.6)" fi # GCC 4.2 through 4.4 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -a $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 4; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.4)" fi # GCC 4.2 through the end of GCC 4 series - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.last)" fi @@ -226,68 +228,68 @@ if test "X-g++" = "X-$cxx_vendor"; then ############################# # gcc >= 4.3 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 3; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.3)" fi # gcc >= 4.4 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 4; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.4)" fi # gcc >= 4.5 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5)" DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.5)" NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.5)" fi # gcc >= 4.6 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 6; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.6)" DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.6)" NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.6)" fi # gcc >= 4.7 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 7; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.7)" DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.7)" NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.7)" fi # gcc >= 4.8 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)" DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)" NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)" fi # gcc >= 4.9 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then + if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 9; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.9)" H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.9)" fi # gcc >= 5 - if test $cc_vers_major -ge 5; then + if test $cxx_vers_major -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 5)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-5)" fi # gcc >= 6 - if test $cc_vers_major -ge 6; then + if test $cxx_vers_major -ge 6; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 6)" fi # gcc >= 7 - if test $cc_vers_major -ge 7; then + if test $cxx_vers_major -ge 7; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)" DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-7)" fi # gcc 8 - if test $cc_vers_major -ge 8; then + if test $cxx_vers_major -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)" DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-8)" @@ -295,7 +297,7 @@ if test "X-g++" = "X-$cxx_vendor"; then fi # gcc 9 - if test $cc_vers_major -ge 9; then + if test $cxx_vers_major -ge 9; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 9)" fi diff --git a/config/gnu-flags b/config/gnu-flags index ad07552..dba9324 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -188,8 +188,10 @@ if test "X-gcc" = "X-$cc_vendor"; then # General # ########### - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" - H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -gt 4; then + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" + H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" + fi ###################### # Developer warnings # -- cgit v0.12 From 9e5dbf69062d4d2cb40ba8f68edb355477fc9b67 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 20 Apr 2020 18:12:00 -0500 Subject: Trim trailing whitespace --- Makefile.am | 8 +- README.txt | 24 +- acsite.m4 | 4 +- bin/batch/ctestP.sl.in.cmake | 2 +- bin/h5cc.in | 24 +- c++/Makefile.am | 2 +- c++/examples/h5tutr_cmprss.cpp | 16 +- c++/examples/h5tutr_crtatt.cpp | 10 +- c++/examples/h5tutr_crtdat.cpp | 4 +- c++/examples/h5tutr_crtgrp.cpp | 6 +- c++/examples/h5tutr_crtgrpar.cpp | 14 +- c++/examples/h5tutr_crtgrpd.cpp | 12 +- c++/examples/h5tutr_extend.cpp | 28 +- c++/examples/h5tutr_rdwt.cpp | 4 +- c++/examples/h5tutr_subset.cpp | 24 +- c++/examples/run-c++-ex.sh.in | 2 +- c++/src/H5CppDoc.h | 8 +- c++/src/H5DataType.cpp | 2 +- c++/src/H5Exception.cpp | 2 +- c++/src/H5IntType.cpp | 2 +- c++/src/H5Location.cpp | 2 +- c++/src/H5Location.h | 2 +- c++/src/H5Object.h | 2 +- c++/src/h5c++.in | 2 +- c++/test/dsets.cpp | 4 +- c++/test/h5cpputil.h | 2 +- c++/test/tarray.cpp | 12 +- c++/test/tattr.cpp | 4 +- c++/test/tfile.cpp | 4 +- c++/test/titerate.cpp | 12 +- c++/test/trefer.cpp | 2 +- c++/test/ttypes.cpp | 4 +- config/cmake/ConfigureChecks.cmake | 2 +- config/cmake/PkgInfo.in | 2 +- config/commence.am | 22 +- config/conclude.am | 6 +- config/examples.am | 6 +- config/toolchain/build32.cmake | 2 +- examples/Attributes.txt | 6 +- examples/Makefile.am | 2 +- examples/h5_cmprss.c | 40 +- examples/h5_crtatt.c | 2 +- examples/h5_crtdat.c | 10 +- examples/h5_crtgrp.c | 2 +- examples/h5_crtgrpar.c | 2 +- examples/h5_crtgrpd.c | 2 +- examples/h5_extend.c | 38 +- examples/h5_rdwt.c | 6 +- examples/h5_ref_extern.c | 2 +- examples/h5_subset.c | 48 +- examples/h5_vds-eiger.c | 36 +- examples/h5_vds-exc.c | 40 +- examples/h5_vds-exclim.c | 38 +- examples/h5_vds-percival-unlim-maxmin.c | 58 +- examples/h5_vds-percival-unlim.c | 66 +- examples/h5_vds-percival.c | 50 +- examples/h5_vds-simpleIO.c | 34 +- examples/h5_vds.c | 52 +- examples/run-c-ex.sh.in | 4 +- examples/testh5cc.sh.in | 6 +- fortran/examples/compound_complex_fortran2003.f90 | 6 +- fortran/examples/compound_fortran2003.f90 | 12 +- fortran/examples/h5_cmprss.f90 | 26 +- fortran/examples/h5_extend.f90 | 54 +- fortran/examples/h5_subset.f90 | 64 +- fortran/examples/nested_derived_type.f90 | 14 +- fortran/examples/rwdset_fortran2003.f90 | 38 +- fortran/examples/testh5fc.sh.in | 16 +- fortran/src/H5Df.c | 10 +- fortran/src/H5Ef.c | 6 +- fortran/src/H5Ff.c | 6 +- fortran/src/H5Lf.c | 2 +- fortran/src/H5Of.c | 48 +- fortran/src/H5Pf.c | 10 +- fortran/src/H5Rf.c | 2 +- fortran/src/H5_f.c | 10 +- fortran/src/H5config_f.inc.in | 4 +- fortran/src/H5f90proto.h | 18 +- fortran/src/H5match_types.c | 10 +- fortran/src/Makefile.am | 2 +- fortran/src/h5fc.in | 14 +- fortran/test/Makefile.am | 2 +- fortran/testpar/hyper.f90 | 4 +- fortran/testpar/ptest.f90 | 4 +- hl/Makefile.am | 2 +- hl/c++/Makefile.am | 2 +- hl/c++/examples/run-hlc++-ex.sh.in | 2 +- hl/examples/run-hlc-ex.sh.in | 2 +- hl/fortran/Makefile.am | 2 +- hl/fortran/examples/ex_ds1.f90 | 42 +- hl/fortran/examples/run-hlfortran-ex.sh.in | 2 +- hl/fortran/src/H5DSfc.c | 62 +- hl/fortran/src/H5LTf90proto.h | 8 +- hl/fortran/src/H5LTfc.c | 12 +- hl/fortran/src/H5TBfc.c | 14 +- hl/fortran/test/Makefile.am | 2 +- hl/src/H5DO.c | 6 +- hl/src/H5IM.c | 38 +- hl/src/H5LD.c | 8 +- hl/src/H5LT.c | 268 +- hl/src/H5LTanalyze.c | 150 +- hl/src/H5LTparse.c | 112 +- hl/src/H5LTparse.h | 10 +- hl/src/H5LTpublic.h | 2 +- hl/src/H5TB.c | 60 +- hl/test/gen_test_ld.c | 30 +- hl/tools/gif2h5/Makefile.am | 6 +- hl/tools/gif2h5/h52giftest.sh.in | 14 +- hl/tools/h5watch/extend_dset.c | 8 +- hl/tools/h5watch/h5watchgentest.c | 30 +- hl/tools/h5watch/swmr_check_compat_vfd.c | 2 +- java/Makefile.am | 2 +- java/examples/Makefile.am | 2 +- java/examples/datasets/Makefile.am | 2 +- java/examples/datatypes/Makefile.am | 2 +- java/examples/groups/Makefile.am | 2 +- java/examples/intro/Makefile.am | 2 +- java/src/Makefile.am | 2 +- java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java | 2 +- .../src/hdf/hdf5lib/structs/H5O_native_info_t.java | 4 +- java/src/hdf/hdf5lib/structs/H5O_token_t.java | 2 +- java/src/jni/h5sImp.c | 2 +- java/src/jni/h5sImp.h | 2 +- java/test/Makefile.am | 2 +- java/test/TestH5Tparams.java | 2 +- m4/aclocal_fc.f90 | 8 +- m4/aclocal_fc.m4 | 24 +- release_docs/HISTORY-1_0-1_8_0_rc3.txt | 1850 ++++----- release_docs/HISTORY-1_10.txt | 32 +- release_docs/HISTORY-1_8.txt | 4248 ++++++++++---------- release_docs/HISTORY-1_8_0-1_10_0.txt | 6 +- src/H5.c | 14 +- src/H5A.c | 2 +- src/H5AC.c | 66 +- src/H5ACdbg.c | 10 +- src/H5ACmpio.c | 256 +- src/H5ACpkg.h | 42 +- src/H5ACprivate.h | 12 +- src/H5Adense.c | 12 +- src/H5Adeprec.c | 2 +- src/H5B2.c | 6 +- src/H5B2int.c | 12 +- src/H5B2internal.c | 4 +- src/H5B2leaf.c | 2 +- src/H5B2pkg.h | 2 +- src/H5B2test.c | 4 +- src/H5C.c | 412 +- src/H5CX.c | 22 +- src/H5Cdbg.c | 86 +- src/H5Cepoch.c | 10 +- src/H5Cimage.c | 538 +-- src/H5Clog.c | 4 +- src/H5Clog_json.c | 74 +- src/H5Clog_trace.c | 38 +- src/H5Cmpio.c | 124 +- src/H5Cpkg.h | 306 +- src/H5Cprefetched.c | 42 +- src/H5Cprivate.h | 556 +-- src/H5Cquery.c | 4 +- src/H5Ctag.c | 72 +- src/H5D.c | 8 +- src/H5Dbtree2.c | 26 +- src/H5Dcontig.c | 6 +- src/H5Dearray.c | 6 +- src/H5Dfarray.c | 10 +- src/H5Dfill.c | 2 +- src/H5Dio.c | 6 +- src/H5Dmpio.c | 46 +- src/H5Dnone.c | 8 +- src/H5Dpublic.h | 4 +- src/H5Dsingle.c | 6 +- src/H5E.c | 4 +- src/H5EAcache.c | 8 +- src/H5EApkg.h | 8 +- src/H5EAtest.c | 8 +- src/H5Eint.c | 2 +- src/H5Epkg.h | 2 +- src/H5FAcache.c | 12 +- src/H5FApkg.h | 6 +- src/H5FDcore.c | 38 +- src/H5FDdirect.c | 2 +- src/H5FDhdfs.h | 2 +- src/H5FDint.c | 4 +- src/H5FDlog.c | 8 +- src/H5FDmirror.c | 2 +- src/H5FDmpio.c | 30 +- src/H5FDmulti.c | 10 +- src/H5FDpublic.h | 12 +- src/H5FDsec2.c | 18 +- src/H5FDstdio.c | 10 +- src/H5FDtest.c | 2 +- src/H5FS.c | 2 +- src/H5FScache.c | 142 +- src/H5FSint.c | 6 +- src/H5FSsection.c | 36 +- src/H5Fefc.c | 2 +- src/H5Fint.c | 2 +- src/H5Fpkg.h | 26 +- src/H5Fsuper_cache.c | 16 +- src/H5G.c | 2 +- src/H5Gcache.c | 10 +- src/H5Gcompact.c | 2 +- src/H5Gint.c | 4 +- src/H5Gnode.c | 4 +- src/H5Gpkg.h | 4 +- src/H5Gprivate.h | 2 +- src/H5Gtraverse.c | 6 +- src/H5HFbtree2.c | 4 +- src/H5HFcache.c | 616 +-- src/H5HFiblock.c | 2 +- src/H5HFman.c | 8 +- src/H5HFpkg.h | 8 +- src/H5HFsection.c | 2 +- src/H5HFtiny.c | 4 +- src/H5HG.c | 4 +- src/H5HGcache.c | 28 +- src/H5HLcache.c | 54 +- src/H5HLdblk.c | 2 +- src/H5HLint.c | 2 +- src/H5I.c | 34 +- src/H5L.c | 6 +- src/H5M.c | 4 +- src/H5MF.c | 210 +- src/H5MFaggr.c | 10 +- src/H5MFdbg.c | 4 +- src/H5MFprivate.h | 6 +- src/H5MFsection.c | 10 +- src/H5MM.c | 2 +- src/H5Oattr.c | 2 +- src/H5Oattribute.c | 2 +- src/H5Ocache.c | 58 +- src/H5Ocache_image.c | 10 +- src/H5Odtype.c | 2 +- src/H5Oflush.c | 8 +- src/H5Olayout.c | 2 +- src/H5Opkg.h | 8 +- src/H5Oprivate.h | 8 +- src/H5P.c | 4 +- src/H5PB.c | 48 +- src/H5Pdcpl.c | 20 +- src/H5Pdeprec.c | 8 +- src/H5Pdxpl.c | 48 +- src/H5Pencdec.c | 2 +- src/H5Pfapl.c | 2 +- src/H5Pfcpl.c | 32 +- src/H5Pfmpl.c | 2 +- src/H5Pgcpl.c | 20 +- src/H5Pint.c | 42 +- src/H5Plapl.c | 14 +- src/H5Plcpl.c | 2 +- src/H5Pocpypl.c | 18 +- src/H5Pstrcpl.c | 2 +- src/H5SM.c | 2 +- src/H5SMcache.c | 22 +- src/H5Sall.c | 2 +- src/H5Smpio.c | 2 +- src/H5Spublic.h | 2 +- src/H5Sselect.c | 2 +- src/H5TS.c | 30 +- src/H5Tcommit.c | 4 +- src/H5Tconv.c | 32 +- src/H5Torder.c | 10 +- src/H5UC.c | 2 +- src/H5UCprivate.h | 2 +- src/H5VLnative_attr.c | 32 +- src/H5VLnative_dataset.c | 6 +- src/H5VLnative_datatype.c | 6 +- src/H5VLnative_file.c | 10 +- src/H5VLnative_group.c | 6 +- src/H5VLnative_link.c | 20 +- src/H5VLnative_object.c | 18 +- src/H5VM.c | 2 +- src/H5Zdeflate.c | 2 +- src/H5Znbit.c | 2 +- src/H5Ztrans.c | 20 +- src/H5mpi.c | 6 +- src/H5public.h | 2 +- src/H5system.c | 2 +- test/SWMR_UseCase_UG.txt | 2 +- test/accum.c | 156 +- test/accum_swmr_reader.c | 12 +- test/big.c | 4 +- test/cache_common.c | 2 +- test/cross_read.c | 22 +- test/del_many_dense_attrs.c | 8 +- test/dsets.c | 12 +- test/efc.c | 4 +- test/enc_dec_plist_cross_platform.c | 2 +- test/enum.c | 2 +- test/evict_on_close.c | 2 +- test/external.c | 2 +- test/external_common.c | 4 +- test/farray.c | 4 +- test/fheap.c | 20 +- test/file_image.c | 140 +- test/filter_fail.c | 34 +- test/filter_plugin1_dsets.c | 2 +- test/flush1.c | 4 +- test/flush2.c | 2 +- test/flushrefresh.c | 132 +- test/gen_bad_compound.c | 2 +- test/gen_bad_offset.c | 8 +- test/gen_bogus.c | 4 +- test/gen_bounds.c | 64 +- test/gen_filespace.c | 2 +- test/gen_filters.c | 8 +- test/gen_plist.c | 26 +- test/genall5.h | 2 +- test/getname.c | 4 +- test/h5test.c | 2 +- test/mirror_vfd.c | 2 +- test/ohdr.c | 2 +- test/page_buffer.c | 132 +- test/swmr_addrem_writer.c | 2 +- test/swmr_check_compat_vfd.c | 2 +- test/swmr_common.c | 2 +- test/swmr_common.h | 2 +- test/swmr_generator.c | 2 +- test/swmr_reader.c | 2 +- test/swmr_remove_reader.c | 2 +- test/swmr_remove_writer.c | 2 +- test/swmr_sparse_reader.c | 4 +- test/swmr_start_write.c | 12 +- test/swmr_writer.c | 2 +- test/test_filter_plugin.sh.in | 10 +- test/test_vol_plugin.sh.in | 10 +- test/testabort_fail.sh.in | 6 +- test/testcheck_version.sh.in | 18 +- test/testerror.sh.in | 8 +- test/testlibinfo.sh.in | 6 +- test/th5s.c | 28 +- test/thread_id.c | 2 +- test/trefer.c | 12 +- test/trefer_deprec.c | 2 +- test/trefer_shutdown.c | 2 +- test/trefstr.c | 2 +- test/tselect.c | 2 +- test/ttsafe.c | 2 +- test/twriteorder.c | 12 +- test/unregister.c | 12 +- test/use_append_chunk.c | 4 +- test/use_common.c | 16 +- test/vds.c | 10 +- test/vds_swmr_writer.c | 2 +- test/vol.c | 4 +- testpar/Makefile.am | 2 +- testpar/t_2Gio.c | 22 +- testpar/t_coll_chunk.c | 2 +- testpar/t_coll_md_read.c | 2 +- testpar/t_file.c | 2 +- testpar/t_file_image.c | 62 +- testpar/t_init_term.c | 2 +- testpar/t_mpi.c | 2 +- testpar/t_pread.c | 24 +- testpar/t_prestart.c | 6 +- testpar/t_prop.c | 10 +- testpar/t_pshutdown.c | 6 +- testpar/testpar.h | 2 +- tools/lib/h5trav.h | 4 +- tools/src/Makefile.am | 2 +- tools/src/h5format_convert/h5format_convert.c | 10 +- tools/src/h5repack/h5repack_copy.c | 2 +- tools/test/h5dump/h5dumpgentest.c | 6 +- tools/test/h5format_convert/h5fc_chk_idx.c | 6 +- tools/test/h5repack/Makefile.am | 2 +- tools/test/misc/vds/UC_1.h | 2 +- tools/test/misc/vds/UC_1_one_dim_gen.c | 4 +- tools/test/misc/vds/UC_2.h | 4 +- tools/test/misc/vds/UC_2_two_dims_gen.c | 2 +- tools/test/perform/chunk_cache.c | 98 +- tools/test/perform/direct_write_perf.c | 86 +- tools/test/perform/overhead.c | 6 +- tools/test/perform/pio_perf.c | 2 +- tools/test/perform/sio_engine.c | 2 +- 374 files changed, 7336 insertions(+), 7336 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9689b58..8565788 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ ## Makefile.am ## Run automake to generate a Makefile.in from this file. ## -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. @@ -45,7 +45,7 @@ include $(top_srcdir)/config/commence.am # Since we're explicitly listing DIST_SUBDIRS, we also need to list # directories that are only conditionally built (so that their Makefiles # are cleaned as well). -# Note that `make clean' will not affect the examples or doc directories. +# Note that `make clean' will not affect the examples or doc directories. # Conditionals. These conditionals are defined during configure # Define each variable to empty if it is not used to placate pmake @@ -133,7 +133,7 @@ mostlyclean-local: # 'make install' will now install examples, the same as 'make install-all'. # 'make-install-all' will be redundant but will still work. install: install-recursive install-examples -uninstall: uninstall-recursive uninstall-examples +uninstall: uninstall-recursive uninstall-examples # 'make install-all' also installs examples install-all: @@ -154,7 +154,7 @@ install-doc: uninstall-doc: @echo "docs no longer live in this tree. Use install-examples to install examples." -# `make check-install' or `make installcheck' checks that examples can +# `make check-install' or `make installcheck' checks that examples can # be successfully built installcheck-local: if test -n "${DESTDIR}"; then \ diff --git a/README.txt b/README.txt index 88f1df0..021f217 100644 --- a/README.txt +++ b/README.txt @@ -7,8 +7,8 @@ Please refer to the release_docs/INSTALL file for installation instructions. THE HDF GROUP --------------- -The HDF Group is the developer of HDF5®, a high-performance software library and -data format that has been adopted across multiple industries and has become a +The HDF Group is the developer of HDF5®, a high-performance software library and +data format that has been adopted across multiple industries and has become a de facto standard in scientific and research communities. More information about The HDF Group, the HDF5 Community and the HDF5 software @@ -19,21 +19,21 @@ project, tools and services can be found at the Group's website. DOCUMENTATION ------------- -This release is fully functional for the API described in the documentation. +This release is fully functional for the API described in the documentation. https://portal.hdfgroup.org/display/HDF5/The+HDF5+API Full Documentation and Programming Resources for this release can be found at https://portal.hdfgroup.org/display/HDF5 -See the RELEASE.txt file in the release_docs/ directory for information specific -to the features and updates included in this release of the library. +See the RELEASE.txt file in the release_docs/ directory for information specific +to the features and updates included in this release of the library. -Several more files are located within the release_docs/ directory with specific +Several more files are located within the release_docs/ directory with specific details for several common platforms and configurations. INSTALL - Start Here. General instructions for compiling and installing the library INSTALL_CMAKE - instructions for building with CMake (Kitware.com) - INSTALL_parallel - instructions for building and configuring Parallel HDF5 + INSTALL_parallel - instructions for building and configuring Parallel HDF5 INSTALL_Windows and INSTALL_Cygwin - MS Windows installations. @@ -48,7 +48,7 @@ Information regarding Help Desk and Support services is available at FORUM and NEWS -------------- -The following public forums are provided for public announcements and discussions +The following public forums are provided for public announcements and discussions of interest to the general HDF5 Community. Homepage of the Forum @@ -59,10 +59,10 @@ of interest to the general HDF5 Community. HDF5 and HDF4 Topics https://forum.hdfgroup.org/c/hdf5 - -These forums are provided as an open and public service for searching and reading. -Posting requires completing a simple registration and allows one to join in the -conversation. Please read the following instructions pertaining to the Forum's + +These forums are provided as an open and public service for searching and reading. +Posting requires completing a simple registration and allows one to join in the +conversation. Please read the following instructions pertaining to the Forum's use and configuration https://forum.hdfgroup.org/t/quickstart-guide-welcome-to-the-new-hdf-forum diff --git a/acsite.m4 b/acsite.m4 index 9d04d1a..9477009 100644 --- a/acsite.m4 +++ b/acsite.m4 @@ -21,9 +21,9 @@ dnl ------------------------------------------------------------------------- dnl _AC_SYS_LARGEFILE_MACRO_VALUE dnl dnl The following macro overrides the autoconf macro of the same name -dnl with this custom definition. This macro performs the same checks as +dnl with this custom definition. This macro performs the same checks as dnl autoconf's native _AC_SYS_LARGEFILE_MACRO_VALUE, but will also set -dnl AM_CPPFLAGS with the appropriate -D defines so additional configure +dnl AM_CPPFLAGS with the appropriate -D defines so additional configure dnl sizeof checks do not fail. dnl # _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, diff --git a/bin/batch/ctestP.sl.in.cmake b/bin/batch/ctestP.sl.in.cmake index 6399de7..1069fa9 100644 --- a/bin/batch/ctestP.sl.in.cmake +++ b/bin/batch/ctestP.sl.in.cmake @@ -10,5 +10,5 @@ cd @HDF5_BINARY_DIR@ ctest . -R MPI_TEST_ -C Release -T test >& ctestP.out -echo "Done running ctestP.sl" +echo "Done running ctestP.sl" diff --git a/bin/h5cc.in b/bin/h5cc.in index d6b7a12..62a0884 100644 --- a/bin/h5cc.in +++ b/bin/h5cc.in @@ -83,10 +83,10 @@ CLINKERBASE="@CC@" # CFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user. # FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS. -# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's -# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and -# before the hdf5 libraries in $link_args, followed by any external library -# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in +# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's +# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and +# before the hdf5 libraries in $link_args, followed by any external library +# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in # from the hdf5 build. The order of the flags is intended to give precedence # to the user's flags. H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@" @@ -102,9 +102,9 @@ LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}" LIBS="${HDF5_LIBS:-$LIBSBASE}" # If a static library is available, the default will be to use it. If the only -# available library is shared, it will be used by default. The user can +# available library is shared, it will be used by default. The user can # override either default, although choosing an unavailable library will result -# in link errors. +# in link errors. STATIC_AVAILABLE="@enable_static@" if test "${STATIC_AVAILABLE}" = "yes"; then USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}" @@ -140,7 +140,7 @@ usage() { echo " HDF5_CC - use a different C compiler" echo " HDF5_CLINKER - use a different linker" echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library" - echo " [default: no except when built with only" + echo " [default: no except when built with only" echo " shared libraries]" echo " " echo " You can also add or change paths and flags to the compile line using" @@ -318,7 +318,7 @@ fi if test "x$do_link" = "xyes"; then shared_link="" -# conditionnaly link with the hl library +# conditionnaly link with the hl library if test "X$HL" = "Xhl"; then libraries=" $libraries -lhdf5_hl -lhdf5 " else @@ -379,10 +379,10 @@ if test "x$do_link" = "xyes"; then # module. It's okay if they're included twice in the compile line. link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS" - # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's - # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and - # before the hdf5 libraries in $link_args, followed by any external library - # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in + # User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's + # LDFLAGS come just before clibpath, user's LIBS come after $link_objs and + # before the hdf5 libraries in $link_args, followed by any external library + # paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in # from the hdf5 build. The order of the flags is intended to give precedence # to the user's flags. $SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link diff --git a/c++/Makefile.am b/c++/Makefile.am index 319ce6e..6bd682d 100644 --- a/c++/Makefile.am +++ b/c++/Makefile.am @@ -14,7 +14,7 @@ ## Run automake to generate a Makefile.in from this file. # # Top-level HDF5-C++ Makefile(.in) -# +# include $(top_srcdir)/config/commence.am diff --git a/c++/examples/h5tutr_cmprss.cpp b/c++/examples/h5tutr_cmprss.cpp index 9531bdd..e3cf978 100644 --- a/c++/examples/h5tutr_cmprss.cpp +++ b/c++/examples/h5tutr_cmprss.cpp @@ -42,7 +42,7 @@ int main (void) // handle the errors appropriately Exception::dontPrint(); - // Create a new file using the default property lists. + // Create a new file using the default property lists. H5File file(FILE_NAME, H5F_ACC_TRUNC); // Create the data space for the dataset. @@ -60,9 +60,9 @@ int main (void) // unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK; // unsigned szip_pixels_per_block = 16; // plist->setSzip(szip_options_mask, szip_pixels_per_block); - - // Create the dataset. - DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME, + + // Create the dataset. + DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME, PredType::STD_I32BE, *dataspace, *plist) ); for (i = 0; i< DIM0; i++) @@ -79,10 +79,10 @@ int main (void) file.close(); // ----------------------------------------------- - // Re-open the file and dataset, retrieve filter + // Re-open the file and dataset, retrieve filter // information for dataset and read the data back. // ----------------------------------------------- - + int rbuf[DIM0][DIM1]; int numfilt; size_t nelmts={1}, namelen={1}; @@ -113,7 +113,7 @@ int main (void) cout << "H5Z_FILTER_DEFLATE" << endl; break; case H5Z_FILTER_SZIP: - cout << "H5Z_FILTER_SZIP" << endl; + cout << "H5Z_FILTER_SZIP" << endl; break; default: cout << "Other filter type included." << endl; @@ -123,7 +123,7 @@ int main (void) // Read data. dataset->read(rbuf, PredType::NATIVE_INT); - delete plist; + delete plist; delete dataset; file.close(); // can be skipped diff --git a/c++/examples/h5tutr_crtatt.cpp b/c++/examples/h5tutr_crtatt.cpp index fcf6c27..409bd62 100644 --- a/c++/examples/h5tutr_crtatt.cpp +++ b/c++/examples/h5tutr_crtatt.cpp @@ -31,7 +31,7 @@ int main (void) { int attr_data[2] = { 100, 200}; hsize_t dims[1] = { DIM1 }; - + // Try block to detect exceptions raised by any of the calls inside it try @@ -47,11 +47,11 @@ int main (void) // Create the data space for the attribute. DataSpace attr_dataspace = DataSpace (1, dims ); - // Create a dataset attribute. - Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE, + // Create a dataset attribute. + Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE, attr_dataspace); - - // Write the attribute data. + + // Write the attribute data. attribute.write( PredType::NATIVE_INT, attr_data); } // end of try block diff --git a/c++/examples/h5tutr_crtdat.cpp b/c++/examples/h5tutr_crtdat.cpp index 985f6ac..3257223 100644 --- a/c++/examples/h5tutr_crtdat.cpp +++ b/c++/examples/h5tutr_crtdat.cpp @@ -37,7 +37,7 @@ int main (void) // handle the errors appropriately Exception::dontPrint(); - // Create a new file using the default property lists. + // Create a new file using the default property lists. H5File file(FILE_NAME, H5F_ACC_TRUNC); // Create the data space for the dataset. @@ -46,7 +46,7 @@ int main (void) dims[1] = NY; DataSpace dataspace(RANK, dims); - // Create the dataset. + // Create the dataset. DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace); } // end of try block diff --git a/c++/examples/h5tutr_crtgrp.cpp b/c++/examples/h5tutr_crtgrp.cpp index e35cb46..43af08a 100644 --- a/c++/examples/h5tutr_crtgrp.cpp +++ b/c++/examples/h5tutr_crtgrp.cpp @@ -37,12 +37,12 @@ int main(void) // Create a new file using default property lists. H5File file(FILE_NAME, H5F_ACC_TRUNC); - + // Create a group named "/MygGroup" in the file Group group(file.createGroup("/MyGroup")); // File and group will be closed as their instances go out of scope. - + } // end of try block // catch failure caused by the H5File operations @@ -57,6 +57,6 @@ int main(void) error.printErrorStack(); return -1; } - + return 0; } diff --git a/c++/examples/h5tutr_crtgrpar.cpp b/c++/examples/h5tutr_crtgrpar.cpp index 76ec9e5..15cf1df 100644 --- a/c++/examples/h5tutr_crtgrpar.cpp +++ b/c++/examples/h5tutr_crtgrpar.cpp @@ -32,7 +32,7 @@ int main(void) // Try block to detect exceptions raised by any of the calls inside it try { - + // Turn off the auto-printing when failure occurs so that we can // handle the errors appropriately. @@ -43,26 +43,26 @@ int main(void) H5File file(FILE_NAME, H5F_ACC_TRUNC); // Create group "MyGroup" in the root group using an absolute name. - + Group group1(file.createGroup( "/MyGroup")); - + // Create group "Group_A" in group "MyGroup" using an // absolute name. - Group group2(file.createGroup("/MyGroup/Group_A")); + Group group2(file.createGroup("/MyGroup/Group_A")); // Create group "Group_B" in group "MyGroup" using a // relative name. - + Group group3(group1.createGroup ("Group_B")); - + // Close the groups and file. group1.close(); group2.close(); group3.close(); file.close(); - + } // end of try block // catch failure caused by the File operations diff --git a/c++/examples/h5tutr_crtgrpd.cpp b/c++/examples/h5tutr_crtgrpd.cpp index e3bb1b1..c28b666 100644 --- a/c++/examples/h5tutr_crtgrpd.cpp +++ b/c++/examples/h5tutr_crtgrpd.cpp @@ -45,12 +45,12 @@ int main(void) // handle the errors appropriately Exception::dontPrint(); - // Initialize the first dataset. + // Initialize the first dataset. for (i = 0; i < D1DIM1; i++) for (j = 0; j < D1DIM2; j++) dset1_data[i][j] = j + 1; - // Initialize the second dataset. + // Initialize the second dataset. for (i = 0; i < D2DIM1; i++) for (j = 0; j < D2DIM2; j++) dset2_data[i][j] = j + 1; @@ -69,7 +69,7 @@ int main(void) // Create the dataset in group "MyGroup". Same note as for the // dataspace above. - DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1, + DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1, PredType::STD_I32BE, *dataspace)); // Write the data to the dataset using default memory space, file @@ -89,7 +89,7 @@ int main(void) Group group(file.openGroup("/MyGroup/Group_A")); // Create the second dataset in group "Group_A". - dataset = new DataSet (group.createDataSet(DATASET_NAME2, + dataset = new DataSet (group.createDataSet(DATASET_NAME2, PredType::STD_I32BE, *dataspace)); // Write the data to the dataset using default memory space, file @@ -100,7 +100,7 @@ int main(void) delete dataspace; delete dataset; group.close(); - + } // end of try block // catch failure caused by the H5File operations @@ -129,6 +129,6 @@ int main(void) error.printErrorStack(); return -1; } - + return 0; } diff --git a/c++/examples/h5tutr_extend.cpp b/c++/examples/h5tutr_extend.cpp index b6927ea..94e9acf 100644 --- a/c++/examples/h5tutr_extend.cpp +++ b/c++/examples/h5tutr_extend.cpp @@ -30,17 +30,17 @@ const H5std_string DATASETNAME("ExtendibleArray"); int main (void) { hsize_t dims[2] = {3,3}; // dataset dimensions at creation - hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={2, 5}; - int data[3][3] = { {1, 1, 1}, // data to write + int data[3][3] = { {1, 1, 1}, // data to write {1, 1, 1}, {1, 1, 1} }; - // Variables used in extending and writing to the extended portion of dataset + // Variables used in extending and writing to the extended portion of dataset hsize_t size[2]; hsize_t offset[2]; - hsize_t dimsext[2] = {7, 3}; // extend dimensions + hsize_t dimsext[2] = {7, 3}; // extend dimensions int dataext[7][3] = { {2, 3, 4}, {2, 3, 4}, {2, 3, 4}, @@ -56,7 +56,7 @@ int main (void) // handle the errors appropriately Exception::dontPrint(); - // Create a new file using the default property lists. + // Create a new file using the default property lists. H5File file(FILE_NAME, H5F_ACC_TRUNC); // Create the data space for the dataset. Note the use of pointer @@ -70,23 +70,23 @@ int main (void) prop.setChunk(2, chunk_dims); // Create the chunked dataset. Note the use of pointer. - DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME, + DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME, PredType::STD_I32BE, *dataspace, prop) ); - + // Write data to dataset. dataset->write(data, PredType::NATIVE_INT); // Extend the dataset. Dataset becomes 10 x 3. size[0] = dims[0] + dimsext[0]; size[1] = dims[1]; - dataset->extend(size); + dataset->extend(size); // Select a hyperslab in extended portion of the dataset. DataSpace *filespace = new DataSpace(dataset->getSpace ()); offset[0] = 3; offset[1] = 0; filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset); - + // Define memory space. DataSpace *memspace = new DataSpace(2, dimsext, NULL); @@ -101,9 +101,9 @@ int main (void) delete dataset; file.close(); - // --------------------------------------- + // --------------------------------------- // Re-open the file and read the data back - // --------------------------------------- + // --------------------------------------- int rdata[10][3]; int i,j, rank, rank_chunk; @@ -111,7 +111,7 @@ int main (void) // Open the file and dataset. file.openFile(FILE_NAME, H5F_ACC_RDONLY); - dataset = new DataSet(file.openDataSet( DATASETNAME)); + dataset = new DataSet(file.openDataSet( DATASETNAME)); // Get the dataset's dataspace and creation property list. filespace = new DataSpace(dataset->getSpace()); @@ -127,7 +127,7 @@ int main (void) memspace = new DataSpace(rank, dimsr, NULL); dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace); - + cout << endl; for (j = 0; j < dimsr[0]; j++) { for (i = 0; i < dimsr[1]; i++) @@ -141,7 +141,7 @@ int main (void) delete memspace; delete dataset; file.close(); - + } // end of try block // catch failure caused by the H5File operations diff --git a/c++/examples/h5tutr_rdwt.cpp b/c++/examples/h5tutr_rdwt.cpp index f17e6a5..e9b76ad 100644 --- a/c++/examples/h5tutr_rdwt.cpp +++ b/c++/examples/h5tutr_rdwt.cpp @@ -28,9 +28,9 @@ const int DIM1 = 6; int main (void) { - + // Data initialization. - + int i, j; int data[DIM0][DIM1]; // buffer for data to write diff --git a/c++/examples/h5tutr_subset.cpp b/c++/examples/h5tutr_subset.cpp index 0747880..f7d0513 100644 --- a/c++/examples/h5tutr_subset.cpp +++ b/c++/examples/h5tutr_subset.cpp @@ -46,19 +46,19 @@ int main (void) Exception::dontPrint(); // --------------------------------------------------- - // Create a new file using the default property lists. - // Then create a dataset and write data to it. + // Create a new file using the default property lists. + // Then create a dataset and write data to it. // Close the file and dataset. // --------------------------------------------------- - + H5File file(FILE_NAME, H5F_ACC_TRUNC); - hsize_t dims[2]; + hsize_t dims[2]; dims[0] = DIM0; dims[1] = DIM1; DataSpace dataspace = DataSpace (RANK, dims); - DataSet dataset(file.createDataSet( DATASET_NAME, + DataSet dataset(file.createDataSet( DATASET_NAME, PredType::STD_I32BE, dataspace) ); @@ -94,7 +94,7 @@ int main (void) file.openFile(FILE_NAME, H5F_ACC_RDWR); dataset = file.openDataSet(DATASET_NAME); - // Specify size and shape of subset to write. + // Specify size and shape of subset to write. offset[0] = 1; offset[1] = 2; @@ -107,7 +107,7 @@ int main (void) block[0] = 1; block[1] = 1; - + // Define Memory Dataspace. Get file dataspace and select // a subset from the file dataspace. @@ -117,7 +117,7 @@ int main (void) DataSpace memspace(RANK, dimsm, NULL); dataspace = dataset.getSpace(); - dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block); + dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block); // Write a subset of data to the dataset, then read the // entire dataset back from the file. @@ -127,15 +127,15 @@ int main (void) for (j = 0; j < DIM0_SUB; j++) { for (i = 0; i < DIM1_SUB; i++) sdata[j][i] = 5; - } - + } + dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace); dataset.read(rdata, PredType::NATIVE_INT); - + cout << endl << "Data in File after Subset is Written:" << endl; for (i = 0; i < DIM0; i++) { - for (j = 0; j < DIM1; j++) + for (j = 0; j < DIM1; j++) cout << " " << rdata[i][j]; cout << endl; } diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index 03e1eac..7ff8506 100644 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -141,5 +141,5 @@ rm *.o rm *.h5 echo -exit $EXIT_VALUE +exit $EXIT_VALUE diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 5e80408..1108181 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -25,7 +25,7 @@ * \section intro_sec Introduction * * The C++ API provides C++ wrappers for the HDF5 C Library. - * + * * It is assumed that the user has knowledge of the HDF5 file format and its * components. For more information on the HDF5 C Library, please refer to * the HDF5 Software Documentation page. @@ -54,9 +54,9 @@ * \section install_sec Installation * * The HDF5 C++ API is included with the HDF5 source code. - * - * Please refer to the release_docs/INSTALL file under the top directory - * of the HDF5 source code for information about installing, building, + * + * Please refer to the release_docs/INSTALL file under the top directory + * of the HDF5 source code for information about installing, building, * and testing the C++ API. * *
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 081cc03..0472975 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -122,7 +122,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } - */ + */ //-------------------------------------------------------------------------- // Function: DataType copy constructor diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index cf9e577..7431e6c 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -60,7 +60,7 @@ H5std_string Exception::getMajorString(hid_t err_major) const { // Preliminary call to H5Eget_msg() to get the length of the message ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0); - + // If H5Eget_msg() returns a negative value, raise an exception, if (mesg_size < 0) throw IdComponentException("Exception::getMajorString", diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 49c638e..01c20e9 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -83,7 +83,7 @@ IntType::IntType(const DataSet& dataset) : AtomType() { // Calls C function H5Dget_type to get the id of the datatype id = H5Dget_type(dataset.getId()); - + if (id < 0) { throw DataSetIException("IntType constructor", "H5Dget_type failed"); diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 764aa12..89a7890 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -568,7 +568,7 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t { p_setId(p_dereference(attr.getId(), ref, ref_type, plist, "dereference")); } - */ + */ #ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 3bad8bc..3c30715 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -72,7 +72,7 @@ class H5_DLLCPP H5Location : public IdComponent { // Creates a reference to a named object or to a dataset region // in this object. - void reference(void* ref, const char* name, + void reference(void* ref, const char* name, H5R_type_t ref_type = H5R_OBJECT) const; void reference(void* ref, const H5std_string& name, H5R_type_t ref_type = H5R_OBJECT) const; diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 033b1b7..a63229c 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -31,7 +31,7 @@ namespace H5 { H5Object is H5File is not an HDF5 object, and renaming H5Object to H5Location will risk breaking user applications. -BMR - Apr 2, 2014: Added wrapper getObjName for H5Iget_name + Apr 2, 2014: Added wrapper getObjName for H5Iget_name Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back into H5Object. This way, C functions that takes attribute id can be in H5Location and those that cannot take attribute id diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index f068f51..5a542f9 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -311,7 +311,7 @@ fi if test "x$do_link" = "xyes"; then shared_link="" - # conditionally link with the hl library + # conditionally link with the hl library if test "X$HL" = "Xhl"; then libraries=" $libraries -lhdf5_hl_cpp -lhdf5_cpp -lhdf5_hl -lhdf5 " else diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index fc29307..76e4424 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -268,7 +268,7 @@ static herr_t test_simple_io( H5File& file) /*------------------------------------------------------------------------- * Function: test_datasize * - * Purpose Tests DataSet::getInMemDataSize(). + * Purpose Tests DataSet::getInMemDataSize(). * * Return Success: 0 * @@ -901,7 +901,7 @@ static herr_t test_multiopen (H5File& file) if (cur_size[0]!=tmp_size[0]) { cerr << " Got " << static_cast(tmp_size[0]) - << " instead of " << static_cast(cur_size[0]) + << " instead of " << static_cast(cur_size[0]) << "!" << endl; throw Exception("test_multiopen", "Failed in multi-open with extending"); } diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 18fd44f..6664d0c 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -55,7 +55,7 @@ class TestFailedException : public Exception { // Overloaded/Template functions to verify values and display proper info -// Verifies +// Verifies void verify_val(const char* x, const char* value, const char* where, int line, const char* file_name); template diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index fccc556..f079780 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -210,7 +210,7 @@ static void test_array_compound_array() // Verify the compound datatype info CompType ctype_check(base_type.getId()); base_type.close(); - + // Check the number of members nmemb = ctype_check.getNmembers(); verify_val(nmemb, 2, "ctype_check.getNmembers", __LINE__, __FILE__); @@ -282,11 +282,11 @@ static void test_array_compound_array() */ H5::DataType getArr() { - hsize_t *dims = new hsize_t; - *dims = 5; - H5::ArrayType ret; - ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); - delete dims; + hsize_t *dims = new hsize_t; + *dims = 5; + H5::ArrayType ret; + ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); + delete dims; return ret; } diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 9485ec6..f432723 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -282,7 +282,7 @@ static void test_attr_getname() if (attr_exists == false) throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); - // Open attribute + // Open attribute Attribute fattr1(fid1.openAttribute(FATTR1_NAME)); // A. Get attribute name with @@ -1221,7 +1221,7 @@ static void test_attr_delete() attr_name = fattr.getName(); verify_val(attr_name, FATTR1_NAME, "Attribute::getName", __LINE__, __FILE__); fattr.close(); - + // Test deleting non-existing attribute // Open the dataset diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index a0231a6..f5625a3 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -633,7 +633,7 @@ static void test_file_attribute() verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__); num_objs = file5.getObjCount(H5F_OBJ_FILE); verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__); - + // Get the file name using the attributes H5std_string fname = fattr1.getFileName(); verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__); @@ -984,7 +984,7 @@ static void test_file_info() /* ret=H5Pget_shared_mesg_nindexes(fcpl2,&nindexes); CHECK(ret, FAIL, "H5Pget_shared_mesg_nindexes"); VERIFY(nindexes, MISC11_NINDEXES, "H5Pget_shared_mesg_nindexes"); - */ + */ // Get and verify the file space info from the creation property list */ fcpl2.getFileSpaceStrategy(out_strategy, out_persist, out_threshold); diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index c689087..d69e8d2 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -400,7 +400,7 @@ static void test_HDFFV_9920() { int attr_data[2] = { 100, 200}; hsize_t dims[1] = { DIM1 }; - + try { // Create a new file and a group in it @@ -414,13 +414,13 @@ static void test_HDFFV_9920() DataSet fds = file.createDataSet(FDATASET_NAME, PredType::STD_I32BE, dspace); DataSet gds = gr1.createDataSet(GDATASET_NAME, PredType::STD_I32BE, dspace); - // Create a file attribute and a group attribute. - Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE, + // Create a file attribute and a group attribute. + Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE, dspace); - Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE, + Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE, dspace); - - // Write the attribute data. + + // Write the attribute data. fa1.write( PredType::NATIVE_INT, attr_data); ga1.write( PredType::NATIVE_INT, attr_data); diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 8a6fb51..b46ae29 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -476,7 +476,7 @@ static void test_reference_group() // Check getting file name given the group dereferenced via constructor H5std_string fname = refgroup.getFileName(); verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); - + // Check getting file name given the group dereferenced by ::reference fname = group.getFileName(); verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__); diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 0de66d7..ae79653 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -54,7 +54,7 @@ using namespace H5; H5T_NATIVE_##TYPE##_ALIGN_g=MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL) #endif /* #include "H5Tpkg.h" - */ + */ const char *FILENAME[] = { "dtypes1.h5", @@ -392,7 +392,7 @@ static void test_vltype() try { VarLenType vltype(PredType::NATIVE_INT); - + bool in_class = vltype.detectClass(H5T_VLEN); verify_val(in_class, true, "VarLenType::detectClass() with H5T_VLEN", __LINE__, __FILE__); in_class = vltype.detectClass(H5T_INTEGER); diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 5a401f7..2930969 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -172,7 +172,7 @@ option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF) endif () # ---------------------------------------------------------------------- -# Check whether we can build the Mirror VFD +# Check whether we can build the Mirror VFD # Header-check flags set in config/cmake_ext_mod/ConfigureChecks.cmake # ---------------------------------------------------------------------- option (HDF5_ENABLE_MIRROR_VFD "Build the Mirror Virtual File Driver" OFF) diff --git a/config/cmake/PkgInfo.in b/config/cmake/PkgInfo.in index e530f88..ae54035 100644 --- a/config/cmake/PkgInfo.in +++ b/config/cmake/PkgInfo.in @@ -1 +1 @@ -FMWK???? \ No newline at end of file +FMWK???? diff --git a/config/commence.am b/config/commence.am index 830c494..41e0f3f 100644 --- a/config/commence.am +++ b/config/commence.am @@ -44,15 +44,15 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la # Install directories that automake doesn't know about docdir = $(exec_prefix)/doc -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -62,11 +62,11 @@ H5CC_PP=${DESTDIR}$(bindir)/h5pcc H5FC=${DESTDIR}$(bindir)/h5fc H5FC_PP=${DESTDIR}$(bindir)/h5pfc H5CPP=${DESTDIR}$(bindir)/h5c++ - + # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. diff --git a/config/conclude.am b/config/conclude.am index 58c2934..3f05a69 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -25,8 +25,8 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) -TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) @@ -198,7 +198,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ fi; \ fi - + # The dummysh.chkexe here prevents the target from being # empty if there are no tests in the current directory. # $${log} is the log file. diff --git a/config/examples.am b/config/examples.am index 247dfa8..e06f4ea 100644 --- a/config/examples.am +++ b/config/examples.am @@ -33,7 +33,7 @@ ## INSTALL_TOP_FILES ## ## EXAMPLEDIR -## The directory into which examples should be installed. +## The directory into which examples should be installed. ## ## Build rules for $(EXTRA_PROG). ## Dependencies for example programs. @@ -62,7 +62,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -109,7 +109,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/config/toolchain/build32.cmake b/config/toolchain/build32.cmake index deb5899..207d03e 100644 --- a/config/toolchain/build32.cmake +++ b/config/toolchain/build32.cmake @@ -72,4 +72,4 @@ else () # for libraries and headers in the target directories set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif () \ No newline at end of file +endif () diff --git a/examples/Attributes.txt b/examples/Attributes.txt index 0f25f68..6cba42b 100644 --- a/examples/Attributes.txt +++ b/examples/Attributes.txt @@ -1,4 +1,4 @@ -Attribute Examples: +Attribute Examples: H5Acreate2 example: Show how to create an attribute for a dataset and a group ---------------- @@ -19,7 +19,7 @@ H5Acreate2 example: Show how to create an attribute for a dataset and a group rank=2; dimsf[0] = H5S_UNLIMITED; dimsf[1] = H5S_UNLIMITED; - dataspace = H5Screate_simple(rank, dimsf, NULL); + dataspace = H5Screate_simple(rank, dimsf, NULL); /* Create a dataset */ dataset = H5Dcreate2(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -122,7 +122,7 @@ H5Alink Example: Shows how to share an attribute between two datasets. /* Get the OID of the attribute */ attr=H5Aopen(dataset1, "Foo", H5P_DEFAULT); - /* + /* * Create an attribute in the second dataset to the attribute in dataset1, * changing the name of the attribute information in dataset2. */ diff --git a/examples/Makefile.am b/examples/Makefile.am index 5b428cd..b7850a7 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -39,7 +39,7 @@ EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \ h5_ref2reg_deprec h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \ h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \ h5_vds-percival-unlim h5_vds-percival-unlim-maxmin -TEST_SCRIPT=testh5cc.sh +TEST_SCRIPT=testh5cc.sh TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES) # Install files diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index b51ec44..5feadd3 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -11,10 +11,10 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example illustrates how to create a compressed dataset. * It is used in the HDF5 Tutorial. - */ + */ #include "hdf5.h" @@ -22,11 +22,11 @@ #define RANK 2 #define DIM0 100 #define DIM1 20 - + int main () { hid_t file_id, dataset_id, dataspace_id; /* identifiers */ - hid_t plist_id; + hid_t plist_id; size_t nelmts; unsigned flags, filter_info; @@ -35,12 +35,12 @@ int main () { herr_t status; hsize_t dims[2]; hsize_t cdims[2]; - + int i,j, numfilt; int buf[DIM0][DIM1]; int rbuf [DIM0][DIM1]; - /* Uncomment these variables to use SZIP compression + /* Uncomment these variables to use SZIP compression unsigned szip_options_mask; unsigned szip_pixels_per_block; */ @@ -62,21 +62,21 @@ int main () { status = H5Pset_chunk (plist_id, 2, cdims); /* Set ZLIB / DEFLATE Compression using compression level 6. - * To use SZIP Compression comment out these lines. - */ - status = H5Pset_deflate (plist_id, 6); + * To use SZIP Compression comment out these lines. + */ + status = H5Pset_deflate (plist_id, 6); - /* Uncomment these lines to set SZIP Compression + /* Uncomment these lines to set SZIP Compression szip_options_mask = H5_SZIP_NN_OPTION_MASK; szip_pixels_per_block = 16; status = H5Pset_szip (plist_id, szip_options_mask, szip_pixels_per_block); */ - - dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE, - dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT); - for (i = 0; i< DIM0; i++) - for (j=0; j diff --git a/examples/h5_subset.c b/examples/h5_subset.c index 904d3f8..ad2eaba 100644 --- a/examples/h5_subset.c +++ b/examples/h5_subset.c @@ -11,44 +11,44 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * This example illustrates how to read/write a subset of data (a slab) +/* + * This example illustrates how to read/write a subset of data (a slab) * from/to a dataset in an HDF5 file. It is used in the HDF5 Tutorial. */ - + #include "hdf5.h" #define FILE "subset.h5" -#define DATASETNAME "IntArray" +#define DATASETNAME "IntArray" #define RANK 2 -#define DIM0_SUB 3 /* subset dimensions */ -#define DIM1_SUB 4 +#define DIM0_SUB 3 /* subset dimensions */ +#define DIM1_SUB 4 -#define DIM0 8 /* size of dataset */ -#define DIM1 10 +#define DIM0 8 /* size of dataset */ +#define DIM1 10 int main (void) { - hsize_t dims[2], dimsm[2]; + hsize_t dims[2], dimsm[2]; int data[DIM0][DIM1]; /* data to write */ int sdata[DIM0_SUB][DIM1_SUB]; /* subset to write */ int rdata[DIM0][DIM1]; /* buffer for read */ - + hid_t file_id, dataset_id; /* handles */ - hid_t dataspace_id, memspace_id; + hid_t dataspace_id, memspace_id; + + herr_t status; - herr_t status; - hsize_t count[2]; /* size of subset in the file */ hsize_t offset[2]; /* subset offset in the file */ hsize_t stride[2]; hsize_t block[2]; int i, j; - + /***************************************************************** * Create a new file with default creation and access properties.* * Then create a dataset and write data to it and close the file * @@ -59,7 +59,7 @@ main (void) dims[0] = DIM0; dims[1] = DIM1; - dataspace_id = H5Screate_simple (RANK, dims, NULL); + dataspace_id = H5Screate_simple (RANK, dims, NULL); dataset_id = H5Dcreate2 (file_id, DATASETNAME, H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -71,7 +71,7 @@ main (void) data[j][i] = 1; else data[j][i] = 2; - } + } status = H5Dwrite (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); @@ -89,7 +89,7 @@ main (void) /***************************************************** * Reopen the file and dataset and write a subset of * - * values to the dataset. + * values to the dataset. *****************************************************/ file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT); @@ -100,7 +100,7 @@ main (void) offset[0] = 1; offset[1] = 2; - count[0] = DIM0_SUB; + count[0] = DIM0_SUB; count[1] = DIM1_SUB; stride[0] = 1; @@ -109,18 +109,18 @@ main (void) block[0] = 1; block[1] = 1; - /* Create memory space with size of subset. Get file dataspace + /* Create memory space with size of subset. Get file dataspace and select subset from file dataspace. */ dimsm[0] = DIM0_SUB; dimsm[1] = DIM1_SUB; - memspace_id = H5Screate_simple (RANK, dimsm, NULL); + memspace_id = H5Screate_simple (RANK, dimsm, NULL); dataspace_id = H5Dget_space (dataset_id); status = H5Sselect_hyperslab (dataspace_id, H5S_SELECT_SET, offset, stride, count, block); - /* Write a subset of data to the dataset, then read the + /* Write a subset of data to the dataset, then read the entire dataset back from the file. */ printf ("\nWrite subset to file specifying:\n"); @@ -128,11 +128,11 @@ main (void) for (j = 0; j < DIM0_SUB; j++) { for (i = 0; i < DIM1_SUB; i++) sdata[j][i] = 5; - } + } status = H5Dwrite (dataset_id, H5T_NATIVE_INT, memspace_id, dataspace_id, H5P_DEFAULT, sdata); - + status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); @@ -147,5 +147,5 @@ main (void) status = H5Sclose (dataspace_id); status = H5Dclose (dataset_id); status = H5Fclose (file_id); - + } diff --git a/examples/h5_vds-eiger.c b/examples/h5_vds-eiger.c index 13b5d93..a02f4f8 100644 --- a/examples/h5_vds-eiger.c +++ b/examples/h5_vds-eiger.c @@ -12,7 +12,7 @@ /************************************************************ This example illustrates the concept of the virtual dataset. - Eiger use case. Every 5 frames 10x10 are in the source + Eiger use case. Every 5 frames 10x10 are in the source dataset "/A" in file with the name f-<#>.h5 This file is intended for use with HDF5 Library version 1.10 @@ -25,13 +25,13 @@ #define FILE "vds-eiger.h5" #define DATASET "VDS-Eiger" -#define VDSDIM0 5 -#define VDSDIM1 10 -#define VDSDIM2 10 -#define DIM0 5 -#define DIM1 10 -#define DIM2 10 -#define RANK 3 +#define VDSDIM0 5 +#define VDSDIM1 10 +#define VDSDIM2 10 +#define DIM0 5 +#define DIM1 10 +#define DIM2 10 +#define RANK 3 int main (void) @@ -69,7 +69,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -85,13 +85,13 @@ main (void) block[1] = DIM1; block[2] = DIM2; - /* - * Build the mappings + /* + * Build the mappings * */ status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); status = H5Pset_virtual (dcpl, vspace, "f-%b.h5", "/A", src_space); - + /* Create a virtual dataset */ @@ -100,8 +100,8 @@ main (void) status = H5Sclose (vspace); status = H5Sclose (src_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. @@ -123,7 +123,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -134,15 +134,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %d\n", (int)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-exc.c b/examples/h5_vds-exc.c index aaf1fa8..b113c36 100644 --- a/examples/h5_vds-exc.c +++ b/examples/h5_vds-exc.c @@ -24,16 +24,16 @@ #define FILE "vds-exc.h5" #define DATASET "VDS-Excalibur" -#define VDSDIM0 0 -#define VDSDIM1 15 -#define VDSDIM2 6 -#define KDIM0 0 -#define KDIM1 2 -#define KDIM2 6 -#define NDIM0 0 -#define NDIM1 3 -#define NDIM2 6 -#define RANK 3 +#define VDSDIM0 0 +#define VDSDIM1 15 +#define VDSDIM2 6 +#define KDIM0 0 +#define KDIM1 2 +#define KDIM2 6 +#define NDIM0 0 +#define NDIM1 3 +#define NDIM2 6 +#define RANK 3 const char *SRC_FILE[] = { "a.h5", @@ -96,7 +96,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -109,7 +109,7 @@ main (void) block[1] = k; block[2] = VDSDIM2; - /* + /* * Build the mappings for A, C and E source datasets. * Unlimited hyperslab selection is the same in the source datasets. * Unlimited hyperslab selections in the virtual dataset have different offsets. @@ -124,7 +124,7 @@ main (void) /* Reinitialize start[1] and block[1] to build the second set of mappings. */ start[1] = 0; block[1] = n; - /* + /* * Build the mappings for B, D and F source datasets. * Unlimited hyperslab selection is the same in the source datasets. * Unlimited hyperslab selections in the virtual dataset have different offsets. @@ -143,8 +143,8 @@ main (void) status = H5Sclose (nsrc_space); status = H5Sclose (ksrc_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. @@ -166,7 +166,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf("Wrong layout found \n"); @@ -177,15 +177,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); @@ -209,7 +209,7 @@ main (void) /* Get selection in the source dataset */ printf(" Selection in the source dataset \n"); src_space = H5Pget_virtual_srcspace (dcpl, (size_t)i); - if (H5Sget_select_type(src_space) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(src_space) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (src_space, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-exclim.c b/examples/h5_vds-exclim.c index fea096a..152731c 100644 --- a/examples/h5_vds-exclim.c +++ b/examples/h5_vds-exclim.c @@ -25,16 +25,16 @@ #define FILE "vds-exclim.h5" #define DATASET "VDS-Excaliburlim" -#define VDSDIM0 3 -#define VDSDIM1 15 -#define VDSDIM2 6 -#define KDIM0 3 -#define KDIM1 2 -#define KDIM2 6 -#define NDIM0 3 -#define NDIM1 3 -#define NDIM2 6 -#define RANK 3 +#define VDSDIM0 3 +#define VDSDIM1 15 +#define VDSDIM2 6 +#define KDIM0 3 +#define KDIM1 2 +#define KDIM2 6 +#define NDIM0 3 +#define NDIM1 3 +#define NDIM2 6 +#define RANK 3 const char *SRC_FILE[] = { "a.h5", @@ -94,7 +94,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -107,7 +107,7 @@ main (void) block[1] = k; block[2] = VDSDIM2; - /* + /* * Build the mappings for A, C and E source datasets. * */ @@ -121,7 +121,7 @@ main (void) /* Reinitialize start[0] and block[1] */ start[0] = 0; block[1] = n; - /* + /* * Build the mappings for B, D and F source datasets. * */ @@ -139,8 +139,8 @@ main (void) status = H5Sclose (nsrc_space); status = H5Sclose (ksrc_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. @@ -162,7 +162,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf("Wrong layout found \n"); @@ -173,15 +173,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-percival-unlim-maxmin.c b/examples/h5_vds-percival-unlim-maxmin.c index 0273bbc..7b0d532 100644 --- a/examples/h5_vds-percival-unlim-maxmin.c +++ b/examples/h5_vds-percival-unlim-maxmin.c @@ -12,8 +12,8 @@ /************************************************************ This example illustrates the concept of the virtual dataset. - Percival use case. Every fifth 10x10 plane in VDS is stored in - the corresponding 3D unlimited dataset. + Percival use case. Every fifth 10x10 plane in VDS is stored in + the corresponding 3D unlimited dataset. There are 4 source datasets total. Each of the source datasets is extended to different sizes. VDS access property can be used to get max and min extent. @@ -28,15 +28,15 @@ #define VFILE "vds-percival-unlim-maxmin.h5" #define DATASET "VDS-Percival-unlim-maxmin" -#define VDSDIM0 H5S_UNLIMITED -#define VDSDIM1 10 -#define VDSDIM2 10 +#define VDSDIM0 H5S_UNLIMITED +#define VDSDIM1 10 +#define VDSDIM2 10 -#define DIM0 H5S_UNLIMITED +#define DIM0 H5S_UNLIMITED #define DIM0_1 4 /* Initial size of the source datasets */ -#define DIM1 10 -#define DIM2 10 -#define RANK 3 +#define DIM1 10 +#define DIM2 10 +#define RANK 3 #define PLANE_STRIDE 4 const char *SRC_FILE[] = { @@ -61,7 +61,7 @@ main (void) hid_t dcpl, dapl; herr_t status; hsize_t vdsdims[3] = {4*DIM0_1, VDSDIM1, VDSDIM2}, - vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, + vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, dims[3] = {DIM0_1, DIM1, DIM2}, memdims[3] = {DIM0_1, DIM1, DIM2}, extdims[3] = {0, DIM1, DIM2}, /* Dimensions of the extended source datasets */ @@ -96,7 +96,7 @@ main (void) for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = i+1; /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ @@ -112,7 +112,7 @@ main (void) status = H5Pclose (dcpl); status = H5Dclose (dset); status = H5Fclose (file); - } + } vfile = H5Fcreate (VFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -124,7 +124,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -143,18 +143,18 @@ main (void) block[1] = DIM1; block[2] = DIM2; - /* - * Build the mappings + /* + * Build the mappings * */ status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block); for (i=0; i < PLANE_STRIDE; i++) { status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space); - start[0]++; - } + start[0]++; + } - H5Sselect_none(vspace); + H5Sselect_none(vspace); /* Create a virtual dataset */ vdset = H5Dcreate2 (vfile, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, @@ -174,14 +174,14 @@ main (void) for (j = 0; j < (i+1)*DIM1*DIM2; j++) wdata[j] = 10*(i+1); /* - * Open the source files and datasets. Appen data to each dataset and + * Open the source files and datasets. Appen data to each dataset and * close all resources. */ file = H5Fopen (SRC_FILE[i], H5F_ACC_RDWR, H5P_DEFAULT); dset = H5Dopen2 (file, SRC_DATASET[i], H5P_DEFAULT); extdims[0] = DIM0_1+i+1; - status = H5Dset_extent (dset, extdims); + status = H5Dset_extent (dset, extdims); src_space = H5Dget_space (dset); start[0] = DIM0_1; start[1] = 0; @@ -194,7 +194,7 @@ main (void) block[2] = DIM2; memdims[0] = i+1; - mem_space = H5Screate_simple(RANK, memdims, NULL); + mem_space = H5Screate_simple(RANK, memdims, NULL); status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, count, block); status = H5Dwrite (dset, H5T_NATIVE_INT, mem_space, src_space, H5P_DEFAULT, wdata); @@ -204,8 +204,8 @@ main (void) } status = H5Dclose (vdset); - status = H5Fclose (vfile); - + status = H5Fclose (vfile); + /* * Now we begin the read section of this example. */ @@ -214,8 +214,8 @@ main (void) * Open file and dataset using the default properties. */ vfile = H5Fopen (VFILE, H5F_ACC_RDONLY, H5P_DEFAULT); - - /* + + /* * Open VDS using different access properties to use max or * min extents depending on the sizes of the underlying datasets */ @@ -252,7 +252,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -263,15 +263,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-percival-unlim.c b/examples/h5_vds-percival-unlim.c index f6a5f50..0823f40 100644 --- a/examples/h5_vds-percival-unlim.c +++ b/examples/h5_vds-percival-unlim.c @@ -12,8 +12,8 @@ /************************************************************ This example illustrates the concept of the virtual dataset. - Percival use case. Every fifth 10x10 plane in VDS is stored in - the corresponding 3D unlimited dataset. + Percival use case. Every fifth 10x10 plane in VDS is stored in + the corresponding 3D unlimited dataset. There are 4 source datasets total. This file is intended for use with HDF5 Library version 1.10 @@ -26,15 +26,15 @@ #define VFILE "vds-percival-unlim.h5" #define DATASET "VDS-Percival-unlim" -#define VDSDIM0 H5S_UNLIMITED -#define VDSDIM1 10 -#define VDSDIM2 10 +#define VDSDIM0 H5S_UNLIMITED +#define VDSDIM1 10 +#define VDSDIM2 10 -#define DIM0 H5S_UNLIMITED +#define DIM0 H5S_UNLIMITED #define DIM0_1 10 /* Initial size of the datasets */ -#define DIM1 10 -#define DIM2 10 -#define RANK 3 +#define DIM1 10 +#define DIM2 10 +#define RANK 3 #define PLANE_STRIDE 4 const char *SRC_FILE[] = { @@ -59,7 +59,7 @@ main (void) hid_t dcpl; herr_t status; hsize_t vdsdims[3] = {4*DIM0_1, VDSDIM1, VDSDIM2}, - vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, + vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, dims[3] = {DIM0_1, DIM1, DIM2}, extdims[3] = {2*DIM0_1, DIM1, DIM2}, chunk_dims[3] = {DIM0_1, DIM1, DIM2}, @@ -95,7 +95,7 @@ main (void) for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = i+1; /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ @@ -111,7 +111,7 @@ main (void) status = H5Pclose (dcpl); status = H5Dclose (dset); status = H5Fclose (file); - } + } vfile = H5Fcreate (VFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -123,7 +123,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -142,18 +142,18 @@ main (void) block[1] = DIM1; block[2] = DIM2; - /* - * Build the mappings + /* + * Build the mappings * */ status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block); for (i=0; i < PLANE_STRIDE; i++) { status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space); - start[0]++; - } + start[0]++; + } - H5Sselect_none(vspace); + H5Sselect_none(vspace); /* Create a virtual dataset */ vdset = H5Dcreate2 (vfile, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, @@ -179,13 +179,13 @@ main (void) for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = 10*(i+1); /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ file = H5Fopen (SRC_FILE[i], H5F_ACC_RDWR, H5P_DEFAULT); dset = H5Dopen2 (file, SRC_DATASET[i], H5P_DEFAULT); - status = H5Dset_extent (dset, extdims); + status = H5Dset_extent (dset, extdims); src_space = H5Dget_space (dset); start[0] = DIM0_1; start[1] = 0; @@ -197,7 +197,7 @@ main (void) block[1] = DIM1; block[2] = DIM2; - mem_space = H5Screate_simple(RANK, dims, NULL); + mem_space = H5Screate_simple(RANK, dims, NULL); status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, count, block); status = H5Dwrite (dset, H5T_NATIVE_INT, mem_space, src_space, H5P_DEFAULT, wdata); @@ -207,8 +207,8 @@ main (void) } status = H5Dclose (vdset); - status = H5Fclose (vfile); - + status = H5Fclose (vfile); + /* * Now we begin the read section of this example. */ @@ -229,7 +229,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -240,15 +240,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); @@ -300,7 +300,7 @@ main (void) /* Read all VDS data */ /* EIP We should be able to do it by using H5S_ALL instead of making selection - * or using H5Sselect_all from vspace. + * or using H5Sselect_all from vspace. */ start[0] = 0; start[1] = 0; @@ -315,12 +315,12 @@ main (void) status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, NULL, count, block); mem_space = H5Screate_simple(RANK, vdsdims_out, NULL); status = H5Dread (vdset, H5T_NATIVE_INT, mem_space, vspace, H5P_DEFAULT, - rdata); + rdata); printf (" All data: \n"); for (i=0; i < (int)vdsdims_out[0]; i++) { for (j=0; j < (int)vdsdims_out[1]; j++) { printf ("(%d, %d, 0)", i, j); - for (k=0; k < (int)vdsdims_out[2]; k++) + for (k=0; k < (int)vdsdims_out[2]; k++) printf (" %d ", rdata[i][j][k]); printf ("\n"); } @@ -338,16 +338,16 @@ main (void) block[0] = 1; block[1] = vdsdims_out[1]; block[2] = vdsdims_out[2]; - dims[0] = 2*DIM0_1; + dims[0] = 2*DIM0_1; status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); mem_space = H5Screate_simple(RANK, dims, NULL); status = H5Dread (vdset, H5T_NATIVE_INT, mem_space, vspace, H5P_DEFAULT, - a_rdata); + a_rdata); printf (" All data: \n"); for (i=0; i < 2*DIM0_1; i++) { for (j=0; j < (int)vdsdims_out[1]; j++) { printf ("(%d, %d, 0)", i, j); - for (k=0; k < (int)vdsdims_out[2]; k++) + for (k=0; k < (int)vdsdims_out[2]; k++) printf (" %d ", a_rdata[i][j][k]); printf ("\n"); } diff --git a/examples/h5_vds-percival.c b/examples/h5_vds-percival.c index 11a974b..aeca368 100644 --- a/examples/h5_vds-percival.c +++ b/examples/h5_vds-percival.c @@ -12,8 +12,8 @@ /************************************************************ This example illustrates the concept of the virtual dataset. - Percival use case. Every fifth 10x10 plane in VDS is stored in - the corresponding 3D unlimited dataset. + Percival use case. Every fifth 10x10 plane in VDS is stored in + the corresponding 3D unlimited dataset. EIP: For now we will use finite dimension. There are 4 source datasets total. This file is intended for use with HDF5 Library version 1.10 @@ -28,18 +28,18 @@ #define FILE "vds-percival.h5" #define DATASET "VDS-Percival" /* later -#define VDSDIM0 H5S_UNLIMITED +#define VDSDIM0 H5S_UNLIMITED */ #define VDSDIM0 40 -#define VDSDIM1 10 -#define VDSDIM2 10 +#define VDSDIM1 10 +#define VDSDIM2 10 /* later -#define DIM0 H5S_UNLIMITED +#define DIM0 H5S_UNLIMITED */ -#define DIM0 10 -#define DIM1 10 -#define DIM2 10 -#define RANK 3 +#define DIM0 10 +#define DIM1 10 +#define DIM2 10 +#define RANK 3 #define PLANE_STRIDE 4 const char *SRC_FILE[] = { @@ -64,7 +64,7 @@ main (void) hid_t dcpl; herr_t status; hsize_t vdsdims[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, - vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, + vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, dims[3] = {DIM0, DIM1, DIM2}, dims_max[3] = {DIM0, DIM1, DIM2}, start[3], /* Hyperslab start parameter for VDS */ @@ -94,7 +94,7 @@ main (void) for (j = 0; j < DIM0*DIM1*DIM2; j++) wdata[j] = i+1; /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ @@ -107,7 +107,7 @@ main (void) status = H5Sclose (src_space); status = H5Dclose (dset); status = H5Fclose (file); - } + } file = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -119,7 +119,7 @@ main (void) /* Create VDS creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - + /* Initialize hyperslab values */ start[0] = 0; @@ -144,18 +144,18 @@ main (void) block[1] = DIM1; block[2] = DIM2; - /* - * Build the mappings + /* + * Build the mappings * */ status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block); for (i=0; i < PLANE_STRIDE; i++) { status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block); status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space); - start[0]++; - } + start[0]++; + } - H5Sselect_none(vspace); + H5Sselect_none(vspace); /* Create a virtual dataset */ dset = H5Dcreate2 (file, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, @@ -163,8 +163,8 @@ main (void) status = H5Sclose (vspace); status = H5Sclose (src_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. */ @@ -185,7 +185,7 @@ main (void) */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -196,15 +196,15 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { if (H5Sis_regular_hyperslab(vspace)) { status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out); printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]); diff --git a/examples/h5_vds-simpleIO.c b/examples/h5_vds-simpleIO.c index 56fa72b..5fd5c52 100644 --- a/examples/h5_vds-simpleIO.c +++ b/examples/h5_vds-simpleIO.c @@ -14,7 +14,7 @@ This example illustrates the concept of virtual dataset I/O The program creates 2-dim source dataset and writes data to it. Then it creates 2-dim virtual dataset that has - the same dimension sizes and maps the all elements of the + the same dimension sizes and maps the all elements of the virtual dataset to all elements of the source dataset. Then VDS is read back. @@ -30,7 +30,7 @@ #define FILE "vds-simpleIO.h5" #define DATASET "VDS" #define DIM1 6 -#define DIM0 4 +#define DIM0 4 #define RANK 2 #define SRC_FILE "a.h5" @@ -40,27 +40,27 @@ int main (void) { - hid_t file, space, src_space, vspace, dset; /* Handles */ + hid_t file, space, src_space, vspace, dset; /* Handles */ hid_t dcpl; herr_t status; hsize_t vdsdims[2] = {DIM0, DIM1}, /* Virtual dataset dimension */ dims[2] = {DIM0, DIM1}; /* Source dataset dimensions */ int wdata[DIM0][DIM1], /* Write buffer for source dataset */ rdata[DIM0][DIM1], /* Read buffer for virtual dataset */ - i, j; + i, j; H5D_layout_t layout; /* Storage layout */ size_t num_map; /* Number of mappings */ ssize_t len; /* Length of the string; also a return value */ - char *filename; + char *filename; char *dsetname; /* * Initialize data. */ - for (i = 0; i < DIM0; i++) + for (i = 0; i < DIM0; i++) for (j = 0; j < DIM1; j++) wdata[i][j] = i+1; - + /* - * Create the source file and the dataset. Write data to the source dataset + * Create the source file and the dataset. Write data to the source dataset * and close all resources. */ @@ -82,12 +82,12 @@ main (void) /* Set VDS creation property. */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - - /* + + /* * Build the mappings. * Selections in the source datasets are H5S_ALL. - * In the virtual dataset we select the first, the second and the third rows - * and map each row to the data in the corresponding source dataset. + * In the virtual dataset we select the first, the second and the third rows + * and map each row to the data in the corresponding source dataset. */ src_space = H5Screate_simple (RANK, dims, NULL); status = H5Pset_virtual (dcpl, vspace, SRC_FILE, SRC_DATASET, src_space); @@ -98,8 +98,8 @@ main (void) status = H5Sclose (vspace); status = H5Sclose (src_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. */ @@ -118,7 +118,7 @@ main (void) * Get storage layout. */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -129,10 +129,10 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset "); /* Get selection in the virttual dataset */ diff --git a/examples/h5_vds.c b/examples/h5_vds.c index 76b849a..cce7b88 100644 --- a/examples/h5_vds.c +++ b/examples/h5_vds.c @@ -16,15 +16,15 @@ This example illustrates the concept of virtual dataset. The program creates three 1-dim source datasets and writes data to them. Then it creates a 2-dim virtual dataset and - maps the first three rows of the virtual dataset to the data - in the source datasets. Elements of a row are mapped to all + maps the first three rows of the virtual dataset to the data + in the source datasets. Elements of a row are mapped to all elements of the corresponding source dataset. - The fourth row is not mapped and will be filled with the fill - values when virtual dataset is read back. - + The fourth row is not mapped and will be filled with the fill + values when virtual dataset is read back. + The program closes all datasets, and then reopens the virtual dataset, and finds and prints its creation properties. - Then it reads the values. + Then it reads the values. This file is intended for use with HDF5 Library version 1.10 @@ -37,9 +37,9 @@ #define FILE "vds.h5" #define DATASET "VDS" -#define VDSDIM1 6 -#define VDSDIM0 4 -#define DIM0 6 +#define VDSDIM1 6 +#define VDSDIM0 4 +#define DIM0 6 #define RANK1 1 #define RANK2 2 @@ -58,7 +58,7 @@ const char *SRC_DATASET[] = { int main (void) { - hid_t file, space, src_space, vspace, dset; /* Handles */ + hid_t file, space, src_space, vspace, dset; /* Handles */ hid_t dcpl; herr_t status; hsize_t vdsdims[2] = {VDSDIM0, VDSDIM1}, /* Virtual datasets dimension */ @@ -73,12 +73,12 @@ main (void) block_out[2]; int wdata[DIM0], /* Write buffer for source dataset */ rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */ - i, j, k, l; + i, j, k, l; int fill_value = -1; /* Fill value for VDS */ H5D_layout_t layout; /* Storage layout */ size_t num_map; /* Number of mappings */ ssize_t len; /* Length of the string; also a return value */ - char *filename; + char *filename; char *dsetname; hsize_t nblocks; hsize_t *buf; /* Buffer to hold hyperslab coordinates */ @@ -91,9 +91,9 @@ main (void) * Initialize data for i-th source dataset. */ for (j = 0; j < DIM0; j++) wdata[j] = i+1; - + /* - * Create the source files and datasets. Write data to each dataset and + * Create the source files and datasets. Write data to each dataset and * close all resources. */ @@ -117,7 +117,7 @@ main (void) /* Set VDS creation property. */ dcpl = H5Pcreate (H5P_DATASET_CREATE); status = H5Pset_fill_value (dcpl, H5T_NATIVE_INT, &fill_value); - + /* Initialize hyperslab values. */ start[0] = 0; start[1] = 0; @@ -126,11 +126,11 @@ main (void) block[0] = 1; block[1] = VDSDIM1; - /* + /* * Build the mappings. * Selections in the source datasets are H5S_ALL. - * In the virtual dataset we select the first, the second and the third rows - * and map each row to the data in the corresponding source dataset. + * In the virtual dataset we select the first, the second and the third rows + * and map each row to the data in the corresponding source dataset. */ src_space = H5Screate_simple (RANK1, dims, NULL); for (i = 0; i < 3; i++) { @@ -146,8 +146,8 @@ main (void) status = H5Sclose (space); status = H5Sclose (src_space); status = H5Dclose (dset); - status = H5Fclose (file); - + status = H5Fclose (file); + /* * Now we begin the read section of this example. */ @@ -167,7 +167,7 @@ main (void) * Get storage layout. */ layout = H5Pget_layout (dcpl); - if (H5D_VIRTUAL == layout) + if (H5D_VIRTUAL == layout) printf(" Dataset has a virtual layout \n"); else printf(" Wrong layout found \n"); @@ -178,26 +178,26 @@ main (void) status = H5Pget_virtual_count (dcpl, &num_map); printf(" Number of mappings is %lu\n", (unsigned long)num_map); - /* + /* * Get mapping parameters for each mapping. */ - for (i = 0; i < (int)num_map; i++) { + for (i = 0; i < (int)num_map; i++) { printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset "); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); /* Make sure that this is a hyperslab selection and then print information. */ - if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { + if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) { nblocks = H5Sget_select_hyper_nblocks (vspace); buf = (hsize_t *)malloc(sizeof(hsize_t)*2*RANK2*nblocks); status = H5Sget_select_hyper_blocklist (vspace, (hsize_t)0, nblocks, buf); for (l=0; l $appmain < $appmain < $hdf5main < 0) + if(c_namelen > 0) c_name = (char *)HDmalloc(c_namelen + 1); if(!c_name) @@ -212,7 +212,7 @@ h5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen) size_t c_namelen = (size_t)*namelen; int_f ret_value = 0; - if(c_namelen > 0) + if(c_namelen > 0) c_name = (char *)HDmalloc(c_namelen + 1); if(!c_name) @@ -242,7 +242,7 @@ done: * estack_id - Error stack identifier. * func - Function to be called upon an error condition. * client_data - Data passed to the error function. - * + * * RETURNS * 0 on success, -1 on failure * AUTHOR diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 12fb7ed..7123f1d 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -486,11 +486,11 @@ h5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) * Changed type of max_obj to size_t_f; added parameter for the * number of open objects * Thursday, September 25, 2008 EIP - * + * * SOURCE */ int_f -h5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, +h5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs) /******/ { @@ -693,7 +693,7 @@ h5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f /* * Call h5fget_file_image function */ - + if ( (c_buf_req = H5Fget_file_image((hid_t)*file_id, buf_ptr, (size_t)*buf_len)) < 0) HGOTO_DONE(FAIL); diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index b5ff7f2..1fee5e8 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -939,7 +939,7 @@ int_f h5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, void *linkval_buff, hid_t_f *lapl_id) /******/ -{ +{ char *c_link_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index 9780814..edbfcbe 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -27,7 +27,7 @@ fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info); int_f fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info) { - /* This function does not used the field parameter because we want + /* This function does not used the field parameter because we want * this function to fill the unfilled fields with C's default values. */ @@ -184,7 +184,7 @@ h5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_ * PURPOSE * Call H5Oclose * INPUTS - * object_id - Object identifier + * object_id - Object identifier * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -197,10 +197,10 @@ h5oclose_c ( hid_t_f *object_id ) /******/ { int_f ret_value=0; /* Return value */ - + if (H5Oclose((hid_t)*object_id) < 0) HGOTO_DONE(FAIL); - + done: return ret_value; } @@ -312,7 +312,7 @@ h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *l char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ H5O_info2_t Oinfo; - + /* * Convert FORTRAN name to C name */ @@ -356,7 +356,7 @@ h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *l * SOURCE */ int_f -h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, +h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields) /******/ { @@ -432,12 +432,12 @@ h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields) * H5Ocopy_c * PURPOSE * Calls H5Ocopy - * INPUTS - * src_loc_id - Object identifier indicating the location of the source object to be copied - * src_name - Name of the source object to be copied + * INPUTS + * src_loc_id - Object identifier indicating the location of the source object to be copied + * src_name - Name of the source object to be copied * src_name_len - Length of src_name - * dst_loc_id - Location identifier specifying the destination - * dst_name - Name to be assigned to the new copy + * dst_loc_id - Location identifier specifying the destination + * dst_name - Name to be assigned to the new copy * dst_name_len - Length of dst_name * ocpypl_id - Object copy property list * lcpl_id - Link creation property list for the new hard link @@ -451,15 +451,15 @@ h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields) */ int_f h5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, - hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, + hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, hid_t_f *ocpypl_id, hid_t_f *lcpl_id ) /******/ { char *c_src_name = NULL; /* Buffer to hold C string */ char *c_dst_name = NULL; /* Buffer to hold C string */ - + int_f ret_value = 0; /* Return value */ - + /* * Convert FORTRAN name to C name */ @@ -471,7 +471,7 @@ h5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, /* * Call H5Ocopy function. */ - if(H5Ocopy( (hid_t)*src_loc_id, c_src_name, (hid_t)*dst_loc_id, c_dst_name, + if(H5Ocopy( (hid_t)*src_loc_id, c_src_name, (hid_t)*dst_loc_id, c_dst_name, (hid_t)*ocpypl_id, (hid_t)*lcpl_id) < 0) HGOTO_DONE(FAIL); @@ -689,8 +689,8 @@ h5oset_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentlen) * Calls H5Oset_comment_by_name * INPUTS * object_id - Identifier of the target object. - * name - Name of the object whose comment is to be set or reset, - * specified as a path relative to loc_id. + * name - Name of the object whose comment is to be set or reset, + * specified as a path relative to loc_id. * namelen - Length of the name. * comment - The new comment. * commentlen - Length of the comment. @@ -757,7 +757,7 @@ h5oset_comment_by_name_c (hid_t_f *object_id, _fcd name, size_t_f *namelen, _fc * SOURCE */ int_f -h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id) /******/ { @@ -765,7 +765,7 @@ h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f ret_value = 0; H5_index_t c_index_type; H5_iter_order_t c_order; - + /* * Convert FORTRAN string to C string */ @@ -818,13 +818,13 @@ h5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssi /* * Allocate buffer to hold comment name */ - + if(NULL == (c_comment = (char *)HDmalloc(c_commentsize))) HGOTO_DONE(FAIL); /* * Call H5Oget_comment function. - */ + */ if((*bufsize = (hssize_t_f)H5Oget_comment((hid_t)*object_id, c_comment, (size_t)*commentsize)) < 0) HGOTO_DONE(FAIL); @@ -862,7 +862,7 @@ h5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssi * SOURCE */ int_f -h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, +h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, _fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id) /******/ { @@ -883,13 +883,13 @@ h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, /* * Allocate buffer to hold comment name */ - + if(NULL == (c_comment = (char *)HDmalloc(c_commentsize))) HGOTO_DONE(FAIL); /* * Call H5Oget_comment_by_name function. - */ + */ if((c_bufsize = H5Oget_comment_by_name((hid_t)*loc_id, c_name, c_comment, (size_t)*commentsize,(hid_t)*lapl_id )) < 0) HGOTO_DONE(FAIL); diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index a931903..7cb3db8 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1831,7 +1831,7 @@ DONE: * Wednesday, February 23, 2000 * HISTORY * Changed type of 'offset' from int_f to off_t_f -- MSB January 9, 2012 - * + * * SOURCE */ int_f @@ -3153,7 +3153,7 @@ h5pget_class_name_c(hid_t_f *cls, _fcd name, int_f *name_len) char *c_name; /* - * Call H5Pget_class_name function. c_name is allocated by the library, + * Call H5Pget_class_name function. c_name is allocated by the library, * has to be freed by application. */ if(NULL == (c_name = H5Pget_class_name((hid_t)*cls))) @@ -3216,7 +3216,7 @@ DONE: * plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * Output: + * Output: * value - property value * RETURNS * 0 on success, -1 on failure @@ -5177,7 +5177,7 @@ h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nby * * Inputs: * fapl_id - File access property list identifier - * buf_ptr - Pointer to the initial file image, + * buf_ptr - Pointer to the initial file image, * or NULL if no initial file image is desired * buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired * @@ -5207,7 +5207,7 @@ h5pset_file_image_c(hid_t_f *fapl_id, void *buf_ptr, size_t_f *buf_len) * Inputs: * fapl_id - File access property list identifier * Outputs: - * buf_ptr - Pointer to the initial file image, + * buf_ptr - Pointer to the initial file image, * or NULL if no initial file image is desired * buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired * diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 6a3181f..df2ded4 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -351,7 +351,7 @@ h5rget_name_ptr_c (hid_t_f *loc_id, int_f *ref_type, void *ref, _fcd name, size_ * OUTPUTS * obj_type - Type of referenced object. These are defined in H5Opublic.h, * enum H5O_type_t - * + * * RETURNS * 0 on success, -1 on failure * AUTHOR diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index ced5049..8044b78 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -101,7 +101,7 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes if (sizeof(int_f) == sizeof(long long)) { if ((types[5] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ - + /* Find appropriate size to store Fortran REAL */ if(sizeof(real_f)==sizeof(float)) { if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; @@ -230,7 +230,7 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes if ((integertypes[12] = (hid_t_f)H5Tcopy(H5T_STD_U32BE)) < 0) return ret_value; if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value; if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value; - if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; + if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; if ((integertypes[17] = (hid_t_f)H5Tcopy(H5T_STD_B8BE)) < 0) return ret_value; if ((integertypes[18] = (hid_t_f)H5Tcopy(H5T_STD_B8LE)) < 0) return ret_value; if ((integertypes[19] = (hid_t_f)H5Tcopy(H5T_STD_B16BE)) < 0) return ret_value; @@ -359,12 +359,12 @@ h5close_types_c( hid_t_f * types, int_f *lentypes, * SOURCE */ int_f -h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, +h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, - hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, - int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, + hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, + int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags, haddr_t_f *h5_haddr_generic_flags) /******/ diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index 8921493..71eb936 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -12,7 +12,7 @@ ! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure ! The script to replace the defines in H5config_f.inc.in is -! located in configure.ac in the Fortran section. +! located in configure.ac in the Fortran section. ! Define if we have parallel support #undef HAVE_PARALLEL @@ -47,7 +47,7 @@ ! If C has quad precision #undef HAVE_FLOAT128 -! Define if INTEGER*16 is available +! Define if INTEGER*16 is available #undef HAVE_Fortran_INTEGER_SIZEOF_16 ! Maximum decimal precision for C diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index fe616d3..695efcd 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -160,9 +160,9 @@ H5_FCDLL int_f h5dfill_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *spac H5_FCDLL int_f h5dget_space_status_c( hid_t_f *dset_id, int_f *flag); H5_FCDLL int_f h5dcreate_anon_c(hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id); -H5_FCDLL int_f h5dwrite_f_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, +H5_FCDLL int_f h5dwrite_f_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf); -H5_FCDLL int_f h5dread_f_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, +H5_FCDLL int_f h5dread_f_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf); H5_FCDLL int_f h5dvlen_reclaim_c(hid_t_f *type_id , hid_t_f *space_id, hid_t_f *plist_id, void *buf); @@ -323,22 +323,22 @@ H5_FCDLL int_f h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5 H5_FCDLL int_f h5ovisit_by_name_c(hid_t_f *loc_id, _fcd object_name, size_t_f *namelen, int_f *index_type, int_f *order, H5O_iterate2_t op, void *op_data, hid_t_f *lapl_id, int_f *fields ); H5_FCDLL int_f h5oget_info_c(hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields); -H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, +H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields); H5_FCDLL int_f h5oget_info_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields); H5_FCDLL int_f h5ocopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, - hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, + hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, hid_t_f *ocpypl_id, hid_t_f *lcpl_id ); H5_FCDLL int_f h5odecr_refcount_c(hid_t_f *object_id); H5_FCDLL int_f h5oincr_refcount_c(hid_t_f *object_id); H5_FCDLL int_f h5oexists_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id); H5_FCDLL int_f h5oset_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentlen); H5_FCDLL int_f h5oset_comment_by_name_c(hid_t_f *object_id, _fcd name, size_t_f *namelen, _fcd comment, size_t_f *commentlen, hid_t_f *lapl_id); -H5_FCDLL int_f h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, +H5_FCDLL int_f h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id); H5_FCDLL int_f h5oget_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssize_t_f *bufsize); -H5_FCDLL int_f h5oget_comment_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *name_size, +H5_FCDLL int_f h5oget_comment_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *name_size, _fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id); H5_FCDLL int_f h5otoken_cmp_c(hid_t_f *loc_id, H5O_token_t *token1, H5O_token_t *token2, int_f *cmp_value); @@ -528,12 +528,12 @@ H5_FCDLL int_f h5open_c(void); H5_FCDLL int_f h5close_c(void); H5_FCDLL int_f h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes); H5_FCDLL int_f h5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f *floatinglen, hid_t_f *integertypes, int_f *integerlen); -H5_FCDLL int_f h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, +H5_FCDLL int_f h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, - hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, - int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, + hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, + int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags, haddr_t_f *h5_haddr_generic_flags); H5_FCDLL int_f h5init1_flags_c(int_f *h5lib_flags); diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index ec2d66f..231b90d 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -150,7 +150,7 @@ int main(void) int RealKinds[] = H5_FORTRAN_REAL_KINDS; int RealKinds_SizeOf[] = H5_FORTRAN_REAL_KINDS_SIZEOF; char Real_C_TYPES[10][32]; - + int FORTRAN_NUM_INTEGER_KINDS=H5_FORTRAN_NUM_INTEGER_KINDS; int H5_FORTRAN_NUM_REAL_KINDS; #if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0 @@ -208,13 +208,13 @@ int main(void) } else if(sizeof(double) == RealKinds_SizeOf[i]) { writeTypedef("float", "double", RealKinds[i]); - strcpy(Real_C_TYPES[i], "C_DOUBLE"); + strcpy(Real_C_TYPES[i], "C_DOUBLE"); } #if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0 else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) { writeTypedef("float", "long double", RealKinds[i]); strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); - found_long_double = 1; + found_long_double = 1; } # ifdef H5_HAVE_FLOAT128 /* Don't select a higher precision than Fortran can support */ @@ -329,7 +329,7 @@ int main(void) /* Defined different KINDs of integers */ fprintf(fort_header," INTEGER, DIMENSION(1:%d), PARAMETER :: Fortran_INTEGER_AVAIL_KINDS = (/", FORTRAN_NUM_INTEGER_KINDS); - + for(i=0;iflags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; switch ( file_image_op ) { /* the app buffer is "copied" to only one FAPL. Afterwards, FAPLs can be "copied" */ case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: - if (udata->app_image_ptr == NULL) + if (udata->app_image_ptr == NULL) goto out; - if (udata->app_image_size != size) + if (udata->app_image_size != size) goto out; - if (udata->fapl_image_ptr != NULL) + if (udata->fapl_image_ptr != NULL) goto out; - if (udata->fapl_image_size != 0) + if (udata->fapl_image_size != 0) goto out; - if (udata->fapl_ref_count != 0) + if (udata->fapl_ref_count != 0) goto out; udata->fapl_image_ptr = udata->app_image_ptr; @@ -135,11 +135,11 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) break; case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: - if (udata->fapl_image_ptr == NULL) + if (udata->fapl_image_ptr == NULL) goto out; - if (udata->fapl_image_size != size) + if (udata->fapl_image_size != size) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; return_value = udata->fapl_image_ptr; @@ -151,17 +151,17 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) case H5FD_FILE_IMAGE_OP_FILE_OPEN: /* FAPL buffer is "copied" to only one VFD buffer */ - if (udata->vfd_image_ptr != NULL) + if (udata->vfd_image_ptr != NULL) goto out; - if (udata->vfd_image_size != 0) + if (udata->vfd_image_size != 0) goto out; - if (udata->vfd_ref_count != 0) + if (udata->vfd_ref_count != 0) goto out; - if (udata->fapl_image_ptr == NULL) + if (udata->fapl_image_ptr == NULL) goto out; - if (udata->fapl_image_size != size) + if (udata->fapl_image_size != size) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; udata->vfd_image_ptr = udata->fapl_image_ptr; @@ -189,15 +189,15 @@ out: /*------------------------------------------------------------------------- * Function: image_memcpy * -* Purpose: Simulates memcpy() function to avoid copying file images. +* Purpose: Simulates memcpy() function to avoid copying file images. * The image buffer can be set to only one FAPL buffer, and * "copied" to only one VFD buffer. The FAPL buffer can be -* "copied" to other FAPLs buffers. +* "copied" to other FAPLs buffers. * * Return: The address of the destination buffer, if successful. Otherwise, it * returns NULL. * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -210,31 +210,31 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; switch(file_image_op) { case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: - if (dest != udata->fapl_image_ptr) + if (dest != udata->fapl_image_ptr) goto out; - if (src != udata->app_image_ptr) + if (src != udata->app_image_ptr) goto out; - if (size != udata->fapl_image_size) + if (size != udata->fapl_image_size) goto out; - if (size != udata->app_image_size) + if (size != udata->app_image_size) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; break; case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: - if (dest != udata->fapl_image_ptr) + if (dest != udata->fapl_image_ptr) goto out; - if (src != udata->fapl_image_ptr) + if (src != udata->fapl_image_ptr) goto out; - if (size != udata->fapl_image_size) + if (size != udata->fapl_image_size) goto out; - if (udata->fapl_ref_count < 2) + if (udata->fapl_ref_count < 2) goto out; break; @@ -242,17 +242,17 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file goto out; case H5FD_FILE_IMAGE_OP_FILE_OPEN: - if (dest != udata->vfd_image_ptr) + if (dest != udata->vfd_image_ptr) goto out; - if (src != udata->fapl_image_ptr) + if (src != udata->fapl_image_ptr) goto out; - if (size != udata->vfd_image_size) + if (size != udata->vfd_image_size) goto out; - if (size != udata->fapl_image_size) + if (size != udata->fapl_image_size) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; - if (udata->vfd_ref_count != 1) + if (udata->vfd_ref_count != 1) goto out; break; @@ -273,15 +273,15 @@ out: /*------------------------------------------------------------------------- -* Function: image_realloc +* Function: image_realloc * * Purpose: Reallocates the shared application image buffer and updates data -* structures that manage buffer "copying". -* +* structures that manage buffer "copying". +* * Return: Address of reallocated buffer, if successful. Otherwise, it returns -* NULL. +* NULL. * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -294,29 +294,29 @@ image_realloc(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void * void * return_value = NULL; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; - /* realloc() is not allowed when the HDF5 library won't release the image + /* realloc() is not allowed when the HDF5 library won't release the image buffer because reallocation may change the address of the buffer. The new address cannot be communicated to the application to release it. */ - if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE) - goto out; + if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE) + goto out; /* realloc() is not allowed if the image is open in read-only mode */ - if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW)) - goto out; + if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW)) + goto out; if (file_image_op == H5FD_FILE_IMAGE_OP_FILE_RESIZE) { - if (udata->vfd_image_ptr != ptr) - goto out; + if (udata->vfd_image_ptr != ptr) + goto out; - if (udata->vfd_ref_count != 1) + if (udata->vfd_ref_count != 1) goto out; if (NULL == (udata->vfd_image_ptr = HDrealloc(ptr, size))) - goto out; - + goto out; + udata->vfd_image_size = size; return_value = udata->vfd_image_ptr; } /* end if */ @@ -337,9 +337,9 @@ out: * reference counters. Shared application buffer is actually * deallocated if there are no outstanding references. * -* Return: SUCCEED or FAIL +* Return: SUCCEED or FAIL * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -351,19 +351,19 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; switch(file_image_op) { case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: - if (udata->fapl_image_ptr != ptr) + if (udata->fapl_image_ptr != ptr) goto out; - if (udata->fapl_ref_count == 0) + if (udata->fapl_ref_count == 0) goto out; udata->fapl_ref_count--; - /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ + /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 && !(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) { HDfree(udata->fapl_image_ptr); @@ -374,14 +374,14 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) break; case H5FD_FILE_IMAGE_OP_FILE_CLOSE: - if (udata->vfd_image_ptr != ptr) + if (udata->vfd_image_ptr != ptr) goto out; - if (udata->vfd_ref_count != 1) + if (udata->vfd_ref_count != 1) goto out; udata->vfd_ref_count--; - /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ + /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 && !(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) { HDfree(udata->vfd_image_ptr); @@ -410,7 +410,7 @@ out: /*------------------------------------------------------------------------- -* Function: udata_copy +* Function: udata_copy * * Purpose: Simulates the copying of the user data structure utilized in the * management of the "copying" of file images. @@ -418,7 +418,7 @@ out: * Return: Address of "newly allocated" structure, if successful. Otherwise, it * returns NULL. * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -430,9 +430,9 @@ udata_copy(void *_udata) H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; - if (udata->ref_count == 0) + if (udata->ref_count == 0) goto out; udata->ref_count++; @@ -449,11 +449,11 @@ out: * * Purpose: Simulates deallocation of the user data structure utilized in the * management of the "copying" of file images. The data structure is -* actually deallocated when there are no outstanding references. +* actually deallocated when there are no outstanding references. * -* Return: SUCCEED or FAIL +* Return: SUCCEED or FAIL * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -465,9 +465,9 @@ udata_free(void *_udata) H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; /* callback is only used if the application buffer is not actually copied */ - if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) goto out; - if (udata->ref_count == 0) + if (udata->ref_count == 0) goto out; udata->ref_count--; @@ -479,7 +479,7 @@ udata_free(void *_udata) return(SUCCEED); -out: +out: return(FAIL); } /* end udata_free */ @@ -522,7 +522,7 @@ H5LT_make_dataset_numerical( hid_t loc_id, hid_t did = -1, sid = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Create the data space for the dataset. */ @@ -801,7 +801,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, size_t size; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* create a string data type */ @@ -852,11 +852,11 @@ out: /*------------------------------------------------------------------------- * Function: H5LTopen_file_image * -* Purpose: Open a user supplied file image using the core file driver. +* Purpose: Open a user supplied file image using the core file driver. * * Return: File identifier, Failure: -1 * -* Programmer: Christian Chilan +* Programmer: Christian Chilan * * Date: October 3, 2011 * @@ -871,22 +871,22 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) size_t min_incr = 65536; /* Minimum buffer increment */ double buf_prcnt = 0.1f; /* Percentage of buffer size to set as increment */ - static long file_name_counter; - H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy, - &image_realloc, &image_free, - &udata_copy, &udata_free, + static long file_name_counter; + H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy, + &image_realloc, &image_free, + &udata_copy, &udata_free, (void *)NULL}; /* check arguments */ - if (buf_ptr == NULL) + if (buf_ptr == NULL) goto out; - if (buf_size == 0) + if (buf_size == 0) goto out; if (flags & (unsigned)~(H5LT_FILE_IMAGE_ALL)) goto out; /* Create FAPL to transmit file image */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto out; /* set allocation increment to a percentage of the supplied buffer size, or @@ -898,7 +898,7 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) alloc_incr = min_incr; /* Configure FAPL to use the core file driver */ - if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0) + if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0) goto out; /* Set callbacks for file image ops ONLY if the file image is NOT copied */ @@ -932,10 +932,10 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) } /* end if */ /* Assign file image in user buffer to FAPL */ - if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0) + if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0) goto out; - /* set file open flags */ + /* set file open flags */ if (flags & H5LT_FILE_IMAGE_OPEN_RW) file_open_flags = H5F_ACC_RDWR; else @@ -943,17 +943,17 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) /* define a unique file name */ HDsnprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++); - - /* Assign file image in FAPL to the core file driver */ - if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0) + + /* Assign file image in FAPL to the core file driver */ + if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0) goto out; /* Close FAPL */ - if (H5Pclose(fapl) < 0) + if (H5Pclose(fapl) < 0) goto out; - /* Return file identifier */ - return file_id; + /* Return file identifier */ + return file_id; out: H5E_BEGIN_TRY { @@ -983,7 +983,7 @@ H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void hid_t did; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Open the dataset. */ @@ -1178,7 +1178,7 @@ herr_t H5LTread_dataset_string( hid_t loc_id, hid_t tid = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Open the dataset. */ @@ -1231,7 +1231,7 @@ herr_t H5LTget_dataset_ndims( hid_t loc_id, hid_t sid = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* Open the dataset. */ @@ -1291,7 +1291,7 @@ herr_t H5LTget_dataset_info( hid_t loc_id, hid_t sid = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) return -1; /* open the dataset. */ @@ -1368,9 +1368,9 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_ int ret = 0; /* check the arguments */ - if (name == NULL) + if (name == NULL) return ret; - + /* Shut the compiler up */ loc_id = loc_id; linfo = linfo; @@ -1460,11 +1460,11 @@ herr_t H5LTset_attribute_string( hid_t loc_id, size_t attr_size; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; - if (attr_data == NULL) + if (attr_data == NULL) return -1; /* Open the object */ @@ -1557,9 +1557,9 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id, int has_attr; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -1974,7 +1974,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, int ret = H5_ITER_CONT; /* check the arguments */ - if (name == NULL) + if (name == NULL) return H5_ITER_CONT; /* Shut compiler up */ @@ -2076,9 +2076,9 @@ herr_t H5LTget_attribute_ndims( hid_t loc_id, hid_t obj_id; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -2149,9 +2149,9 @@ herr_t H5LTget_attribute_info( hid_t loc_id, hid_t obj_id; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -2230,7 +2230,7 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) hid_t type_id; /* check the arguments */ - if (text == NULL) + if (text == NULL) return -1; if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG) @@ -2273,7 +2273,7 @@ out: * *------------------------------------------------------------------------- */ -static char* +static char* realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str_to_add) { size_t size_str_to_add, size_str; @@ -2298,7 +2298,7 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str /* find the size of the current buffer */ size_str = HDstrlen(buf); - /* Check to make sure the appended string does not + /* Check to make sure the appended string does not * extend past the allocated buffer; if it does then truncate the string */ if(size_str < *len - 1) { @@ -2555,7 +2555,7 @@ char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *sl if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, NULL))) goto out; - + if(lang != H5LT_DDL) { HDsnprintf(dt_str, *slen, "only DDL is supported for now"); goto out; @@ -3122,9 +3122,9 @@ herr_t H5LTget_attribute_string( hid_t loc_id, hid_t obj_id; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -3132,9 +3132,9 @@ herr_t H5LTget_attribute_string( hid_t loc_id, return -1; /* Get the attribute */ - if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 ) + if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 ) { - H5Oclose(obj_id); + H5Oclose(obj_id); return -1; } @@ -3548,9 +3548,9 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id, hid_t attr_id = -1; /* check the arguments */ - if (obj_name == NULL) + if (obj_name == NULL) return -1; - if (attr_name == NULL) + if (attr_name == NULL) return -1; /* Open the object */ @@ -3790,7 +3790,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) ret_value = FALSE; goto done; } - + /* Determine if link resolves to an actual object */ if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { ret_value = FAIL; diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 7288498..c05db67 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -1,25 +1,25 @@ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wnested-externs" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wstrict-overflow" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#pragma GCC diagnostic ignored "-Wswitch-default" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-macros" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined __SUNPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-overflow" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif #line 2 "hl/src/H5LTanalyze.c" #line 4 "hl/src/H5LTanalyze.c" @@ -75,7 +75,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -92,7 +92,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -209,7 +209,7 @@ extern FILE *H5LTyyin, *H5LTyyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -266,7 +266,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -893,7 +893,7 @@ char *H5LTyytext; /* Turn off suggest const & malloc attribute warnings in gcc */ #if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" -#endif +#endif int my_yyinput(char *, int); #undef YY_INPUT @@ -996,7 +996,7 @@ extern int H5LTyywrap (void ); #endif static void yyunput (int c,char *buf_ptr ); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -1117,7 +1117,7 @@ YY_DECL register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - + #line 82 "hl/src/H5LTanalyze.l" @@ -1411,17 +1411,17 @@ YY_RULE_SETUP case 40: YY_RULE_SETUP #line 127 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_NULLTERM_TOKEN);} +{return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP #line 128 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_NULLPAD_TOKEN);} +{return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP #line 129 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_SPACEPAD_TOKEN);} +{return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP @@ -1486,12 +1486,12 @@ YY_RULE_SETUP case 55: YY_RULE_SETUP #line 145 "hl/src/H5LTanalyze.l" -{ - if( is_str_size || (is_enum && is_enum_memb) || +{ + if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || (csindex>-1 && cmpd_stack[csindex].is_field) ) { H5LTyylval.ival = atoi(H5LTyytext); - return NUMBER; + return NUMBER; } else REJECT; } @@ -1501,7 +1501,7 @@ YY_RULE_SETUP #line 155 "hl/src/H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ - if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) + if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) && first_quote) { first_quote = 0; BEGIN TAG_STRING; @@ -1821,7 +1821,7 @@ static int yy_get_next_buffer (void) { register yy_state_type yy_current_state; register char *yy_cp; - + yy_current_state = (yy_start); (yy_state_ptr) = (yy_state_buf); @@ -1851,7 +1851,7 @@ static int yy_get_next_buffer (void) static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; - + register YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { @@ -1870,7 +1870,7 @@ static int yy_get_next_buffer (void) static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; - + yy_cp = (yy_c_buf_p); /* undo effects of setting up H5LTyytext */ @@ -1913,7 +1913,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1980,12 +1980,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void H5LTyyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ H5LTyyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -1998,11 +1998,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * H5LTyypop_buffer_state(); @@ -2042,13 +2042,13 @@ static void H5LTyy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE H5LTyy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); @@ -2071,11 +2071,11 @@ static void H5LTyy_load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with H5LTyy_create_buffer() - * + * */ void H5LTyy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2096,7 +2096,7 @@ static void H5LTyy_load_buffer_state (void) { int oerrno = errno; - + H5LTyy_flush_buffer(b ); b->yy_input_file = file; @@ -2112,13 +2112,13 @@ static void H5LTyy_load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void H5LTyy_flush_buffer (YY_BUFFER_STATE b ) { @@ -2147,7 +2147,7 @@ static void H5LTyy_load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -2177,7 +2177,7 @@ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void H5LTyypop_buffer_state (void) { @@ -2201,7 +2201,7 @@ void H5LTyypop_buffer_state (void) static void H5LTyyensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -2214,9 +2214,9 @@ static void H5LTyyensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -2244,13 +2244,13 @@ static void H5LTyyensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -2279,14 +2279,14 @@ YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to H5LTyylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * H5LTyy_scan_bytes() instead. */ YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr ) { - + return H5LTyy_scan_bytes(yystr,strlen(yystr) ); } @@ -2294,7 +2294,7 @@ YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) @@ -2303,7 +2303,7 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_ char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) H5LTyyalloc(n ); @@ -2357,16 +2357,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int H5LTyyget_lineno (void) { - + return H5LTyylineno; } /** Get the input stream. - * + * */ FILE *H5LTyyget_in (void) { @@ -2374,7 +2374,7 @@ FILE *H5LTyyget_in (void) } /** Get the output stream. - * + * */ FILE *H5LTyyget_out (void) { @@ -2382,7 +2382,7 @@ FILE *H5LTyyget_out (void) } /** Get the length of the current token. - * + * */ yy_size_t H5LTyyget_leng (void) { @@ -2390,7 +2390,7 @@ yy_size_t H5LTyyget_leng (void) } /** Get the current token. - * + * */ char *H5LTyyget_text (void) @@ -2400,18 +2400,18 @@ char *H5LTyyget_text (void) /** Set the current line number. * @param line_number - * + * */ void H5LTyyset_lineno (int line_number ) { - + H5LTyylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see H5LTyy_switch_to_buffer */ void H5LTyyset_in (FILE * in_str ) @@ -2470,7 +2470,7 @@ static int yy_init_globals (void) /* H5LTyylex_destroy is for both reentrant and non-reentrant scanners. */ int H5LTyylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); @@ -2546,8 +2546,8 @@ void H5LTyyfree (void * ptr ) int my_yyinput(char *buf, int max_size) { int ret; - - memcpy(buf, myinput, input_len); + + memcpy(buf, myinput, input_len); ret = (int)input_len; return ret; } diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 0275917..d8661a7 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1,41 +1,41 @@ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wnested-externs" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wstrict-overflow" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#pragma GCC diagnostic ignored "-Wswitch-default" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-macros" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined __SUNPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-overflow" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif /* A Bison parser, made by GNU Bison 2.7. */ /* Bison implementation for Yacc-like parsers in C - + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -48,7 +48,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -127,7 +127,7 @@ struct arr_info { }; /*stack for nested array type*/ struct arr_info arr_stack[STACK_SIZE]; -int asindex = -1; /*pointer to the top of array stack*/ +int asindex = -1; /*pointer to the top of array stack*/ hbool_t is_str_size = 0; /*flag to lexer for string size*/ hbool_t is_str_pad = 0; /*flag to lexer for string padding*/ @@ -135,7 +135,7 @@ H5T_str_t str_pad; /*variable for string padding*/ H5T_cset_t str_cset; /*variable for string character set*/ hbool_t is_variable = 0; /*variable for variable-length string*/ size_t str_size; /*variable for string size*/ - + hid_t enum_id; /*type ID*/ hbool_t is_enum = 0; /*flag to lexer for enum type*/ hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ @@ -1868,9 +1868,9 @@ yyreduce: case 48: /* Line 1792 of yacc.c */ #line 161 "hl/src/H5LTparse.y" - { (yyval.hid) = cmpd_stack[csindex].id; + { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; - cmpd_stack[csindex].first_memb = 1; + cmpd_stack[csindex].first_memb = 1; csindex--; } break; @@ -1884,7 +1884,7 @@ yyreduce: case 52: /* Line 1792 of yacc.c */ #line 172 "hl/src/H5LTparse.y" - { + { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; @@ -1898,7 +1898,7 @@ yyreduce: cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - + if((yyvsp[(6) - (7)].ival) == 0) { new_size = origin_size + H5Tget_size((yyvsp[(1) - (7)].hid)); H5Tset_size(dtype_id, new_size); @@ -1915,7 +1915,7 @@ yyreduce: } cmpd_stack[csindex].is_field = 0; H5Tclose((yyvsp[(1) - (7)].hid)); - + new_size = H5Tget_size(dtype_id); } break; @@ -1951,7 +1951,7 @@ yyreduce: case 58: /* Line 1792 of yacc.c */ #line 223 "hl/src/H5LTparse.y" - { + { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; @@ -1969,9 +1969,9 @@ yyreduce: /* Line 1792 of yacc.c */ #line 234 "hl/src/H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; - arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; + arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; - arr_stack[asindex].is_dim = 0; + arr_stack[asindex].is_dim = 0; } break; @@ -1990,10 +1990,10 @@ yyreduce: case 67: /* Line 1792 of yacc.c */ #line 251 "hl/src/H5LTparse.y" - { + { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); - is_opq_size = 0; + is_opq_size = 0; } break; @@ -2006,7 +2006,7 @@ yyreduce: case 69: /* Line 1792 of yacc.c */ #line 257 "hl/src/H5LTparse.y" - { + { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); free(yylval.sval); yylval.sval = NULL; @@ -2029,12 +2029,12 @@ yyreduce: case 74: /* Line 1792 of yacc.c */ #line 272 "hl/src/H5LTparse.y" - { + { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; - else + else str_size = yylval.ival; - is_str_size = 0; + is_str_size = 0; } break; @@ -2054,7 +2054,7 @@ yyreduce: case 76: /* Line 1792 of yacc.c */ #line 289 "hl/src/H5LTparse.y" - { + { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; else if((yyvsp[(13) - (14)].ival) == H5T_CSET_UTF8_TOKEN) @@ -2076,7 +2076,7 @@ yyreduce: case 78: /* Line 1792 of yacc.c */ #line 303 "hl/src/H5LTparse.y" - { + { hid_t str_id = (yyvsp[(19) - (20)].hid); /*set string size*/ @@ -2085,12 +2085,12 @@ yyreduce: is_variable = 0; } else H5Tset_size(str_id, str_size); - + /*set string padding and character set*/ H5Tset_strpad(str_id, str_pad); H5Tset_cset(str_id, str_cset); - (yyval.hid) = str_id; + (yyval.hid) = str_id; } break; @@ -2160,9 +2160,9 @@ yyreduce: { is_enum_memb = 1; /*indicate member of enum*/ #ifdef H5_HAVE_WIN32_API - enum_memb_symbol = _strdup(yylval.sval); + enum_memb_symbol = _strdup(yylval.sval); #else /* H5_HAVE_WIN32_API */ - enum_memb_symbol = strdup(yylval.sval); + enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ free(yylval.sval); yylval.sval = NULL; @@ -2182,32 +2182,32 @@ yyreduce: hid_t native = H5Tget_native_type(super, H5T_DIR_ASCEND); H5T_order_t super_order = H5Tget_order(super); H5T_order_t native_order = H5Tget_order(native); - + if(is_enum && is_enum_memb) { /*if it's an enum member*/ /*To handle machines of different endianness*/ if(H5Tequal(native, H5T_NATIVE_SCHAR) || H5Tequal(native, H5T_NATIVE_UCHAR)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &char_val); } else if(H5Tequal(native, H5T_NATIVE_SHORT) || H5Tequal(native, H5T_NATIVE_USHORT)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &short_val); } else if(H5Tequal(native, H5T_NATIVE_INT) || H5Tequal(native, H5T_NATIVE_UINT)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &int_val); } else if(H5Tequal(native, H5T_NATIVE_LONG) || H5Tequal(native, H5T_NATIVE_ULONG)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &long_val); } else if(H5Tequal(native, H5T_NATIVE_LLONG) || H5Tequal(native, H5T_NATIVE_ULLONG)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &llong_val); } - is_enum_memb = 0; + is_enum_memb = 0; if(enum_memb_symbol) free(enum_memb_symbol); } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 30c5ea8..0ecd15d 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -1,19 +1,19 @@ /* A Bison parser, made by GNU Bison 2.7. */ /* Bison interface for Yacc-like parsers in C - + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 47be98a..6df7c4b 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -20,7 +20,7 @@ /* user supplied image buffer. The same image is open with the core driver. */ #define H5LT_FILE_IMAGE_DONT_RELEASE 0x0004 /* The HDF5 lib won't */ /* deallocate user supplied image buffer. The user application is reponsible */ -/* for doing so. */ +/* for doing so. */ #define H5LT_FILE_IMAGE_ALL 0x0007 typedef enum H5LT_lang_t { diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index a4bcbd4..c54c41f 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -102,7 +102,7 @@ herr_t H5TBmake_table(const char *table_title, if (field_names == NULL) { goto out; } - + dims[0] = nrecords; dims_chunk[0] = chunk_size; @@ -300,7 +300,7 @@ herr_t H5TBappend_records(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* get the original number of records and fields */ @@ -374,7 +374,7 @@ herr_t H5TBwrite_records(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -477,9 +477,9 @@ herr_t H5TBwrite_fields_name(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; - if (field_names == NULL) + if (field_names == NULL) goto out; /* create xfer properties to preserve initialized data */ @@ -640,7 +640,7 @@ herr_t H5TBwrite_fields_index(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* create xfer properties to preserve initialized data */ @@ -801,7 +801,7 @@ herr_t H5TBread_table(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -878,7 +878,7 @@ herr_t H5TBread_records(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* get the number of records and fields */ @@ -959,9 +959,9 @@ herr_t H5TBread_fields_name(hid_t loc_id, /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; - if (field_names == NULL) + if (field_names == NULL) goto out; /* open the dataset */ @@ -1029,7 +1029,7 @@ herr_t H5TBread_fields_name(hid_t loc_id, /* check to make sure field was found, no reason to continue if it does not exist */ if(j == 0) goto out; - + /* get the dataspace handle */ if((sid = H5Dget_space(did)) < 0) goto out; @@ -1121,7 +1121,7 @@ herr_t H5TBread_fields_index(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -1281,9 +1281,9 @@ herr_t H5TBdelete_record(hid_t loc_id, unsigned char *tmp_buf = NULL; herr_t ret_val = -1; - + /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /*------------------------------------------------------------------------- @@ -1446,7 +1446,7 @@ herr_t H5TBinsert_record(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /*------------------------------------------------------------------------- @@ -1601,9 +1601,9 @@ herr_t H5TBadd_records_from(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name1 == NULL) + if (dset_name1 == NULL) goto out; - if (dset_name2 == NULL) + if (dset_name2 == NULL) goto out; /*------------------------------------------------------------------------- @@ -1754,11 +1754,11 @@ herr_t H5TBcombine_tables(hid_t loc_id1, herr_t ret_val = -1; /* check the arguments */ - if (dset_name1 == NULL) + if (dset_name1 == NULL) goto out; - if (dset_name2 == NULL) + if (dset_name2 == NULL) goto out; - if (dset_name3 == NULL) + if (dset_name3 == NULL) goto out; /*------------------------------------------------------------------------- @@ -2117,9 +2117,9 @@ herr_t H5TBinsert_field(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; - if (field_name == NULL) + if (field_name == NULL) goto out; /* get the number of records and fields */ @@ -2532,9 +2532,9 @@ herr_t H5TBdelete_field(hid_t loc_id, /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; - if (field_name == NULL) + if (field_name == NULL) goto out; /* get the number of records and fields */ @@ -2982,7 +2982,7 @@ htri_t H5TBAget_fill(hid_t loc_id, htri_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* get the number of records and fields */ @@ -3014,7 +3014,7 @@ htri_t H5TBAget_fill(hid_t loc_id, out: if(src_offset) HDfree(src_offset); - + return ret_val; } /* end H5TBAget_fill() */ @@ -3054,7 +3054,7 @@ herr_t H5TBget_table_info(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -3145,7 +3145,7 @@ herr_t H5TBget_field_info(hid_t loc_id, herr_t ret_val = -1; /* check the arguments */ - if (dset_name == NULL) + if (dset_name == NULL) goto out; /* open the dataset. */ @@ -3253,9 +3253,9 @@ hbool_t H5TB_find_field(const char *field, const char *field_list) const char *end; /* check the arguments */ - if (field == NULL) + if (field == NULL) return FALSE; - if (field_list == NULL) + if (field_list == NULL) return FALSE; while((end = HDstrstr(start, ",")) != 0) { diff --git a/hl/test/gen_test_ld.c b/hl/test/gen_test_ld.c index d717a47..981aded 100644 --- a/hl/test/gen_test_ld.c +++ b/hl/test/gen_test_ld.c @@ -13,23 +13,23 @@ #include "H5LDprivate.h" /* - * WATCH.h5: file with various types of datasets for testing-- + * WATCH.h5: file with various types of datasets for testing-- * - * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: - * DSET_ONE: one-dimensional dataset - * DSET_TWO: two-dimensional dataset - * DSET_CMPD: one-dimensional dataset with compound type + * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: + * DSET_ONE: one-dimensional dataset + * DSET_TWO: two-dimensional dataset + * DSET_CMPD: one-dimensional dataset with compound type * DSET_CMPD_ESC: one-dimensional dataset with compound type and member names with - * escape/separator characters - * DSET_CMPD_TWO: two-dimensional dataset with compound type - * - * The following datasets are one-dimensional, chunked, max. dimension setting: - * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY - * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE - * - * The following datasets are one-dimensional: - * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE - * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR + * escape/separator characters + * DSET_CMPD_TWO: two-dimensional dataset with compound type + * + * The following datasets are one-dimensional, chunked, max. dimension setting: + * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY + * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE + * + * The following datasets are one-dimensional: + * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE + * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR */ #define ONE_DIMS0 10 #define MAX_ONE_DIMS0 100 diff --git a/hl/tools/gif2h5/Makefile.am b/hl/tools/gif2h5/Makefile.am index 9ffde58..9de2135 100644 --- a/hl/tools/gif2h5/Makefile.am +++ b/hl/tools/gif2h5/Makefile.am @@ -29,9 +29,9 @@ bin_PROGRAMS=gif2h5 h52gif h52gif_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) gif2h5_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) -gif2h5_SOURCES=gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c +gif2h5_SOURCES=gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c -h52gif_SOURCES=hdf2gif.c hdfgifwr.c +h52gif_SOURCES=hdf2gif.c hdfgifwr.c # Programs all depend on the hdf5 library, the tools library, and the HL @@ -42,7 +42,7 @@ if BUILD_TESTS_CONDITIONAL TEST_SCRIPT=h52giftest.sh check_SCRIPTS=$(TEST_SCRIPT) noinst_PROGRAMS=h52gifgentst - h52gifgentst_SOURCES=h52gifgentst.c + h52gifgentst_SOURCES=h52gifgentst.c endif CHECK_CLEANFILES+=*.h5 diff --git a/hl/tools/gif2h5/h52giftest.sh.in b/hl/tools/gif2h5/h52giftest.sh.in index 5643e30..02c9e89 100644 --- a/hl/tools/gif2h5/h52giftest.sh.in +++ b/hl/tools/gif2h5/h52giftest.sh.in @@ -70,20 +70,20 @@ echo "" # Positive tests for h52gif echo "**validate the h52gif tool processes input correctly..." -TESTING "./h52gif h52giftst.h5 image1.gif -i image" +TESTING "./h52gif h52giftst.h5 image1.gif -i image" TOOLTEST ./h52gif $TESTFILE1 image1.gif -i image echo "" # Negative tests. echo "**verify that the h52gif tool handles error conditions correctly..." # nonexisting dataset name -TESTING "./h52gif h52giftst.h5 image.gif -i nosuch_image" -TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i nosuch_image" +TESTING "./h52gif h52giftst.h5 image.gif -i nosuch_image" +TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i nosuch_image" # this test should have failed but it did not. Comment it out for now. -#TESTING "./h52gif h52giftst.h5 image.gif -i palette" -#TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i palette" -TESTING "./h52gif h52giftst.h5 image24.gif -i image24bitpixel" -TOOLTESTFAIL "./h52gif $TESTFILE3 image24.gif -i image24bitpixel" +#TESTING "./h52gif h52giftst.h5 image.gif -i palette" +#TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i palette" +TESTING "./h52gif h52giftst.h5 image24.gif -i image24bitpixel" +TOOLTESTFAIL "./h52gif $TESTFILE3 image24.gif -i image24bitpixel" echo "" # all done. summarize results. diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 4dcf25e..6b59ea1 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -66,7 +66,7 @@ typedef struct set_t { * * Extending a two-dimensional dataset by action1 and action2. * --action1 and action2 can be a positive # or negative # or 0. - * + * *********************************************************************** */ static herr_t @@ -399,12 +399,12 @@ main(int argc, const char *argv[]) if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { if(extend_dset_one(fname, dname, action1) < 0) goto error; - } else if(!HDstrcmp(dname, DSET_ONE) || - !HDstrcmp(dname, DSET_ALLOC_LATE) || + } else if(!HDstrcmp(dname, DSET_ONE) || + !HDstrcmp(dname, DSET_ALLOC_LATE) || !HDstrcmp(dname, DSET_ALLOC_EARLY)) { if(extend_dset_one(fname, dname, action1) < 0) goto error; - } else if(!HDstrcmp(dname, DSET_TWO) || + } else if(!HDstrcmp(dname, DSET_TWO) || !HDstrcmp(dname, DSET_CMPD_TWO)) { if(extend_dset_two(fname, dname, action1, action2) < 0) goto error; diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index 18e15fc..19c9876 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -15,23 +15,23 @@ #include "H5HLprivate2.h" /* - * WATCH.h5: file with various types of datasets for testing-- + * WATCH.h5: file with various types of datasets for testing-- * - * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: - * DSET_ONE: one-dimensional dataset - * DSET_TWO: two-dimensional dataset - * DSET_CMPD: one-dimensional dataset with compound type + * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: + * DSET_ONE: one-dimensional dataset + * DSET_TWO: two-dimensional dataset + * DSET_CMPD: one-dimensional dataset with compound type * DSET_CMPD_ESC: one-dimensional dataset with compound type and member names with - * escape/separator characters - * DSET_CMPD_TWO: two-dimensional dataset with compound type - * - * The following datasets are one-dimensional, chunked, max. dimension setting: - * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY - * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE - * - * The following datasets are one-dimensional: - * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE - * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR + * escape/separator characters + * DSET_CMPD_TWO: two-dimensional dataset with compound type + * + * The following datasets are one-dimensional, chunked, max. dimension setting: + * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY + * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE + * + * The following datasets are one-dimensional: + * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE + * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR */ #define ONE_DIMS0 10 #define MAX_ONE_DIMS0 100 diff --git a/hl/tools/h5watch/swmr_check_compat_vfd.c b/hl/tools/h5watch/swmr_check_compat_vfd.c index 26f76cb..608f4a8 100644 --- a/hl/tools/h5watch/swmr_check_compat_vfd.c +++ b/hl/tools/h5watch/swmr_check_compat_vfd.c @@ -13,7 +13,7 @@ /* Purpose: This is a small program that checks if the HDF5_DRIVER * environment variable is set to a value that supports SWMR. - * + * * It is intended for use in shell scripts. */ diff --git a/java/Makefile.am b/java/Makefile.am index 51398f2..4426e3e 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -10,7 +10,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. diff --git a/java/examples/Makefile.am b/java/examples/Makefile.am index 8ca49f2..054407c 100644 --- a/java/examples/Makefile.am +++ b/java/examples/Makefile.am @@ -10,7 +10,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. diff --git a/java/examples/datasets/Makefile.am b/java/examples/datasets/Makefile.am index b442603..c5b8a5d 100644 --- a/java/examples/datasets/Makefile.am +++ b/java/examples/datasets/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)datasets.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ H5Ex_D_Alloc.java \ diff --git a/java/examples/datatypes/Makefile.am b/java/examples/datatypes/Makefile.am index 5e0e971..f695528 100644 --- a/java/examples/datatypes/Makefile.am +++ b/java/examples/datatypes/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)datatypes.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ H5Ex_T_Array.java \ diff --git a/java/examples/groups/Makefile.am b/java/examples/groups/Makefile.am index 09df743..d5824e8 100644 --- a/java/examples/groups/Makefile.am +++ b/java/examples/groups/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)groups.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ H5Ex_G_Create.java \ diff --git a/java/examples/intro/Makefile.am b/java/examples/intro/Makefile.am index 33f44c2..8c3716a 100644 --- a/java/examples/intro/Makefile.am +++ b/java/examples/intro/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)intro.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ H5_CreateAttribute.java \ diff --git a/java/src/Makefile.am b/java/src/Makefile.am index b7ad4bd..0df48bd 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -10,7 +10,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java index 8d0cc24..73aaa47 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java @@ -74,7 +74,7 @@ public class H5O_hdr_info_t implements Serializable { if (this.mesg_present != info.mesg_present) return false; if (this.mesg_shared != info.mesg_shared) - return false; + return false; return true; } diff --git a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java index 4e80849..f410a7f 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java @@ -22,7 +22,7 @@ public class H5O_native_info_t implements Serializable { public H5O_hdr_info_t hdr_info; /* Object header information */ /* Extra metadata storage for obj & attributes */ - public H5_ih_info_t obj_info; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ + public H5_ih_info_t obj_info; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ public H5_ih_info_t attr_info; /* v2 B-tree & heap for attributes */ H5O_native_info_t (H5O_hdr_info_t oheader_info, H5_ih_info_t obj_info, H5_ih_info_t attr_info) @@ -49,4 +49,4 @@ public class H5O_native_info_t implements Serializable { return true; } -} \ No newline at end of file +} diff --git a/java/src/hdf/hdf5lib/structs/H5O_token_t.java b/java/src/hdf/hdf5lib/structs/H5O_token_t.java index 8ec0b7f..e6d2474 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_token_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_token_t.java @@ -42,4 +42,4 @@ public class H5O_token_t implements Serializable { return Arrays.equals(this.data, token.data); } -} \ No newline at end of file +} diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index 33d3c2b..3498392 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -165,7 +165,7 @@ done: /* 10/28/99 -- added code to copy the array -- this is not used, * but serves as a reminder in case we try to implement this in * the future.... - */ + */ /* * Note: the argument coord is actually long coord[][], which has been * flattened by the caller. diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h index a07d4c5..cea2ebf 100644 --- a/java/src/jni/h5sImp.h +++ b/java/src/jni/h5sImp.h @@ -52,7 +52,7 @@ Java_hdf_hdf5lib_H5__1H5Scopy /* 10/28/99 -- added code to copy the array -- this is not used, * but serves as a reminder in case we try to implement this in * the future.... - */ + */ /* * Note: the argument coord is actually long coord[][], which has been * flattened by the caller. diff --git a/java/test/Makefile.am b/java/test/Makefile.am index 3f11933..46e6a7e 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)test.jar AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation -TESTPACKAGE = +TESTPACKAGE = noinst_JAVA = \ TestH5.java \ diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java index 8baccd1..f2b5ab5 100644 --- a/java/test/TestH5Tparams.java +++ b/java/test/TestH5Tparams.java @@ -274,7 +274,7 @@ public class TestH5Tparams { public void testH5Tpack_invalid() throws Throwable { H5.H5Tpack(-1); } - + @Test(expected = HDF5LibraryException.class) public void testH5Treclaim_invalid() throws Throwable { byte[] buf = new byte[2]; diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90 index 7e81a52..f0c6d68 100644 --- a/m4/aclocal_fc.f90 +++ b/m4/aclocal_fc.f90 @@ -11,12 +11,12 @@ ! help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! This file contains all the configure test programs +! This file contains all the configure test programs ! used by autotools and cmake. This avoids having to ! duplicate code for both cmake and autotool tests. ! For autotools, a program below is chosen via a ! sed command in aclocal_fc.m4. For cmake, a program -! below is chosen via the macro READ_SOURCE in +! below is chosen via the macro READ_SOURCE in ! HDF5UseFortran.cmake ! @@ -88,7 +88,7 @@ PROGRAM FC_AVAIL_KINDS INTEGER, DIMENSION(1:10) :: list_ikinds = -1 INTEGER, DIMENSION(1:10) :: list_rkinds = -1 LOGICAL :: new_kind - + OPEN(8, FILE='pac_fconftest.out', FORM='formatted') ! Find integer KINDs @@ -157,6 +157,6 @@ END PROGRAM FC_AVAIL_KINDS PROGRAM FC_MPI_CHECK INCLUDE 'mpif.h' INTEGER :: comm, amode, info, fh, ierror - CHARACTER(LEN=1) :: filename + CHARACTER(LEN=1) :: filename CALL MPI_File_open( comm, filename, amode, info, fh, ierror) END PROGRAM FC_MPI_CHECK diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index ab45bbc..950d457 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -30,7 +30,7 @@ dnl fortran compilers for use with AC_PROG_FC that is more suitable for HPC dnl software packages AC_DEFUN([PAC_FC_SEARCH_LIST], [gfortran ifort pgf90 pathf90 pathf95 xlf90 xlf95 xlf2003 f90 epcf90 f95 fort lf95 g95 ifc efc gfc]) -dnl +dnl dnl PAC_PROG_FC([COMPILERS]) dnl dnl COMPILERS is a space separated list of Fortran compilers to search for. @@ -54,10 +54,10 @@ dnl ifc - An older Intel compiler dnl fc - A compiler on some unknown system. This has been removed because dnl it may also be the name of a command for something other than dnl the Fortran compiler (e.g., fc=file system check!) -dnl gfortran - The GNU Fortran compiler (not the same as g95) +dnl gfortran - The GNU Fortran compiler (not the same as g95) dnl gfc - An alias for gfortran recommended in cygwin installations dnl NOTE: this macro suffers from a basically intractable "expanded before it -dnl was required" problem when libtool is also used +dnl was required" problem when libtool is also used dnl [1] MPICH.org dnl @@ -66,7 +66,7 @@ dnl See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV" AC_DEFUN([PAC_PROG_FC_ISO_FORTRAN_ENV],[ HAVE_ISO_FORTRAN_ENV="no" AC_MSG_CHECKING([if Fortran compiler supports intrinsic module ISO_FORTRAN_ENV]) - TEST_SRC="`sed -n '/PROGRAM PROG_FC_ISO_FORTRAN_ENV/,/END PROGRAM PROG_FC_ISO_FORTRAN_ENV/p' $srcdir/m4/aclocal_fc.f90`" + TEST_SRC="`sed -n '/PROGRAM PROG_FC_ISO_FORTRAN_ENV/,/END PROGRAM PROG_FC_ISO_FORTRAN_ENV/p' $srcdir/m4/aclocal_fc.f90`" AC_LINK_IFELSE([$TEST_SRC],[AC_MSG_RESULT([yes]) HAVE_ISO_FORTRAN_ENV="yes"], [AC_MSG_RESULT([no])]) @@ -122,11 +122,11 @@ dnl Check if C_LONG_DOUBLE is different from C_DOUBLE if test "X$FORTRAN_HAVE_C_LONG_DOUBLE" = "Xyes"; then AC_DEFUN([PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE],[ - C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="no" + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="no" AC_MSG_CHECKING([if Fortran C_LONG_DOUBLE is different from C_DOUBLE]) TEST_SRC="`sed -n '/MODULE type_mod/,/END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE/p' $srcdir/m4/aclocal_fc.f90`" - AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) - C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="yes"], + AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) + C_LONG_DOUBLE_IS_UNIQUE_FORTRAN="yes"], [AC_MSG_RESULT([no])]) ]) fi @@ -138,8 +138,8 @@ AC_DEFUN([PAC_PROG_FC_HAVE_F2003_REQUIREMENTS],[ HAVE_F2003_REQUIREMENTS="no" AC_MSG_CHECKING([if Fortran compiler version compatible with Fortran 2003 HDF]) TEST_SRC="`sed -n '/PROG_FC_HAVE_F2003_REQUIREMENTS/,/END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS/p' $srcdir/m4/aclocal_fc.f90`" - AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) - HAVE_F2003_REQUIREMENTS="yes"], + AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) + HAVE_F2003_REQUIREMENTS="yes"], [AC_MSG_RESULT([no])]) ]) @@ -262,7 +262,7 @@ TEST_SRC="`sed -n '/PROGRAM FC_AVAIL_KINDS/,/END PROGRAM FC_AVAIL_KINDS/p' $srcd AC_RUN_IFELSE([$TEST_SRC], [ if test -s pac_fconftest.out ; then - + dnl The output from the above program will be: dnl -- LINE 1 -- valid integer kinds (comma seperated list) dnl -- LINE 2 -- valid real kinds (comma seperated list) @@ -453,7 +453,7 @@ rm -f pac_Cconftest.out #define C_FLT128_DIG 0 #endif #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define C_LDBL_DIG DECIMAL_DIG + #define C_LDBL_DIG DECIMAL_DIG #else #define C_LDBL_DIG LDBL_DIG #endif @@ -465,7 +465,7 @@ rm -f pac_Cconftest.out ]) AC_RUN_IFELSE([],[ if test -s pac_Cconftest.out ; then - LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" + LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" else AC_MSG_ERROR([No output from C decimal precision program!]) diff --git a/release_docs/HISTORY-1_0-1_8_0_rc3.txt b/release_docs/HISTORY-1_0-1_8_0_rc3.txt index 964d374..9c1ba12 100644 --- a/release_docs/HISTORY-1_0-1_8_0_rc3.txt +++ b/release_docs/HISTORY-1_0-1_8_0_rc3.txt @@ -27,7 +27,7 @@ CONTENTS 4. Changes from Release 1.0.0 to Release 1.0.1 3. Changes from the Beta 1.0.0 Release to Release 1.0.0 2. Changes from the Second Alpha 1.0.0 Release to the Beta 1.0.0 Release -1. Changes from the First Alpha 1.0.0 Release to the +1. Changes from the First Alpha 1.0.0 Release to the Second Alpha 1.0.0 Release [Search on the string '%%%%' for per-release section breaks.] @@ -35,15 +35,15 @@ CONTENTS %%%%1.8.0-rc3%%%% Changes from 1.6.0 to 1.8.0-rc3 -HDF5 version 1.8.0-rc3 +HDF5 version 1.8.0-rc3 ================================================================================ INTRODUCTION This document describes the differences between HDF5-1.6.* and -Hdf5 1.8.0 release candidate "HDF5-1.8.0-rc3", and contains information -on the platforms tested and known problems in HDF5-1.8.0-rc3. +Hdf5 1.8.0 release candidate "HDF5-1.8.0-rc3", and contains information +on the platforms tested and known problems in HDF5-1.8.0-rc3. For more details check the HISTORY.txt file in the HDF5 source. @@ -51,7 +51,7 @@ Links to HDF5 1.8.0-rc3 source code, documentation, and additional materials can be found on THG's development server (www.hdfgroup.uiuc.edu) at the following location: http://www.hdfgroup.uiuc.edu/HDF5/release/beta/obtain518.html -User documentation for the beta can be accessed directly at this location: +User documentation for the beta can be accessed directly at this location: http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ New features of the upcoming 1.8.0 release are described in @@ -66,7 +66,7 @@ and will be listed in the "HDF5 Software Changes" document: For more information, see the HDF5 home page: - + http://www.hdfgroup.org/HDF5/ If you have any questions or comments, please send them to the HDF Help Desk: @@ -89,13 +89,13 @@ New Features Configuration: -------------- - Removed stream-vfd from the HDF5 library. - AKC 2007/11/19. - - Updated versions of autotools. HDF5 now uses automake 1.10.0, + - Updated versions of autotools. HDF5 now uses automake 1.10.0, autoconf 2.61, and libtool 1.5.22. MAM - 2007/7/25. - Changed default fortran compiler to g95 when gcc is used. - AKC 2007/2/17. - 'make check-vfd' can now be run from the top level directory. Not all tests that 'make check' invokes work with certain Virtual File Drivers, - so those tests have been skipped. - MAM 2006/7/17 + so those tests have been skipped. - MAM 2006/7/17 - Added the variable HDF5TestExpress to control how long tests run. Setting it to a value between 0 and 3 controls how thoroughly the library is tested, with 0 being an "exhaustive run" and 3 being a @@ -105,8 +105,8 @@ New Features tested during 'make install'. -MAM 2006/06/21 - Added support to explicity enable stream_vfd or shared libraries when using parallel via the '--enable-stream_vfd' and - '--enable-shared' options, respectively. If not explicity defined, - These settings default to enabled when parallel is not used, + '--enable-shared' options, respectively. If not explicity defined, + These settings default to enabled when parallel is not used, and disabled when parallel is used. -MAM 2006/06/17 - Remove the flexible parallel code and the --enable-fphdf5 configure option, it was never up to production standards @@ -187,7 +187,7 @@ New Features JML 2005/01 - 2005/03 - Hardware conversion between long double and integers is also added. SLU 2005/02/10 - - Started to support software conversion between long double and + - Started to support software conversion between long double and integers. Hardware conversion will come very soon. SLU - 2005/1/6 - Intel v8.0 compiler would infinite loop when compiling some test code with -O3 option. Changed enable-production default compiler @@ -214,8 +214,8 @@ New Features be used as the "location ID". If a file ID is used, the attribute operation will occur on the root group of the file. - QAK - 2007/02/09 - - Enabled the CORE driver to read an existing file depending on - the setting of the backing_store for H5Pset_fapl_core and file + - Enabled the CORE driver to read an existing file depending on + the setting of the backing_store for H5Pset_fapl_core and file open flags. - SLU - 2006/11/30 - Added new H5Gget_info_by_idx() routine to query the information about a group according to the order within an index. @@ -309,10 +309,10 @@ New Features application by building one MPI derived datatype accross all chunks. 2) Implemented the decision-making support to do collective IO inside - MPI-IO per chunk. + MPI-IO per chunk. 3) Added the decision-making support to do one IO accross all chunks or to do multiple IOs with each IO per chunk. - 4) Added the support to handle the case some processes won't do any IOs in + 4) Added the support to handle the case some processes won't do any IOs in collectively. 5) Some MPI-IO package(mpich 1.2.6 or lower, e.g.) cannot handle collective IO correctly for the case when some processes have no @@ -320,8 +320,8 @@ New Features collective IO mode to independent IO mode inside HDF5 library. Currently we find that MPICH at Linux and vender MPI-IO package at NCSA - Altix cannot handle this case. - + Altix cannot handle this case. + "hdf5_mpi_special_collective_io_works=${hdf5_mpi_special_collective_io_works='no'}" has been added at the end of file and . @@ -329,8 +329,8 @@ New Features If MPI-IO packages at your Linux and Altix support this case, please comment out the last line and report to us at help@hdfgroup.org. We can tune in our configuration to - support this. - + support this. + KY - 2006/02/16 - Added character encoding to attribute creation property lists. JML - 2006/01/02 @@ -352,7 +352,7 @@ New Features more than once for the same dataset. Currently, not all MPI-IO packages support complicated MPI derived datatype used in the implementation of irregular - selection INSIDE HDF5. + selection INSIDE HDF5. 1) DEC 5.x is not supporting complicated derived datatype. 2) For AIX 5.1, if your poe version number is 3.2.0.19 or lower, @@ -362,39 +362,39 @@ New Features and UNCOMMENT this line before the configure. check poe version with the following command: lpp -l all | grep ppe.poe - 3) For Linux cluster, + 3) For Linux cluster, if mpich version is 1.2.5 or lower, collective irregular selection IO is not supported, internally independent IO is used. 4) For IRIX 6.5, if C compiler version is 7.3 or lower, collective irregular selection IO is not supported, internally independent IO is used. 5) For platforms which internally used mpich, if the - mpich version is 1.2.5 or lower, please find the + mpich version is 1.2.5 or lower, please find the corresponding config file and add hdf5_mpi_complex_derived_datatype_works='no' at the end of the configuration file. For example, at NCSA - SGI Altix, the internal mpich library is 1.2.5. So + SGI Altix, the internal mpich library is 1.2.5. So hdf5_mpi_complex_derived_datatype_works='no' should be added at the end of the config file ia64-linux-gnu. KY - 2005/09/12 We also found not all MPI-IO packages support collective IO with one or more processes to have no contributions to IO. - For mpich version 1.2.6 or lower and all IRIX machine, + For mpich version 1.2.6 or lower and all IRIX machine, if the library checks that there are no IO contributions for some processes, collective IO request is replaced with independent inside HDF5. KY - 2006/05/04 - - - HDF5 N-bit filter - HDF5 support N-bit filter from this version, + + - HDF5 N-bit filter + HDF5 support N-bit filter from this version, The N-Bit filter is used effectively for compressing data of N-Bit - datatype as well as compound and array datatype with N-Bit fields. + datatype as well as compound and array datatype with N-Bit fields. KY - 2005/04/15 - HDF5 scaleoffset filter HDF5 supports scaleoffset filter for users to do data - compression through HDF5 library. + compression through HDF5 library. Scale-Offset compression performs a scale and/or offset operation - on each data value and truncates the resulting value to a minimum + on each data value and truncates the resulting value to a minimum number of bits and then stores the data. Scaleoffset filter supports floating-point and integer datatype. Please check the HDF5 reference manual for this. @@ -410,9 +410,9 @@ New Features - Added function H5Pget_data_transform, together with the previously added H5Pset_data_transform, to support the data transform feature. AKC - 2004/10/26 - - Compound datatype has been enhanced with a new feature of size + - Compound datatype has been enhanced with a new feature of size adjustment. The size can be increased and decreased(without - cutting the last member) as long as it doesn't go down to zero. + cutting the last member) as long as it doesn't go down to zero. No API change is involved. SLU - 2004/10/1 - Put back 6 old error API functions to be backward compatible with version 1.6. They are H5Epush, H5Eprint, H5Ewalk, H5Eclear, @@ -421,14 +421,14 @@ New Features H5Eclear_stack, H5Eset_auto_stack, H5Eget_auto_stack. SLU - 2004/9/2 - 4 new API functions, H5Tencode, H5Tdecode, H5Sencode, H5Sdecode were - added to the library. Given object ID, these functions encode and - decode HDF5 objects(data type and space) information into and from + added to the library. Given object ID, these functions encode and + decode HDF5 objects(data type and space) information into and from binary buffer. SLU - 2004/07/21 - - Modified the way how HDF5 calculates 'pixels_per_scanline' parameter for + - Modified the way how HDF5 calculates 'pixels_per_scanline' parameter for SZIP compression. Now there is no restriction on the size and shape of the - chunk except that the total number of elements in the chunk cannot be - bigger than 'pixels_per_block' parameter provided by the user. - EIP - 2004/07/21 + chunk except that the total number of elements in the chunk cannot be + bigger than 'pixels_per_block' parameter provided by the user. + EIP - 2004/07/21 - Added support for SZIP without encoder. Added H5Zget_filter_info and changed H5Pget_filter and H5Pget_filter_by_id to support this change. JL/NF - 2004/06/30 @@ -443,19 +443,19 @@ New Features - A new API function H5Fget_filesize was added. It returns the actual file size of the opened file. SLU - 2004/06/24 - New Feature of Data transformation is added. AKC - 2004/05/03. - - New exception handler for datatype conversion is put in to + - New exception handler for datatype conversion is put in to replace the old overflow callback function. This exception handler is set through H5Pset_type_conv_cb function. SLU - 2004/4/27 - Added option that if $HDF5_DISABLE_VERSION_CHECK is set to 2, will suppress all library version mismatch warning messages. AKC - 2004/4/14 - - A new type of dataspace, null dataspace(dataspace without any + - A new type of dataspace, null dataspace(dataspace without any element) was added. SLU - 2004/3/24 - Data type conversion(software) from integer to float was added. - SLU - 2004/3/13 + SLU - 2004/3/13 - Data type conversion(software) from float to integer was added. - Conversion from integer to float will be added later. + Conversion from integer to float will be added later. SLU -2004/2/4 - Added new H5Premove_filter routine to remove I/O pipeline filters from dataset creation property lists. PVN - 2004/01/26 @@ -469,7 +469,7 @@ New Features object's object header. QAK 2003/10/06 - Added new H5Fget_freespace() routine to query the free space in a given file. QAK 2003/10/06 - - Added backward compatability with v1.6 for new Error API. SLU - + - Added backward compatability with v1.6 for new Error API. SLU - 2003/09/24 - Changed 'objno' field in H5G_stat_t structure from 'unsigned long[2]' to 'haddr_t'. QAK - 2003/08/08 @@ -503,18 +503,18 @@ New Features ---------------- - added support for shared Fortran libraries. -JML 2005/09/20 - added missing h5tget_member_class_f function - EIP 2005/04/06 - - added new functions h5fget_name_f and h5fget_filesize_f + EIP 2005/04/06 + - added new functions h5fget_name_f and h5fget_filesize_f EIP 2004/07/08 - h5dwrite/read_f and h5awrite/read_f functions only accept dims parameter of the type INTEGER(HSIZE_T). - added support for native integers of 8 bytes (i.e. when special compiler flag is specified to set native fortran integers to 8 bytes, - for example, -i8 flag for PGI and Absoft Fortran compilers, + for example, -i8 flag for PGI and Absoft Fortran compilers, -qintsize=8 flag for IBM xlf compiler). EIP 2005/06/20 - added support for "big" REAL and DOUBLE PRECISION types - (usually the size is specified by compilers flags like + (usually the size is specified by compilers flags like -r8, -r16, etc.) Known problem: multi file test fails when REAL is 16 bytes. EIP 2005/09/8 @@ -540,9 +540,9 @@ New Features ------ - h5repack and h5diff changed command line parameter syntax to be similar to h5dump, adding also long switch names. PVN - 2008/1/16 - - h5repack now supports adding multiple filters to all objects. + - h5repack now supports adding multiple filters to all objects. PVN - 2008/1/16 - - h5dump lists groups and attributes in requested orders (by name and + - h5dump lists groups and attributes in requested orders (by name and creation order, both ascending and descending). PVN - 2007/10/5 - h5import imports string (text) data. PVN - 2007/10/5 - h52gif and gif2h5: Both these tools were revised to include the High @@ -605,21 +605,21 @@ New Features - There are two new functions in the Lite library, H5LTtext_to_dtype and H5LTdtype_to_text. H5LTtext_to_dtype creates a HDF5 data type given a text description; H5LTdtype_to_text converts a data type - to text description. Only DDL definition is supported as text + to text description. Only DDL definition is supported as text desciption now. SLU - 2006/05/17 - Added Packet Table API for creating tables with less overhead than H5TB API. Added C++ wrapper for Packet Tables. See documentation. JML - 2004/03/28 - - Documentation - ------------- - - The documentation for this release is largely complete, but - trails the source code. A few of the newer functions are + + Documentation + ------------- + - The documentation for this release is largely complete, but + trails the source code. A few of the newer functions are not yet documented. FMB - 2007/04/18 - The user documents for this release can be accessed directly at this location: http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ - The most recent document versions (updated daily) in the + The most recent document versions (updated daily) in the 1.8 development branch can be accessed at this location: http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot/H5_dev/ FMB - 2007/04/18 @@ -633,7 +633,7 @@ Support for new platforms, languages and compilers. - Added support for sequential and parallel libraries for Intel 64 Linux cluster (abe.ncsa.uiuc.edu). Among three MPICH packages available on this machine, only Open MPI works. The VMI has seg fault in hyperslab.c - and bittests.c tests. The MVAPICH2 complained about mpd not running + and bittests.c tests. The MVAPICH2 complained about mpd not running the parallel test. (see Known Problems section for more info) EIP - 2007/06/25 - Added support for HPUX11.23 for both 32 and 64-bit; HDF5 C++ @@ -762,12 +762,12 @@ Bug Fixes since HDF5-1.6.0 release particular file ID being closed, instead of operating on all open file IDs for a given file. QAK - 2005/06/01 - For family driver, the library didn't save member size in file. - When file is reopened, the size of 1st member file determine the - member size. Now member size is saved in file and is used to + When file is reopened, the size of 1st member file determine the + member size. Now member size is saved in file and is used to define member file size. Wrong file access property of member size - will result in a failure. Using any other driver except family - will cause library to return error. So is multi driver. SLU - - 2005/05/24 + will result in a failure. Using any other driver except family + will cause library to return error. So is multi driver. SLU - + 2005/05/24 - Fixed error in opening object in group that was opened in mounted file which has been unmounted. QAK - 2005/03/17 - Fixed a racing condition in MPIPOSIX virtual file drive close @@ -776,8 +776,8 @@ Bug Fixes since HDF5-1.6.0 release accessing the file for another purpose (e.g., open with truncate) while other "slower" processes have not closed the same file with the previous purpose. AKC - 2005/03/01 - - H5Tget_member_value calls for enum datatype didn't return correct - value if H5Tenum_valueof was called first. It's fixed. SLU - + - H5Tget_member_value calls for enum datatype didn't return correct + value if H5Tenum_valueof was called first. It's fixed. SLU - 2005/02/08 - For variable-length string, H5Tget_class returned H5T_STRING as its class. But H5Tdetect_class and H5Tget_member_class considered it @@ -785,12 +785,12 @@ Bug Fixes since HDF5-1.6.0 release as H5T_STRING. SLU - 2005/02/08 - The byte order of 1-byte integer types was fixed as little endian even on a big-endian machine. This has been corrected. SLU - - 2005/02/07 + 2005/02/07 - Fix segmentation fault when calling H5Fflush with an attribute that hasn't had a value written to it open. QAK - 2004/10/18 - - Back up supporting bitfield and time types in H5Tget_native_type. - Leave it to future support. The function simply returns error - message of "not support" for bitfield and time types. + - Back up supporting bitfield and time types in H5Tget_native_type. + Leave it to future support. The function simply returns error + message of "not support" for bitfield and time types. SLU - 2004/10/5 - Fixed address check in Core VFL driver to avoid spurious address/size overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 @@ -799,10 +799,10 @@ Bug Fixes since HDF5-1.6.0 release processes used point selections, and others didn't. JRM - 2004/9/15 - Corrected error where dataset region references were written in an incorrect way on Cray machines. PVN & QAK - 2004/09/13 - - The H5Tget_native_type now determines the native type for integers - based on the precision. This is to avoid cases of wrongly converting - an int to a short in machines that have a short of 8 bytes but with - 32bit precision (e.g Cray SV1). PVN - 2004/09/07 + - The H5Tget_native_type now determines the native type for integers + based on the precision. This is to avoid cases of wrongly converting + an int to a short in machines that have a short of 8 bytes but with + 32bit precision (e.g Cray SV1). PVN - 2004/09/07 - Changed H5Dread() to not overwrite data in an application's buffer with garbage when accessing a chunked dataset with an undefined fill value and an unwritten chunk is uncountered. QAK - 2004/08/25 @@ -844,10 +844,10 @@ Bug Fixes since HDF5-1.6.0 release variable-length string as field. SLU - 2004/06/10 - Fixed potential file corruption bug when a block of metadata could overlap the end of the internal metadata accumulator buffer and - the buffer would be extended correctly, but would incorrectly + the buffer would be extended correctly, but would incorrectly change it's starting address. QAK - 2004/06/09 - Opaque datatype with no tag failed for some operations. Fixed. - SLU - 2004/6/3 + SLU - 2004/6/3 - Fixed potential file corruption bug where dimensions that were too large (a value greater than could be represented in 32-bits) could cause the incorrect amount of space to be allocated in a @@ -903,7 +903,7 @@ Bug Fixes since HDF5-1.6.0 release but were interspersed with dimensions that could not be flattened were not correctly handled, causing core dumps. QAK - 2003/10/25 - Fixed incorrect datatype of the third parameter to the Fortran90 - h5pset(get)_cache_f subroutine (INTEGER to INTEGER(SIZE_T)) + h5pset(get)_cache_f subroutine (INTEGER to INTEGER(SIZE_T)) EIP - 2003/10/13 - Fixed problems with accessing variable-length data datatypes on Crays. QAK - 2003/10/10 @@ -994,10 +994,10 @@ Bug Fixes since HDF5-1.6.0 release selections. PVN 2008/01/16 - Fixed h5diff regarding the display of NaN (Not a Number) values. PVN 2008/01/16 - - Fixed h5dump regarding the parsing of binary output parameters. + - Fixed h5dump regarding the parsing of binary output parameters. PVN 2008/01/16 - Fixed memory problems in h52gif and gif2h5. PVN 2008/01/16 - - Fixed h5repack dealing with NULL references. PVN 2008/01/16 + - Fixed h5repack dealing with NULL references. PVN 2008/01/16 - Fixed h5dump & h5ls to display attributes in "name" order, rather than the order they are encountered in the object header. QAK - 2007/10/04 @@ -1005,7 +1005,7 @@ Bug Fixes since HDF5-1.6.0 release attributes. PVN 2007/03/13 - Fixed h5dump regarding the display of group comments. PVN 2007/03/13 - - Fixed h5dump regarding the display of hardlinks pointing + - Fixed h5dump regarding the display of hardlinks pointing to the root group. PVN 2007/03/13 - Fixed h5diff percentage option -p. PVN 2007/03/05 - Fixed h5dump that caused array indices greater than 2 ^32-1 @@ -1023,14 +1023,14 @@ Bug Fixes since HDF5-1.6.0 release H5Tget_native_type() internally. QAK - 2003/08/25 - Documentation - ------------- + Documentation + ------------- F90 APIs -------- - h5pget_driver_f was returning information that could not be - interpreted by fortran application program; fixed. EIP - 2005/04/10 + interpreted by fortran application program; fixed. EIP - 2005/04/10 Platforms Tested @@ -1041,7 +1041,7 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release * AIX 5.2 (32/64 bit) xlc 8.0.0.11 xlC 8.0 - xlf 10.01.0000.0 + xlf 10.01.0000.0 mpcc_r 6.0.0.8 mpxlf_r 8.1.1.7 * AIX 5.3 (32/64 bit) xlc 7.0.0.8 @@ -1065,9 +1065,9 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release HP F90 v2.9.2 HP aC++/ANSI C B3910B A.06.00 IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m - F90 MIPSpro 7.4.4m + F90 MIPSpro 7.4.4m C++ MIPSpro cc 7.4.4m - + * Linux 2.6.9 (RHEL4) Intel 10.0 compilers (abe.ncsa.uiuc.edu) Linux 2.4.21-47 gcc 3.2.3 20030502 @@ -1078,9 +1078,9 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, g95 (GCC 4.0.3) (smirom) PGI 6.2-5 (pgcc, pgf90, pgCC) Intel 9.1 (icc, iort, icpc) - Linux 2.6.5-7.252.1-rtgfx #1 + Linux 2.6.5-7.252.1-rtgfx #1 SMP ia64 Intel(R) C++ Version 9.0 - (cobalt) Intel(R) Fortran Itanium(R) Version 9.0 + (cobalt) Intel(R) Fortran Itanium(R) Version 9.0 SGI MPI SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 95 6.2 @@ -1088,9 +1088,9 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release * SunOS 5.10 i86pc Sun C 5.7 Sun Fortran 95 8.1 Sun C++ 5.7 - SunOS 5.10 cc: Sun C 5.8 - (linew) f90: Sun Fortran 95 8.2 - CC: Sun C++ 5.8 + SunOS 5.10 cc: Sun C 5.8 + (linew) f90: Sun Fortran 95 8.2 + CC: Sun C++ 5.8 Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre (tungsten) gcc 3.2.2 20030222 Intel(R) C++ Version 9.0 @@ -1100,17 +1100,17 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release Intel(R) C++ Version 8.1 Intel(R) Fortran Compiler Version 8.1 mpich-gm-1.2.5..10-intel-r2 - Windows XP + Windows XP Visual Studio .NET Visual Studio 2005 w/ Intel Fortran 9.1 Cygwin(native gcc compiler and g95) MinGW(native gcc compiler and g95) - Windows XP x64 + Windows XP x64 Visual Studio 2005 w/ Intel Fortran 9.1 - Windows Vista + Windows Vista Visual Studio 2005 - MAC OS 10.4 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 + MAC OS 10.4 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) * Alpha Open VMS 7.3 @@ -1125,7 +1125,7 @@ Supported Configuration Features Summary x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -1149,57 +1149,57 @@ RedHat EL3 W PGI (3) n y n y y n SuSe x86_64 gcc (3,12) y(1a) y(11) n y y y SuSe x86_64 Int (3,12) n y(13) n y y n SuSe x86_64 PGI (3,12) n y(8) n y y y -Linux 2.4 Xeon C +Linux 2.4 Xeon C Lustre Intel (3,6) n y n y y n -Linux 2.6 SuSE ia64 C +Linux 2.6 SuSE ia64 C Intel (3,7) y y y y y n -Linux 2.6 SGI Altix +Linux 2.6 SGI Altix ia64 Intel (3) y y y y y y Alpha OpenVMS 7.3.2 n y n y n n -Platform Shared Shared Shared static- Thread- - C libs F90 libs C++ libs exec safe -Solaris2.8 64-bit y y y x y -Solaris2.8 32-bit y y y x y -Solaris2.10 64-bit y x y -Solaris2.10 32-bit y x y -IRIX64_6.5 64-bit y y n y y -IRIX64_6.5 32-bit y dna y y y -HPUX11.00 y n y x n -HPUX11.23-32bit y n n y n -HPUX11.23-64bit y dna n y n -Cray XT3 (16) n n n n n -AIX-5.2 & 5.3 32-bit n n n y n -AIX-5.2 & 5.3 64-bit n n n y n -Windows XP y y(15) y y y -Windows XP x64 y y(15) y y y -Windows Vista y n n y y -Mac OS X 10.3 y y n +Platform Shared Shared Shared static- Thread- + C libs F90 libs C++ libs exec safe +Solaris2.8 64-bit y y y x y +Solaris2.8 32-bit y y y x y +Solaris2.10 64-bit y x y +Solaris2.10 32-bit y x y +IRIX64_6.5 64-bit y y n y y +IRIX64_6.5 32-bit y dna y y y +HPUX11.00 y n y x n +HPUX11.23-32bit y n n y n +HPUX11.23-64bit y dna n y n +Cray XT3 (16) n n n n n +AIX-5.2 & 5.3 32-bit n n n y n +AIX-5.2 & 5.3 64-bit n n n y n +Windows XP y y(15) y y y +Windows XP x64 y y(15) y y y +Windows Vista y n n y y +Mac OS X 10.3 y y n Mac OS X 10.4 PowerPC -FreeBSD 4.11 y n y y y -RedHat EL3 W (3) y y(10) y y y -RedHat EL3 W Intel (3) y y y y n -RedHat EL3 W PGI (3) y y y y n -SuSe x86_64 W GNU (3,12) y y y y y -SuSe x86_64 W Int (3,12) y y y y(14) n -SuSe x86_64 W PGI (3,12) y y y y(14) n -Linux 2.4 Xeon C - Lustre Intel (6) y y y y n -Linux 2.4 SuSE - ia64 C Intel (7) y y y y n -Linux 2.4 SGI Altix - ia64 Intel y y n -Alpha OpenVMS 7.3.2 n n n y n +FreeBSD 4.11 y n y y y +RedHat EL3 W (3) y y(10) y y y +RedHat EL3 W Intel (3) y y y y n +RedHat EL3 W PGI (3) y y y y n +SuSe x86_64 W GNU (3,12) y y y y y +SuSe x86_64 W Int (3,12) y y y y(14) n +SuSe x86_64 W PGI (3,12) y y y y(14) n +Linux 2.4 Xeon C + Lustre Intel (6) y y y y n +Linux 2.4 SuSE + ia64 C Intel (7) y y y y n +Linux 2.4 SGI Altix + ia64 Intel y y n +Alpha OpenVMS 7.3.2 n n n y n Notes: (1) Using mpich 1.2.6. (1a) Using mpich2 1.0.6. (2) Using mpt and mpich 1.2.6. - (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. + (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. W or C indicates workstation or cluster, respectively. - (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre and Intel compilers (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel compilers (8) pgf90 @@ -1218,14 +1218,14 @@ Alpha OpenVMS 7.3.2 n n n y n Known Problems ============== -* We discovered two problems when running collective IO parallel HDF5 tests - with chunking storage on ChaMPIon MPI compiler on tungsten, a linux +* We discovered two problems when running collective IO parallel HDF5 tests + with chunking storage on ChaMPIon MPI compiler on tungsten, a linux cluster at NCSA. - Under some complex selection cases, + Under some complex selection cases, 1) MPI_Get_element returns the wrong value. 2) MPI_Type_struct also generates wrong derived data type and corrupt data may be generated. - This only happens when turning on collective IO with chunking storage + This only happens when turning on collective IO with chunking storage with some complex selections. We haven't found these problems on other MPI-IO compilers. If you encounter these problems, you may use Independent IO instead. @@ -1241,22 +1241,22 @@ Known Problems * 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. + -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. * For LLNL, uP: both serial and parallel pass. Zeus: serial passes but parallel fails with a known proglem in MPI. ubgl: serial passes but - parallel fails. -* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test + parallel fails. +* 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. + 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 @@ -1270,23 +1270,23 @@ Known Problems that when using 4 processors, a simple collective write will be hung sometimes. This can be verified with t_mpi test under testpar. * On IRIX6.5, when C compiler version >7.4, the complicate MPI derived data type - code will work. However, the user should be aware to enlarge MPI_TYPE_MAX environment + code will work. However, the user should be aware to enlarge MPI_TYPE_MAX environment variable to some certian value in order to use collective irregular selection code. - For example, the current parallel HDF5 test needs to enlarge MPI_TYPE_MAX to + For example, the current parallel HDF5 test needs to enlarge MPI_TYPE_MAX to 200,000 to make the test pass. -* 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 +* 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. + 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 @@ -1300,7 +1300,7 @@ Known Problems 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 + 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 @@ -1318,7 +1318,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on IBM SP2 platform for the serial mode. The parallel mode works fine with this option. - + It is suggested that you don't use this option on these platforms during configuration. @@ -1327,7 +1327,7 @@ Known Problems 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. @@ -1347,7 +1347,7 @@ Known Problems the different precision in the values displayed and h5ls appears to be dumping floating-point numbers correctly. -* Before building HDF5 F90 Library from source on Crays +* Before building HDF5 F90 Library from source on Crays replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src subdirectory in the top level directory with the Cray-specific files from this site: @@ -1362,7 +1362,7 @@ Known Problems * 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 + complaining about exit subroutine. Comment out the line IF (total_error .ne. 0) CALL exit (total_error) * On IA32 and IA64 systems, if you use a compiler other than GCC (such as @@ -1386,28 +1386,28 @@ Known Problems 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 + 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 + 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. + 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 + 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. + 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 + 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. @@ -1429,11 +1429,11 @@ Known Problems 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 + 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 + 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 @@ -1453,16 +1453,16 @@ HDF5 version 1.6.7 released on Thu Jan 31 21:09:10 CST 2008 INTRODUCTION ============ -This document describes the differences between HDF5-1.6.6 and HDF5-1.6.7 +This document describes the differences between HDF5-1.6.6 and HDF5-1.6.7 It contains information on the platforms tested and known problems in HDF5-1.6.7. For more details, check the HISTORY.txt file in the HDF5 source. HDF5 documentation can be found in the distributed release source code -in the subdirectory doc/html/ or on the THG (The HDF Group) FTP server: +in the subdirectory doc/html/ or on the THG (The HDF Group) FTP server: ftp://ftp.hdfgroup.org/HDF5/docs/ -Documentation for the current release in the HDF5 Release 1.6.x series is +Documentation for the current release in the HDF5 Release 1.6.x series is also on the HDF web site: http://hdfgroup.org/HDF5/doc1.6/ @@ -1492,7 +1492,7 @@ New Features ============ Configuration: ------------------------- - '--enable-stream-vfd' and '--disable-stream-vfd' are no longer valid + '--enable-stream-vfd' and '--disable-stream-vfd' are no longer valid configure options because the stream I/O driver has ben removed from the distribution. @@ -1502,12 +1502,12 @@ New Features -------- The stream I/O driver is not included with the HDF5 Library in this release. The source code files hdf5/src/H5FDstream.c and - hdf5/src/H5FDstream.h and the driver ENUM value H5FD_STREAM have been + hdf5/src/H5FDstream.h and the driver ENUM value H5FD_STREAM have been removed. Parallel Library: ----------------- - None + None Tools: ------ @@ -1533,9 +1533,9 @@ Bug Fixes since HDF5-1.6.6 Release Library ------- - - H5Iget_name could not be used with an object identifier returned - by H5Rdereference; the function would not be able to determine - a valid object name. It has been fixed. SLU - 2008/1/30 + - H5Iget_name could not be used with an object identifier returned + by H5Rdereference; the function would not be able to determine + a valid object name. It has been fixed. SLU - 2008/1/30 - Changed library's behavior for reading files that might have corrupted object header information from a previous (buggy) version of the library. By default, the library now rebuilds the @@ -1557,15 +1557,15 @@ Bug Fixes since HDF5-1.6.6 Release Performance ------------- None - + Tools ----- None - Documentation - ------------- + Documentation + ------------- None @@ -1573,7 +1573,7 @@ Bug Fixes since HDF5-1.6.6 Release ------- None - + C++ API ------- None @@ -1581,13 +1581,13 @@ Bug Fixes since HDF5-1.6.6 Release Documentation ============= - HDF5 documentation can be found in the distributed release source - code in the subdirectory doc/html/ (start with index.html) or on the - THG (The HDF Group) FTP server: + HDF5 documentation can be found in the distributed release source + code in the subdirectory doc/html/ (start with index.html) or on the + THG (The HDF Group) FTP server: ftp://ftp.hdfgroup.org/HDF5/docs/ - Online documentation for the current release in the HDF5 Release 1.6.x + Online documentation for the current release in the HDF5 Release 1.6.x series can be found on the THG web site: http://hdfgroup.org/HDF5/doc1.6/ @@ -1596,9 +1596,9 @@ Documentation in the document "HDF5 Software Changes from Release to Release": http://hdfgroup.org/HDF5/doc1.6/ADGuide/Changes.html - - Since the stream I/O driver is not included in this release, the - functions H5Pset_fapl_stream and H5Pget_fapl_stream and the stream + + Since the stream I/O driver is not included in this release, the + functions H5Pset_fapl_stream and H5Pget_fapl_stream and the stream ENUM value H5FD_STREAM have been removed from the documentation. @@ -1622,20 +1622,20 @@ Platforms Tested Linux 2.6.9-42.0.10.ELsmp #1 gcc (GCC) 3.4.6 SMP i686 i386 G95 (GCC 4.0.3 (g95 0.91!) April 18 2007) - (kagiso) PGI C, Fortran, C++ 7.0-7 32-bit - Intel(R) C Compiler for 32-bit - applications, Version 9.1 - Intel(R) C++ Compiler for 32-bit + (kagiso) PGI C, Fortran, C++ 7.0-7 32-bit + Intel(R) C Compiler for 32-bit + applications, Version 9.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 9.1 + Intel(R) Fortran Compiler for 32-bit applications, Version 9.1 - Intel(R) Fortran Compiler for 32-bit - applications, Version 9.1 Absoft 32-bit Fortran 95 10.0.4 - MPICH mpich2-1.0.6p1 compiled with - gcc 4.2.1 and G95 (GCC 4.0.3 (g95 0.91!) + MPICH mpich2-1.0.6p1 compiled with + gcc 4.2.1 and G95 (GCC 4.0.3 (g95 0.91!) Linux 2.6.16.46-0.12-debug #1 Intel(R) C++ Version 10.0.025 SMP ia64 GNU/Linux Intel(R) Fortran Itanium(R) Version 10.0.025 - (ucar hir1) + (ucar hir1) Linux 2.6.16.46-0.14-smp #1 Intel(R) C++ for Intel(R) EM64T Ver. 9.1.037 SMP x86_64 GNU/Linux Intel(R) Fortran Intel(R) EM64T Ver. 9.1.031 @@ -1654,7 +1654,7 @@ Platforms Tested SunOS 5.10 32- and 64-bit Sun WorkShop 6 update 2 C 5.8 (linew) Sun WorkShop 6 update 2 Fortran 95 8.2 Sun WorkShop 6 update 2 C++ 5.8 - Patch 121019-06 + Patch 121019-06 Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre (tungsten) Intel(R) C++ Version 9.0 @@ -1724,34 +1724,34 @@ SuSE Linux 2.4 ia64 C y y y y y y SuSe Linux 2.6.5 SGI Altix ia64 n y n y y y -Platform Shared static- Thread- - libraries(4) exec safe -Solaris2.8 32- and 64-bit y n y -Solaris2.10 32- and 64-bit y n y -IRIX64_6.5 32-bit y n y -IRIX64_6.5 64-bit y n y -WinXP Visual Studio 6.0 y n n -WinXP CYGWIN y n n -WinXP 2005 y n n -WinXP .Net y n n -WinVista 2005 y n n -Mac OS X 10.4.10 y n n -AIX-5.2 & 5.3 32- and 64-bit n n n -FreeBSD 6.2 32- and 64-bit y n n -RedHat Linux 2.4.21 W y n n -SuSE Linux 2.6.9-42 i686 GNU (1) W y n y -SuSE Linux 2.6.9-42 i686 Intel W y n n -SuSE Linux 2.6.9-42 i686 PGI W n n n -SuSE Linux 2.6.16 x86_64 GNU (1) W y n y -SuSE Linux 2.6.16 x86_64 Intel W y n n -SuSE Linux 2.6.16 x86_64 PGI W n n n -RHEL 4 Linux 2.6.9 Xeon Lustre C y n n -RedHat Linux 2.4 Xeon Lustre C y n n -SuSE Linux 2.4 ia64 C y n n -SuSe Linux 2.6.5 SGI Altix ia64 n n n - -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +Platform Shared static- Thread- + libraries(4) exec safe +Solaris2.8 32- and 64-bit y n y +Solaris2.10 32- and 64-bit y n y +IRIX64_6.5 32-bit y n y +IRIX64_6.5 64-bit y n y +WinXP Visual Studio 6.0 y n n +WinXP CYGWIN y n n +WinXP 2005 y n n +WinXP .Net y n n +WinVista 2005 y n n +Mac OS X 10.4.10 y n n +AIX-5.2 & 5.3 32- and 64-bit n n n +FreeBSD 6.2 32- and 64-bit y n n +RedHat Linux 2.4.21 W y n n +SuSE Linux 2.6.9-42 i686 GNU (1) W y n y +SuSE Linux 2.6.9-42 i686 Intel W y n n +SuSE Linux 2.6.9-42 i686 PGI W n n n +SuSE Linux 2.6.16 x86_64 GNU (1) W y n y +SuSE Linux 2.6.16 x86_64 Intel W y n n +SuSE Linux 2.6.16 x86_64 PGI W n n n +RHEL 4 Linux 2.6.9 Xeon Lustre C y n n +RedHat Linux 2.4 Xeon Lustre C y n n +SuSE Linux 2.4 ia64 C y n n +SuSe Linux 2.6.5 SGI Altix ia64 n n n + +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, compilers used are the system compilers. Footnotes: @@ -1763,13 +1763,13 @@ Known Problems * We discovered two problems when running collective IO parallel HDF5 tests with chunking storage with the ChaMPIon MPI compiler on tungsten, a Linux cluster at NCSA. - Under some complex selection cases, + Under some complex selection cases, 1) MPI_Get_element returns the wrong value. - 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt data may be generated. This only happens when turning on collective IO with chunking storage - with some complex selections. We haven't found these problems on other - MPI-IO compilers. If you encounter these problems, you may use Independent + with some complex selections. We haven't found these problems on other + MPI-IO compilers. If you encounter these problems, you may use Independent IO instead. To avoid this problem, change the following line in your code: @@ -1777,7 +1777,7 @@ Known Problems to H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); - + KY - 2007/08/24 * QSC (an HP alpha-based OSF1 cluster) does not create h5pfc correctly. It @@ -1790,7 +1790,7 @@ Known Problems "523648:lt-h5repacktst: rld: Fatal Error: Cannot Successfully map soname 'libh5test.so.1' under any of the filenames .......(bunch of directories) " - And the testing will fail. + And the testing will fail. We believe this is a libtool problem. One way to get rid of this is to add the paths of libh5test.so.1 and libh5.so.1 to the shared library path. @@ -1804,15 +1804,15 @@ Known Problems setenv LD_LIBRARY64_PATH ......(existing paths):[full path of HDF5 directory/test/.libs]:[full path of HDF5 directory/src/.libs] - NOTE: This problem ONLY affects the testing of the HDF5 library when you - build from source. It won't affect any applications that would like to link - with the HDF5 shared library since the shared library path needs to be set + NOTE: This problem ONLY affects the testing of the HDF5 library when you + build from source. It won't affect any applications that would like to link + with the HDF5 shared library since the shared library path needs to be set anyway. KY - 2007/8/2 * QSC (an HP alpha-based OSF1 cluster) failed the testpar/testphdf5 sub-test - "calloc". All other tests passed. This indicates that a dataset using - chunked storage created by serial HDF5 may not work properly with parallel - HDF5. The calloc test can be skipped by running "prun ... testphdf5 -x + "calloc". All other tests passed. This indicates that a dataset using + chunked storage created by serial HDF5 may not work properly with parallel + HDF5. The calloc test can be skipped by running "prun ... testphdf5 -x calloc". AKC - 2007/7/12. * The Intel C Compiler for the Linux x86_64 platform (EM64T-based, v8.1) has @@ -1821,30 +1821,30 @@ Known Problems PROD_CFLAGS from -O3 to -O0. Then run configure. AKC - 2005/11/10. * When testing parallel HDF5 with the C compiler version MIPSpro 7.4.3 on IRIX - 6.5, set the environment variable MPI_TYPE_MAX to be a bigger number, for - example 120000, in order to pass the complicated collective IO tests inside - the parallel HDF5 library. This is not a problem inside the parallel HDF5 + 6.5, set the environment variable MPI_TYPE_MAX to be a bigger number, for + example 120000, in order to pass the complicated collective IO tests inside + the parallel HDF5 library. This is not a problem inside the parallel HDF5 library. You can always set a bigger number on your system. KY - 2005/10/6 -* A contiguous or chunked dataset created by a sequential version of HDF5 - might not be able to be modified with a parallel version of the library. - Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the +* A contiguous or chunked dataset created by a sequential version of HDF5 + might not be able to be modified with a parallel version of the library. + Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the dataset creation property list to avoid the problem. EIP - 2005/09/09 -* A 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 (a 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. HDF5 library releases - after 1.6.4 can still read datasets created or rewritten with an HDF5 +* A 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 (a 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. HDF5 library releases + after 1.6.4 can still read datasets created or rewritten with an HDF5 library of v1.6.2 or before. SLU - 2005/7/8 * For version 6 (6.02 and 6.04) of the Portland Group compiler on AMD Opteron processor, there's a bug in the compiler for optimization(-O2). The library - failed in several tests, all related to the multi driver. The problem has - been reported to the vendor. + failed in several tests, all related to the multi driver. The problem has + been reported to the vendor. * test/big fails sometimes with the message "Possible overlap with another region." The test selects regions randomly, and this error occurs when @@ -1852,7 +1852,7 @@ Known Problems HDF5. Since the error is triggered by a random situation, it will usually disappear if the test is re-run. -* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but +* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but have a "guard" statement in stdint.h that will #error and skip the rest of the header file if the C99 option is not used explicitly. Hardsetting $CC to c99 will resolve the problem. AKC - 2004/12/13 @@ -1863,11 +1863,11 @@ Known Problems and run the tests again. The tests may also fail with messages like "The socket name is already - in use". HDF5 does not use sockets. This is due to problems of the - poe command trying to set up the debug socket. Check whether there are - many old /tmp/s.pedb.* files 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 means + in use". HDF5 does not use sockets. This is due to problems of the + poe command trying to set up the debug socket. Check whether there are + many old /tmp/s.pedb.* files 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 means to run poe without the debug socket. * The h5dump tests may fail to match the expected output on some platforms @@ -1885,7 +1885,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on the HPUX 11.00. - + It is suggested that you don't use this option on these platforms during configuration. @@ -1899,9 +1899,9 @@ Known Problems long long (absolute values less than 1**-308) to double. This triggers the test/dtypes to report failure in the following test: Testing random sw long double -> double conversions - If -ieee is used, the converted doubles spread over the range 0.0 to - 10**-308. If -ieee is not used, the converted double values are mostly - 0.0, but occasionally appear as 10**-308. This has been reported to the + If -ieee is used, the converted doubles spread over the range 0.0 to + 10**-308. If -ieee is not used, the converted double values are mostly + 0.0, but occasionally appear as 10**-308. This has been reported to the system staff. All other tests have passed. @@ -1975,8 +1975,8 @@ HDF5-1.6.6 It contains information on the platforms tested and known problems in HDF5-1.6.6. For more details, check the HISTORY.txt file in the HDF5 source. -HDF5 documentation can be found in the distributed release source -code in the subdirectory doc/html/ or on the THG (The HDF Group) +HDF5 documentation can be found in the distributed release source +code in the subdirectory doc/html/ or on the THG (The HDF Group) ftp server (ftp.hdfgroup.org) in the directory: /HDF5/docs/ @@ -2020,28 +2020,28 @@ New Features Parallel Library: ----------------- - None - + Tools: ------ - h52gif and gif2h5: Both these tools were revised to include High Level Image API support. Tests were added to /hl/tools/gif2h5. PVN - 2007/04/13 - - h5dump: Added support for double long type H5T_NATIVE_LDOUBLE. + - h5dump: Added support for double long type H5T_NATIVE_LDOUBLE. PVN - 2007/03/13 - h5dump: Added support for binary output; see usage. PVN 2007/03/13 - h5repack: Added support for reading and writing by hyperslabs for large files. PVN - 2007/03/01 - h5repack: A new option allows the copy to use the source file type - (default) instead of the previous conversion to native type. + (default) instead of the previous conversion to native type. PVN - 2007/03/01 - - h5repack: Added output of the percentage of compression achieved. + - h5repack: Added output of the percentage of compression achieved. PVN - 2007/03/01 - h5diff: Added support for comparing dataset regions. PVN - 2007/02/20 - - h5diff: Added support for reading and comparing by hyperslabs for + - h5diff: Added support for reading and comparing by hyperslabs for large files. PVN - 2007/02/20 - h5diff: Added printing of dataset dimensions along with dataset - name. + name. PVN - 2007/02/19 F90 API: @@ -2057,7 +2057,7 @@ Support for New Platforms, Languages and Compilers ================================================== - Added support for MAC Intel (Darwin 8.8.2) (gcc 4.0.1 and g95 0.91) EIP - 2007/02/13 - - Added support for GNU C compiler version 4.2.1 for FreeBSD 6.2 + - Added support for GNU C compiler version 4.2.1 for FreeBSD 6.2 (32- and 64-bit) @@ -2070,8 +2070,8 @@ Bug Fixes since HDF5-1.6.5 Release a variable-length datatype or component datatype. QAK - 2007/06/19 - STDIO driver didn't support files bigger than 2GB because the OFFSET - parameter of fseek is of type LONG INT, not big enough for big - files. Use fseeko instead for big files if it's available on the + parameter of fseek is of type LONG INT, not big enough for big + files. Use fseeko instead for big files if it's available on the system. SLU - 2007/4/5 - Relaxed restrictions on attribute operations to allow a file ID to be used as the "location ID". If a file ID is used, the attribute @@ -2129,12 +2129,12 @@ corrupt object header - too few messages Configuration ------------- - - Changed to default to --disable-shared if parallel is enabled. + - Changed to default to --disable-shared if parallel is enabled. AKC - 2007/5/12 - Corrected a coding error in configure when it tries to locate the - needed MPI and MPI-IO library for the fortran interface. + needed MPI and MPI-IO library for the fortran interface. AKC - 007/5/9. - - Changed default fortran compiler to g95 when gcc is used. + - Changed default fortran compiler to g95 when gcc is used. AKC - 007/2/17. - Configure can now use any tr command. No more need for defining the variable TR, nor is it supported. AKC - 2006/05/20 @@ -2142,28 +2142,28 @@ corrupt object header - too few messages Performance ------------- - None - + Tools ----- - Fixed a bug in h5dump regarding the display of named datatypes attributes. PVN - 2007/03/13 - - Fixed a bug in h5dump regarding the display of group comments. + - Fixed a bug in h5dump regarding the display of group comments. PVN - 2007/03/13 - - Fixed a bug in h5dump regarding the display of hardlinks pointing + - Fixed a bug in h5dump regarding the display of hardlinks pointing to the root group. PVN - 2007/03/13 - Fixed a bug in the h5diff percentage option -p. PVN - 2007/03/05 - Fixed a bug in h5dump that caused array indices greater than 2^32-1 not to be printed correctly. PVN - 2007/2/19 - Documentation - ------------- - - Corrected errors and extended the descriptions in Reference Manual - entries for several functions. + Documentation + ------------- + - Corrected errors and extended the descriptions in Reference Manual + entries for several functions. F90 API ------- - None - + C++ API ------- - Changed @@ -2193,13 +2193,13 @@ DataSpace& Documentation ============= - HDF5 documentation can be found in the distributed release source - code in the subdirectory doc/html/ (start with index.html) or on the + HDF5 documentation can be found in the distributed release source + code in the subdirectory doc/html/ (start with index.html) or on the THG (The HDF Group) ftp server (ftp.hdfgroup.org) in the directory: /HDF5/docs/ - Online documentation for the current release can be found on the THG + Online documentation for the current release can be found on the THG web site: http://hdfgroup.org/HDF5/doc/ @@ -2235,17 +2235,17 @@ Platforms Tested Linux 2.6.9-42.0.10.ELsmp #1 gcc (GCC) 3.4.6 SMP i686 i386 G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) - (kagiso) PGI C, Fortran, C++ 6.2-5 32-bit - icc (ICC) 9.1 - Intel(R) C++ Compiler for 32-bit + (kagiso) PGI C, Fortran, C++ 6.2-5 32-bit + icc (ICC) 9.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 9.1 + Intel(R) Fortran Compiler for 32-bit applications, Version 9.1 - Intel(R) Fortran Compiler for 32-bit - applications, Version 9.1 Absoft 32-bit Fortran 95 10.0.4 - MPICH mpich2-1.0.4p1 compiled with - gcc 3.4.6 and G95 (GCC 4.0.3 (g95 0.91!) + MPICH mpich2-1.0.4p1 compiled with + gcc 3.4.6 and G95 (GCC 4.0.3 (g95 0.91!) - Linux 2.6.16.46-0.12-debug #1 + Linux 2.6.16.46-0.12-debug #1 SMP ia64 GNU/Linux Intel(R) C++ Version 10.0.025 (ucar hir1) Intel(R) Fortran Itanium(R) Version 10.0.025 @@ -2255,14 +2255,14 @@ Platforms Tested for 64-bit target on x86-64 tested for both 32- and 64-bit binaries - Linux 2.6.5-7.283-rtgfx Altix + Linux 2.6.5-7.283-rtgfx Altix SMP ia64 Intel(R) C++ Version 9.0 (cobalt) Intel(R) Fortran Itanium(R) Version 9.0 SGI MPI - OSF1 V5.1 (QSC) Compaq C V6.5-011 + OSF1 V5.1 (QSC) Compaq C V6.5-011 (See "Known Problems.") HP Fortran V5.5A-3548 - Compaq C++ V6.5-036 + Compaq C++ V6.5-036 MPIX200_64_r13.4 SunOS 5.8 32- and 64-bit Sun WorkShop 6 update 2 C 5.3 @@ -2272,7 +2272,7 @@ Platforms Tested SunOS 5.10 32- and 64-bit Sun WorkShop 6 update 2 C 5.8 (linew) Sun WorkShop 6 update 2 Fortran 95 8.2 Sun WorkShop 6 update 2 C++ 5.8 - Patch 121019-06 + Patch 121019-06 Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre (tungsten) Intel(R) C++ Version 9.0 @@ -2371,13 +2371,13 @@ SuSe Linux 2.6.16 SGI Altix ia64 n n n y SuSe Linux 2.6.5 SGI Altix ia64 n n n y OSF1 v5.1 n n n y -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, compilers used are the system compilers. Footnotes: (1) Fortran compiled with g95. -(2) In most cases, shared libraries are provided only for the C library, +(2) In most cases, shared libraries are provided only for the C library, except on Windows where they are provided for C, C++, and Fortran. (3) C++ works only with static libraries. @@ -2394,7 +2394,7 @@ Known Problems "523648:lt-h5repacktst: rld: Fatal Error: Cannot Successfully map soname 'libh5test.so.1' under any of the filenames .......(bunch of directories) " - And the testing will fail. + And the testing will fail. We believe this is a libtool problem. One way to get rid of this is to add the paths of libh5test.so.1 and libh5.so.1 to the shared library path. @@ -2407,15 +2407,15 @@ Known Problems setenv LD_LIBRARY64_PATH ......(existing pathes):[full path of HDF5 directory/test/.libs]:[full path of HDF5 directory/src/.libs] - NOTE: This problem ONLY affects the testing of the HDF5 library when you - build from source. It won't affect any applications that would like to link - with the HDF5 shared library since the shared library path needs to be set + NOTE: This problem ONLY affects the testing of the HDF5 library when you + build from source. It won't affect any applications that would like to link + with the HDF5 shared library since the shared library path needs to be set anyway. KY - 2007/8/2 * QSC (an HP alpha-based OSF1 cluster) failed the testpar/testphdf5 sub-test - "calloc". All other tests passed. This indicates that a dataset using - chunked storage created by serial HDF5 may not work properly with parallel - HDF5. The calloc test can be skipped by running "prun ... testphdf5 -x + "calloc". All other tests passed. This indicates that a dataset using + chunked storage created by serial HDF5 may not work properly with parallel + HDF5. The calloc test can be skipped by running "prun ... testphdf5 -x calloc". AKC - 2007/7/12. * The Intel C Compiler for the Linux x86_64 platform (EM64T-based, v8.1) has @@ -2424,30 +2424,30 @@ Known Problems PROD_CFLAGS from -O3 to -O0. Then run configure. AKC - 2005/11/10. * When testing parallel HDF5 with the C compiler version MIPSpro 7.4.3 on IRIX - 6.5, set the environment variable MPI_TYPE_MAX to be a bigger number, for - example 120000, in order to pass the complicated collective IO tests inside - the parallel HDF5 library. This is not a problem inside the parallel HDF5 + 6.5, set the environment variable MPI_TYPE_MAX to be a bigger number, for + example 120000, in order to pass the complicated collective IO tests inside + the parallel HDF5 library. This is not a problem inside the parallel HDF5 library. You can always set a bigger number on your system. KY - 2005/10/6 -* A contiguous or chunked dataset created by a sequential version of HDF5 - might not be able to be modified with a parallel version of the library. - Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the +* A contiguous or chunked dataset created by a sequential version of HDF5 + might not be able to be modified with a parallel version of the library. + Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the dataset creation property list to avoid the problem. EIP - 2005/09/09 -* 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 (a 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 +* 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 (a 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/7/8 * For version 6 (6.02 and 6.04) of the Portland Group compiler on AMD Opteron processor, there's a bug in the compiler for optimization(-O2). The library - failed in several tests, all related to the multi driver. The problem has - been reported to the vendor. + failed in several tests, all related to the multi driver. The problem has + been reported to the vendor. * test/big fails sometimes with the message "Possible overlap with another region." The test selects regions randomly, and this error occurs when @@ -2455,7 +2455,7 @@ Known Problems HDF5. Since the error is triggered by a random situation, it will usually disappear if the test is re-run. -* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but +* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but have a "guard" statement in stdint.h that will #error and skip the rest of the header file if the C99 option is not used explicitly. Hardsetting $CC to c99 will resolve the problem. AKC - 2004/12/13 @@ -2468,7 +2468,7 @@ Known Problems The tests may also 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 whether there are many old /tmp/s.pedb.* files staying around. These + Check whether there are many old /tmp/s.pedb.* files 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 means to run poe without the debug socket. @@ -2494,7 +2494,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on the HPUX 11.00. - + It is suggested that you don't use this option on these platforms during configuration. @@ -2510,9 +2510,9 @@ Known Problems long long (absolute values less than 1**-308) to double. This triggers the test/dtypes to report failure in the following test: Testing random sw long double -> double conversions - If -ieee is used, the converted doubles spread over the range 0.0 to - 10**-308. If -ieee is not used, the converted double values are mostly - 0.0, but occasionally appear as 10**-308. This has been reported to the + If -ieee is used, the converted doubles spread over the range 0.0 to + 10**-308. If -ieee is not used, the converted double values are mostly + 0.0, but occasionally appear as 10**-308. This has been reported to the system staff. All other tests have passed. @@ -2637,7 +2637,7 @@ New Features Library: -------- - Added HSYS_ERROR which retrieves the system error message and pushes - it to the error stack. This provides more information regarding the + it to the error stack. This provides more information regarding the failed system call. AKC - 2005/08/04 - Added H5F_OBJ_LOCAL flag to H5Fget_obj_count() & H5Fget_obj_ids(), to allow querying for objects in a file that was opened with a particular @@ -2650,9 +2650,9 @@ New Features - HDF5 supports collective MPI-IO for irregular selection with HDF5 dataset. Irregular selection is when users use API H5Sselect_hyperslab more than once for the same dataset. - Currently, not all MPI-IO packages support the complicated - MPI derived datatypes used in the implementation of irregular - selections INSIDE HDF5. + Currently, not all MPI-IO packages support the complicated + MPI derived datatypes used in the implementation of irregular + selections INSIDE HDF5. 1) DEC 5.x wdoes not support complicated derived datatypes. 2) For AIX 5.1: If your poe version number is 3.2.0.20 or lower, @@ -2666,15 +2666,15 @@ New Features If mpich version is 1.2.5 or lower, collective irregular selection IO is not supported; internally independent IO is used. 4) For IRIX 6.5: - if C compiler version is 7.3 or lower, collective irregular + if C compiler version is 7.3 or lower, collective irregular selection IO is not supported; internally independent IO is used. - 5) For platforms which internally used mpich: - If the mpich version is 1.2.5 or lower, please find the + 5) For platforms which internally used mpich: + If the mpich version is 1.2.5 or lower, please find the corresponding config (in hdf5/config) file and add - hdf5_mpi_complex_derived_datatype_works='no' - at the end of the configuration file. For example, on the - NCSA SGI Altix, the internal mpich library is 1.2.5. So - hdf5_mpi_complex_derived_datatype_works='no' + hdf5_mpi_complex_derived_datatype_works='no' + at the end of the configuration file. For example, on the + NCSA SGI Altix, the internal mpich library is 1.2.5. So + hdf5_mpi_complex_derived_datatype_works='no' should be added at the end of the config file ia64-linux-gnu. KY - 2005/09/12 @@ -2708,9 +2708,9 @@ Support for New Platforms, Languages and Compilers - Added support for RedStorm platform (serial only.) AKC 2005/11/10 - Added support for BG/L platform (serial only.) LA 2005/11/10 - Added support for HPUX 11.23 (IA64); only C and C++ are supported - with the +DD64 flag + with the +DD64 flag EIP 2005/10/05 - + Configuration ------------- @@ -2722,8 +2722,8 @@ Bug Fixes since HDF5-1.6.4 Release Library ------- - - Fixed collective IO in chunking-storage. HDF5 may have called the - wrong routine when the shape of the dataspace in the file and in + - Fixed collective IO in chunking-storage. HDF5 may have called the + wrong routine when the shape of the dataspace in the file and in the bufferred chunk were different. This bug was fixed to make sure the correct routine is called. KY - 2005/10/19 - Fixed core dump when closing root groups opened through two different @@ -2777,23 +2777,23 @@ Bug Fixes since HDF5-1.6.4 Release Performance ------------- - - Optimized I/O for enumerated datatypes that are a superset of a + - Optimized I/O for enumerated datatypes that are a superset of a source enumerated datatype. QAK - 2005/03/19 - + Tools ----- - Documentation - ------------- + Documentation + ------------- F90 API ------- - h5pget_driver_f was returning information that could not be interpreted by a Fortran application program; fixed. EIP - 2005/04/10 - + C++ API ------- - - Several member functions' prototype changed due to the + - Several member functions' prototype changed due to the "int -> unsigned" change in the main library. They are: H5::CompType::getMemberDataType(unsigned member_num) H5::CompType::getMemberCompType(unsigned member_num) @@ -2805,7 +2805,7 @@ Bug Fixes since HDF5-1.6.4 Release - + Platforms Tested ================ @@ -2839,7 +2839,7 @@ Platforms Tested FreeBSD 4.11 gcc 2.95.4 g++ 2.95.4 gcc 3.2.3, 3.3.6, 3.4.4, 4.0.0 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 HP ANSI C++ B3910B A.03.13 HP-UX B.11.23 HP aC++/ANSI C B3910B A.06.00 @@ -2854,27 +2854,27 @@ Platforms Tested mpt 1.6 Linux 2.4.20-28.7 gcc 2.96 (eirene, verbena) gcc 3.3.2 - PGI compilers (pgcc, pgf90, pgCC) + PGI compilers (pgcc, pgf90, pgCC) version 5.2-1 Absoft Fortran compiler v9.0 Intel(R) C++ 32-bit Version 8.1 Intel(R) Fortran 32-bit Version 8.1 MPIch 1.2.6 Linux 2.4.21-268-smp x86_64 gcc 3.3.1 (SuSE Linux, AMD) - (mir) PGI 5.2-1 C and F90 (with k3-32) + (mir) PGI 5.2-1 C and F90 (with k3-32) Intel(R) C++ 32-bit Version 8.1 Intel(R) Fortran 32-bit Version 8.1 - Linux 2.4.21-sgi306rp21 Altix + Linux 2.4.21-sgi306rp21 Altix SMP ia64 Intel(R) C++ Version 8.1 (cobalt) Intel(R) Fortran Itanium(R) Version 8.1 SGI MPI - OSF1 V5.1 (QSC) Compaq C V6.5-011 + OSF1 V5.1 (QSC) Compaq C V6.5-011 HP Fortran V5.5A-3548 - Compaq C++ V6.5-036 + Compaq C++ V6.5-036 MPIX200_64_r13.4 - OSF1 V5.1 (PSC) Compaq C V6.5-303 + OSF1 V5.1 (PSC) Compaq C V6.5-303 HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 + Compaq C++ V6.5-040 SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 Sun WorkShop 6 update 2 C++ 5.3 @@ -2884,7 +2884,7 @@ Platforms Tested SunOS 5.10 Sun WorkShop 6 update 2 C 5.3 Sun WorkShop 6 update 2 Fortran 95 6.2 Sun WorkShop 6 update 2 C++ 5.3 - Patch 111685-13 + Patch 111685-13 Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre (tungsten) Intel(R) C++ Version 9.0 Intel(R) Fortran Compiler Version 9.0 @@ -2896,9 +2896,9 @@ Platforms Tested MSVC++ 6.0 Intel 8.1 C++ MAC OS X Darwin 7.5 - gcc and g++ Apple Computer, Inc. GCC + gcc and g++ Apple Computer, Inc. GCC version 1175, based on gcc version 3.3.2 - IBM XL Fortran version 8.1 + IBM XL Fortran version 8.1 Absoft Fortran compiler v8.2 @@ -2912,7 +2912,7 @@ Key: y = tested and supported ( ) = footnote appears below second table Platform C F90 F90 C++ zlib SZIP - parallel parallel + parallel parallel IBM BG/L (16) n n n n y y Solaris2.8 64-bit y y y(1) y y y Solaris2.8 32-bit y y y(1) y y y @@ -2944,8 +2944,8 @@ Linux 2.4 SuSE ia64 C Intel (3,7) y y y y y y Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y -Platform Shared static- Thread- STREAM- - libraries(4) exec safe VFD +Platform Shared static- Thread- STREAM- + libraries(4) exec safe VFD IBM BG/L n y n n Solaris2.8 64-bit y x y y Solaris2.8 32-bit y x y y @@ -2976,28 +2976,28 @@ Linux 2.4 SuSE ia64 C Intel (3,7) y y n n Linux 2.4 SGI Altix ia64 Intel (3) y y n y -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, compilers used are the system compilers. Footnotes: (1) Using mpich 1.2.6 (2) Using mpt and mpich 1.2.6. - (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. + (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. W or C indicates workstation or cluster, respectively. - (4) Shared libraries are provided only for the C library, + (4) Shared libraries are provided only for the C library, except on Windows where they are provided for C and C++. (5) Using mpt. - (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp-perfctr-lustre + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp-perfctr-lustre and Intel compilers (7) Linux 2.4.21, SuSE_292.til1. Ia64 cluster with Intel compilers (8) Intel 8.1 (9) One test of this release failed with Compaq Visual Fortran 6.6c. No binary fortran release will be provided. Users should build - the library by themselves and use it at their own risk. - We recommend that users use HDF5 1.7 instead + the library by themselves and use it at their own risk. + We recommend that users use HDF5 1.7 instead or use Compaq Visual Fortran 6.0. (10) IBM XLF and Absoft - (11) PGI, Absoft. No shared libraries with Absoft; + (11) PGI, Absoft. No shared libraries with Absoft; use '--disable-shared'. (12) PGI and Intel compilers for both C and Fortran (13) AMD Opteron x86_64 @@ -3014,43 +3014,43 @@ Known Problems configure, edit the file config/intel-flags by changing the setting of PROD_CFLAGS from -O3 to -O0, then run configure. AKC - 2005/11/10. -* Fortran testing and compiling failures on windows XP +* Fortran testing and compiling failures on windows XP 1. Compaq visual fortran 6.6c with VS 6.0 The Fortran tests failed for both release, release dll, debug and debug dll. The failure is a random one. We won't provide fortran libraries. The - same test passed with the 1.7.51 snapshot. You may find the 1.7.51 + same test passed with the 1.7.51 snapshot. You may find the 1.7.51 snapshot under ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/snapshots/. 2. Intel fortran 8.1 under .Net environment The fortran library cannot even be compiled. Some users have pointed this to intel forum. * When testing parallel HDF5 with the C compiler version MIPSpro 7.4.3 at IRIX - 6.5, set enviroment variable MPI_TYPE_MAX to be a bigger number, for example - 120000, in order to pass the complicated collective IO tests inside parallel - HDF5 library. This is not a problem inside parallel HDF5 library. You can + 6.5, set enviroment variable MPI_TYPE_MAX to be a bigger number, for example + 120000, in order to pass the complicated collective IO tests inside parallel + HDF5 library. This is not a problem inside parallel HDF5 library. You can always set a bigger number in your system. KY - 2005/10/6 * A contiguous or chunked dataset created by a sequential version may - not be modified with a parallel version of the library. - Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the + not be modified with a parallel version of the library. + Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the dataset creation property list to avoid the problem. EIP - 2005/09/09 -* 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 +* 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/7/8 * For version 6 (6.02 and 6.04) of the 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. + failed in several tests but all related to multi driver. The problem has + been reported to the vendor. * test/big fails sometimes with the message "Possible overlap with another region." The test selects regions randomly, and this error occurs when @@ -3075,9 +3075,9 @@ Known Problems Ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. -* Two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) - failed on windows xp with .NET for debug and debug dll. Release and - Release dll work fine. +* Two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) + failed on windows xp with .NET for debug and debug dll. Release and + Release dll work fine. * The h5dump tests may fail to match the expected output on some platforms (e.g. parallel jobs, Windows) where the error messages directed to @@ -3100,14 +3100,14 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on the HPUX 11.00. - + It is suggested that you don't use this option on these platforms during configuration. * The Stream VFD was not tested yet under Windows. -* Before building HDF5 F90 Library from source on Crays +* Before building HDF5 F90 Library from source on Crays replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src subdirectory in the top level directory with the Cray-specific files from the site: @@ -3129,10 +3129,10 @@ Known Problems All other tests have passed. * Fortran release DLL randomly failed with Compaq Visual Fortran 6.6c on - Windows. + Windows. * Fortran DLL built with Intel 8.1 in .NET environment crushed the compiler, - Building Fortran static library with Intel 8.1 in .NET environment + Building Fortran static library with Intel 8.1 in .NET environment requires manually setting the project file. Please contact to hdfhelp@ncsa.uiuc.edu if you need to build Fortran static library with Intel 8.1 with .NET environment. @@ -3213,7 +3213,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -3241,19 +3241,19 @@ New Features For HL documentation, see http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5hl.html. - The HL library, libhdf5_hl.a(so), is built and installed by default. + The HL library, libhdf5_hl.a(so), is built and installed by default. Use --disable-hl configure flag to disable the HL library. Library: -------- - - We recommend you to use SZIP v2.0 with this release. + - We recommend you to use SZIP v2.0 with this release. For more information see - http://hdf.ncsa.uiuc.edu/doc_resource/SZIP/ - - The compound datatype has been enhanced with a new feature of size + http://hdf.ncsa.uiuc.edu/doc_resource/SZIP/ + - The compound datatype has been enhanced with a new feature of size adjustment. The size can be increased and decreased (without - cutting the last member). No API change is involved. SLU - + cutting the last member). No API change is involved. SLU - 2004/10/1 - - Removed PABLO support. 2005/01/20 EIP + - Removed PABLO support. 2005/01/20 EIP Parallel Library: ----------------- @@ -3262,7 +3262,7 @@ New Features Tools: ------ - - New tool, h5jam. See HDF5 Reference Manual. 2004/10/08 + - New tool, h5jam. See HDF5 Reference Manual. 2004/10/08 F90 API: -------- @@ -3271,7 +3271,7 @@ New Features C++ API: -------- - Started using C library's reference counting in place of the class - RefCounter, which existed before the C mechanism was available. + RefCounter, which existed before the C mechanism was available. As a result, RefCounter has been removed. 2005/03/12 BMR @@ -3294,8 +3294,8 @@ Bug Fixes since HDF5-1.6.3 release accessing the file for another purpose (e.g., open with truncate) while other "slower" processes have not closed the same file with the previous purpose. AKC - 2005/03/01 - - H5Tget_member_value calls for enum datatype didn't return correct - value if H5Tenum_valueof was called first. It's fixed. SLU - + - H5Tget_member_value calls for enum datatype didn't return correct + value if H5Tenum_valueof was called first. It's fixed. SLU - 2005/02/08 - For variable-length string, H5Tget_class returned H5T_STRING as its class. But H5Tdetect_class and H5Tget_member_class considered it @@ -3307,7 +3307,7 @@ Bug Fixes since HDF5-1.6.3 release - Fixed segmentation fault when calling H5Fflush with an attribute that hasn't had a value written to it open. QAK - 2004/10/18 - Backed out support for bitfield and time types in H5Tget_native_type. - Leave it to future support. The function simply returns error + Leave it to future support. The function simply returns error message of "not support" for bitfield and time types. SLU - 2004/10/5 - Fixed address check in Core VFL driver to avoid spurious address/size overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 @@ -3328,18 +3328,18 @@ Bug Fixes since HDF5-1.6.3 release ------------- Many changes were made to the library to improve performance, especially for the variable-length datatypes and metadata cache. - + Tools ----- - h5fc and h5c++ work correctly when -c compiler flag - is used. EIP - 2005/03/14 + is used. EIP - 2005/03/14 - Fixed h5dump to print attributes data in ASCII if -r option is used. AKC - 2004/11/18 - - Fixed space utilization reported in h5ls to correct error + - Fixed space utilization reported in h5ls to correct error in formula used. QAK - 2004/10/22 - Documentation - ------------- + Documentation + ------------- F90 API ------- @@ -3356,7 +3356,7 @@ Documentation HDF5 Library documentation -------------------------- - No substantive changes to the structure or types of content in the + No substantive changes to the structure or types of content in the HDF5 Library documentation. Windows installation documentation @@ -3365,10 +3365,10 @@ Documentation either http://www.zlib.net/zlib122-dll.zip or ftp://hdf.ncsa.uiuc.edu/lib-external/zlib/bin/windows - 2. Only DLLs of external libraries (zlib and szip) are linked with the - HDF5 Library. We will no longer provide binary to link static library + 2. Only DLLs of external libraries (zlib and szip) are linked with the + HDF5 Library. We will no longer provide binary to link static library with HDF5. For details, please check INSTALL_Windows in this directory. - + Platforms Tested ================ @@ -3400,7 +3400,7 @@ Platforms Tested FreeBSD 4.9 gcc 2.95.4 g++ 2.95.4 gcc 3.2.3, 3.3.6, 3.4.4, 4.0.0 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 HP ANSI C++ B3910B A.03.13 MPIch 1.2.4 @@ -3413,29 +3413,29 @@ Platforms Tested mpt 1.6 Linux 2.4.20-28.7 gcc 2.96 (eirene, verbena) gcc 3.3.2 - PGI compilers (pgcc, pgf90, pgCC) + PGI compilers (pgcc, pgf90, pgCC) version 5.2-1 Absoft Fortran compiler v9.0 Intel(R) C++ 32-bit Version 8.1 Intel(R) Fortran 32-bit Version 8.1 MPIch 1.2.6 Linux 2.4.21-268-smp x86_64 gcc 3.3.1 (SuSE Linux, AMD) - (mir) PGI 5.2-1 C and F90 (with k3-32) + (mir) PGI 5.2-1 C and F90 (with k3-32) Intel(R) C++ 32-bit Version 8.1 Intel(R) Fortran 32-bit Version 8.1 - Linux 2.4.21-sgi303r2 Altix + Linux 2.4.21-sgi303r2 Altix SMP ia64 Intel(R) C++ Version 8.1 (cobalt) Intel(R) Fortran Itanium(R) Version 8.1 SGI MPI - OSF1 V5.1 (QSC) Compaq C V6.5-011 + OSF1 V5.1 (QSC) Compaq C V6.5-011 HP Fortran V5.5A-3548 - Compaq C++ V6.5-036 + Compaq C++ V6.5-036 MPIX200_64_r13.4 - OSF1 V5.1 (PSC) Compaq C V6.5-303 + OSF1 V5.1 (PSC) Compaq C V6.5-303 HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 + Compaq C++ V6.5-040 MPIX200_64_r13.4 - FORTRAN 90 2.0 Patch 107356-04 + FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 Sun WorkShop 6 update 2 C++ 5.3 @@ -3456,9 +3456,9 @@ Platforms Tested Compaq Visual Fortran 6.6C Intel 8.1 C++ MAC OS X Darwin 7.5 - gcc and g++ Apple Computer, Inc. GCC + gcc and g++ Apple Computer, Inc. GCC version 1175, based on gcc version 3.3.2 - IBM XL Fortran version 8.1 + IBM XL Fortran version 8.1 Absoft Fortran compiler v8.2 @@ -3472,7 +3472,7 @@ Key: y = tested and supported ( ) = footnote appears below second table Platform C F90 F90 C++ zlib SZIP - parallel parallel + parallel parallel Solaris2.8 64-bit y y y(1) y y y Solaris2.8 32-bit y y y(1) y y y Solaris2.9 64-bit y(1) y y(1) y y y @@ -3500,8 +3500,8 @@ Linux 2.4 SuSE ia64 C Intel (3,7) y y y y y y Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y -Platform Shared static- Thread- STREAM- - libraries(4) exec safe VFD +Platform Shared static- Thread- STREAM- + libraries(4) exec safe VFD Solaris2.8 64-bit y x y y Solaris2.8 32-bit y x y y Solaris2.9 64-bit y x y y @@ -3529,24 +3529,24 @@ Linux 2.4 SuSE ia64 C Intel (3,7) y y n n Linux 2.4 SGI Altix ia64 Intel (3) y y n y -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, compilers used are the system compilers. Footnotes: (1) Using mpich 1.2.6 (2) Using mpt and mpich 1.2.6. - (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. + (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. W or C indicates workstation or cluster, respectively. - (4) Shared libraries are provided only for the C library, + (4) Shared libraries are provided only for the C library, except on Windows where they are provided for C and C++. (5) Using mpt. - (6) Linux 2.4.20-31.9. Xeon cluster with smp_perfctr_lustre + (6) Linux 2.4.20-31.9. Xeon cluster with smp_perfctr_lustre and Intel compilers (7) Linux 2.4.21, SuSE_128.befl. Ia64 cluster with Intel compilers (8) Intel 8.1 (9) Compaq Visual Fortran 6.6C (10) IBM XLF and Absoft - (11) PGI, Absoft. No shared libraries with Absoft; + (11) PGI, Absoft. No shared libraries with Absoft; use '--disable-shared'. (12) PGI and Intel compilers for both C and Fortran (13) AMD Opteron x86_64 @@ -3583,12 +3583,12 @@ Known Problems Ask your system administrator to clean them out. Lastly, request IBM to provide a mean to run poe without the debug socket. -* Fortran subroutine h5pget_driver_f doesn't return a correct driver +* Fortran subroutine h5pget_driver_f doesn't return a correct driver information. -* There are two h5dump xml tests(h5dump --xml thlink.h5 and - h5dump --xml tmany.h5) failed on windows xp with .NET for debug and - debug dll. Release and Release dll work fine. +* There are two h5dump xml tests(h5dump --xml thlink.h5 and + h5dump --xml tmany.h5) failed on windows xp with .NET for debug and + debug dll. Release and Release dll work fine. * The h5dump tests may fail to match the expected output on some platforms (e.g. parallel jobs, Windows) where the error messages directed to @@ -3608,7 +3608,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on IBM SP2 platform for the serial mode. The parallel mode works fine with this option. - + It is suggested that you don't use this option on these platforms during configuration. @@ -3627,15 +3627,15 @@ Known Problems the different precision in the values displayed. h5ls appears to be dumping floating-point numbers correctly. -* Before building HDF5 F90 Library from source on Crays +* Before building HDF5 F90 Library from source on Crays replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src subdirectory in the top level directory with the Cray-specific files from the site: ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ -* 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 +* 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) * Use --disable-shared configure flag if building with Absoft Fortran @@ -3660,10 +3660,10 @@ Known Problems setenv CXX "pgCC -tlocal" for others * Fortran release DLL randomly failed with compaq visual fortran 6.6c on - windows. + windows. * Fortran DLL built with Intel 8.1 in .NET environment crushed the compiler, - To build Fortran Static library with Intel 8.1 in .NET environment + To build Fortran Static library with Intel 8.1 in .NET environment needs manually setting the project file, please contact to hdfhelp@ncsa.uiuc.edu if you need to build fortran static library with Intel 8.1 with .NET environment. @@ -3745,7 +3745,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -3776,36 +3776,36 @@ New Features - WINDOWS building,testing and installing improvements - - On Windows, FORTRAN,C++ and C projects are merged into one zip file, - users can choose an option to build either FORTRAN or C++ or both + - On Windows, FORTRAN,C++ and C projects are merged into one zip file, + users can choose an option to build either FORTRAN or C++ or both with basic C library.For detailed information, please read INSTALL_Windows.txt. - On Windows, szip compression library with or without encoder can be easily turned off or on when building HDF5. For detailed information, - please read INSTALL_Windows.txt, especially section V. - + please read INSTALL_Windows.txt, especially section V. + - On Windows, an optional procedure for building,testing and installing HDF5 from command line is provided. This procedure is supposed to be - convenient for experienced users, please read + convenient for experienced users, please read INSTALL_windows_From_Command_Line.txt for details. - On Windows, an alternative short instruction document for building, testing and installing HDF5 is provided. This instruction is supposed to - be convenient for general users, please read + be convenient for general users, please read INSTALL_Windows_Short.txt for details. - On Windows, h5repack,h5diff,h5ls and h5import tool tests have been added. KY - 2004/9/16 - + Library: -------- - Modified the way how HDF5 calculates 'pixels_per_scanline' parameter for - SZIP compression. Now there is no restriction on the size and shape of the - chunk except that the total number of elements in the chunk cannot be + SZIP compression. Now there is no restriction on the size and shape of the + chunk except that the total number of elements in the chunk cannot be bigger than 'pixels_per_block' parameter provided by the user. - EIP - 2004/07/21 + EIP - 2004/07/21 - HDF5 can now link to SZIP with or without szip's encoder. The new API function H5Zget_filter_info can be used to check szip's status. Attempting to assign szip to a dataset property @@ -3829,9 +3829,9 @@ New Features Tools: ------ - - h5repack was added to the tools suite. h5repack regenerates an HDF5 file - from another HDF5 file, optionally applying HDF5 filters (compression) - and/or chunking to the copied file. The filters options are read from + - h5repack was added to the tools suite. h5repack regenerates an HDF5 file + from another HDF5 file, optionally applying HDF5 filters (compression) + and/or chunking to the copied file. The filters options are read from the command line. See /doc/html/Tools.html for more details. PVN - 2004/9/13 @@ -3843,7 +3843,7 @@ New Features 5) Print array indices with the data (the default). These options are all switch controlled. See /doc/html/Tools.html for more details. PVN - 2004/9/13 - + F90 API: -------- @@ -3853,7 +3853,7 @@ New Features h5premove_filter_f h5zget_filter_info_f EIP 2004/9/21 - + - added new h5fget_name_f and h5fget_filesize_f subroutines EIP 2004/07/08 @@ -3872,7 +3872,7 @@ Support for new platforms, languages and compilers. - Added PGI Fortran support for Linux64 (x86_64) systems EIP - 2004/08/19 - Absoft compiler f95 v9.0 is supported on Linux 2.4 32bit - EIP - 2004/07/29 + EIP - 2004/07/29 - HDF5 Fortran APIs are supported on Mac OSX with IBM XL Fortran compiler version 8.1. This is a default compiler. - HDF5 Fortran APIs are supported on MAC OSX with Absoft F95 compiler @@ -3893,9 +3893,9 @@ Bug Fixes since HDF5-1.6.2 release - Corrected error where dataset region references were written in an incorrect way on Cray machines. PVN & QAK - 2004/09/13 - The H5Tget_native_type now determines the native type for integers - based on the precision. This is to avoid cases of wrongly converting + based on the precision. This is to avoid cases of wrongly converting an int to a short in machines that have a short of 8 bytes but with - 32bit precision (e.g Cray SV1). PVN - 2004/09/07 + 32bit precision (e.g Cray SV1). PVN - 2004/09/07 - Changed H5Dread() to not overwrite data in an application's buffer with garbage when accessing a chunked dataset with an undefined fill value and an unwritten chunk is uncountered. QAK - 2004/08/25 @@ -3938,7 +3938,7 @@ Bug Fixes since HDF5-1.6.2 release Fixed. SLU - 2004/06/11 - Fixed potential file corruption bug when a block of metadata could overlap the end of the internal metadata accumulator buffer and - the buffer would be extended correctly, but would incorrectly + the buffer would be extended correctly, but would incorrectly change it's starting address. QAK - 2004/06/09 - Opaque datatype with no tag failed for some operations. Fixed. SLU - 2004/6/3 @@ -3961,33 +3961,33 @@ Bug Fixes since HDF5-1.6.2 release ----- - On SGI h5dump displayed only part of the data due to the bug in the system printf; fixed. - EIP - 2004/09/21 - Documentation - ------------- - - Several descriptive errors have been fixed throughout the + EIP - 2004/09/21 + Documentation + ------------- + - Several descriptive errors have been fixed throughout the documentation, particularly in the reference manual (RM). - A selection particularly worthy of note would be these: + A selection particularly worthy of note would be these: - The H5Pset_szip description in the RM has been expanded and corrected to facilitate use of SZIP compression. - A note has been added to the H5Dcreate description that an - unexplained failure is likely to be due to a property list error + unexplained failure is likely to be due to a property list error that is detected only at the time of dataset creation. - FMB - 2004/09/21 F90 API ------- - + Fortran functions h5dwrite/read_f and h5awrite/read_f do not accept dims parameter of INTEGER type anymore. Code was removed. 2004/04/15 C++ API ------- - - H5::Exception's and its subclasses' constructors that were + - H5::Exception's and its subclasses' constructors that were overloaded to take char pointers are removed and constructors - that passed in reference of 'string' are changed to pass + that passed in reference of 'string' are changed to pass by value. In addition, the default value of the data member - H5::Exception::detailMessage is changed from 0/NULL to + H5::Exception::detailMessage is changed from 0/NULL to DEFAULT_MSG ("No detailed information provided".) - Prototype for DSetCreatPropList::setLayout is changed: 1st parameter is removed because it was there only by mistake. @@ -3998,35 +3998,35 @@ Documentation HDF5 Library documentation -------------------------- - HDF5 C++ API Reference Manual - This document has been added to the HDF5 document set. + This document has been added to the HDF5 document set. The predecessor document, "HDF5 C++ Interfaces," has been removed. - HDF5 C++ API Design Specification - A first draft of this document has been added to the HDF5 document - set. The draft has been posted on the HDF5 website and a link - has been added to the HDF5 documents index (index.html at the top + A first draft of this document has been added to the HDF5 document + set. The draft has been posted on the HDF5 website and a link + has been added to the HDF5 documents index (index.html at the top level of the document set). - Parallel HDF5 In prior releases, the HDF5 document set included two parallel - HDF5 documents. Those documents have been deleted and the - HDF5 documents index (index.html) now links to a "Parallel HDF5" + HDF5 documents. Those documents have been deleted and the + HDF5 documents index (index.html) now links to a "Parallel HDF5" page on the HDF5 website (http://hdf.ncsa.uiuc.edu/HDF5/PHDF5/). - HDF5 High Level APIs - Links to the HDF5 High Level APIs and to the HDF5 High Level + Links to the HDF5 High Level APIs and to the HDF5 High Level Reference Manual have been added to the HDF5 documents index (index.html). - HDF5 Reference Manual - Tools: h5repack -- A description of the new h5repack tool has been + Tools: h5repack -- A description of the new h5repack tool has been added to the Tools page. Tools: h5dump -- Several new options have been added to h5dump. New functions -- All new functions have been added to the RM. API changes -- Relevant function descriptions have been updated in - instances where programming interfaces have changed. + instances where programming interfaces have changed. FMB - 2004/09/21 Windows installation documentation ---------------------------------- - - INSTALL_Windows.txt has been enhanced to include instructions building - HDF5 with FORTRAN and C++. + - INSTALL_Windows.txt has been enhanced to include instructions building + HDF5 with FORTRAN and C++. - Two optional installation documents have been added. They are INSTALL_Windows_Short.txt and INSTALL_Windows_From_Command_Line.txt. INSTALL_Windows_Short.txt is supposed to help general users who @@ -4036,7 +4036,7 @@ Documentation - INSTALL_Windows_withcpp.txt and INSTALL_Windows_withF90.txt became obsolete. Files are deleted from the release_docs directory. KY 2004/09/16, EIP 2004/9/21 - + Platforms Tested @@ -4065,7 +4065,7 @@ Platforms Tested Cray Fortran Version 3.6.0.3.1 FreeBSD 4.9 gcc 2.95.4 g++ 2.95.4 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 HP ANSI C++ B3910B A.03.13 MPIch 1.2.4 @@ -4092,20 +4092,20 @@ Platforms Tested Linux 2.4.19-SMP x86_64 gcc (GCC) 3.2.2 (SuSE Linux) g++ 3.2.2 Linux 2.6.4-52smp x86_64 gcc 3.3.3 (SuSE Linux 9.1 AMD64)) - PGI 5.2-1 C and F90 + PGI 5.2-1 C and F90 - Linux 2.4.21-sgi Altix + Linux 2.4.21-sgi Altix SMP ia64 Intel(R) C++ Version 8.0 Intel(R) Fortran Itanium(R) Version 8.0 SGI MPI - OSF1 V5.1 Compaq C V6.5-303 + OSF1 V5.1 Compaq C V6.5-303 HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 + Compaq C++ V6.5-040 MPI_64bit_R13 SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 Sun WorkShop 6 update 2 C++ 5.3 @@ -4118,7 +4118,7 @@ Platforms Tested Xeon Linux 2.4.20-31.9smp_perfctr_lustre Intel(R) C++ Version 8.0 Intel(R) Fortran Compiler Version 8.0 - + IA-64 Linux 2.4.16 ia64 gcc version 3.0.4 Intel(R) C++ Version 7.1 Intel(R) Fortran Compiler Version 7.1 @@ -4138,11 +4138,11 @@ Platforms Tested DEC Visual Fortran 6.0 MAC OS X Darwin 7.5 - gcc and g++ Apple Computer, Inc. GCC + gcc and g++ Apple Computer, Inc. GCC version 1175, based on gcc version 3.3.2 - IBM XL Fortran version 8.1 + IBM XL Fortran version 8.1 Absoft Fortran compiler v8.2 - + Supported Configuration Features Summary @@ -4155,7 +4155,7 @@ Key: y = tested and supported ( ) = footnote appears below second table Platform C F90 F90 C++ zlib SZIP - parallel parallel + parallel parallel Solaris2.7 64-bit y (1) y y (1) y y y Solaris2.7 32-bit y (1) y y (1) y y y Solaris2.8 64-bit y (1) y y (1) y y y @@ -4187,8 +4187,8 @@ Linux 2.4 SuSE ia64 C Intel (3,8) y y y y y y Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y -Platform Shared static- Thread- STREAM- - libraries (4) exec safe VFD +Platform Shared static- Thread- STREAM- + libraries (4) exec safe VFD Solaris2.7 64-bit y x y y Solaris2.7 32-bit y x y y Solaris2.8 64-bit y x y y @@ -4221,19 +4221,19 @@ Linux 2.4 SGI Altix ia64 Intel (3) y y n y -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, compilers used are the system compilers. Footnotes: (1) Using mpich 1.2.4 (2) Using mpt and mpich 1.2.4 - (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated + (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated W or C indicates workstation or cluster, respectively - (4) Shared libraries are provided only for the C library, + (4) Shared libraries are provided only for the C library, except on Windows where they are provided for C and C++ (5) Using mpt (6) Intel 7.1 compilers in Visual Studio 6.0 environment - (7) Linux 2.4.20-31.9. Xeon cluster with smp_perfctr_lustre + (7) Linux 2.4.20-31.9. Xeon cluster with smp_perfctr_lustre and Intel compilers (8) Linux 2.4.21, SuSE_128.befl. Ia64 cluster with Intel compilers (9) DEC Visual Fortran 6.0 and Intel 7.1 @@ -4249,14 +4249,14 @@ Known Problems ============== * h5fc and h5c++ compilation scripts have a bug: object files (*.o) cannot be created when source code is compiled using h5fc or h5c++. We will provide - a fix. Please check ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ + a fix. Please check ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ for the patches. * Fortran subroutine h5pget_driver_f doesn't return a correct driver information. * There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) failed on windows xp with .NET for debug and debug dll. Release and Release - dll work fine. + dll work fine. * The h5dump tests may fail to match the expected output on some platforms (e.g. parallel jobs, Windows) where the error messages directed to @@ -4276,7 +4276,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on IBM SP2 platform for the serial mode. The parallel mode works fine with this option. - + It is suggested that you don't use this option on these platforms during configuration. @@ -4295,7 +4295,7 @@ Known Problems the different precision in the values displayed and h5ls appears to be dumping floating-point numbers correctly. -* Before building HDF5 F90 Library from source on Crays +* Before building HDF5 F90 Library from source on Crays replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src subdirectory in the top level directory with the Cray-specific files from the site: @@ -4303,7 +4303,7 @@ Known Problems * 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 + complaining about exit subroutine. Comment out the line IF (total_error .ne. 0) CALL exit (total_error) * On IA32 and IA64 systems, if you use a compiler other than GCC (such as @@ -4411,7 +4411,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -4469,8 +4469,8 @@ New Features Support for new platforms, languages and compilers. ======================================= - HDF5 Fortran APIs are supported on MAC OSX with IBM XL Fortran compiler - version 8.1 Beta - Use --disbale-shared --enable-static flags with configure when + version 8.1 Beta + Use --disbale-shared --enable-static flags with configure when building HDF5 Fortran Library on MAC OSX. - C and C++ Libraries are available for Linux64 RH8 - C, C++ and Fortran sequential Libraries, and C and Fortran parallel @@ -4551,8 +4551,8 @@ Bug Fixes since HDF5-1.6.1 release test command. (The complain did not hinder the h5redploy to proceed correctly.) AKC - 2003/11/03 - Documentation - ------------- + Documentation + ------------- Documentation @@ -4580,7 +4580,7 @@ Platforms Tested Cray Fortran Version 3.4.0.0 FreeBSD 4.9 gcc 2.95.4 g++ 2.95.4 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 HP ANSI C++ B3910B A.03.13 MPIch 1.2.4 @@ -4601,7 +4601,7 @@ Platforms Tested Linux 2.4.19-SMP x86_64 gcc (GCC) 3.2.2 (SuSE Linux) g++ 3.2.2 - Linux 2.4.21-sgi Altix + Linux 2.4.21-sgi Altix SMP ia64 Intel(R) C++ Version 7.1 Intel(R) Fortran Itanium(R) Version 7.1 SGI MPI @@ -4612,9 +4612,9 @@ Platforms Tested Compaq C++ V6.5-030 MPI_64bit_R13 SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 Sun WorkShop 6 update 2 C++ 5.3 @@ -4623,7 +4623,7 @@ Platforms Tested IA-32 Linux 2.4.18 gcc 2.96 Intel(R) C++ Version 7.0 Intel(R) Fortran Compiler Version 7.0 - + IA-64 Linux 2.4.16 ia64 gcc version 3.0.4 Intel(R) C++ Version 7.1 Intel(R) Fortran Compiler Version 7.1 @@ -4639,10 +4639,10 @@ Platforms Tested Code Warrior 8.0 Windows XP MSVC++.NET MAC OS X Darwin 7.2 - gcc and g++ Apple Computer, Inc. GCC + gcc and g++ Apple Computer, Inc. GCC version 1175, based on gcc version 3.3.2 IBM XL Fortran version 8.1 Beta - + Supported Configuration Features Summary @@ -4686,10 +4686,10 @@ RedHat 7.1 ia64 C Intel (3) y n y n y n y RedHat 8 & SuSe x86_64 y n n n y n y gcc (3) Linux 2.4 SGI Altix ia64 y n y n y y y - Intel (3) + Intel (3) -Platform static- Thread- SZIP GASS STREAM- High- H4/H5 +Platform static- Thread- SZIP GASS STREAM- High- H4/H5 exec safe VFD level tools APIs (6) Solaris2.7 64-bit x y y n y y n @@ -4722,21 +4722,21 @@ RedHat 7.1 ia64 C Intel (3) y n y n y y y RedHat 8 & SuSe x86_64 y n y n y y y gcc (3) Linux 2.4 SGI Altix ia64 y n y n y y y - Intel (3) + Intel (3) -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, compilers used are the system compilers. Footnotes: (1) Using mpich 1.2.4. (2) Using mpt and mpich 1.2.4. - (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. + (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. W or C indicates workstation or cluster, respectively. - (4) Shared libraries are provided only for the C library, + (4) Shared libraries are provided only for the C library, except on Windows where they are provided for C and C++. (5) Using mpt. - (6) Includes the H4toH5 Library and the h4toh5 and h5toh4 + (6) Includes the H4toH5 Library and the h4toh5 and h5toh4 utilities. @@ -4746,7 +4746,7 @@ Known Problems * There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) failed on windows xp with .NET for debug and debug dll. Release and Release - dll work fine. + dll work fine. * The h5dump tests may fail to match the expected output on some platforms (e.g. parallel jobs, Windows) where the error messages directed to @@ -4766,7 +4766,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on IBM SP2 platform for the serial mode. The parallel mode works fine with this option. - + It is suggested that you don't use this option on these platforms during configuration. @@ -4786,7 +4786,7 @@ Known Problems the different precision in the values displayed and h5ls appears to be dumping floating-point numbers correctly. -* Before building HDF5 F90 Library from source on Crays +* Before building HDF5 F90 Library from source on Crays replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src subdirectory in the top level directory with the Cray-specific files from the site: @@ -4794,7 +4794,7 @@ Known Problems * On some platforms that use Intel 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 + complaining about exit subroutine. Comment out the line IF (total_error .ne. 0) CALL exit (total_error) * On IA32 and IA64 systems, if you use a compiler other than GCC (such as @@ -4848,7 +4848,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -4921,7 +4921,7 @@ New Features Support for new platforms, languages and compilers. ======================================= - gcc 3.3.1 is supported on Linux. - + Bug Fixes since HDF5-1.6.0 release ================================== @@ -5008,20 +5008,20 @@ Bug Fixes since HDF5-1.6.0 release - Switched away from tools using internal "fixtype" function(s) to use H5Tget_native_type() internally. QAK - 2003/08/25 - Documentation - ------------- - - Added two missing Fortran APIs (h5pget_fapl_mpiposix_f and + Documentation + ------------- + - Added two missing Fortran APIs (h5pget_fapl_mpiposix_f and h5pset_fapl_mpiposix_f) to the reference manual. FMB - 2003/10/15 - - Corrected the reference manual descriptions of H5open/h5open_f and - H5close/h5close_f to indicate that these calls are required in + - Corrected the reference manual descriptions of H5open/h5open_f and + H5close/h5close_f to indicate that these calls are required in Fortran90 applications. FMB - 2003/10/15 Documentation ============= - Fortran90 APIs are being integrated into the main body of the + Fortran90 APIs are being integrated into the main body of the HDF5 Reference Manual (RM). This process is complete in all RM sections except H5P. @@ -5050,7 +5050,7 @@ Platforms Tested Cray Fortran Version 3.4.0.3 FreeBSD 4.9 gcc 2.95.4 g++ 2.95.4 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 HP ANSI C++ B3910B A.03.13 HP MPI 01.07.00.00 @@ -5072,9 +5072,9 @@ Platforms Tested MPI_64bit_R5 g++ version 3.0 for C++ SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 Sun WorkShop 6 update 2 C++ 5.3 @@ -5083,7 +5083,7 @@ Platforms Tested IA-32 Linux 2.4.9 gcc 2.96 Intel(R) C++ Version 7.0 Intel(R) Fortran Compiler Version 7.0 - + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 Intel(R) C++ Version 7.0 Intel(R) Fortran Compiler Version 7.0 @@ -5093,9 +5093,9 @@ Platforms Tested Code Warrior 8.0 Windows XP MSVC++.NET MAC OS X Darwin 6.8 - gcc and g++ Apple Computer, Inc. GCC + gcc and g++ Apple Computer, Inc. GCC version 1175, based on gcc version 3.1 - + Supported Configuration Features Summary @@ -5114,7 +5114,7 @@ Solaris2.7 64-bit y y (1) y y (1) y y y Solaris2.7 32-bit y y (1) y y (1) y y y Solaris2.8 64-bit y y (1) y y (1) y y y Solaris2.8 32-bit y y y y (1) y y y -IRIX6.5 y y (1) n n n y y +IRIX6.5 y y (1) n n n y y IRIX64_6.5 64-bit y y (2) y y y y y IRIX64_6.5 32-bit y y (2) n n n y y HPUX11.00 y y (1) y y y y y @@ -5141,7 +5141,7 @@ Linux 2.4 IA64 Intel y n y n y n y ASCII Table 2 -- for RELEASE.txt -Platform static- Thread- SZIP GASS STREAM- High-level H4/H5 +Platform static- Thread- SZIP GASS STREAM- High-level H4/H5 exec safe VFD APIs tools (7) Solaris2.7 64-bit x y y n y y n Solaris2.7 32-bit x y y n y y y @@ -5174,12 +5174,12 @@ Linux 2.4 IA64 Intel y n y n y y y Notes: (1) Using mpich 1.2.4. (2) Using mpt and mpich 1.2.4. (3) Linux 2.4 with GNU, Intel, and PGI compilers, respectively. - (4) Shared libraries are provided only for the C library, except + (4) Shared libraries are provided only for the C library, except on Windows where they are provided for C and C++. (5) Using mpt. - (6) Binaries only; source code for this platform is not being + (6) Binaries only; source code for this platform is not being released at this time. - (7) Includes the H4toH5 Library and the h4toh5 and h5toh4 + (7) Includes the H4toH5 Library and the h4toh5 and h5toh4 utilities. Compiler versions for each platform are listed in the preceding "Platforms Tested" table. @@ -5189,10 +5189,10 @@ Linux 2.4 IA64 Intel y n y n y y y Known Problems ============== * Fortran subroutine h5pget_driver_f doesn't return a correct driver information. - The fix willl be available in the 1.6.2 release. + The fix willl be available in the 1.6.2 release. * There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) failed on windows xp with .NET for debug and debug dll. Release and Release - dll work fine. + dll work fine. * The h5dump tests may fail to match the expected output on some platforms (e.g. parallel jobs, Windows) where the error messages directed to @@ -5212,7 +5212,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on IBM SP2 platform for the serial mode. The parallel mode works fine with this option. - + It is suggested that you don't use this option on these platforms during configuration. @@ -5221,7 +5221,7 @@ Known Problems 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. @@ -5241,14 +5241,14 @@ Known Problems the different precision in the values displayed and h5ls appears to be dumping floating-point numbers correctly. -* Before building HDF5 F90 Library from source on Crays +* Before building HDF5 F90 Library from source on Crays replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src subdirectory in the top level directory with the Cray-specific files from the site: * On some platforms that use Intel 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 + complaining about exit subroutine. Comment out the line IF (total_error .ne. 0) CALL exit (total_error) ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/hdf5-1.6.0/F90_source_for_Crays @@ -5291,7 +5291,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -5336,8 +5336,8 @@ Library: For more information see http://hdf.ncsa.uiuc.edu/HDF5/doc_resource/SZIP/index.html http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide.html - http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide/Changes.html - + http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide/Changes.html + Complete list of changes: * Changed dataset modification time to _not_ be updated when raw data is @@ -5365,16 +5365,16 @@ Library: I/O filters: H5Pmodify_filter, H5Pget_filter_by_id and H5Pall_filters_avail. Also changed H5Zregister to use new method of registering filters with library. QAK - 2003/04/08 - * The first version of szip compression support were implemented. + * The first version of szip compression support were implemented. User should have static szlib library installed. Using function H5Pset_szip to pass the szip parameters to the HDF5 library. More detailed decription of the process will be followed. KY-2003/04/01 - * Added Fletcher32 checksum as a filter in pipeline. It only works in + * Added Fletcher32 checksum as a filter in pipeline. It only works in chunked dataset. SLU - 2003/2/11 * MPICH/MPE instrumentation feature added. Use --with-mpe[=DIR] to configure it. AKC - 2003/1/3 - * New functions H5Gget_num_objs, H5Gget_objname_by_idx and H5Gget_objtype_by_idx + * New functions H5Gget_num_objs, H5Gget_objname_by_idx and H5Gget_objtype_by_idx are added to the library. SLU - 2002/11/25 * H5Dget_offset is added to return the offset of a dataset's data relative to the beginning of the file. SLU - 2002/11/7 @@ -5399,7 +5399,7 @@ Library: H5D_SPACE_ALLOC_LATE for H5Dset_space_time(). This allows chunked datasets to be incrementally allocated as in the 1.4.x branch. QAK - 2002/08/27 - * Compact dataset is added to the library. The data will be stored in + * Compact dataset is added to the library. The data will be stored in the header message of dataset layout. Space allocation time has to be EARLY. No hyperslab is supported for parallel collective write. There is no API changes except activating H5Pset_layout and H5Pget_layout for @@ -5413,9 +5413,9 @@ Library: This can improve parallel I/O performance for chunked datasets. QAK - 2002/05/17 * New functions H5Glink2 and H5Gmove2 were added to allow link and move to - be in different locations in the same file. The old functions H5Glink - and H5Gmove remain valid. SLU - 2002/04/26 - * Fill-value's behaviors for contiguous dataset have been redefined. + be in different locations in the same file. The old functions H5Glink + and H5Gmove remain valid. SLU - 2002/04/26 + * Fill-value's behaviors for contiguous dataset have been redefined. Basicly, dataset won't allocate space until it's necessary. Full details are available at http://hdf.ncsa.uiuc.edu/RFC/Fill_Value, at this moment. SLU - 2002/04/11 @@ -5436,14 +5436,14 @@ Library: in order to correctly handle dataset region references. Moved H5Rget_object_type() to be only compiled into the library when v1.4 compatibility is enabled. - * Added a new file access property, file close degree, to control file + * Added a new file access property, file close degree, to control file close behavior. It has four values, H5F_CLOSE_WEAK, H5F_CLOSE_SEMI, - H5F_CLOSE_STRONG, and H5F_CLOSE_DEFAULT. Two correspont functions - H5Pset_fclose_degree and H5Pget_fclose_degree are also provided. Two + H5F_CLOSE_STRONG, and H5F_CLOSE_DEFAULT. Two correspont functions + H5Pset_fclose_degree and H5Pget_fclose_degree are also provided. Two new functions H5Fget_obj_count and H5Fget_obj_ids are offerted to assist - this new feature. For full details, please refer to the reference - manual under the description of H5Fcreate, H5Fopen, H5Fclose and the - functions mentioned above. + this new feature. For full details, please refer to the reference + manual under the description of H5Fcreate, H5Fopen, H5Fclose and the + functions mentioned above. * Removed H5P(get|set)_hyper_cache API function, since the property is no longer used. * Improved performance of non-contiguous hyperslabs (built up with @@ -5481,19 +5481,19 @@ Tools: QAK - 2003/06/06 * h5diff to compare two HDF5 files was added * h5import to import ascii and binary data to an HDF5 file was added. - Old h5import tool in the tools/misc directory was renamed to - h5createU8 to reflect its purpose. h5createU8 will be deleted in - 1.6.1 release. + Old h5import tool in the tools/misc directory was renamed to + h5createU8 to reflect its purpose. h5createU8 will be deleted in + 1.6.1 release. * Two new scripts h5fc and h5c++ were added to compile F90 and C++ HDF5 applications. Support for new platforms, languages and compilers. ======================================= * Added C++ API support on HPUX11.00. BMR - 2003/03/19 - * Absoft compiler is supported for Fortran HDF5 Library. + * Absoft compiler is supported for Fortran HDF5 Library. When building with Absoft compiler, add -DH5_ABSOFT to C compilation flags to get correct names of C functions - called by Fortran APIs. + called by Fortran APIs. Bug Fixes since HDF5-1.4.0 release @@ -5527,7 +5527,7 @@ Library for floating point data). This adds a new API function: H5Pset_shuffle. KY - 2002/11/13 * Allow scalar dataspaces to be used for parallel I/O. QAK - 2002/11/05 - * New functions H5Gget_comment(modification), H5Aget_storage_size, + * New functions H5Gget_comment(modification), H5Aget_storage_size, H5Arename. SLU - 2002/10/29 * Fixed an assertion of H5S_select_iterate that did not account for scalar type that has no dimension sizes. AKC - 2002/10/15 @@ -5536,10 +5536,10 @@ Library * Fixed data corruption problem which could occur when fill values were written to a contiguously stored dataset in parallel. QAK - 2002/08/27 * Fixed VL memory leak when data is overwritten. The heap objects holding - old data are freed. If the fill value writting time is set to + old data are freed. If the fill value writting time is set to H5D_FILL_TIME_NEVER, the library prohibits user to create VL type dataset. - The library free all the heap objects storing VL type if there is nested - VL type(a VL type contains another VL type). SLU - 2002/07/10 + The library free all the heap objects storing VL type if there is nested + VL type(a VL type contains another VL type). SLU - 2002/07/10 * Tweaked a few API functions to use 'size_t' instead of 'unsigned' or 'hsize_t', which may cause errors in some cases. @@ -5563,17 +5563,17 @@ Performance Tools ----- - * Added a -force option to h5redeploy. AKC - 2003/03/04 + * Added a -force option to h5redeploy. AKC - 2003/03/04 * The VL string bug(data and datatype cannot be shown) in h5dump is fixed. -SLU - 2002/11/18 - * Fixed segfault if h5dump was invoked with some options but no file + * Fixed segfault if h5dump was invoked with some options but no file (e.g., h5dump -H). -AKC, 2002/10/15 * Fixed so that the "-i" flag works correctly with the h5dumper. * Fixed segfault when "-v" flag was used with the h5dumper. -Documentation -------------- +Documentation +------------- @@ -5603,7 +5603,7 @@ Platforms Tested mpt 2.1.0.0 FreeBSD 4.7 gcc 2.95.4 g++ 2.95.5 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 HP ANSI C++ B3910B A.03.13 MPIch 1.2.4 @@ -5624,9 +5624,9 @@ Platforms Tested MPI_64bit_R5 g++ version 3.0 for C++ SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8/32 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 Sun WorkShop 6 update 2 C++ 5.3 @@ -5638,7 +5638,7 @@ Platforms Tested IA-32 Linux 2.4.9 gcc 2.96 Intel(R) C++ Version 7.0 Intel(R) Fortran Compiler Version 7.0 - + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 Intel(R) C++ Version 7.0 Intel(R) Fortran Compiler Version 7.0 @@ -5648,9 +5648,9 @@ Platforms Tested Code Warrior 8.0 Windows XP MSVC++.NET MAC OS X Darwin 6.5 - gcc and g++ Apple Computer, Inc. GCC + gcc and g++ Apple Computer, Inc. GCC version 1161, based on gcc version 3.1 - + Supported Configuration Features Summary @@ -5669,7 +5669,7 @@ Solaris2.7 64-bit y y (1) y y (1) y y y Solaris2.7 32-bit y y (1) y y (1) y y y Solaris2.8 64-bit y y (1) y y (1) y y y Solaris2.8 32-bit y y y y (1) y y y -IRIX6.5 y y (1) n n n y y +IRIX6.5 y y (1) n n n y y IRIX64_6.5 64-bit y y (2) y y y y y IRIX64_6.5 32-bit y y (2) n n n y y HPUX11.00 y y (1) y y y y y @@ -5696,7 +5696,7 @@ Linux 2.4 IA64 Intel y n y n y n y ASCII Table 2 -- for RELEASE.txt -Platform static- Thread- SZIP GASS STREAM- High-level H4/H5 +Platform static- Thread- SZIP GASS STREAM- High-level H4/H5 exec safe VFD APIs tools (7) Solaris2.7 64-bit x y y n y y n Solaris2.7 32-bit x y y n y y y @@ -5729,12 +5729,12 @@ Linux 2.4 IA64 Intel y n y n y y y Notes: (1) Using mpich 1.2.4. (2) Using mpt and mpich 1.2.4. (3) Linux 2.4 with GNU, Intel, and PGI compilers, respectively. - (4) Shared libraries are provided only for the C library, except + (4) Shared libraries are provided only for the C library, except on Windows where they are provided for C and C++. (5) Using mpt. - (6) Binaries only; source code for this platform is not being + (6) Binaries only; source code for this platform is not being released at this time. - (7) Includes the H4toH5 Library and the h4toh5 and h5toh4 + (7) Includes the H4toH5 Library and the h4toh5 and h5toh4 utilities. Compiler versions for each platform are listed in the preceding "Platforms Tested" table. @@ -5766,7 +5766,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on IBM SP2 platform for the serial mode. The parallel mode works fine with this option. - + It is suggested that you don't use this option on these platforms during configuration. @@ -5775,7 +5775,7 @@ Known Problems 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. @@ -5795,14 +5795,14 @@ Known Problems the different precision in the values displayed and h5ls appears to be dumping floating-point numbers correctly. -* Before building HDF5 F90 Library from source on Crays +* Before building HDF5 F90 Library from source on Crays replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src subdirectory in the top level directory with the Cray-specific files from the site: * On some platforms that use Intel 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 + complaining about exit subroutine. Comment out the line IF (total_error .ne. 0) CALL exit (total_error) ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/hdf5-1.6.0/F90_source_for_Crays @@ -5838,7 +5838,7 @@ INTRODUCTION This document describes the differences between HDF5-1.4.4 and HDF5-1.4.5, and contains information on the platforms tested and -known problems in HDF5-1.4.5. For additional information check the +known problems in HDF5-1.4.5. For additional information check the HISTORY.txt file in the HDF5 source. The HDF5 documentation can be found on the NCSA ftp server @@ -5847,7 +5847,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information, see the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -5880,7 +5880,7 @@ New Features o Library ========= o General - --------- + --------- * Allow scalar dataspaces to be used for parallel I/O. QAK - 2002/11/05 * Added environment variable "HDF5_DISABLE_VERSION_CHECK", which disables the version checking between the header files and the library linked @@ -5903,7 +5903,7 @@ New Features ------ * Several missing fortran APIs have been added to the library: - h5get_libversion_f h5tget_member_index_f h5dget_storage_size_f + h5get_libversion_f h5tget_member_index_f h5dget_storage_size_f h5check_version_f h5tvlen_create_f h5dvlen_get_max_len_f h5garbage_collect_f h5dwrite_vl_f h5dont_atexit_f h5dread_vl_f @@ -5937,11 +5937,11 @@ New Features ========================================= * C++ API now works on the Origin2000 (IRIX6.5.14.) BMR - 2002/11/14 - + o Misc. ========================================= - HDF5 1.4.5 works with Portland Group Compilers (pgcc, pgf90 and pgCC - version 4.0-2) on Linux 2.4 + HDF5 1.4.5 works with Portland Group Compilers (pgcc, pgf90 and pgCC + version 4.0-2) on Linux 2.4 Bug Fixes since HDF5-1.4.4 Release @@ -5955,8 +5955,8 @@ Bug Fixes since HDF5-1.4.4 Release QAK - 2003/01/21 * Added improved error assertion for nil VL strings. It return error stack instead of a simple assertion. SLU - 2002/12/16 - * Fixed h5dump bug(cannot dump data and datatype) for VL string. - SLU - 2002/11/18 + * Fixed h5dump bug(cannot dump data and datatype) for VL string. + SLU - 2002/11/18 * Fixed error condition where "none" selections were not being handled correctly in serial & parallel. QAK - 2002/10/29 * Fixed problem where optimized hyperslab routines were incorrectly @@ -5980,15 +5980,15 @@ Platforms Tested AIX 5.1 (32 and 64-bit) C for AIX Compiler, Version 6 xlf 8.1.0.2 poe 3.2.0.11 - Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.1.3 - Cray Fortran Version 3.6.0.0.12 + Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.1.3 + Cray Fortran Version 3.6.0.0.12 Cray SV1 10.0.1. 0 Cray Standard C Version 6.6.0.1.3 Cray Fortran Version 3.6.0.0.12 Cray T90IEEE 10.0.1.01u Cray Standard C Version 6.4.0.2.3 Cray Fortran Version 3.4.0.3 FreeBSD 4.7 gcc 2.95.4 g++ 2.95.5 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 IRIX 6.5 MIPSpro cc 7.30 IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m @@ -6003,16 +6003,16 @@ Platforms Tested Compaq Fortran X5.4A-1684 gcc version 3.0 for C++ SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 Patch 109503-07 2001/08/11 Sun WorkShop 6 update 1 C++ 5.2 Patch 109508-04 2001/07/11 SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 Patch 109503-07 2001/08/11 Sun WorkShop 6 update 1 C++ 5.2 Patch 109508-04 2001/07/11 @@ -6021,7 +6021,7 @@ Platforms Tested IA-32 Linux 2.4.9 gcc 2.96 Intel(R) C++ Version 7.0 Intel(R) Fortran Compiler Version 7.0 - + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 Intel(R) C++ Version 7.0 Intel(R) Fortran Compiler Version 7.0 @@ -6030,9 +6030,9 @@ Platforms Tested Windows XP .NET Windows NT4.0 Code Warrior 6.0 MAC OS X Darwin 6.2 - gcc and g++ Apple Computer, Inc. GCC + gcc and g++ Apple Computer, Inc. GCC version 1161, based on gcc version 3.1 - + Supported Configuration Features Summary @@ -6053,7 +6053,7 @@ Supported Configuration Features Summary Solaris2.7 32-bit y y (1) y y (1) y y y Solaris2.8 64-bit y n y y (1) y y y Solaris2.8 32-bit y n y y (1) y y y - IRIX6.5 y y (1) n n n y y + IRIX6.5 y y (1) n n n y y IRIX64_6.5 64-bit y y (2) y y y y y IRIX64_6.5 32-bit y y (2) n n n y y HPUX11.00 y y (1) y n n y y @@ -6075,7 +6075,7 @@ Supported Configuration Features Summary Linux 2.4 PGI (3) y n y n y n y Linux 2.4 IA32 y n y n n n y Linux 2.4 IA64 y n y n n n y - + Platform static- Thread- SRB GASS STREAM- exec safe VFD @@ -6111,23 +6111,23 @@ Supported Configuration Features Summary (2) Using mpt and mpich 1.2.4. (3) Linux 2.4 with GNU, Intel, and PGI compilers. (4) No HDF4-related tools. - (5) Shared libraries are provided only for the C library, + (5) Shared libraries are provided only for the C library, except on Windows where they are provided for all languages. (6) Debug mode only. - (7) Binaries only; source code for this platform is not being + (7) Binaries only; source code for this platform is not being released at this time. Known Problems ============== - * On Linux 2.4 IA64, Fortran test fails for h5dwrite_vl_f + * On Linux 2.4 IA64, Fortran test fails for h5dwrite_vl_f for integer and real base datatypes. * When fortran library is built with Intel compilers, compilation - for fflush1.f90, fflush2.f90 and fortanlib_test.f90 will fail + for fflush1.f90, fflush2.f90 and fortanlib_test.f90 will fail complaining about EXEC function. Comment the call to EXEC subroutine - in each program, or get a patch for the HDF5 Fortran source code. + in each program, or get a patch for the HDF5 Fortran source code. * Fortran external dataset test fails on Linux 2.4 with pgf90 compiler. @@ -6137,11 +6137,11 @@ Known Problems * Datasets or attributes which have a variable-length string datatype are not printing correctly with h5dump and h5ls. - * When a dataset with the variable-length datatype is overwritten, - the library can develop memory leaks that cause the file to become + * When a dataset with the variable-length datatype is overwritten, + the library can develop memory leaks that cause the file to become unnecessarily large. This is planned to be fixed in the next release. - * On the SV1, the h5ls test fails due to a difference between the + * On the SV1, the h5ls test fails due to a difference between the SV1 printf precision and the printf precision on other platforms. * The h5dump tests may fail to match the expected output on some @@ -6152,17 +6152,17 @@ Known Problems * The --enable-static-exec configure flag fails to compile for HP-UX 11.00 platforms. - * The executables are always dynamic on IRIX64 6.5(64 and n32) and + * The executables are always dynamic on IRIX64 6.5(64 and n32) and IRIX 6.5 even if they are configured with --enable-static-exec. * IRIX 6.5 fails to compile if configured with --enable-static-exec. * The executables are always dynamic on Solaris 2.7 ans 2.8(64 and n32) even if they are configured with --enable-static-exec. - + * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause a hang in some cases when chunked storage is used. This is now set to - be off by default. One may turn it on by setting the environment + be off by default. One may turn it on by setting the environment variable HDF5_MPI_OPT_TYPES to a non-zero value such as 1. * On OSF1 v5.1 and IA32 h5dumpgentst program that generates test files @@ -6173,10 +6173,10 @@ Known Problems * On Cray T3E (sn6606 2.0.6.08 unicosmk CRAY T3E) with Cray Standard C Version 6.6.0.1.3 compiler optimization causes errors in many HDF5 Library tests. Use -g -h zero flags - to build HDF5 Library. + to build HDF5 Library. * On Cray SV1 10.0.1. 0 datatype convertion test fails. Please check HDF FTP site - if patch is available. We will try to provide one in the nearest future. + if patch is available. We will try to provide one in the nearest future. * For configuration, building and testing with Intel and PGI compilers see corresponding section in INSTALL file. @@ -6200,7 +6200,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information, see the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -6223,32 +6223,32 @@ New Features ============ o Configuration ================ - * The H4 to H5 tools have been removed from the main source and placed + * The H4 to H5 tools have been removed from the main source and placed in a separate package. You can get these tools from the HDF ftp site - (ftp://hdf.ncsa.uiuc.edu/). The "--with-hdf4" command-line option + (ftp://hdf.ncsa.uiuc.edu/). The "--with-hdf4" command-line option during configure is no longer valid. BW - 2002/06/25 o Library ========= o General - --------- + --------- * Fill-value forward-compatibility with release 1.5 was added. SLU - 2002/04/11 * A new query function H5Tget_member_index has been added for compound - and enumeration data types. This function retrieves a member's index + and enumeration data types. This function retrieves a member's index by name. SLU - 2002/04/05 * Added serial multi-gigabyte file size test. "test/big -h" shows the help page. AKC - 2002/03/29 - + o APIs ------ - * The F90 subroutines h5dwrite_f, h5dread_f, h5awrite_f, and h5aread_f - were overloaded with a "dims" argument of type INTEGER(HSIZE_T) to - specify the size of the array. We recommend using these subroutines + * The F90 subroutines h5dwrite_f, h5dread_f, h5awrite_f, and h5aread_f + were overloaded with a "dims" argument of type INTEGER(HSIZE_T) to + specify the size of the array. We recommend using these subroutines with the new type; module subroutines that accept "dims" as an i - INTEGER array of size 7 will be deprecated in release 1.6. + INTEGER array of size 7 will be deprecated in release 1.6. EIP - 2002/05/06 - + o Performance ------------- * Added internal "small data" aggregation, which can reduce the number of @@ -6305,15 +6305,15 @@ New Features * Intel C++ and F90 compilers Version 6.0 are supported on Linux 2.4. * Intel C++ compilers Version 6.0 are supported on Windows 2000. - + o Misc. ========================================= * zlib has been moved out of the Windows source release. Users should go to - the ZLIB homepage(http://www.zlib.org) to download the corresponding + the ZLIB homepage(http://www.zlib.org) to download the corresponding zlib library. - * The Windows binary release is built with the old version of the zlib - library. We expect users to use zlib 1.1.4 to build with the source - release. + * The Windows binary release is built with the old version of the zlib + library. We expect users to use zlib 1.1.4 to build with the source + release. * In the Windows-specific install document, we specify how to test backward compatibility. However, in this release, we are not testing the backward compatibility of HDF5. @@ -6337,7 +6337,7 @@ Bug Fixes since HDF5-1.4.3 Release library to go into infinite loop. QAK - 2002/06/10 * Fixed bug (#699, fix provided by a user) where a scalar dataspace was written to the file and then subsequently queried with the - H5Sget_simple_extent_type function; type was reported as H5S_SIMPLE + H5Sget_simple_extent_type function; type was reported as H5S_SIMPLE instead of H5S_SCALAR. EIP - 2002/06/04 * Clear symbol table node "dirty" flag when flushing symbol tables to disk, to reduce I/O calls made & improve performance. QAK - 2002/06/03 @@ -6390,11 +6390,11 @@ address it. Documentation ============= * Documentation was updated for the hdf5-1.4.4 release. - * A new "HDF5 User's Guide" is under development. See + * A new "HDF5 User's Guide" is under development. See http://hdf.ncsa.uiuc.edu/HDF5/doc_dev_snapshot/H5_NewUG/current/. - * A "Parallel HDF5 Tutorial" is available at + * A "Parallel HDF5 Tutorial" is available at http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/. - * The "HDF5 Tutorial" is not distributed with this release. It is + * The "HDF5 Tutorial" is not distributed with this release. It is available at http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/. @@ -6408,20 +6408,20 @@ Platforms Tested AIX 4.3 (IBM SP RS6000) C for AIX Compiler, Version 5.0.2.0 xlf 7.1.0.2 poe 3.1.0.12 (includes mpi) - AIX 5.1 xlc 5.0.2.0 + AIX 5.1 xlc 5.0.2.0 xlf 07.01.0000.0002 mpcc_r 5.0.2.0; mpxlf_r 07.01.0000.0002 Cray T3E sn6711 2.0.5.57 Cray Standard C Version 6.5.0.3 Cray Fortran Version 3.5.0.4 - Cray SV1 10.0.1.1 Cray Standard C Version 6.5.0.3 + Cray SV1 10.0.1.1 Cray Standard C Version 6.5.0.3 Cray Fortran Version 3.5.0.4 FreeBSD 4.6 gcc 2.95.4 g++ 2.95.4 HP-UX B.10.20 HP C HP92453-01 A.10.32.30 HP F90 v2.3 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 - HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 HP F90 v2.4 HP MPI [not a product] (03/24/2000) B6060BA IRIX 6.5 MIPSpro cc 7.30 @@ -6440,16 +6440,16 @@ Platforms Tested Compaq Fortran V5.5-1877-48BBF gcc version 3.0 for C++ SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 Patch 109503-07 2001/08/11 Sun WorkShop 6 update 1 C++ 5.2 Patch 109508-04 2001/07/11 SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 Patch 109503-07 2001/08/11 Sun WorkShop 6 update 1 C++ 5.2 Patch 109508-04 2001/07/11 @@ -6459,7 +6459,7 @@ Platforms Tested gcc 2.96 Intel(R) C++ Version 6.0 Intel(R) Fortran Compiler Version 6.0 - + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 Intel(R) C++ Version 6.0 Intel(R) Fortran Compiler Version 6.0 @@ -6540,10 +6540,10 @@ Supported Configuration Features Summary Footnotes: (1) Using mpich. (2) Using mpt and mpich. - (3) When configured with static-exec enabled, tests fail in + (3) When configured with static-exec enabled, tests fail in serial mode. (4) No HDF4-related tools. - (5) Shared libraries are provided only for the C library, + (5) Shared libraries are provided only for the C library, except on Windows where they are provided for all languages. (6) Linux 2.4 with Intel compilers. @@ -6554,11 +6554,11 @@ Known Problems * Datasets or attributes which have a variable-length string datatype are not printing correctly with h5dump and h5ls. - * When a dataset with the variable-length datatype is overwritten, - the library can develop memory leaks that cause the file to become + * When a dataset with the variable-length datatype is overwritten, + the library can develop memory leaks that cause the file to become unnecessarily large. This is planned to be fixed in the next release. - * On the SV1, the h5ls test fails due to a difference between the + * On the SV1, the h5ls test fails due to a difference between the SV1 printf precision and the printf precision on other platforms. * The h5dump tests may fail to match the expected output on some @@ -6569,14 +6569,14 @@ Known Problems * The --enable-static-exec configure flag fails to compile for HP-UX 11.00 platforms. - * The executables are always dynamic on IRIX64 6.5(64 and n32) and + * The executables are always dynamic on IRIX64 6.5(64 and n32) and IRIX 6.5 even if they are configured with --enable-static-exec. * IRIX 6.5 fails to compile if configured with --enable-static-exec. - + * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause a hang in some cases when chunked storage is used. This is now set to - be off by default. One may turn it on by setting the environment + be off by default. One may turn it on by setting the environment variable HDF5_MPI_OPT_TYPES to a non-zero value such as 1. * On IA32 and IA64 systems, if you use a compiler other than GCC (such as @@ -6592,7 +6592,7 @@ Known Problems # How to pass a linker flag through the compiler. wl="-Wl," - * To build the Fortran library using Intel compilers, one has to + * To build the Fortran library using Intel compilers, one has to x modify the source code in the fortran/src directory to remove the !DEC and !MS compiler directives. x The build will fail in the fortran/test directory and then in the @@ -6600,7 +6600,7 @@ Known Problems those directories to contain two lines work.pc - ../src/work.pc + ../src/work.pc * To build the Fortran library on IA64 use setenv CC "ecc -DIA64" @@ -6627,7 +6627,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -6655,7 +6655,7 @@ New Features o Library ========= o General - --------- + --------- * Added a new test to verify the information provided by the configure command. * Changed internal error handling macros to reduce code size of library by @@ -6756,7 +6756,7 @@ Bug Fixes since HDF5-1.4.2 Release Documentation ============= * Documentation was updated for the hdf5-1.4.3 release. - * A new "HDF5 User's Guide" is under development. See + * A new "HDF5 User's Guide" is under development. See http://hdf.ncsa.uiuc.edu/HDF5/doc_dev_snapshot/H5_NewUG/current/. * Parallel Tutorial is available at http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/ @@ -6773,15 +6773,15 @@ Platforms Tested poe 3.1.0.12 (includes mpi) Cray T3E sn6711 2.0.5.57 Cray Standard C Version 6.5.0.3 Cray Fortran Version 3.5.0.4 - Cray SV1 10.0.0.8 Cray Standard C Version 6.5.0.3 + Cray SV1 10.0.0.8 Cray Standard C Version 6.5.0.3 Cray Fortran Version 3.5.0.4 FreeBSD 4.5 gcc 2.95.3 g++ 2.95.3 HP-UX B.10.20 HP C HP92453-01 A.10.32.30 HP F90 v2.3 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 - HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 HP F90 v2.4 HP MPI [not a product] (03/24/2000) B6060BA IRIX 6.5 MIPSpro cc 7.30 @@ -6792,19 +6792,19 @@ Platforms Tested gcc 2.95.2 with mpich 1.2.1 g++ 2.95.2 pgf90 3.2-4 - OSF1 V5.1 Compaq C V6.3-028 + OSF1 V5.1 Compaq C V6.3-028 Compaq Fortran V5.4-1283 SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 - Workshop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 + (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 + Workshop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 Patch 109503-07 2001/08/11 Sun WorkShop 6 update 1 C++ 5.2 Patch 109508-04 2001/07/11 SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 Patch 109503-07 2001/08/11 Sun WorkShop 6 update 1 C++ 5.2 Patch 109508-04 2001/07/11 @@ -6813,9 +6813,9 @@ Platforms Tested IA-32 Linux 2.2.10smpx cc Intel 5.0.1 egcs-2.91.66 IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 - Intel(R) C++ Itanium(TM) Compiler + Intel(R) C++ Itanium(TM) Compiler for the Itanium(TM)-based applications, - Version 6.0 Beta, Build 20010905 + Version 6.0 Beta, Build 20010905 Windows 2000 (NT5.0) MSVC++ 6.0 DEC Visual Fortran 6.0 Windows NT4.0 MSVC++ 6.0 @@ -6841,7 +6841,7 @@ Supported Configuration Features Summary Solaris2.7 y y (1) y n y y y y Solaris2.8 64 y n y n y y y y Solaris2.8 32 y n y n y y y y - IA-64 y n n n n n y y + IA-64 y n n n n n y y IRIX6.5 y y (1) n n n y y y IRIX64_6.5 64 y y (2) y y n y y y IRIX64_6.5 32 y y (2) n n n y y y @@ -6868,7 +6868,7 @@ Supported Configuration Features Summary Solaris2.7 n x y n n y Solaris2.8 64 n y n n n y Solaris2.8 32 n x n n n y - IA-64 n n n n n y + IA-64 n n n n n y IRIX6.5 n x y n n y IRIX64_6.5 64 n x y n y y IRIX64_6.5 32 n x y n y y @@ -6892,7 +6892,7 @@ Supported Configuration Features Summary Footnotes: (1) Using mpich. (2) Using mpt and mpich. - (3) When configured with static-exec enabled, tests fail + (3) When configured with static-exec enabled, tests fail in serial mode. (4) No HDF4-related tools. (5) Shared libraries are provided only for the C library. @@ -6905,11 +6905,11 @@ Known Problems * Datasets or attributes which have a variable-length string datatype are not printing correctly with h5dump and h5ls. - * When a dataset with the variable-legth datatype is overwritten, - the library can develop memory leaks that cause the file to become + * When a dataset with the variable-legth datatype is overwritten, + the library can develop memory leaks that cause the file to become unnecessarily large. This is planned to be fixed in the next release. - * On the SV1, the h5ls test fails due to a difference between the + * On the SV1, the h5ls test fails due to a difference between the SV1 printf precision and the printf precision on other platforms. @@ -6921,11 +6921,11 @@ Known Problems * The --enable-static-exec configure flag fails to compile for HP-UX 11.00 platforms. - * The executables are always dynamic on IRIX64 6.5(64 and n32) and + * The executables are always dynamic on IRIX64 6.5(64 and n32) and IRIX 6.5 even if they are configured with --enable-static-exec. * IRIX 6.5 fails to compile if configured with --enable-static-exec. - + * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause a hang in some cases when chunked storage is used. This is now set to be off by default. One may turn it on by setting environment variable @@ -6933,12 +6933,12 @@ Known Problems * On IA64 systems one has to use -DIA64 compilation flag to compile h4toh5 and h5toh4 utilites. After configuration step manually modify - Makefile in the tools/h4toh4 and tools/h5toh4 directories to add + Makefile in the tools/h4toh4 and tools/h5toh4 directories to add -DIA64 to the compilation flags. - * On IA32 ansd IA64 systems, if you use a compiler other than GCC + * On IA32 ansd IA64 systems, if you use a compiler other than GCC (such as Intel's ecc compiler), you will need to modify the generated - "libtool" program after configuration is finished. On or around line 102 + "libtool" program after configuration is finished. On or around line 102 of the libtool file, there are lines which look like: # How to pass a linker flag through the compiler. @@ -6952,7 +6952,7 @@ Known Problems %%%%1.4.2%%%% Release Information for hdf5-1.4.2 (31/July/01) -10. Release Information for hdf5-1.4.2 +10. Release Information for hdf5-1.4.2 ================================================================= @@ -6968,7 +6968,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -6999,33 +6999,33 @@ New Features * Parallel HDF5 now runs on the HP V2500 and HP N4000 machines. * F90 API: - Added aditional parameter "dims" to the h5dread_f/h5dwrite_f and - h5aread_f/h5awrite_f subroutines. This parameter is a 1-D array - of size 7 and contains the sizes of the data buffer dimensions. + h5aread_f/h5awrite_f subroutines. This parameter is a 1-D array + of size 7 and contains the sizes of the data buffer dimensions. This change enables portability between Windows and UNIX platforms. - In previous versions of the F90 APIs, the data buffer parameters of - the above functions were declared as assumed-shape arrays, which - were passed to the C functions by a descriptor. There is no - portable means, however, of passing descriptors from F90 to C, + In previous versions of the F90 APIs, the data buffer parameters of + the above functions were declared as assumed-shape arrays, which + were passed to the C functions by a descriptor. There is no + portable means, however, of passing descriptors from F90 to C, causing portability problems between Windows and UNIX and among UNIX platforms. With this change, the data buffers are assumed- size arrays, which can be portably passed to the C functions. - * F90 static library is available on Windows platforms. + * F90 static library is available on Windows platforms. See INSTALL_Windows_withF90.txt for details. * F90 APIs are available on HPUX 11.00 and 10.20 and IBM SP platforms. - * H5 <-> GIF convertor has been added. This is available under + * H5 <-> GIF convertor has been added. This is available under tools/gifconv. The convertor supports the ability to create animated gifs as well. * Verified correct operation of library on Solaris 2.8 in both 64-bit and 32-bit compilation modes. See INSTALL document for instructions on compiling the distribution with 64-bit support. - * Added support for the Metrowerks Code Warrior compiler for Windows. + * Added support for the Metrowerks Code Warrior compiler for Windows. * For H4->H5 converter utility, added a new option to choose not to convert HDF4 specified attributes(reference number, class) into HDF5 attributes. - * Added support chunking and compression in SDS and image in H4->H5 converter. - Currently HDF5 only supports gzip compression, so by default an HDF4 file - with any other compression method will be converted into an HDF5 file in - gzip compression. - * correct the order or reading HDF4 image array in H4->H5 conversion. + * Added support chunking and compression in SDS and image in H4->H5 converter. + Currently HDF5 only supports gzip compression, so by default an HDF4 file + with any other compression method will be converted into an HDF5 file in + gzip compression. + * correct the order or reading HDF4 image array in H4->H5 conversion. * Added new parallel hdf5 tests in t_mpi. The new test checks if the filesystem or the MPI-IO can really handle greater than 2GB files. If it fails, it prints information message only without failing the @@ -7040,8 +7040,8 @@ New Features * Added new checking in H5check_version() to verify the five HDF5 version information macros (H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, H5_VERS_SUBRELEASE and H5_VERS_INFO) are consistent. - - + + Bug Fixes since HDF5-1.4.1 Release ================================== @@ -7050,21 +7050,21 @@ Bug Fixes since HDF5-1.4.1 Release * Fixed problems with Pablo build and linking with non-standard MPI I/O. * Fixed build on Linux systems with --enable-static-exec flag. It now works correctly. - * IMPORTANT: Fixed file metadata corruption bug which could cause + * IMPORTANT: Fixed file metadata corruption bug which could cause metadata data loss in certain situations. * The allocation by alignment (H5Pset_alignment) feature code somehow got dropped in some 1.3.x version. Re-implemented it with "new and improved" algorithm. It keeps track of "wasted" file-fragment in the free-list too. * Removed limitation that the data transfer buffer size needed to be - set for datasets whose dimensions were too large for the 'all' - selection code to handle. Any size dimensioned datasets should be + set for datasets whose dimensions were too large for the 'all' + selection code to handle. Any size dimensioned datasets should be handled correctly now. * Changed behavior of H5Tget_member_type to correctly emulate HDF5 v1.2.x when --enable-hdf5v1_2 configure flag is enabled. - * Added --enable-linux-lfs flag to allow more control over whether to + * Added --enable-linux-lfs flag to allow more control over whether to enable or disable large file support on Linux. - * Fixed various bugs releated to SDS dimensional scale conversions in H4->H5 + * Fixed various bugs releated to SDS dimensional scale conversions in H4->H5 converter. * Fixed a bug to correctly convert HDF4 objects with fill value into HDF5. * Fixed a bug of H5pubconf.h causing repeated definitions if it is included @@ -7082,18 +7082,18 @@ Documentation ============= * The H5T_conv_t and H5T_cdata_t structures are now properly defined - in the H5Tregister entry in the "H5T" section of the "HDF5 Reference - Manual" and described in detail in section 12, "Data Conversions," in + in the H5Tregister entry in the "H5T" section of the "HDF5 Reference + Manual" and described in detail in section 12, "Data Conversions," in the "Datatypes" chapter of the "HDF5 User's Guide." * The new tools h52gif and gif2h5 have been added to the "Tools" section of the Reference Manual. - * A "Freespace Management" section has been added to the "Performance" + * A "Freespace Management" section has been added to the "Performance" chapter of the User's Guide. * Several user-reported bugs have been fixed since Release 1.4.1. * The "HDF5 Image and Palette Specification" (in the "HDF5 Application - Developer's Guide") has been heavily revised. Based on extensive user - feedback and input from visualization software developers, Version 1.2 - of the image specification is substantially different from prior + Developer's Guide") has been heavily revised. Based on extensive user + feedback and input from visualization software developers, Version 1.2 + of the image specification is substantially different from prior versions. @@ -7108,15 +7108,15 @@ Platforms Tested xlf 7.1.0.2 poe 2.4.0.14 (includes mpi) Cray T3E sn6711 2.0.5.49a Cray Standard C Version 6.5.0.1 - Cray SV1 10.0.0.2 Cray Standard C Version 6.5.0.1 + Cray SV1 10.0.0.2 Cray Standard C Version 6.5.0.1 Cray Fortran Version 3.5.0.1 FreeBSD 4.3 gcc 2.95.3 g++ 2.95.3 HP-UX B.10.20 HP C HP92453-01 A.10.32.30 HP F90 v2.3 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 HP F90 v2.4 - HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 + HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 HP F90 v2.4 IRIX 6.5 MIPSpro cc 7.30 IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.2m @@ -7128,19 +7128,19 @@ Platforms Tested pgf90 3.2-4 OSF1 V4.0 DEC-V5.2-040 on Digital UNIX V4.0 (Rev 564) Digital Fortran 90 V4.1-270 - SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.6) WorkShop Compilers 5.0 98/10/25 FORTRAN 90 + SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.6) WorkShop Compilers 5.0 98/10/25 FORTRAN 90 2.0 Patch 107356-04 SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 + (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 Workshop Compilers 5.0 98/10/25 FORTRAN 90 - 2.0 Patch 107356-04 + 2.0 Patch 107356-04 SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 2000/09/11 Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 2000/09/11 Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 TFLOPS r1.0.4 v4.0.7 i386 pgcc Rel 3.1-4i with mpich-1.2.1 with @@ -7220,7 +7220,7 @@ Supported Configuration Features Summary Footnotes: (1) Using mpich. (2) Using mpt and mpich. - (3) When configured with static-exec enabled, tests fail + (3) When configured with static-exec enabled, tests fail in serial mode. (4) No HDF4-related tools. (5) Shared libraries are provided only for the C library. @@ -7229,11 +7229,11 @@ Supported Configuration Features Summary Known Problems ============== - * When a dataset with the variable-legth datatype is overwritten, - the library can develop memory leaks that cause the file to become + * When a dataset with the variable-legth datatype is overwritten, + the library can develop memory leaks that cause the file to become unnecessarily large. This is planned to be fixed in the next release. - * On the SV1, the h5ls test fails due to a difference between the + * On the SV1, the h5ls test fails due to a difference between the SV1 printf precision and the printf precision on other platforms. * The h5dump tests may fail to match the expected output in some @@ -7244,13 +7244,13 @@ Known Problems * The --enable-static-exec configure flag fails to compile for HP-UX 11.00 platforms. - * The executables are always dynamic on IRIX64 6.5(64 and n32) and + * The executables are always dynamic on IRIX64 6.5(64 and n32) and IRIX 6.5 even if they are configured with --enable-static-exec. * IRIX 6.5 fails to compile if configured with --enable-static-exec. - + * For 24-bit image conversion from H4->H5, the current conversion is - not consistent with HDF5 image specification. + not consistent with HDF5 image specification. * In some cases, and SDS with an UNLIMITED dimension that has not been written (current size = 0) is not converted correctly. @@ -7269,7 +7269,7 @@ Known Problems ===================================================================== - + HDF5 Release 1.4.1 @@ -7285,7 +7285,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -7307,10 +7307,10 @@ New Features ============ * XML output option for h5dump utility. - + A new option --xml to output data in XML format has been added. The XML output contains a complete description of the file, marked up in - XML. + XML. The XML conforms to the HDF5 Document Type Definition (DTD), which is available at: @@ -7353,25 +7353,25 @@ Bug Fixes since HDF5-1.4.0 Release Documentation ============= - PDF and Postscript versions of the following documents are available + PDF and Postscript versions of the following documents are available for this release: Document Filename -------- -------- Introduction to HDF5 H5-R141-Introduction.pdf - HDF5 Reference Manual H5-R141-RefManual.pdf + HDF5 Reference Manual H5-R141-RefManual.pdf C++ APIs to HDF5 documents H5-R141-Cplusplus.pdf Fortran90 APIs to HDF5 documents H5-R141-Fortran90.pdf PDF and Postscript files containing H5-R141-DocSet.pdf all of the above H5-R141-DocSet.ps - These files are not included in this distribution, but are available + These files are not included in this distribution, but are available via the Web or FTP at the following locations: http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/ ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/docs/ - While these documents are labeled Release 1.4.1, they describe - Release 1.4.0 as well. + While these documents are labeled Release 1.4.1, they describe + Release 1.4.0 as well. Platforms Tested @@ -7392,8 +7392,8 @@ Due to the nature of this release only C, C++ libraries and tools were tested. g++ 2.95.2 OSF1 V4.0 DEC-V5.2-040 Digital Fortran 90 V4.1-270 - SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.6) + SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.6) SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 @@ -7419,11 +7419,11 @@ Known Problems * The --enable-static-exec configure flag fails to compile for HP-UX 11.00 platforms. - * The executable are always dynamic on IRIX64 6.5(64 and n32) and + * The executable are always dynamic on IRIX64 6.5(64 and n32) and IRIX 6.5 even if they are configured with --enable-static-exec. * The shared library failed compilation on IRIX 6.5. - + * After "make install" or "make install-doc" one may need to reload the source from the tar file before doing another build. @@ -7434,7 +7434,7 @@ Known Problems 8. Release Information for hdf5-1.4.0 =================================================================== - + HDF5 Release 1.4.0 @@ -7451,7 +7451,7 @@ The HDF5 documentation can be found on the NCSA ftp server /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -7462,11 +7462,11 @@ If you have any questions or comments, please send them to: CONTENTS - New Features -- h4toh5 Utility +- h4toh5 Utility - F90 Support - C++ Support -- Pablo Support -- Bug Fixes since HDF5-1.2.0 +- Pablo Support +- Bug Fixes since HDF5-1.2.0 - Bug Fixes since HDF5-1.4.0-beta2 - Bug Fixes since HDF5-1.4.0 - Documentation @@ -7495,15 +7495,15 @@ New Features * Added new Virtual File Driver, Stream VFD, to send/receive entire HDF5 files via socket connections. * As parts of VFL, HDF-GASS and HDF-SRB are also added to this - release. To find out details, please read INSTALL_VFL file. + release. To find out details, please read INSTALL_VFL file. * Increased maximum number of dimensions for a dataset (H5S_MAX_RANK) from 31 to 32 to align with HDF4 & netCDF. * Added 'query' function to VFL drivers. Also added 'type' parameter to VFL 'read' & 'write' calls, so they are aware of the type of data being accessed in the file. Updated the VFL document also. * A new h4toh5 utility, to convert HDF4 files to analogous HDF5 files. - * Added a new array datatype to the datatypes which can be created. - Removed "array fields" from compound datatypes (use an array datatype + * Added a new array datatype to the datatypes which can be created. + Removed "array fields" from compound datatypes (use an array datatype instead). * Parallel HDF5 works correctly with mpich-1.2.1 on Solaris, SGI, Linux. * You can now install the HDF5 documentation using the @@ -7514,26 +7514,26 @@ New Features Check doc/html/TechNotes/openmp-hdf5.html for details. -h4toh5 Utility +h4toh5 Utility ============== - The h4toh5 utility is a new utility that converts an HDF4 file to an - HDF5 file. For details, see the document, "Mapping HDF4 Objects to + The h4toh5 utility is a new utility that converts an HDF4 file to an + HDF5 file. For details, see the document, "Mapping HDF4 Objects to HDF5 Objects": http://hdf.ncsa.uiuc.edu/HDF5/papers/H4-H5MappingGuidelines.pdf Known Bugs: The h4toh5 utility produces images that do not correctly conform - to the HDF5 Image and Palette Specification. + to the HDF5 Image and Palette Specification. http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html - Several required HDF5 attributes are omitted, and the dataspace - is reversed (i.e., the ht. and width of the image dataset is + Several required HDF5 attributes are omitted, and the dataspace + is reversed (i.e., the ht. and width of the image dataset is incorrectly described.) For more information, please see: http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.html - + This bug has been fixed for the snapshot of hdf5 1.4 release. March 12th,2001 Known Limitations of the h4toh5 release @@ -7555,7 +7555,7 @@ h4toh5 Utility be an H5T_INTEGER type. * For attributes of any HDF4 object, data of type 'DFNT_CHAR8' will be converted to an HDF5 'H5T_STRING' type. - * For an HDF4 Vdata, it is difficult to determine whether data + * For an HDF4 Vdata, it is difficult to determine whether data of type 'DFNT_CHAR8' is intended to be bytes or characters. The h4toh5 utility will consider them to be C characters, and will convert them to an HDF5 'H5T_STRING' type. @@ -7569,10 +7569,10 @@ h4toh5 Utility with analogous chunked storage. An HDF4 object that uses compression will be converted to an - uncompressed HDF5 object. + uncompressed HDF5 object. An HDF4 object that uses external storage will be converted to an - HDF5 object without external storage. + HDF5 object without external storage. 4. Memory Use @@ -7589,29 +7589,29 @@ h4toh5 Utility The h4toh5 utility requires HDF5-1.4.0 and HDF4r1.4 - h4toh5 utility has been tested on all platforms listed below (see + h4toh5 utility has been tested on all platforms listed below (see section "Platforms Tested") except TFLOPS. - + F90 Support =========== - This is the first release of the HDF5 Library with fully integrated - F90 API support. The Fortran Library is created when the + This is the first release of the HDF5 Library with fully integrated + F90 API support. The Fortran Library is created when the --enable-fortran flag is specified during configuration. - Not all F90 subroutines are implemented. Please refer to the HDF5 + Not all F90 subroutines are implemented. Please refer to the HDF5 Reference Manual for more details. - - F90 APIs are available for the Solaris 2.6 and 2.7, Linux, DEC UNIX, - T3E, SV1 and O2K (64 bit option only) platforms. The Parallel version of + + F90 APIs are available for the Solaris 2.6 and 2.7, Linux, DEC UNIX, + T3E, SV1 and O2K (64 bit option only) platforms. The Parallel version of the HDF5 F90 Library is supported on the O2K and T3E platforms. Changes since the last prototype release (July 2000) ---------------------------------------------------- - * h5open_f and h5close_f must be called instead of h5init_types and + * h5open_f and h5close_f must be called instead of h5init_types and h5close_types. - * The following subroutines are no longer available: + * The following subroutines are no longer available: h5pset_xfer_f h5pget_xfer_f @@ -7625,45 +7625,45 @@ F90 Support h5pget_core_f h5pset_family_f h5pget_family_f - + * The following functions have been added: h5pset_fapl_mpio_f h5pget_fapl_mpio_f h5pset_dxpl_mpio_f h5pget_dxpl_mpio_f - - * In the previous HDF5 F90 releases, the implementation of object - references and dataset region references was not portable. This - release introduces a portable implementation, but it also introduces - changes to the read/write APIs that handle references. If object or - dataset region references are written or read to/from an HDF5 file, - h5dwrite_f and h5dread_f must use the extra parameter, n, for the + + * In the previous HDF5 F90 releases, the implementation of object + references and dataset region references was not portable. This + release introduces a portable implementation, but it also introduces + changes to the read/write APIs that handle references. If object or + dataset region references are written or read to/from an HDF5 file, + h5dwrite_f and h5dread_f must use the extra parameter, n, for the buffer size: h5dwrite(read)_f(dset_id, mem_type_id, buf, n, hdferr, & - ^^^ + ^^^ mem_space_id, file_space_id, xfer_prp) - For other datatypes the APIs were not changed. - - + For other datatypes the APIs were not changed. + + C++ Support =========== - This is the first release of the HDF5 Library with fully integrated + This is the first release of the HDF5 Library with fully integrated C++ API support. The HDF5 C++ library is built when the --enable-cxx flag is specified during configuration. Check the HDF5 Reference Manual for available C++ documentation. - C++ APIs are available for Solaris 2.6 and 2.7, Linux, and FreeBSD. + C++ APIs are available for Solaris 2.6 and 2.7, Linux, and FreeBSD. Pablo Support ============= This version does not allow proper building of the Pablo-instrumented version of the library. A version supporting the pablo build is - available on the Pablo Website at + available on the Pablo Website at www-pablo.cs.uiuc.edu/pub/Pablo.Release.5/HDFLibrary/hdf5_v1.4.tar.gz @@ -7724,7 +7724,7 @@ Library Configuration ------------- * The hdf5.h include file was fixed to allow the HDF5 Library to be - compiled with other libraries/applications that use GNU autoconf. + compiled with other libraries/applications that use GNU autoconf. * Configuration for parallel HDF5 was improved. Configure now attempts to link with libmpi.a and/or libmpio.a as the MPI libraries by default. It also uses "mpirun" to launch MPI tests by default. It @@ -7774,14 +7774,14 @@ Tools * h5dump correctly displays the committed copy of predefined types correctly. * Added an option, -V, to show the version information of h5dump. - * Fixed a core dumping bug of h5toh4 when executed on platforms like + * Fixed a core dumping bug of h5toh4 when executed on platforms like TFLOPS. * The test script for h5toh4 used to not able to detect the hdp dumper command was not valid. It now detects and reports the failure of hdp execution. * Merged the tools with the 1.2.2 branch. Required adding new macros, VERSION12 and VERSION13, used in conditional compilation. - Updated the Windows project files for the tools. + Updated the Windows project files for the tools. * h5dump displays opaque and bitfield data correctly. * h5dump and h5ls can browse files created with the Stream VFD (eg. "h5ls :"). @@ -7794,10 +7794,10 @@ Tools Bug Fixes since HDF5-1.4.0-beta2 ================================ - * Fixed a bug in the conversion from a little endian double to a big + * Fixed a bug in the conversion from a little endian double to a big endian float in some special cases. - * Corrected configuration error which was not including compression - support correctly. + * Corrected configuration error which was not including compression + support correctly. * Cleaned up lots of warnings. * Changed a few h5dump command line switches and added long versions of the switches. @@ -7806,7 +7806,7 @@ Bug Fixes since HDF5-1.4.0-beta2 * Fixed fairly obscure bug in hyperslab I/O which could (in rare cases) not copy all the data during a transfer. * Removed ragged array code from library. - * F90 library and module files are installed properly now on all supported + * F90 library and module files are installed properly now on all supported platforms. @@ -7822,26 +7822,26 @@ Bug Fixes since HDF5-1.4.0 Release Documentation ============= - * A new document summarizing the changes in the library leading up to - the current release has been added: + * A new document summarizing the changes in the library leading up to + the current release has been added: HDF5 Software Changes from Release to Release - This document is in the Application Developer's Guide and is of - particular interest to developers who must keep an application + This document is in the Application Developer's Guide and is of + particular interest to developers who must keep an application synchronized with the library. * The documentation for the Fortran90 and C++ APIs is linked to the - opening page of the Reference Manual. Fortran90 functions are + opening page of the Reference Manual. Fortran90 functions are individually referenced from the corresponding C functions through- out the Reference Manual. - * User's Guide and Reference Manual were updated to reflect changed - function syntax and to fix reported bugs. - * Functions that are new at this release were added to the Reference - Manual. - * Functions that have been removed from the library were removed from + * User's Guide and Reference Manual were updated to reflect changed + function syntax and to fix reported bugs. + * Functions that are new at this release were added to the Reference + Manual. + * Functions that have been removed from the library were removed from the User's Guide and the Reference Manual. - * PostScript and PDF versions of the Release 1.4 document set are + * PostScript and PDF versions of the Release 1.4 document set are not available at the time of Release 1.4.0. - + Platforms Tested ================ AIX 4.3.3.0 (IBM SP powerpc) xlc 3.6.6 @@ -7865,7 +7865,7 @@ Platforms Tested mpich-1.2.1 OSF1 V4.0 DEC-V5.2-040 Digital Fortran 90 V4.1-270 - SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 + SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 (Solaris 2.6) WorkShop Compilers 5.0 99/10/25 Fortran 90 2.0 Patch 107356-04 Workshop Compilers 5.0 98/12/15 C++ 5.0 @@ -7874,7 +7874,7 @@ Platforms Tested 2.0 Patch 107356-04 Workshop Compilers 5.0 98/12/15 C++ 5.0 mpich-1.2.1 - SunOS 5.5.1 gcc-2.7.2 + SunOS 5.5.1 gcc-2.7.2 (Solaris 2.5.1 (x86)) TFLOPS r1.0.4 v4.0 mpich-1.2.1 with local changes Windows NT4.0, 2000 (NT5.0) MSVC++ 6.0 @@ -7931,17 +7931,17 @@ Supported Configuration Features Summary Footnotes: (1) Using mpich. (2) Using mpt and mpich. - (3) When configured with static-exec enabled, tests fail + (3) When configured with static-exec enabled, tests fail in serial mode. (4) No HDF4-related tools. Known Problems ============== - * 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 + * 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 fails to compile for Solaris @@ -7950,7 +7950,7 @@ Known Problems The --enable-static-exec configure flag also fails to correctly compile on Linux platforms using the gcc-2.95.2 compiler. - + The --enable-static-exec configure flag also fails to correctly compile on IBM SP2 platform for the serial mode. The parallel mode works fine with this option. @@ -7959,7 +7959,7 @@ Known Problems The executable files in hdf5/bin are dynamic-linked for IRIX64 6.5(64 and n32 modes) and IRIX 6.5, even though they are compiled with static library. - + It is suggested that you don't use this option on these platforms during configuration. @@ -7971,10 +7971,10 @@ Known Problems 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. - * SunOS 5.6 with C WorkShop Compilers 4.2: Hyperslab selections will + * SunOS 5.6 with C WorkShop Compilers 4.2: Hyperslab selections will fail if library is compiled using optimization of any level. * When building hdf5 tools and applications on windows platform, a linking @@ -7982,8 +7982,8 @@ Known Problems on debug version when running VC++6.0. This warning doesn't affect building and testing hdf5 applications. We will continue investigating this. - * h5toh4 converter fails two cases(tstr.h5 and tmany.h5) for release dll - version on windows 2000 and NT. The reason is possibly due to Windows NT + * h5toh4 converter fails two cases(tstr.h5 and tmany.h5) for release dll + version on windows 2000 and NT. The reason is possibly due to Windows NT DLL convention on freeing memory. It seems that memory cannot be freed across library or DLL. It is still under investigation. @@ -7991,7 +7991,7 @@ Known Problems the configured with --with-gass. * HDF-SRB testing got segmentation error on Solaris 2.7. - + * The Stream VFD was not tested yet under Windows. It is not supported in the TFLOPS machine. @@ -8006,7 +8006,7 @@ Known Problems * Certain platforms give false negatives when testing h5ls: - Solaris x86 2.5.1, Cray T3E and Cray J90 give errors during testing - when displaying object references in certain files. These are benign + when displaying object references in certain files. These are benign differences due to the difference in sizes of the objects created on those platforms. h5ls appears to be dumping object references correctly. @@ -8015,18 +8015,18 @@ Known Problems different precision in the values displayed and h5ls appears to be dumping floating-point numbers correctly. - * Before building HDF5 F90 Library from source on Crays (T3E and SV1) - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files from + * Before building HDF5 F90 Library from source on Crays (T3E and SV1) + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files from the ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/hdf5-1.4.0/src/crayf90/ directory. * The h4toh5 utility produces images that do not correctly conform - to the HDF5 Image and Palette Specification. + to the HDF5 Image and Palette Specification. http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html - Several required HDF5 attributes are omitted, and the dataspace - is reversed (i.e., the ht. and width of the image dataset is + Several required HDF5 attributes are omitted, and the dataspace + is reversed (i.e., the ht. and width of the image dataset is incorrectly described.) For more information, please see: http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.htm @@ -8037,17 +8037,17 @@ Known Problems ================================================================= INTRODUCTION -This document describes the differences between HDF5-1.2.1 and +This document describes the differences between HDF5-1.2.1 and HDF5-1.2.2, and contains information on the platforms where HDF5-1.2.2 -was tested and known problems in HDF5-1.2.2. +was tested and known problems in HDF5-1.2.2. -The HDF5 documentation can be found on the NCSA ftp server +The HDF5 documentation can be found on the NCSA ftp server (ftp.ncsa.uiuc.edu) in the directory: /HDF/HDF5/docs/ For more information look at the HDF5 home page at: - + http://hdf.ncsa.uiuc.edu/HDF5/ If you have any questions or comments, please send them to: @@ -8057,7 +8057,7 @@ If you have any questions or comments, please send them to: CONTENTS -- Features Added since HDF5-1.2.1 +- Features Added since HDF5-1.2.1 - Bug Fixes since HDF5-1.2.1 - Known Problems - Platforms Tested @@ -8108,10 +8108,10 @@ Bug Fixes since HDF5-1.2.1 Known Problems ============== -o SunOS 5.6 with C WorkShop Compilers 4.2: hyperslab selections will +o SunOS 5.6 with C WorkShop Compilers 4.2: hyperslab selections will fail if library is compiled using optimization of any level. o TFLOPS: dsets test fails if compiled with optimization turned on. -o J90: tools fail to dispay data for the datasets with a compound datatype. +o J90: tools fail to dispay data for the datasets with a compound datatype. Platforms Tested ================ @@ -8125,13 +8125,13 @@ Platforms Tested mpt.1.3 FreeBSD 4.0 gcc 2.95.2 HP-UX B.10.20 HP C HP92453-01 A.10.32 - HP-UX B.11.00 HP92453-01 A.11.00.13 HP C Compiler - (static library only, h5toh4 tool is not available) + HP-UX B.11.00 HP92453-01 A.11.00.13 HP C Compiler + (static library only, h5toh4 tool is not available) IRIX 6.5 MIPSpro cc 7.30 IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m mpt.1.4 - Linux 2.2.10 SMP gcc 2.95.1 + Linux 2.2.10 SMP gcc 2.95.1 mpicc(gcc-2.95.1) gcc (egcs-2.91.66) mpicc (egcs-2.91.66) @@ -8162,7 +8162,7 @@ Configuration ------------- * The hdf5.h include file was fixed to allow the HDF5 Library to be compiled - with other libraries/applications that use GNU autoconf. + with other libraries/applications that use GNU autoconf. * Configuration for parallel HDF5 was improved. Configure now attempts to link with libmpi.a and/or libmpio.a as the MPI libraries by default. It also uses "mpirun" to launch MPI tests by default. It tests to @@ -8195,7 +8195,7 @@ Tools ------ * Added an option, -V, to show the version information of h5dump. - * Fixed a core dumping bug of h5toh4 when executed on platforms like + * Fixed a core dumping bug of h5toh4 when executed on platforms like TFLOPS. * The test script for h5toh4 used to not able to detect the hdp dumper command was not valid. It now detects and reports the @@ -8204,10 +8204,10 @@ Tools Documentation ------------- - * User's Guide and Reference Manual were updated. - See doc/html/PSandPDF/index.html for more details. + * User's Guide and Reference Manual were updated. + See doc/html/PSandPDF/index.html for more details. + - Platforms Tested: ================ Note: Due to the nature of bug fixes, only static versions of the library and tools were tested. @@ -8224,7 +8224,7 @@ Note: Due to the nature of bug fixes, only static versions of the library and to Linux 2.2.10 SuSE egcs-2.91.66 configured with (i686-pc-linux-gnu) --disable-hsizet - mpich-1.2.0 egcs-2.91.66 19990314/Linux + mpich-1.2.0 egcs-2.91.66 19990314/Linux OSF1 V4.0 DEC-V5.2-040 SunOS 5.6 cc WorkShop Compilers 4.2 no optimization @@ -8236,13 +8236,13 @@ Note: Due to the nature of bug fixes, only static versions of the library and to Known Problems: ============== -o SunOS 5.6 with C WorkShop Compilers 4.2: Hyperslab selections will +o SunOS 5.6 with C WorkShop Compilers 4.2: Hyperslab selections will fail if library is compiled using optimization of any level. %%%%1.2.0%%%% Release Information for hdf5-1.2.0 - + 5. Release Information for hdf5-1.2.0 =================================================================== @@ -8254,13 +8254,13 @@ applicable, are systems that HDF5 1.2.0 was tested on. Compiler & libraries Platform Information Comment - -------- ---------- -------- - + -------- ---------- -------- + AIX 4.3.2 (IBM SP) 3.6.6 Cray J90 10.0.0.6 cc 6.3.0.0 - Cray T3E 2.0.4.61 cc 6.2.1.0 + Cray T3E 2.0.4.61 cc 6.2.1.0 mpt.1.3 FreeBSD 3.2 gcc 2.95.1 @@ -8268,7 +8268,7 @@ applicable, are systems that HDF5 1.2.0 was tested on. HP-UX B.10.20 HP C HP92453-01 A.10.32 gcc 2.8.1 - IRIX 6.5 MIPSpro cc 7.30 + IRIX 6.5 MIPSpro cc 7.30 IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m mpt.1.3 (SGI MPI 3.2.0.0) @@ -8279,19 +8279,19 @@ applicable, are systems that HDF5 1.2.0 was tested on. OSF1 V4.0 DEC-V5.2-040 - SunOS 5.6 cc WorkShop Compilers 4.2 + SunOS 5.6 cc WorkShop Compilers 4.2 no optimization gcc 2.8.1 SunOS 5.7 cc WorkShop Compilers 5.0 gcc 2.8.1 - + TFLOPS 2.7.1 cicc (pgcc Rel 3.0-4i) mpich-1.1.2 with local changes Windows NT4.0 intel MSVC++ 5.0 and 6.0 - Windows NT alpha 4.0 MSVC++ 5.0 + Windows NT alpha 4.0 MSVC++ 5.0 Windows 98 MSVC++ 5.0 @@ -8306,7 +8306,7 @@ B. Known Problems Hyperslab selections will fail if library is compiled using optimization of any level. - + C. Changes Since Version 1.0.1 --------------------------- @@ -8320,7 +8320,7 @@ C. Changes Since Version 1.0.1 * Self-contained documentation for installations isolated from the Internet. -* HDF5 Tutorial was added to the documentation +* HDF5 Tutorial was added to the documentation 2. Configuration ------------- @@ -8352,7 +8352,7 @@ C. Changes Since Version 1.0.1 * Optimizations to compound datatype conversions and I/O operations. -* Added nearly 100 optimized conversion functions for native datatypes +* Added nearly 100 optimized conversion functions for native datatypes including support for non-aligned data. * Added support for bitfield, opaque, and enumeration types. @@ -8404,23 +8404,23 @@ C. Changes Since Version 1.0.1 * Improved the algorithm that translates an HDF5 hyperslab selection into an MPI type for better collective I/O performance. -8. New API functions +8. New API functions ----------------- a. Property List Interface: ------------------------ H5Pset_xfer - set data transfer properties - H5Pset_preserve - set dataset transfer property list status + H5Pset_preserve - set dataset transfer property list status H5Pget_preserve - get dataset transfer property list status H5Pset_hyper_cache - indicates whether to cache hyperslab blocks during I/O - H5Pget_hyper_cache - returns information regarding the caching of + H5Pget_hyper_cache - returns information regarding the caching of hyperslab blocks during I/O - H5Pget_btree_ratios - sets B-tree split ratios for a dataset + H5Pget_btree_ratios - sets B-tree split ratios for a dataset transfer property list H5Pset_btree_ratios - gets B-tree split ratios for a dataset transfer property list - H5Pset_vlen_mem_manager - sets the memory manager for variable-length + H5Pset_vlen_mem_manager - sets the memory manager for variable-length datatype allocation H5Pget_vlen_mem_manager - sets the memory manager for variable-length datatype allocation @@ -8435,26 +8435,26 @@ C. Changes Since Version 1.0.1 c. Dataspace Interface: -------------------- H5Sget_select_hyper_nblocks - get number of hyperslab blocks - H5Sget_select_hyper_blocklist - get the list of hyperslab blocks + H5Sget_select_hyper_blocklist - get the list of hyperslab blocks currently selected - H5Sget_select_elem_npoints - get the number of element points + H5Sget_select_elem_npoints - get the number of element points in the current selection - H5Sget_select_elem_pointlist - get the list of element points + H5Sget_select_elem_pointlist - get the list of element points currently selected - H5Sget_select_bounds - gets the bounding box containing + H5Sget_select_bounds - gets the bounding box containing the current selection d. Datatype Interface: ------------------- - H5Tget_super - return the base datatype from which a + H5Tget_super - return the base datatype from which a datatype is derived H5Tvlen_create - creates a new variable-length dataype H5Tenum_create - creates a new enumeration datatype H5Tenum_insert - inserts a new enumeration datatype member - H5Tenum_nameof - returns the symbol name corresponding to a + H5Tenum_nameof - returns the symbol name corresponding to a + specified member of an enumeration datatype + H5Tvalueof - return the value corresponding to a specified member of an enumeration datatype - H5Tvalueof - return the value corresponding to a - specified member of an enumeration datatype H5Tget_member_value - return the value of an enumeration datatype member H5Tset_tag - tags an opaque datatype H5Tget_tag - gets the tag associated with an opaque datatype @@ -8468,7 +8468,7 @@ C. Changes Since Version 1.0.1 H5Rcreate - creates a reference H5Rdereference - open the HDF5 object referenced H5Rget_region - retrieve a dataspace with the specified region selected - H5Rget_object_type - retrieve the type of object that an + H5Rget_object_type - retrieve the type of object that an object reference points to g. Ragged Arrays (alpha) (names of those API functions were changed): @@ -8486,7 +8486,7 @@ C. Changes Since Version 1.0.1 * Enhancements to the h5ls tool including the ability to list objects from more than one file, to display raw hexadecimal data, to show file addresses for raw data, to format output more reasonably, - to show object attributes, and to perform a recursive listing, + to show object attributes, and to perform a recursive listing, * Enhancements to h5dump: support new data types added since previous versions. @@ -8496,7 +8496,7 @@ C. Changes Since Version 1.0.1 %%%%1.0.1%%%% Release Information for hdf5-1.0.1 - + 4. Changes from Release 1.0.0 to Release 1.0.1 ===================================================================== @@ -8506,7 +8506,7 @@ C. Changes Since Version 1.0.1 * [Bug-Fix]: Configure failed for all IRIX versions other than 6.3. It now configures correctly for all IRIX 6.x version. -* Released Parallel HDF5 +* Released Parallel HDF5 Supported Features: ------------------ @@ -8526,7 +8526,7 @@ C. Changes Since Version 1.0.1 IBM SP2 SGI Origin 2000 - Changes In This Release: + Changes In This Release: ----------------------- o Support of Access to Extendable Dimension Datasets. @@ -8570,7 +8570,7 @@ C. Changes Since Version 1.0.1 ==================================================================== * Added fill values for datasets. For contiguous datasets fill value - performance may be quite poor since the fill value is written to the + performance may be quite poor since the fill value is written to the entire dataset when the dataset is created. This will be remedied in a future version. Chunked datasets using fill values do not incur any additional overhead. See H5Pset_fill_value(). @@ -8621,17 +8621,17 @@ C. Changes Since Version 1.0.1 %%%%1.0.0 Alpha 2%%%% Release Information for hdf5-1.0.0 Alpha 2 -1. Changes from the First Alpha 1.0.0 Release to +1. Changes from the First Alpha 1.0.0 Release to the Second Alpha 1.0.0 Release ===================================================================== * Two of the packages have been renamed. The data space API has been - renamed from `H5P' to `H5S' and the property list (template) API has + renamed from `H5P' to `H5S' and the property list (template) API has been renamed from `H5C' to `H5P'. -* The new attribute API `H5A' has been added. An attribute is a small +* The new attribute API `H5A' has been added. An attribute is a small dataset which can be attached to some other object (for instance, a - 4x4 transformation matrix attached to a 3-dimensional dataset, or an + 4x4 transformation matrix attached to a 3-dimensional dataset, or an English abstract attached to a group). * The error handling API `H5E' has been completed. By default, when an @@ -8643,7 +8643,7 @@ C. Changes Since Version 1.0.1 * Support for large files and datasets (>2GB) has been added. There is an html document that describes how it works. Some of the types for function arguments have changed to support this: all arguments - pertaining to sizes of memory objects are `size_t' and all arguments + pertaining to sizes of memory objects are `size_t' and all arguments pertaining to file sizes are `hsize_t'. * More data type conversions have been added although none of them are @@ -8669,7 +8669,7 @@ C. Changes Since Version 1.0.1 * Data types can be stored in the file as independent objects and multiple datasets can share a data type. -* The raw data I/O stream has been implemented and the application can +* The raw data I/O stream has been implemented and the application can control meta and raw data caches, so I/O performance should be improved from the first alpha release. @@ -8681,14 +8681,14 @@ C. Changes Since Version 1.0.1 applications or I/O libraries and described and accessed through HDF5. -* Hard and soft (symbolic) links are implemented which allow groups to +* Hard and soft (symbolic) links are implemented which allow groups to share objects. Dangling and recursive symbolic links are supported. * User-defined data compression is implemented although we may generalize the interface to allow arbitrary user-defined filters which can be used for compression, checksums, encryption, performance monitoring, etc. The publicly-available `deflate' - method is predefined if the GNU libz.a can be found at configuration + method is predefined if the GNU libz.a can be found at configuration time. * The configuration scripts have been modified to make it easier to @@ -8786,16 +8786,16 @@ Property Lists H5Pset_mpi - set MPI-IO properties H5Pget_xfer - get data transfer properties + H5Pset_xfer - set data transfer properties - + H5Pset_preserve - set dataset transfer property list status + + H5Pset_preserve - set dataset transfer property list status + H5Pget_preserve - get dataset transfer property list status + H5Pset_hyper_cache - indicates whether to cache hyperslab blocks during I/O - + H5Pget_hyper_cache - returns information regarding the caching of + + H5Pget_hyper_cache - returns information regarding the caching of hyperslab blocks during I/O - + H5Pget_btree_ratios - sets B-tree split ratios for a dataset + + H5Pget_btree_ratios - sets B-tree split ratios for a dataset transfer property list + H5Pset_btree_ratios - gets B-tree split ratios for a dataset transfer property list - + H5Pset_vlen_mem_manager - sets the memory manager for variable-length + + H5Pset_vlen_mem_manager - sets the memory manager for variable-length datatype allocation + H5Pget_vlen_mem_manager - sets the memory manager for variable-length datatype allocation @@ -8885,13 +8885,13 @@ Dataspaces H5Soffset_simple - set selection offset H5Sselect_valid - determine if selection is valid for extent + H5Sget_select_hyper_nblocks - get number of hyperslab blocks - + H5Sget_select_hyper_blocklist - get the list of hyperslab blocks + + H5Sget_select_hyper_blocklist - get the list of hyperslab blocks currently selected - + H5Sget_select_elem_npoints - get the number of element points + + H5Sget_select_elem_npoints - get the number of element points in the current selection - + H5Sget_select_elem_pointlist - get the list of element points + + H5Sget_select_elem_pointlist - get the list of element points currently selected - + H5Sget_select_bounds - gets the bounding box containing + + H5Sget_select_bounds - gets the bounding box containing the current selection Datatypes @@ -8942,15 +8942,15 @@ Datatypes H5Tset_sign - set integer sign type H5Tset_size - set size in bytes H5Tset_strpad - set string padding - + H5Tget_super - return the base datatype from which a + + H5Tget_super - return the base datatype from which a datatype is derived + H5Tvlen_create - creates a new variable-length dataype + H5Tenum_create - creates a new enumeration datatype + H5Tenum_insert - inserts a new enumeration datatype member - + H5Tenum_nameof - returns the symbol name corresponding to a + + H5Tenum_nameof - returns the symbol name corresponding to a + specified member of an enumeration datatype + + H5Tvalueof - return the value corresponding to a specified member of an enumeration datatype - + H5Tvalueof - return the value corresponding to a - specified member of an enumeration datatype + H5Tget_member_value - return the value of an enumeration datatype member + H5Tset_tag - tags an opaque datatype + H5Tget_tag - gets the tag associated with an opaque datatype @@ -8959,10 +8959,10 @@ Datatypes - H5Tregister_soft - register general type conversion function Filters - H5Tregister - register a conversion function + H5Tregister - register a conversion function Compression - H5Zregister - register new compression and uncompression + H5Zregister - register new compression and uncompression functions for a method specified by a method number Identifiers @@ -8972,7 +8972,7 @@ References + H5Rcreate - creates a reference + H5Rdereference - open the HDF5 object referenced + H5Rget_region - retrieve a dataspace with the specified region selected - + H5Rget_object_type - retrieve the type of object that an + + H5Rget_object_type - retrieve the type of object that an object reference points to Ragged Arrays (alpha) diff --git a/release_docs/HISTORY-1_10.txt b/release_docs/HISTORY-1_10.txt index ad8beb2..2ddbe7a 100644 --- a/release_docs/HISTORY-1_10.txt +++ b/release_docs/HISTORY-1_10.txt @@ -7,7 +7,7 @@ This file contains development history of the HDF5 1.10 branch 05. Release Information for hdf5-1.10.3 04. Release Information for hdf5-1.10.2 03. Release Information for hdf5-1.10.1 -02. Release Information for hdf5-1.10.0-patch1 +02. Release Information for hdf5-1.10.0-patch1 01. Release Information for hdf5-1.10.0 [Search on the string '%%%%' for section breaks of each release.] @@ -134,7 +134,7 @@ Bug Fixes since HDF5-1.10.3 release Java Library: ---------------- - JNI native library dependencies - + The build for the hdf5_java native library used the wrong hdf5 target library for CMake builds. Correcting the hdf5_java library to build with the shared hdf5 library required testing @@ -291,7 +291,7 @@ The following platforms are not supported but have been tested for this release. #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) (jelly) with NAG Fortran Compiler Release 6.1(Tozai) GCC Version 7.1.0 - OpenMPI 3.0.0-GCC-7.2.0-2.29, + OpenMPI 3.0.0-GCC-7.2.0-2.29, 3.1.0-GCC-7.2.0-2.29 Intel(R) C (icc) and C++ (icpc) compilers Version 17.0.0.098 Build 20160721 @@ -3204,7 +3204,7 @@ This release supports the following features: - Version 3 Metadata Cache - The version 3 metadata cache moves management of metadata I/O from + The version 3 metadata cache moves management of metadata I/O from the clients to the metadata cache proper. This change is essential for SWMR and other features that have yet to be released. @@ -3265,7 +3265,7 @@ This release supports the following features: - New Public Functions: H5PTget_dataset and H5PTget_type Two accessor functions have been added. H5PTget_dataset returns - the identifier of the dataset associated with the packet table, + the identifier of the dataset associated with the packet table, and H5PTget_type returns the identifier of the datatype used by the packet table. @@ -3391,28 +3391,28 @@ Issues Addressed in this Release Since 1.10.0 - Configure fails to detect valid real KINDs on FreeBSD 9.3 (i386) with Fortran enabled. - Fixed. Added the exponential option to SELECTED_REAL_KIND to distinguish + Fixed. Added the exponential option to SELECTED_REAL_KIND to distinguish KINDs of same precision (MSB - 2016/05/14,HDFFV-9912) - Corrected the f90 H5AWRITE_F integer interface's buf to be INTENT(IN). - (MSB - 2016/05/14) + (MSB - 2016/05/14) - Configure fails in sed command on FreeBSD 9.3 (i386) with Fortran enabled. - + Fixed. (MSB - 2016/05/14,HDFFV-9912) - Compile time error in H5f90global.F90 with IBM XL Fortran 14.1.0.13 on BG/Q with Fortran enabled. - + Fixed. (MSB - 2016/05/16,HDFFV-9917) - A cmake build with Fortran enabled does not install module h5fortkit - Fixed. + Fixed. (MSB - 2016/05/23,HDFFV-9923) @@ -3916,7 +3916,7 @@ This release supports the following features: - Version 3 Metadata Cache - The version 3 metadata cache moves management of metadata I/O from + The version 3 metadata cache moves management of metadata I/O from the clients to the metadata cache proper. This change is essential for SWMR and other features that have yet to be released. @@ -3977,7 +3977,7 @@ This release supports the following features: - New Public Functions: H5PTget_dataset and H5PTget_type Two accessor functions have been added. H5PTget_dataset returns - the identifier of the dataset associated with the packet table, + the identifier of the dataset associated with the packet table, and H5PTget_type returns the identifier of the datatype used by the packet table. @@ -4378,16 +4378,16 @@ known issues if it is a new issue. - When building HDF5 with Java using CMake and specifying Debug for CMAKE_BUILD_TYPE, there is a missing command argument for the tests of the examples. - This error can be avoided by not building Java with Debug, HDF5_BUILD_JAVA:BOOL=OFF, + This error can be avoided by not building Java with Debug, HDF5_BUILD_JAVA:BOOL=OFF, or not building Examples, HDF5_BUILD_EXAMPLES:BOOL=OFF. - (LRK - 2016/03/30, HDFFV-9743) + (LRK - 2016/03/30, HDFFV-9743) - - The H5Lexists API changed behavior in HDF5-1.10 when used with a file handle + - The H5Lexists API changed behavior in HDF5-1.10 when used with a file handle and root group name ("/"): H5Lexists(fileid, "/") - In HDF5-1.8 it returns false (0) and in HDF5-1.10 it returns true (1). + In HDF5-1.8 it returns false (0) and in HDF5-1.10 it returns true (1). The documentation will be updated with information regarding this change. (LRK - 2016/03/30, HDFFV-8746) diff --git a/release_docs/HISTORY-1_8.txt b/release_docs/HISTORY-1_8.txt index 4465d06..e6df15b 100644 --- a/release_docs/HISTORY-1_8.txt +++ b/release_docs/HISTORY-1_8.txt @@ -90,17 +90,17 @@ New Features Configuration ------------- - Cmakehdf5: Added Ability to Run Multiple Make Commands - + Added option --njobs to specify up to how many jobs to launch during build (cmake) and testing (ctest). - + (AKC - 2015/12/13, HDFFV-9612) - Cmakehdf5: Added Szip Support and Verbose Option - - Added --with-szlib to support the Szip library; and + + Added --with-szlib to support the Szip library; and --enable/disable-verbose to display all CMake process output. - + (AKC - 2015/11/16, HDFFV-8932 and DAILYTEST-195) - CMake minimum is now 3.1.0. (ADB - 2015/11/14) @@ -122,13 +122,13 @@ New Features Library ------- - New API Calls for Searching for External Dataset Storage - + API calls that determine the search path for dataset external - storage were added. H5Pset/get_efile_prefix() API calls were added - to the library. These functions give control over the search path - for dataset external storage that has been configured with + storage were added. H5Pset/get_efile_prefix() API calls were added + to the library. These functions give control over the search path + for dataset external storage that has been configured with H5Pset_external(). - + Additionally, the HDF5_EXTFILE_PREFIX environment variable can be used to control the search path. @@ -160,7 +160,7 @@ New Features H5PTcreate has been added to replace H5PTcreate_fl. H5PTcreate takes a property list identifier to provide flexibility on creation properties. This also removes the following warning: - "deprecated conversion from string constant to "char*" + "deprecated conversion from string constant to "char*" [-Wwrite-strings]". (BMR - 2016/04/25, HDFFV-9708, HDFFV-8615) @@ -201,7 +201,7 @@ New Features Two accessor wrappers were added to class PacketTable. PacketTable::GetDataset() returns the identifier of the dataset - associated with the packet table, and PacketTable::GetDatatype() + associated with the packet table, and PacketTable::GetDatatype() returns the identifier of the datatype that the packet table uses. (BMR - 2016/04/25, HDFFV-8623 patch 4) @@ -211,7 +211,7 @@ New Features Overloaded functions were added to provide the "const char*" argument; the existing version will be deprecated in future releases. This also removes the following warning: - "deprecated conversion from string constant to "char*" + "deprecated conversion from string constant to "char*" [-Wwrite-strings]". (BMR - 2016/04/25, HDFFV-8623 patch 1, HDFFV-8615) @@ -247,9 +247,9 @@ New Features The two following functions were added: ArrayType::getArrayNDims() const ArrayType::getArrayDims() const - to provide const version, and the non-const version was marked - deprecated. In-memory array information, ArrayType::rank and - ArrayType::dimensions, were removed. This is an implementation + to provide const version, and the non-const version was marked + deprecated. In-memory array information, ArrayType::rank and + ArrayType::dimensions, were removed. This is an implementation detail and should not affect applications. (BMR, 2016/04/25, HDFFV-9725) @@ -264,8 +264,8 @@ New Features Support for New Platforms, Languages, and Compilers =================================================== - - Mac OS X El Capitan 10.11.4 with compilers Apple clang/clang++ - version 7.3.0 from Xcode 7.3, gfortran GNU Fortran (GCC) 5.2.0 + - Mac OS X El Capitan 10.11.4 with compilers Apple clang/clang++ + version 7.3.0 from Xcode 7.3, gfortran GNU Fortran (GCC) 5.2.0 and Intel icc/icpc/ifort version 16.0.2 @@ -293,7 +293,7 @@ Bug Fixes since HDF5-1.8.16 (DER - 2015/12/08, HDFFV-9627) - - The --enable-clear-file-buffers configure Option was Non-functional + - The --enable-clear-file-buffers configure Option was Non-functional so the Feature was Always Enabled (its default value). Regardless of the configure flag, the setting was always enabled when @@ -311,7 +311,7 @@ Bug Fixes since HDF5-1.8.16 (DER - 2016/02/03, HDFFV-9676) - - Added a patch to remove '"'s from arguments for MPI compilers that + - Added a patch to remove '"'s from arguments for MPI compilers that were causing errors compiling H5lib_settings.c with SGI MPT. (LRK - 2016/04/20, HDFFV-9439) @@ -354,19 +354,19 @@ Bug Fixes since HDF5-1.8.16 ----- - h5dump: Sub-setting Fixed for Dimensions Greater than Two - When a dataset has more than two dimensions, sub-setting would - incorrectly calculate the data that needed to be displayed. - Added in block and stride calculations that account for dimensions - greater than two. NOTE: lines that have line breaks inserted - because of display length calculations may have index info that + When a dataset has more than two dimensions, sub-setting would + incorrectly calculate the data that needed to be displayed. + Added in block and stride calculations that account for dimensions + greater than two. NOTE: lines that have line breaks inserted + because of display length calculations may have index info that is incorrect until the next dimension break. (ADB - 2016/03/07, HDFFV-9698) - h5dump: Issue with Argument Segmentation Fault - When an argument with an optional value was at the end of the command - line with a value, h5dump would crash. Reworked check for remaining + When an argument with an optional value was at the end of the command + line with a value, h5dump would crash. Reworked check for remaining arguments. (ADB - 2016/03/07, HDFFV-9570, HDFFV-9684) @@ -378,7 +378,7 @@ Bug Fixes since HDF5-1.8.16 (ADB -, 2016/03/07, HDFFV-9241) - h5dump: Clarified Help - + Clarified usage of -O F option in h5dump utility help. (ADB - 2016/03/07, HDFFV-9066) @@ -391,7 +391,7 @@ Bug Fixes since HDF5-1.8.16 - VS2015 Release Changed how Timezone was Handled - Created a function, HDget_timezone, in H5system.c. Replaced + Created a function, HDget_timezone, in H5system.c. Replaced timezone variable usage with function call. (ADB - 2015/11/02, HDFFV-9550) @@ -408,7 +408,7 @@ Bug Fixes since HDF5-1.8.16 ------- - Removal of Obsolete Methods - The overloaded methods which had parameters that should be const + The overloaded methods which had parameters that should be const but were not have been removed. (BMR - 2016/01/13, HDFFV-9789) @@ -419,7 +419,7 @@ Bug Fixes since HDF5-1.8.16 --------------- - Fixed Memory Leak in Packet Table API - Applied user's patch to fix memory leak in the creation of a + Applied user's patch to fix memory leak in the creation of a packet table. (BMR - 2016/04/25, HDFFV-9700) @@ -1421,7 +1421,7 @@ Known Problems (SLU - 2005/06/30) -%%%%1.8.15%%%% +%%%%1.8.15%%%% HDF5 version 1.8.15 released on 2015-05-04 @@ -1430,9 +1430,9 @@ HDF5 version 1.8.15 released on 2015-05-04 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.14 and -HDF5-1.8.15, and contains information on the platforms tested and -known problems in HDF5-1.8.15. +This document describes the differences between HDF5-1.8.14 and +HDF5-1.8.15, and contains information on the platforms tested and +known problems in HDF5-1.8.15. Links to the HDF5 source code, documentation, and additional materials can be found on the HDF5 web page at: @@ -1443,11 +1443,11 @@ The HDF5 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for HDF5 can be accessed directly at this location: +User documentation for HDF5 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -All new and modified APIs are listed in detail in the "HDF5 Software Changes +All new and modified APIs are listed in detail in the "HDF5 Software Changes from Release to Release" document at this location: http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -1475,18 +1475,18 @@ New Features Configuration ------------- - CMake - + Improvements made to the CMake build system. - + The default options were changed to align with the Autotools configure defaults. CMake configure files now support components when packaged with CPack. Windows CPack supports WiX packaging, and will look for - WiX and NSIS in the standard locations. - + WiX and NSIS in the standard locations. + The CMake minimum has been changed to 3.1. - + (ADB - 2015/04/01 HDFFV-8074, 8968, 9006) - + - cmakehdf5 for Cmake building. Added configure options to support the building of Fortran or CXX API, to enable/disable testings. Use "cmakehdf5 --help" for details. @@ -1516,10 +1516,10 @@ New Features (MSC - 2015/02/19 HDFFV-9068) - Large File Support Configuration Option - + Removed the option to enable or disable large file support. It will always be enabled. - + (MSC - 2015/02/19 HDFFV-9097) - Removed Configuration Feature @@ -1576,11 +1576,11 @@ New Features (DER - 2015-02-26, HDFFV-9057, 7567, 9088, 7566) - - _POSIX_C_SOURCE, _GNU_SOURCE, and _BSD_SOURCE No Longer Exported + - _POSIX_C_SOURCE, _GNU_SOURCE, and _BSD_SOURCE No Longer Exported to h5cc and Other Compiler Wrappers - The _POSIX_C_SOURCE, _GNU_SOURCE, and _BSD_SOURCE definitions are - not required for using API functions and may conflict with user + The _POSIX_C_SOURCE, _GNU_SOURCE, and _BSD_SOURCE definitions are + not required for using API functions and may conflict with user code requirements. (DER - 2015-03-08, HDFFV-9152) @@ -1664,33 +1664,33 @@ New Features separately from the library. (DER - 2015-04-01, HDFFV-9100) - + - H5Pset_istore_k and H5Pset_sym_k - These two functions didn't check the value of the input parameter "ik". - When 2*ik exceeded 2 bytes of storage, data was lost in the file; - for example, some chunks would be overwritten. + These two functions didn't check the value of the input parameter "ik". + When 2*ik exceeded 2 bytes of storage, data was lost in the file; + for example, some chunks would be overwritten. Added validation of "ik" to not exceed the max v1 btree entries (2 bytes) to these two routines. (VC - 2015-03-24, HDFFV-9173) - - Added Functions to Control the Value of H5PL_no_plugin_g without + - Added Functions to Control the Value of H5PL_no_plugin_g without Using an Environment Variable - - Sometimes it is necessary for an application to disable the use of - dynamically loaded plugin libraries without requiring the library to - be built with plugin support disabled or to set an environment + + Sometimes it is necessary for an application to disable the use of + dynamically loaded plugin libraries without requiring the library to + be built with plugin support disabled or to set an environment variable to disable plugin support globally. - + Two new functions (H5PLset_loading_state() and H5PLget_loading_state()) - were added to the HDF5 C Library. These functions require a parameter - that indicates which type of dynamically loaded plugin is enabled or + were added to the HDF5 C Library. These functions require a parameter + that indicates which type of dynamically loaded plugin is enabled or disabled. - + (ADB - 2015-03-17, HDFFV-8520) - + Parallel Library ---------------- - MPI_Finalize and HDF5 Library Shutdown @@ -1701,12 +1701,12 @@ New Features Attached an attribute destroy callback to MPI_COMM_SELF that shuts down the HDF5 library when MPI_COMM_SELF is destroyed, - in other words, on MPI_Finalize. This should fix several issues - that users see when they forget to close HDF5 objects before - calling MPI_Finalize(). + in other words, on MPI_Finalize. This should fix several issues + that users see when they forget to close HDF5 objects before + calling MPI_Finalize(). (MSC - 2015/02/25, HDFFV-883) - + Tools ----- - None @@ -1717,19 +1717,19 @@ New Features Fortran API ----------- - - Added Global Variables - - These new global variables are equivalent to the C definitions + - Added Global Variables + + These new global variables are equivalent to the C definitions without the '_F': - - H5G_UDLINK_F + + H5G_UDLINK_F H5G_SAME_LOC_F H5O_TYPE_UNKNOWN_F H5O_TYPE_GROUP_F H5O_TYPE_DATASET_F H5O_NAMED_DATATYPE_F H5O_TYPE_NTYPES_F - + (MSB - 2015/02/03, HDFFV-9040) @@ -1737,7 +1737,7 @@ New Features ------- - New Wrappers for C Functions H5P[s/g]et_libver_bounds - Wrappers were added to class H5::FileAccPropList for the + Wrappers were added to class H5::FileAccPropList for the C Functions H5Pget_libver_bounds and H5Pset_libver_bounds. (BMR, 2015/04/06, Part of HDFFV-9167) @@ -1747,7 +1747,7 @@ New Features The following wrappers are added to class H5::CommonFG Returns the object header version of an object in a file or group, given the object's name. - + unsigned childObjVersion(const char* objname) const; unsigned childObjVersion(const H5std_string& objname) const; @@ -1756,7 +1756,7 @@ New Features - New DataType Constructor Added a DataType constructor that takes a PredType object, and this - constructor will invoke H5Tcopy to generate another datatype id + constructor will invoke H5Tcopy to generate another datatype id from a predefined datatype. (BMR, 2015/04/06) @@ -1764,7 +1764,7 @@ New Features Support for New Platforms, Languages, and Compilers =================================================== - - Support for Linux 3.10.0-123.20.1.el7 added (LK - 2015/04/01) + - Support for Linux 3.10.0-123.20.1.el7 added (LK - 2015/04/01) - Support for Mac OS X Yosemite 10.10 added (AKC - 2015/03/04, HDFFV-9007) - Support for AIX 6.1 added and AIX 5.3 is retired. (AKC - 2015/01/09) @@ -1778,19 +1778,19 @@ Bug Fixes since HDF5-1.8.14 Fixed by assign it with the proper value. - (AKC - 2015/04/29, HDFFV-9298) + (AKC - 2015/04/29, HDFFV-9298) - Windows Installer Incorrect Display of PATH Environment Variable - + In the Windows installer, the dialog box where the user can elect to add the product's bin path to the %PATH% environment variable displayed an incorrect path. This path was missing the C:\Program Files part and used the POSIX file separator '/' before the bin (/bin, instead of \bin). - + The dialog box text was changed to simply say that the product's bin path would be added instead of explicitly displaying the path. - This is in line with most installers. The reason for not fixing the + This is in line with most installers. The reason for not fixing the displayed path instead is that it is difficult to pass the correct path from CPack to the NSIS installer for display. @@ -1803,34 +1803,34 @@ Bug Fixes since HDF5-1.8.14 Library ------- - Incorrect Usage of List in CMake COMPILE_DEFINITIONS set_property - + The CMake command set_property with COMPILE_DEFINITIONS property needs a quoted semi-colon separated list of values. CMake will transform the list to a series of -D{value} for the compile. - + (ADB - 2014/12/09, HDFV-9041) - + - Fixed Compile Errors on Windows w/ Visual Studio and CMake When UNICODE is Defined - + The HDF5 Library could not be built on Windows with Visual Studio when - UNICODE was defined. This was due to the incorrect use of the TEXT() + UNICODE was defined. This was due to the incorrect use of the TEXT() macro and some Win32 API functions that take TCHAR parameters. The faulty code was a part of the filter plugin functionality. This was a compile-time error that only affected users who build HDF5 from source and define UNICODE, usually when HDF5 is being built as a part of a larger product. There were no run-time effects. - + These errors caused no problems when UNICODE was not defined. HDF5 is normally not built with UNICODE defined and the binaries were unaffected. - + The fix was to remove the TEXT() macro and explicitly use the 'A' form of the Win32 API calls, which expect char strings instead of wchar_t strings. - + Note that HDF5 currently does not support Unicode file paths on Windows. - + (DER - 2015/02/22, HDFFV-8927) - Addition of Error Tracing Functionality to Several C API Calls @@ -1846,11 +1846,11 @@ Bug Fixes since HDF5-1.8.14 - H5Rdereference Now Checks for HADDR_UNDEF or Uninitialized References - When passed HADDR_UNDEF or uninitialized references, the previous - behavior of H5Rdereference was to continue to process the reference - as a valid address. - - H5Rdereference was changed to return immediately (with an error + When passed HADDR_UNDEF or uninitialized references, the previous + behavior of H5Rdereference was to continue to process the reference + as a valid address. + + H5Rdereference was changed to return immediately (with an error message) if the references are HADDR_UNDEF or uninitialized. (MSB - 2015/3/10, HDFFV-7959) @@ -1868,19 +1868,19 @@ Bug Fixes since HDF5-1.8.14 Parallel Library ---------------- - Fixed a Potential Memory Error - - Fixed a potential memory error when performing parallel I/O on a - dataset with a single chunk, and at least one process has nothing + + Fixed a potential memory error when performing parallel I/O on a + dataset with a single chunk, and at least one process has nothing to do. - + (NAF - 2015/02/16) - Parallel Test Problem Fixed - + Fixed problem with parallel tests where they failed beyond a certain number of ranks. All tests should work for any arbitrary - number of ranks. - + number of ranks. + (MSC - 2014/11/06, HDFFV-1027,8962,8963) - MPE Support @@ -1889,7 +1889,7 @@ Bug Fixes since HDF5-1.8.14 dropped at some point in time. Fixed problem with enabling MPE. Users should use the community - maintained MPE on github (http://git.mpich.org/mpe.git/). + maintained MPE on github (http://git.mpich.org/mpe.git/). (MSC - 2015/02/20, HDFFV-9135) @@ -1925,28 +1925,28 @@ Bug Fixes since HDF5-1.8.14 - Source perform/ directory moved to tools/perform. The perform directory is moved to tools/perform for easier maintenance. (AKC - 2014/12/17, HDFFV-9046) - + Fortran API ------------ - Fortran Fails with --enable-fortran2003 and Intel 15.x Compilers - - Added BIND(C) to the offending APIs. - The Fortran Library (--enable-fortran2003) now works using Intel 15.x - without the need for any additional compilers flags. - + Added BIND(C) to the offending APIs. + + The Fortran Library (--enable-fortran2003) now works using Intel 15.x + without the need for any additional compilers flags. + (MSB - 2015/1/26, HDFFV-9049) - - h5tenum_insert_f Does Not Work with Default 8 Byte Integers + - h5tenum_insert_f Does Not Work with Default 8 Byte Integers (xlf compiler) - - In the Fortran 90 API, 'value' is no longer cast into the C int type. - Therefore, if h5tenum_insert_f is passed an 8 byte integer (via -i8) - then 'value' is written as the same type as the default Fortran + + In the Fortran 90 API, 'value' is no longer cast into the C int type. + Therefore, if h5tenum_insert_f is passed an 8 byte integer (via -i8) + then 'value' is written as the same type as the default Fortran integer type (which can be 8 bytes). - - A new Fortran 2003 API was added which is more in line with the C - API and users are strongly encouraged to use the Fortran 2003 API + + A new Fortran 2003 API was added which is more in line with the C + API and users are strongly encouraged to use the Fortran 2003 API instead of the Fortran 90 API. SUBROUTINE h5tenum_insert_f(type_id, name, value, hdferr) @@ -1958,29 +1958,29 @@ Bug Fixes since HDF5-1.8.14 (MSB - 2015/2/19, HDFFV-8908) - Some Fortran APIs Never Returned the Error State - - Some Fortran APIs never returned the error state: they - would always return a positive number. The APIs include + + Some Fortran APIs never returned the error state: they + would always return a positive number. The APIs include the following: - + h5fget_file_image_f h5lget_name_by_idx_f h5oget_comment_by_name_f - They were corrected to return a negative number as described in - the Reference Manual if an error occurred. + They were corrected to return a negative number as described in + the Reference Manual if an error occurred. (MSB - 2015/3/19, HDF5-239) - - Fixed h5pget_class_f + - Fixed h5pget_class_f - h5pget_class_f never correlated the class identifier to the property - list class name as indicated in the HDF5 Reference Manual; it instead - returned a property list class identifier as an INTEGER. The INTEGER + h5pget_class_f never correlated the class identifier to the property + list class name as indicated in the HDF5 Reference Manual; it instead + returned a property list class identifier as an INTEGER. The INTEGER needed to be of type INTEGER(HID_T) to be correct. - The h5pget_class_f API was changed to return an INTEGER(HID_T) - property list class identifier instead of an INTEGER. This mimics the + The h5pget_class_f API was changed to return an INTEGER(HID_T) + property list class identifier instead of an INTEGER. This mimics the intended behavior of the C API. (MSB - 2015/3/16, HDFFV5-9162) @@ -1990,12 +1990,12 @@ Bug Fixes since HDF5-1.8.14 - Combined Two H5File::getObjCount Overloaded Methods The following two methods - + ssize_t getObjCount(unsigned types) const; ssize_t getObjCount() const; - + were combined into one: - + ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const; (BMR - 2015/04/06) @@ -2003,7 +2003,7 @@ Bug Fixes since HDF5-1.8.14 - Many Warnings Were Removed Many warnings such as conversion, unused variables, missing base - class initialization, and initializing base classes in wrong order + class initialization, and initializing base classes in wrong order were removed. (BMR, 2015/04/06) @@ -2014,10 +2014,10 @@ Bug Fixes since HDF5-1.8.14 H5Location, and H5Object are no longer appropriate after the data member "id" had been moved from IdComponent to the sub-classes in previous releases. - + (const hid_t h5_id); (const & original); - + The copy constructors were no-op and removed in 1.8.15. The other constructors will be removed from 1.10 release, and then from 1.8.17 if their removal does not cause any problems. @@ -2041,39 +2041,39 @@ Bug Fixes since HDF5-1.8.14 (MSB - 2015/2/14, HDFFV-8685) - + - H5PTcreate_fl Does Not Convert to Memory Datatype - H5PTcreate_fl now converts to the table's native memory datatype + H5PTcreate_fl now converts to the table's native memory datatype to fix the problem of handling BE and LE packet tables. (MSB - 2015/2/26 - HDFFV-9042) - Fix for H5LT Attribute Functions - - H5LT attribute functions fail to create attributes whose name + + H5LT attribute functions fail to create attributes whose name is a substring of an existing attribute. - H5LT attribute functions can now create attributes whose name + H5LT attribute functions can now create attributes whose name is a substring of an existing attribute. (MSB - 2015/2/24, HDFFV-9132) - + Fortran High-Level APIs: ------------------------ - Internal Library Fix for Missing Argument Declaration - - In Interface block for h5tbmake_table_c, "max_char_size_field_names" - is listed as an input, but in the argument definitions it is - "INTEGER :: max_char_size". This caused no known problems with the + + In Interface block for h5tbmake_table_c, "max_char_size_field_names" + is listed as an input, but in the argument definitions it is + "INTEGER :: max_char_size". This caused no known problems with the Fortran HL API. Fixed missing argument definition. - + (MSB - 2015/2/18, HDFFV-8559) - + Testing ------- @@ -2104,17 +2104,17 @@ They are built with the configure process unless specified otherwise. #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-55) Version 4.8.4, 4.9.2 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 15.0.1.133 Build 20141023 Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: (platypus) Version 4.4.7 20120313 Version 4.8.2, Version 4.9.2 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 14.10-0 + Version 14.10-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: Version 15.0.1.133 Build 20141023 @@ -2123,7 +2123,7 @@ They are built with the configure process unless specified otherwise. #1 SMP x86_64 GNU/Linux compilers: (moohan) Version 4.8.2 20140120 (Red Hat 4.8.2-16) Intel(R) C Intel(R) 64 Compiler XE for - applications running on Intel(R) 64, + applications running on Intel(R) 64, Version 15.0.1.133 Build 20141023 Linux 2.6.32-431.29.2.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) @@ -2147,7 +2147,7 @@ They are built with the configure process unless specified otherwise. Visual Studio 2010 w/ Intel Fortran 14 (cmake) Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) - + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 15 (cmake) Visual Studio 2013 w/ Intel Fortran 15 (cmake) @@ -2171,14 +2171,14 @@ Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel @@ -2186,7 +2186,7 @@ SunOS 5.11 32-bit n y/y n y y y SunOS 5.11 64-bit n y/y n y y y Windows 7 y y/y n y y y Windows 7 x64 y y/y n y y y -Windows 7 Cygwin n y/y n y y n +Windows 7 Cygwin n y/y n y y n Windows 8.1 n y/y n y y y Windows 8.1 x64 n y/y n y y y Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y @@ -2205,30 +2205,30 @@ CentOS 7.0 Linux 3.10.0 x86_64 GNU y y/y y y y y CentOS 7.0 Linux 3.10.0 x86_64 Intel n y/y n y y y Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -SunOS 5.11 32-bit y y y y -SunOS 5.11 64-bit y y y y +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y Windows 8.1 y y y y Windows 8.1 x64 y y y y -Mac OS X Mountain Lion 10.8.5 64-bit y n y y +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 Yosemeti 10.10.2 64-bit y n y y -AIX 6.1 32- and 64-bit y n n y -CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +AIX 6.1 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n -CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n CentOS 7.0 Linux 3.10.0 x86_64 GNU y y y n CentOS 7.0 Linux 3.10.0 x86_64 Intel y y y n -Linux 2.6.32-431.11.2.el6.ppc64 y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. @@ -2244,7 +2244,7 @@ The following platforms are not supported but have been tested for this release. Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1.3 compiled with #1 SMP x86_64 GNU/Linux gcc 4.9.2 and gfortran 4.9.2 - (platypus) g95 (GCC 4.0.3 (g95 0.94!) + (platypus) g95 (GCC 4.0.3 (g95 0.94!) FreeBSD 8.2-STABLE i386 gcc 4.5.4 [FreeBSD] 20110526 (loyalty) gcc 4.6.1 20110527 @@ -2275,7 +2275,7 @@ The following platforms are not supported but have been tested for this release. gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 (cmake and autotools) - + hopper.nersc.gov PrgEnv-gnu/5.2.40 gcc (GCC) 4.9.2 20141030 (Cray Inc.) GNU Fortran (GCC) 4.9.2 20141030 (Cray Inc.) @@ -2285,7 +2285,7 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== * On Windows platforms in debug configurations, the VFD flush1 tests will fail - with the split and multi VFD drivers. These tests will display a modal debug + with the split and multi VFD drivers. These tests will display a modal debug dialog which must be answered or wait for the test timeout to expire. (ADB - 2014/06/23 - HDFFV-8851) @@ -2309,7 +2309,7 @@ Known Problems h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 - + This is due to the embedded spaces in the dataset name being interpreted by the command script launcher as meta-characters, thus passing three arguments to h5dump's -d flag. The command passes if run by hand, just @@ -2336,7 +2336,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -2344,15 +2344,15 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) * Shared Fortran libraries are not quite working on AIX. While they are generated when --enable-shared is specified, the fortran and hl/fortran - tests fail. the issue. HL and C++ shared libraries should now be + tests fail. the issue. HL and C++ shared libraries should now be working as intended, however. (MAM - 2011/04/20) @@ -2374,32 +2374,32 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) * 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 + 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. (MAM - 2009/11/04) - -* A dataset created or rewritten with a v1.6.3 library or after cannot be read + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) -%%%%1.8.14%%%% +%%%%1.8.14%%%% HDF5 version 1.8.14 released on 2014-11-12 @@ -2408,11 +2408,11 @@ HDF5 version 1.8.14 released on 2014-11-12 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.13 and -HDF5-1.8.14, and contains information on the platforms tested and -known problems in HDF5-1.8.14. +This document describes the differences between HDF5-1.8.13 and +HDF5-1.8.14, and contains information on the platforms tested and +known problems in HDF5-1.8.14. -All new and modified APIs are listed in the "HDF5 Software Changes +All new and modified APIs are listed in the "HDF5 Software Changes from Release to Release" document along with details about previous releases at: @@ -2427,7 +2427,7 @@ The HDF5 1.8.14 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.14 can be accessed directly at this location: +User documentation for 1.8.14 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ @@ -2456,7 +2456,7 @@ New Features - bin/cmakehdf5 configures, builds and installs C, C++, Fortran and High level API's. (It used to build the C API only). (AKC 2014/10/17 HDFFV-8932). - + Library ------- - None @@ -2464,17 +2464,17 @@ New Features Parallel Library ---------------- - Chunk Fill Writes Changed to Collective - - Slow performance in chunk fill writes. Chunk fills - in the past were written independently by rank 0 one block - at a time. - - Optimized the chunk fill write algorithm so that all - chunk fill values will be written collectively in a single MPI-IO - call. This should show a great performance improvement when - creating chunked datasets in parallel when the chunk dimensions + + Slow performance in chunk fill writes. Chunk fills + in the past were written independently by rank 0 one block + at a time. + + Optimized the chunk fill write algorithm so that all + chunk fill values will be written collectively in a single MPI-IO + call. This should show a great performance improvement when + creating chunked datasets in parallel when the chunk dimensions are fairly small. - + (MSC - 2014/08/22, HDFFV-8878) Tools @@ -2496,7 +2496,7 @@ New Features The data member "id" in classes that represent HDF5 objects were initialized to 0, which caused problem for some users. - Replaced 0 with H5I_INVALID_HID to initialize these "id"s. For the + Replaced 0 with H5I_INVALID_HID to initialize these "id"s. For the PropList class, H5P_DEFAULT is used instead of H5I_INVALID_HID. (BMR - 2014/09/30, HDFFV-4259) @@ -2505,7 +2505,7 @@ New Features Support for New Platforms, Languages, and Compilers =================================================== - - None + - None Bug Fixes since HDF5-1.8.13 =========================== @@ -2513,26 +2513,26 @@ Bug Fixes since HDF5-1.8.13 Configuration ------------- - CMake and SVN URLs - + The SVN URLs will be different when the HDF Group domain name changes. - + Removed the SVN URL references in the cacheinit.cmake and release_docs files. - + (ADB - 2014/10/27, HDFFV-8953) - CMake Packaging - + A Fortran module was not generated if the compiler was not F2003 compliant. - + Removed the module name from the package list of Fortran modules because that module was never generated. This was only an issue for Fortran compliers that are not F2003 compatible. - + (ADB - 2014/10/16, HDFFV-8932) - Shared Library Interface Version Number (soname) - + In order to increase the maintainability of HDF5, an architectural change was made which required the renaming of several public symbols in H5Ppublic.h. @@ -2543,71 +2543,71 @@ Bug Fixes since HDF5-1.8.13 the 'HDF5 Software Changes from Release to Release' document: http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html - + (AKC - 2014/10/03, HDFFV-8937) - - Configure Settings for Mac OSX Need Defaults for PROD_XXX, DEBUG_XXX, + - Configure Settings for Mac OSX Need Defaults for PROD_XXX, DEBUG_XXX, and PROFILE_XXX - - The configure setting files for Mac OSX (config/apple) did not - have the default settings of PROD_XXX, DEBUG_XXX, PROFILE_XXX. - - Added the default settings. Mac platforms now builds library with - "-O3" optimization when the default clang compiler is used. - + + The configure setting files for Mac OSX (config/apple) did not + have the default settings of PROD_XXX, DEBUG_XXX, PROFILE_XXX. + + Added the default settings. Mac platforms now builds library with + "-O3" optimization when the default clang compiler is used. + (AKC - 2014/10/01, HDFFV-8933) - CMake ConfigureChecks - + Two include files were missing from two C tests. - + Propagated the configure test changes to H5_LDOUBLE_TO_INTEGER_WORKS_TEST and H5_ULLONG_TO_LDOUBLE_PRECISION_TEST to ConfigureChecks.cmake (added stdlib.h and string.h in the HDFTests.c file). - + (ADB - 2014/09/02 HDFFV-8845) - + - CMake Parallel Test Missing - - The source file was removed in the previous release but the parallel + + The source file was removed in the previous release but the parallel test t_posix_compliant was not. - - Removed the t_posix_compliant parallel test from the library. - + + Removed the t_posix_compliant parallel test from the library. + (ADB - 2014/8/14 HDFFV-8880) - Autotools Reconfigure. Bison. Flex. - - The Bison and Flex files were out of date. - - Bison was upgraded to 2.7, and Flex was upgraded to 2.5.37. The - bin/reconfigure script now will execute Bison and Flex and update - the hl/src files. - + + The Bison and Flex files were out of date. + + Bison was upgraded to 2.7, and Flex was upgraded to 2.5.37. The + bin/reconfigure script now will execute Bison and Flex and update + the hl/src files. + (ADB - 2014/06/16 HDFFV-8709) - Autotools Reconfigure. m4. The m4 macro processor was out of date. - - Reconfigured Autotools with m4 upgraded to 1.4.17. - + + Reconfigured Autotools with m4 upgraded to 1.4.17. + (ADB - 2014/06/12 HDFFV-8743) - - - Autotools: Modified configure to add an entry at the beginning of AM_LDFLAGS - for the hdf5 install directory. Without this entry the relink commands - invoked by "make install" to create libraries dependent on libhdf5.so added - a dependency on the first libhdf5.so found in any directory in AM_LDFLAGS + + - Autotools: Modified configure to add an entry at the beginning of AM_LDFLAGS + for the hdf5 install directory. Without this entry the relink commands + invoked by "make install" to create libraries dependent on libhdf5.so added + a dependency on the first libhdf5.so found in any directory in AM_LDFLAGS regardless of its version. (LRK - 2014/10/17 HDFFV-8944) - Changed Autotools Build Behavior. Fortran High-level Library. - The Fortran high-level (HL) library did not compile if the default - size of a REAL is DOUBLE PRECISION; the build would fail during + The Fortran high-level (HL) library did not compile if the default + size of a REAL is DOUBLE PRECISION; the build would fail during compilation. - Configure now checks to see if REAL is DOUBLE PRECISION, Fortran is - enabled, and HL library is enabled. If this is true, then configure + Configure now checks to see if REAL is DOUBLE PRECISION, Fortran is + enabled, and HL library is enabled. If this is true, then configure will stop with an error message. (MSB - 2014/8/11, HDFFV-8883/HDFFV-889) @@ -2617,36 +2617,36 @@ Bug Fixes since HDF5-1.8.13 Library ------- - Fixed Identifier Management Code - - Opening an object returns an identifier; closing the object should - free up the identifier. A problem was found where the identifiers + + Opening an object returns an identifier; closing the object should + free up the identifier. A problem was found where the identifiers were not being freed up correctly. - - Fixed the problem so that identifiers that have been used can be + + Fixed the problem so that identifiers that have been used can be used again after their object has been closed. - + (QAK - 2014/10/16, HDFFV-8930) - - Removal of DllMain() from Static Windows Builds + - Removal of DllMain() from Static Windows Builds - A DllMain() function was added in HDF5 1.8.13 in order to handle - win32 thread cleanup. The preprocessor #ifdefs around the DllMain - function allowed it to be compiled when the static library is built, - which is incorrect behavior that can cause linkage problems in + A DllMain() function was added in HDF5 1.8.13 in order to handle + win32 thread cleanup. The preprocessor #ifdefs around the DllMain + function allowed it to be compiled when the static library is built, + which is incorrect behavior that can cause linkage problems in clients. - The fix was to change the preprocessor #ifdefs to exclude compiling - DllMain() in static builds. Our DllMain function is now only + The fix was to change the preprocessor #ifdefs to exclude compiling + DllMain() in static builds. Our DllMain function is now only compiled when the shared, thread-safe library is built on Windows. (DER - 2014/06/13, HDFFV-8837) - Enforce Constraint on page_size Parameter in H5Pset_core_write_tracking() - The reference manual states that the page_size parameter cannot be + The reference manual states that the page_size parameter cannot be zero. - This change checks the page_size parameter to see it is zero and + This change checks the page_size parameter to see it is zero and returns an error code if it is. (DER - 2014/08/11, HDFFV-8891) @@ -2655,31 +2655,31 @@ Bug Fixes since HDF5-1.8.13 (MSC - 2014/07/31, HDFFV-8888) - H5Ldelete_by_idx() Seg Fault on Non-existent Group Name - - If a non-existent group name was used by H5Ldelete_by_idx(), a - segmentation fault would result. - + + If a non-existent group name was used by H5Ldelete_by_idx(), a + segmentation fault would result. + Bug was fixed. - + (MSC - 2014/07/31, HDFFV-8888) - Bug in Test When Building Parallel HDF5 on PVFS2 - + There was a bug in a test when building Parallel HDF5 on PVFS2. - + The build now uses MPI_File_get_size() instead of stat(). - + (MSC - 2014/07/14, HDFFV-8856) - MPI-IO Driver Tried to Allocate Space for Zero-length Dataset - + MPI-IO driver tried to allocate space for zero-length dataset - and asserts. - + and asserts. + Fixed driver and added a regression test. - + (MSC - 2014/07/03, HDFFV-8761) - + Parallel Library ---------------- @@ -2695,48 +2695,48 @@ Bug Fixes since HDF5-1.8.13 Fortran API ------- - - SIZEOF Replaced by C_SIZEOF and STORAGE_SIZE. - - The intrinsic function SIZEOF is non-standard and should be replaced with a + - SIZEOF Replaced by C_SIZEOF and STORAGE_SIZE. + + The intrinsic function SIZEOF is non-standard and should be replaced with a standard intrinsic function. - If the F2008 intrinsic C_SIZEOF and STORAGE_SIZE are available, then they will - be used instead of the non-standard SIZEOF intrinsic, even when the SIZEOF + If the F2008 intrinsic C_SIZEOF and STORAGE_SIZE are available, then they will + be used instead of the non-standard SIZEOF intrinsic, even when the SIZEOF function is available. (MSB - 2014/6/16, HDFFV-8653) - Non-functional API: h5pget_fill_value_f - + The Fortran wrapper h5pget_fill_value_f was calling the wrong C API. - The correct C API, H5Pget_fill_value, is now called by the Fortran + The correct C API, H5Pget_fill_value, is now called by the Fortran wrapper. (MSB - 2014/9/25, HDFFV-8879) - Interoperability with C HDF5: H5Literate and h5literate_f - h5literate_f assumes the return value for the callback function to - be of type int (or int_f in C). However, in the C wrapper the return - value of H5Literate is type herr_t, and this could cause + h5literate_f assumes the return value for the callback function to + be of type int (or int_f in C). However, in the C wrapper the return + value of H5Literate is type herr_t, and this could cause interoperability issues. - The callback function should be declared INTEGER(C_INT) for + The callback function should be declared INTEGER(C_INT) for portability. The tests were updated accordingly. (MSB - 2014/9/26, HDFFV-8909) - - Interoperability with C HDF5: Constant INTEGER Parameters with the + - Interoperability with C HDF5: Constant INTEGER Parameters with the H5FD Interface Wrong type cast of constant Fortran INTEGER parameters was used. - The following parameter constant types were changed from INTEGER to - INTEGER(HID_T) to match the C types: H5FD_CORE, H5FD_FAMILY, H5FD_LOG, + The following parameter constant types were changed from INTEGER to + INTEGER(HID_T) to match the C types: H5FD_CORE, H5FD_FAMILY, H5FD_LOG, H5FD_MPIO, H5FD_MULTI, H5FD_SEC2, and H5FD_STDIO. - Other internal 'int' types where changed to 'hid_t'; these are + Other internal 'int' types where changed to 'hid_t'; these are transparent to the user. (MSB - 2014/7/18, HDFFV-8748) @@ -2753,7 +2753,7 @@ Bug Fixes since HDF5-1.8.13 (BMR - 2014/09/30, HDFFV-8928) - Disallow H5F_ACC_CREAT - + H5F_ACC_CREAT was included in the C++ API but the C library does not allow it at this time. @@ -2763,10 +2763,10 @@ Bug Fixes since HDF5-1.8.13 - Missing Flags in Documentation: H5F_ACC_RDONLY and H5F_ACC_RDWR - The H5F_ACC_RDONLY and H5F_ACC_RDWR flags were missing from the + The H5F_ACC_RDONLY and H5F_ACC_RDWR flags were missing from the documentation of the H5File constructors. - These two flags are now included in the documentation for opening + These two flags are now included in the documentation for opening files. (BMR - 2014/09/29, HDFFV-8852) @@ -2775,12 +2775,12 @@ Bug Fixes since HDF5-1.8.13 ------ - Seg Faults in H5TBread_field_name and H5TBread_field_name_f - When H5TBread_field_name or H5TBread_field_name_f were used to read a - field and if the name of the field was wrong, a segmentation fault + When H5TBread_field_name or H5TBread_field_name_f were used to read a + field and if the name of the field was wrong, a segmentation fault would result. - Both C and Fortran APIs were fixed so they no longer seg fault if - the name of the field is wrong, and both APIs return a negative + Both C and Fortran APIs were fixed so they no longer seg fault if + the name of the field is wrong, and both APIs return a negative value if the name of the field is wrong. (MSB - 2014/09/29, HDFFV-8912) @@ -2788,25 +2788,25 @@ Bug Fixes since HDF5-1.8.13 - Possible Buffer Overflow in High-level (HL) APIs Multiple HL APIs (H5DSis_scale is one example) had issues: - (1) The datatype from the file was re-used as the memory datatype, + (1) The datatype from the file was re-used as the memory datatype, and - (2) No effort was made to ensure that strings were actually + (2) No effort was made to ensure that strings were actually null-terminated. - - All of the HL routines now check for NULL pointers, for null-terminated - strings, and to see if string buffers are short enough not to overflow - the buffer. The minimum length of the buffers is now used in strncmp + + All of the HL routines now check for NULL pointers, for null-terminated + strings, and to see if string buffers are short enough not to overflow + the buffer. The minimum length of the buffers is now used in strncmp to avoid overflow. (MSB - 2014/9/29, HDFFV-8670) - Behavior Change of H5LTdtype_to_text - If a user buffer was passed in to H5LTdtype_to_text along with the - length, then the function would not truncate at the end of the + If a user buffer was passed in to H5LTdtype_to_text along with the + length, then the function would not truncate at the end of the buffer, but would exceed the end of the user buffer. - H5LTdtype_to_text was changed to truncate the string if the user + H5LTdtype_to_text was changed to truncate the string if the user buffer is too small. (MSB - 2014/9/29, HDFFV-8855) @@ -2826,7 +2826,7 @@ Bug Fixes since HDF5-1.8.13 used by several test programs. (AKC - 2014/07/22 HDFFV-8881) - Fixed Incorrect Exit Code Values in Testframe - The testframe which is commonly used by several test programs + The testframe which is commonly used by several test programs had some incorrect exit code values. Fixed the incorrect exit code values. (AKC - 2014/07/22, HDFFV-8881) @@ -2854,17 +2854,17 @@ They are built with the configure process unless specified otherwise. #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) Version 4.8.2 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 14.0.2 (Build 20140120) Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: (platypus) Version 4.4.7 20120313 Version 4.8.2 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 13.7-0 + Version 13.7-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: Version 14.0.2 (Build 20140120) @@ -2890,7 +2890,7 @@ They are built with the configure process unless specified otherwise. Visual Studio 2010 w/ Intel Fortran 14 (cmake) Visual Studio 2012 w/ Intel Fortran 14 (cmake) Visual Studio 2013 w/ Intel Fortran 14 (cmake) - + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 14 (cmake) Visual Studio 2013 w/ Intel Fortran 14 (cmake) @@ -2914,14 +2914,14 @@ Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel @@ -2929,7 +2929,7 @@ Solaris2.11 32-bit n y/y n y y y Solaris2.11 64-bit n y/y n y y y Windows 7 y y/y n y y y Windows 7 x64 y y/y n y y y -Windows 7 Cygwin n y/y n y y n +Windows 7 Cygwin n y/y n y y n Windows 8.1 n y/y n y y y Windows 8.1 x64 n y/y n y y y Mac OS X Lion 10.7.5 64-bit n y/y n y y y @@ -2946,28 +2946,28 @@ CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.11 32-bit y y y y -Solaris2.11 64-bit y y y y +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y Windows 8.1 y y y y Windows 8.1 x64 y y y y -Mac OS X Lion 10.7.5 64-bit y n y y -Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Lion 10.7.5 64-bit y n y y +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 -AIX 5.3 32- and 64-bit y n n y -CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +AIX 5.3 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n -CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n -Linux 2.6.32-431.11.2.el6.ppc64 y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. @@ -2983,7 +2983,7 @@ The following platforms are not supported but have been tested for this release. Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1.2 compiled with #1 SMP x86_64 GNU/Linux gcc 4.9.1 and gfortran 4.9.1 - (platypus) g95 (GCC 4.0.3 (g95 0.94!) + (platypus) g95 (GCC 4.0.3 (g95 0.94!) FreeBSD 8.2-STABLE i386 gcc 4.5.4 [FreeBSD] 20110526 (loyalty) gcc 4.6.1 20110527 @@ -3014,7 +3014,7 @@ The following platforms are not supported but have been tested for this release. gcc (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 GNU Fortran (Ubuntu/Linaro 4.9.1-0ubuntu1) 4.9.1 (cmake and autotools) - + Cray Linux Environment (CLE) PrgEnv-pgi/4.2.34 hopper.nersc.gov pgcc 13.6-0 64-bit target on x86-64 Linux -tp istanbul pgf90 13.6-0 64-bit target on x86-64 Linux -tp istanbul @@ -3029,7 +3029,7 @@ Known Problems (ADB - 2014/11/04 - HDFFV-8736) * On windows platforms in debug configurations, the VFD flush1 tests will fail - with the split and multi VFD drivers. These tests will display a modal debug + with the split and multi VFD drivers. These tests will display a modal debug dialog which must be answered or wait for the test timeout to expire. The flush1 and flush2 tests will be skipped under debug for this release. (ADB - 2014/06/23 - HDFFV-8851) @@ -3077,7 +3077,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -3085,8 +3085,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -3118,38 +3118,38 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) * 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 + 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. (MAM - 2009/11/04) - + * 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) -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) -%%%%1.8.13%%%% +%%%%1.8.13%%%% HDF5 version 1.8.13 released on 2014-05-05 @@ -3158,10 +3158,10 @@ HDF5 version 1.8.13 released on 2014-05-05 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.12 and -HDF5-1.8.13, and contains information on the platforms tested and -known problems in HDF5-1.8.13. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.12 and +HDF5-1.8.13, and contains information on the platforms tested and +known problems in HDF5-1.8.13. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.13 source code, documentation, and additional materials @@ -3173,18 +3173,18 @@ The HDF5 1.8.13 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.13 can be accessed directly at this location: +User documentation for 1.8.13 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.13 (current +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.13 (current release) versus Release 1.8.12": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -3215,37 +3215,37 @@ New Features - CMake: Moved minimum CMake version to 2.8.11 which enables better library include processing. (ADB - 2014/03/26) - - - When configuring a thread-safe HDF5 Library it is no longer necessary - to specify --enable-threadsafe with --with-pthreads if the Pthreads + + - When configuring a thread-safe HDF5 Library it is no longer necessary + to specify --enable-threadsafe with --with-pthreads if the Pthreads library is in a standard location. (DER - 2014/04/11 HDFFV-8693) Library ------- - - Added an H5free_memory API call. This should be used to free memory - that has been allocated by HDF5 API calls. H5Tget_member_name and - H5Pget_class_name are two examples. The main motivation for this call - is Windows, where it is common for application code and the HDF5 Library - to be using different C run-time libraries (CRT). Using the new call - ensures that the same CRT handles both the allocation and free. This - new function can also be useful in any case where the library uses a - different memory manager than the application, such as when a debug - memory manager is in use or when the HDF5 Library is wrapped for use - in a managed language like Python or Java. Fixes HDFFV-7710, 8519, + - Added an H5free_memory API call. This should be used to free memory + that has been allocated by HDF5 API calls. H5Tget_member_name and + H5Pget_class_name are two examples. The main motivation for this call + is Windows, where it is common for application code and the HDF5 Library + to be using different C run-time libraries (CRT). Using the new call + ensures that the same CRT handles both the allocation and free. This + new function can also be useful in any case where the library uses a + different memory manager than the application, such as when a debug + memory manager is in use or when the HDF5 Library is wrapped for use + in a managed language like Python or Java. Fixes HDFFV-7710, 8519, and 8851. (DER - 2014/04/11) - - The Core VFD (aka Memory VFD) can now be configured to track dirty - regions in the file and only write out the changed regions on - flush/close. Additionally, a "page aggregation" size can be set that - will aggregate small writes into larger writes. For example, setting - a 1 MiB page aggregation size will logically partition the the - in-memory file into 1 MiB pages that will be written out in their - entirety if even a single byte is dirtied. The feature is controlled - via the new H5Pset/get_core_write_tracking() API call. A new - "core_paged" target has been added to the check-vfd target in + - The Core VFD (aka Memory VFD) can now be configured to track dirty + regions in the file and only write out the changed regions on + flush/close. Additionally, a "page aggregation" size can be set that + will aggregate small writes into larger writes. For example, setting + a 1 MiB page aggregation size will logically partition the the + in-memory file into 1 MiB pages that will be written out in their + entirety if even a single byte is dirtied. The feature is controlled + via the new H5Pset/get_core_write_tracking() API call. A new + "core_paged" target has been added to the check-vfd target in test/Makefile.am that exercises the feature over all HDF5 VFD-aware tests. (DER - 2014/04/12) - + Parallel Library ---------------- - Removed MPI-POSIX VFD, as it wasn't helping anyone and was just @@ -3255,7 +3255,7 @@ New Features - Improved parallel I/O support to allow collective I/O on point selections. (QAK - 2014/03/15) - + Tools ----- - None @@ -3266,7 +3266,7 @@ New Features Fortran API ----------- - - Wrappers h5pset_file_image_f and h5pget_file_image_f were added to the + - Wrappers h5pset_file_image_f and h5pget_file_image_f were added to the library. (MSB - 2014/1/2014) C++ API @@ -3283,7 +3283,7 @@ New Features H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") - + Wrappers to class DSetMemXferPropList for setting/getting a transform + + Wrappers to class DSetMemXferPropList for setting/getting a transform property list (HDFFV-7907). DSetMemXferPropList(const char* expression); void setDataTransform(const char* expression) @@ -3292,7 +3292,7 @@ New Features H5std_string getDataTransform() + Wrapper to CompType for setting size to compound datatype (HDFFV-8642). void setSize(size_t size) - + Overloaded functions to provide prototypes that declare constant + + Overloaded functions to provide prototypes that declare constant arguments const (HDFFV-3384). These include: DataSet::fillMemBuf DataSet::getVlenBufSize @@ -3307,7 +3307,7 @@ New Features ssize_t getName(char* attr_name, size_t buf_size=0) ssize_t getName(H5std_string& attr_name, size_t buf_size=0) (BMR, 2014/04/15) - + A static wrapper to Exception for printing the error stack without an + + A static wrapper to Exception for printing the error stack without an instance of Exception static void printErrorStack(FILE* stream = stderr, hid_t err_stack = H5E_DEFAULT); @@ -3321,7 +3321,7 @@ Support for New Platforms, Languages, and Compilers supported platforms. (AKC - 2014/03/14 HDFFV-8704) Mac OS X 10.9 Mavericks is supported. (AKC - 2014/03/04 HDFFV-8694) - + Bug Fixes since HDF5-1.8.12 =========================== @@ -3331,42 +3331,42 @@ Bug Fixes since HDF5-1.8.12 - CMake: When CMake commands are executed individually on the command line and the external filters are being built, the CMAKE_BUILD_TYPE define must be set to the same value as the configuration - (-DCMAKE_BUILD_TYPE:STRING=Release if using -C Release). This is needed + (-DCMAKE_BUILD_TYPE:STRING=Release if using -C Release). This is needed by the the szip and zlib filter build commands. (ADB - HDFFV-8695) - - CMake: Removed use of the XLATE_UTILITY program. + - CMake: Removed use of the XLATE_UTILITY program. (ADB - 2014/03/28 HDFFV-8640) - CMake: Added missing quotes in setting the CMAKE_EXE_LINKER_FLAGS for the MPI option. (ADB - 2014/02/27 HDFFV-8674) - - CMake: Configuration of the HDF5 C++ or Fortran libraries with the + - CMake: Configuration of the HDF5 C++ or Fortran libraries with the thread-safety feature. C++ and/or Fortran + thread-safe is enforced as a non-supported configuration. This matches the autotools. (DER - 2014/04/11) - CMake: Configuration of static HDF5 C library with the thread-safety - feature. + feature. Static + thread-safe + Win32 threads is not a supported configuration - due to the inability to automatically clean up thread-local storage. - This is expected to be fixed in a future release. In the meantime, a - work-around that uses internal functionality may allow the combination - to be used without resource leaks. Contact the help desk for more + due to the inability to automatically clean up thread-local storage. + This is expected to be fixed in a future release. In the meantime, a + work-around that uses internal functionality may allow the combination + to be used without resource leaks. Contact the help desk for more information. (DER - 2014/04/11) - - Autotools: Several changes were done to configure and installcheck. + - Autotools: Several changes were done to configure and installcheck. An export of LD_LIBRARY_PATH= was removed from configure; make installcheck was revised to run - scripts installed in share/hdf5_examples to use the installed h5cc, etc. - to compile and run example source files also installed there. + scripts installed in share/hdf5_examples to use the installed h5cc, etc. + to compile and run example source files also installed there. - Make installcheck will now fail when a shared szip or other external lib - file cannot be found in the same manner that executables compiled and - linked with h5cc will fail to run when those lib files cannot be found - after install. Make installcheck should pass after setting + Make installcheck will now fail when a shared szip or other external lib + file cannot be found in the same manner that executables compiled and + linked with h5cc will fail to run when those lib files cannot be found + after install. Make installcheck should pass after setting LD_LIBRARY_PATH to the szip location. (LRK - 2014/04/16) Library @@ -3378,50 +3378,50 @@ Bug Fixes since HDF5-1.8.12 either do not use parallel make or install Gnu Make to build the library. (AKC 2014/04/08 HDFFV-8738) - - H5R.c: H5Rget_name gave an assertion failure if the "name" parameter + - H5R.c: H5Rget_name gave an assertion failure if the "name" parameter was NULL. Fixed H5Rget_name to return the size of the buffer needed to read a - name of the referenced object in this case. The size doesn't include - the NULL terminator. H5Rget_name returns negative on failure. + name of the referenced object in this case. The size doesn't include + the NULL terminator. H5Rget_name returns negative on failure. (MSB - 2014/01/22 HDFFV-8620) - H5Z.c: H5Zfilter_avail didn't check if a filter was available as a dynamically loaded filter. The error manifested itself in the h5repack tool when removing user-defined dynamically loaded filter. - Added a code to find the filter among the dynamically loaded filters - after the function fails to find it among the registered filters. + Added a code to find the filter among the dynamically loaded filters + after the function fails to find it among the registered filters. (ADB - 2014/03/03 HDFFV-8629) - - Memory leak: a memory leak was observed in conjunction to the - H5TS_errstk_key_g thread-local variable allocated in the H5E_get_stack - function in H5E.c. + - Memory leak: a memory leak was observed in conjunction to the + H5TS_errstk_key_g thread-local variable allocated in the H5E_get_stack + function in H5E.c. - The shared HDF5 thread-safe library now no longer leaks thread-local - storage resources on Windows with Win32 threads. Currently, there is - no solution for this problem when HDF5 is statically built. We - disabled the build of the static HDF5 thread-safe library with + The shared HDF5 thread-safe library now no longer leaks thread-local + storage resources on Windows with Win32 threads. Currently, there is + no solution for this problem when HDF5 is statically built. We + disabled the build of the static HDF5 thread-safe library with Win32 threads. (DER - 2014/04/11 HDFFV-8518) - - H5Dio.c: Improved handling of NULL pointers to H5Dread/H5Dwrite + - H5Dio.c: Improved handling of NULL pointers to H5Dread/H5Dwrite calls. Credit to Jason Newton (nevion@gmail.com) for the original patch. - H5Dwrite/read failed when a NULL pointer was passed for a data buffer + H5Dwrite/read failed when a NULL pointer was passed for a data buffer and 0 elements were selected. Fixed. (QAK - 2014/04/16 HDFFV-8705) - Deprecated API (1_6 API): Improved handling of closing the library and re-accessing it with a deprecated routine. - When a program used a deprecated API (for example, H5Gcreate1), - closed the library, and reopened it again to access a group, dataset, - datatype, dataspace, attribute, or property list, HDF5 failed to + When a program used a deprecated API (for example, H5Gcreate1), + closed the library, and reopened it again to access a group, dataset, + datatype, dataspace, attribute, or property list, HDF5 failed to provide an identifier for the object. Fixed. (NAF, QAK - 2014/04/16 HDFFV-8232) Parallel Library ---------------- - - Fixed a missing H5F_Provisional module in HDF5mpio.f90 + - Fixed a missing H5F_Provisional module in HDF5mpio.f90 (MSB - 2014/2/7 HDFFV-8651) Performance @@ -3437,11 +3437,11 @@ Bug Fixes since HDF5-1.8.12 - The h5dump and h5diff utilities occasionally produced different output between Linux and Windows systems. This has been fixed. - - This happened to datasets that used chunked storage, with default fill - values, and some of the chunks had not been written. - When the dataset was read, the library failed to write the default fill - values to parts of the use buffer that were associated with the unwritten + + This happened to datasets that used chunked storage, with default fill + values, and some of the chunks had not been written. + When the dataset was read, the library failed to write the default fill + values to parts of the use buffer that were associated with the unwritten chunks. (JP - 2014/05/01 HDFFV-8247) - The compress option is retired from bin/release. @@ -3450,8 +3450,8 @@ Bug Fixes since HDF5-1.8.12 - bin/release has a new option "zip" that produces a release zip file for the Windows platform. (AKC - 2014/04/24 HDFFV-8433) - - h5diff: Several failures relating to handling of strings attributes - are fixed. + - h5diff: Several failures relating to handling of strings attributes + are fixed. The tool crashed or gave an error message when one of the strings had fixed size type and another variable-length size type. h5diff now flags such @@ -3460,13 +3460,13 @@ Bug Fixes since HDF5-1.8.12 (AKC - 2014/04/18 HDFFV-8625, 8639, 8745) - h5repack: h5repack would not remove user-defined filters. - Fixed by modifying h5repack to check if the filter is registered or + Fixed by modifying h5repack to check if the filter is registered or can be dynamically loaded. (ADB - 2014/03/03 HDFFV-8629) F90 API ------- - - H5D_CHUNK_CACHE_NSLOTS_DFLT_F and H5D_CHUNK_CACHE_NBYTES_DFLT_F were - changed from the default KIND for INTEGER to INTEGER of KIND size_t. + - H5D_CHUNK_CACHE_NSLOTS_DFLT_F and H5D_CHUNK_CACHE_NBYTES_DFLT_F were + changed from the default KIND for INTEGER to INTEGER of KIND size_t. (MSB - 2014/3/31 HDFFV-8689) C++ API @@ -3487,14 +3487,14 @@ Bug Fixes since HDF5-1.8.12 Testing ------- - - testhdf5 now exits with EXIT_SUCCESS(0) if no errors, else + - testhdf5 now exits with EXIT_SUCCESS(0) if no errors, else EXIT_FAILURE(1). (AKC - 2014/01/27 HDFFV-8572) - The big test now pays attention to the HDF5_DRIVER environment variable. Previously, it would run all tests with the family, stdio, and sec2 - virtual file drivers (VFDs) for each VFD in the check-vfd make target, - regardless of the variable setting. It now checks the variable and - either runs the appropriate VFD-specific tests or skips as needed. + virtual file drivers (VFDs) for each VFD in the check-vfd make target, + regardless of the variable setting. It now checks the variable and + either runs the appropriate VFD-specific tests or skips as needed. This saves much testing time. Fixes HDFFV-8554. (DER - 2014/04/11) Supported Platforms @@ -3522,20 +3522,20 @@ They are built with the configure process unless specified otherwise. #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) Version 4.8.2 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 13.7-0 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Version 13.7-0 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 14.0.2 (Build 20140120) Linux 2.6.32-431.11.2.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: (platypus) Version 4.4.7 20120313 Version 4.8.2 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 13.7-0 + Version 13.7-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: Version 14.0.2 (Build 20140120) @@ -3559,7 +3559,7 @@ They are built with the configure process unless specified otherwise. Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 14 (cmake) Visual Studio 2010 w/ Intel Fortran 14 (cmake) Visual Studio 2012 w/ Intel Fortran 14 (cmake) - + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 14 (cmake) Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 14 (cmake) @@ -3581,14 +3581,14 @@ Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel @@ -3614,28 +3614,28 @@ CentOS 6.4 Linux 2.6.32 x86_64 PGI n y/y n y y y Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y OpenVMS IA64 V8.4 n y/n n y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.11 32-bit y y y y -Solaris2.11 64-bit y y y y +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y Windows 8.1 y y y y Windows 8.1 x64 y y y y -Mac OS X Lion 10.7.3 64-bit y n y y -Mac OS X Mountain Lion 10.8.1 64-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y Mac OS X Mavericks 10.9.1 64-bit y n y y -AIX 5.3 32- and 64-bit y n n y -CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +AIX 5.3 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n -CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n -Linux 2.6.32-431.11.2.el6.ppc64 y y y n +CentOS 6.4 Linux 2.6.32 x86_64 PGI y y y n +Linux 2.6.32-431.11.2.el6.ppc64 y y y n OpenVMS IA64 V8.4 n n n n Compiler versions for each platform are listed in the preceding @@ -3652,7 +3652,7 @@ The following platforms are not supported but have been tested for this release. Linux 2.6.18-431.11.2.el6 MPICH mpich 3.1 compiled with #1 SMP x86_64 GNU/Linux gcc 4.8.2 and gfortran 4.8.2 - (platypus) g95 (GCC 4.0.3 (g95 0.94!) + (platypus) g95 (GCC 4.0.3 (g95 0.94!) FreeBSD 8.2-STABLE i386 gcc 4.5.4 [FreeBSD] 20110526 (loyalty) gcc 4.6.1 20110527 @@ -3683,7 +3683,7 @@ The following platforms are not supported but have been tested for this release. gcc (Ubuntu/Linaro 4.8.1-10ubuntu8) 4.8.1 GNU Fortran (Ubuntu/Linaro 4.8.1-10ubuntu8) 4.8.1 (cmake and autotools) - + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai @@ -3704,20 +3704,20 @@ Known Problems (AKC 2014/05/02 HDFFV-8479) * Due to an Intel compiler bug introduced in version 14.0.1, the HDF5 FORTRAN - wrappers do not work with configure option --enable-fortran2003. - However, the option --enable-fortran works with Intel 14.0.1. The compiler - bug was fixed in Intel version 14.0.2 and resolved the issue. + wrappers do not work with configure option --enable-fortran2003. + However, the option --enable-fortran works with Intel 14.0.1. The compiler + bug was fixed in Intel version 14.0.2 and resolved the issue. (MSB - 2014/4/15) -* Due to a PGI compiler bug introduced in versions before 13.3 and versions - after 14.2, the FORTRAN test 'Testing get file image' will fail. +* Due to a PGI compiler bug introduced in versions before 13.3 and versions + after 14.2, the FORTRAN test 'Testing get file image' will fail. (MSB - 2014/4/15) -* On CYGWIN, when building the library dynamically, testing will fail on - dynamically loaded filters. The test process will build dynamic filter - libraries with the *.dll.a extension, and the HDF5 Library will be looking +* On CYGWIN, when building the library dynamically, testing will fail on + dynamically loaded filters. The test process will build dynamic filter + libraries with the *.dll.a extension, and the HDF5 Library will be looking for *.so libraries. Entered as issue HDFFV-8736. (ADB - 2014/04/14) - + * A Gnu Make directive (.NOTPARALLEL) is added to fortran/test/Makefile. AIX native make does not support this directive and would fail if parallel make (e.g. make -j4) is used to build the library. AIX users @@ -3742,7 +3742,7 @@ Known Problems * On OpenVMS, ZLIB 1.2.8 library doesn't work properly. ZLIB 1.2.5 works fine. So please use ZLIB 1.2.5 to build HDF5 library. (Issue VMS-5; - SLU 2013/09/19) + SLU 2013/09/19) * When building using the Cray compilers on Cray machines, HDF5 configure mistakenly thinks the compiler is an intel compiler and @@ -3751,15 +3751,15 @@ Known Problems INSTALL_parallel for building on Hopper. (MSC - 2013/04/26 - HDFFV-8429) -* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It +* 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 + 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 Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler + But Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this identifier, try to compile the following simple C++ program: #include @@ -3780,7 +3780,7 @@ Known Problems h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 - + This is due to the embedded spaces in the dataset name being interpreted by the command script launcher as meta-characters, thus passing three arguments to h5dump's -d flag. The command passes if run by hand, just @@ -3791,21 +3791,21 @@ Known Problems to aprun -np X, because the H5lib_settings.c file was not generated properly. Not setting those environment variables works, because configure was able to automatically detect that it's a Cray system - and used the proper launch commands when necessary. + and used the proper launch commands when necessary. (MSC - 2012/04/18) * The data conversion test dt_arith.c fails in "long double" to integer conversion on Ubuntu 11.10 (3.0.0.13 kernel) 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 the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of "configure" like: CFLAGS=-O1 ./configure This will overwrite the library's default optimization level. (SLU - 2012/02/07 - HDFFV-7829) - This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with + This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with gcc 4.7.2. * The STDIO VFD does not work on some architectures, possibly due to 32/64 @@ -3828,7 +3828,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -3836,8 +3836,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -3872,42 +3872,42 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) * 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 + 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. (MAM - 2009/11/04) - + * 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) -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use -mp -O1 compilation flags to build the libraries. A higher level of - optimization causes failures in several HDF5 library tests. +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) -%%%%1.8.12%%%% +%%%%1.8.12%%%% HDF5 version 1.8.12 released on 2013-11-04 @@ -3916,10 +3916,10 @@ HDF5 version 1.8.12 released on 2013-11-04 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.11 and -HDF5-1.8.12, and contains information on the platforms tested and -known problems in HDF5-1.8.12. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.11 and +HDF5-1.8.12, and contains information on the platforms tested and +known problems in HDF5-1.8.12. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.12 source code, documentation, and additional materials @@ -3931,18 +3931,18 @@ The HDF5 1.8.12 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.12 can be accessed directly at this location: +User documentation for 1.8.12 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.12 (current +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.12 (current release) versus Release 1.8.11": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -3974,25 +3974,25 @@ New Features The cmake option is -DH5_DEFAULT_PLUGINDIR:PATH=location. HDFFV-8513. (ADB 2013/09/04) - Renamed FFLAGS to FCFLAGS in configure. (ADB 2013/08/13) - - CMake can now package a compressed examples file, the default for + - CMake can now package a compressed examples file, the default for Windows binaries from HDF Group. (ADB - 2013/07/22) - + Library ------- - None - + Parallel Library ---------------- - None - + Tools ----- - - h5repack: Added the ability to use plugin filters to read and write - files. The option uses the filter number. HDFFV-8345 + - h5repack: Added the ability to use plugin filters to read and write + files. The option uses the filter number. HDFFV-8345 (ADB - 2013/09/04). - - h5dump: Added the option -N --any_path, which searches the file for + - h5dump: Added the option -N --any_path, which searches the file for paths that match the search path. HDFFV-7989 (ADB - 2013/08/12). - - h5dump: Added the optional arg 0 to -A, which excludes attributes + - h5dump: Added the optional arg 0 to -A, which excludes attributes from display. HDFFV-8134 (ADB - 2013/08/01). High-Level APIs @@ -4033,7 +4033,7 @@ Bug Fixes since HDF5-1.8.11 Configuration ------------- - Modified H5detect.c to scan floating point types for padding bits before - analyzing the type further. This should fix problems with gcc 4.8. + analyzing the type further. This should fix problems with gcc 4.8. (NAF - 2013/09/19 - HDFFV-8523/HDFFV-8500) - HDF5 rpaths are no longer encoded in the library files when configured with --disable-sharedlib-rpath. (LRK-2013-09-23 - HDFFV-8276) @@ -4043,7 +4043,7 @@ Bug Fixes since HDF5-1.8.11 - Added const qualifier to source buffer parameters in H5Dgather and H5D_scatter_func_t (H5Dscatter callback). (NAF - 2013/7/09) - - CMake now creates *.so.{lt_version} files with the same version as + - CMake now creates *.so.{lt_version} files with the same version as configure. (ADB - 2013/06/05 HDFFV-8437) Parallel Library @@ -4056,14 +4056,14 @@ Bug Fixes since HDF5-1.8.11 Tools ----- - - h5dump: Added the option -N --any_path, which searches the file for + - h5dump: Added the option -N --any_path, which searches the file for paths that match the search path. HDFFV-7989 (ADB - 2013/08/12). - - h5dump: Added the optional arg 0 to -A, which excludes attributes + - h5dump: Added the optional arg 0 to -A, which excludes attributes from display. HDFFV-8134 (ADB - 2013/08/01). - h5dump correctly exports subsetted data to a file, using the --output option. (ADB - 2013/06/07 HDFFV-8447) - h5cc and other compile scripts now default to linking shared libraries - when HDF5 is configured with the --disable-static option. + when HDF5 is configured with the --disable-static option. (LRK - 2013-09-23 - HDFFV-8141) F90 API @@ -4114,20 +4114,20 @@ They are built with the configure process unless specified otherwise. #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-54) Version 4.8.1 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 13.7-0 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Version 13.7-0 + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 13.1.3 (Build 20130607) Linux 2.6.32-358.18.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: (platypus) Version 4.4.7 20120313 Version 4.8.1 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 13.7-0 + Version 13.7-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: Version 13.1.3 (Build 20130607) @@ -4170,22 +4170,22 @@ They are built with the configure process unless specified otherwise. 64-bit gfortran GNU Fortran (GCC) 4.6.2 (wren) Intel icc/icpc/ifort version 13.0.3 - OpenVMS IA64 V8.4 HP C V7.3-018 + OpenVMS IA64 V8.4 HP C V7.3-018 HP Fortran V8.2-104939-50H96 - HP C++ V7.4-004 + HP C++ V7.4-004 Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel @@ -4211,28 +4211,28 @@ CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y Linux 2.6.32-358.2.1.el6.ppc64 n y/n n y y y OpenVMS IA64 V8.4 n y/n n y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.11 32-bit y y y y -Solaris2.11 64-bit y y y y +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y Windows 8.1 y y y y Windows 8.1 x64 y y y y -Mac OS X Snow Leopard 10.6.8 64-bit y n y n -Mac OS X Lion 10.7.3 64-bit y n y y -Mac OS X Mountain Lion 10.8.1 64-bit y n y y -AIX 5.3 32- and 64-bit y n n y -CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n -CentOS 5.9 Linux 2.6.18 x86_64 PGI y y y n +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +AIX 5.3 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 5.9 Linux 2.6.18 x86_64 PGI y y y n CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n -Linux 2.6.32-358.2.1.el6.ppc64 y y y n +Linux 2.6.32-358.2.1.el6.ppc64 y y y n OpenVMS IA64 V8.4 n n n n Compiler versions for each platform are listed in the preceding @@ -4250,7 +4250,7 @@ The following platforms are not supported but have been tested for this release. Linux 2.6.18-308.16.1.el5 MPICH mpich2-1.4.1p1 compiled with #1 SMP x86_64 GNU/Linux gcc 4.1.2 and gfortran 4.1.2 (koala) g95 (GCC 4.0.3 (g95 0.94!) - + FreeBSD 8.2-STABLE i386 gcc 4.5.4 [FreeBSD] 20110526 (loyalty) gcc 4.6.1 20110527 g++ 4.6.1 20110527 @@ -4273,14 +4273,14 @@ The following platforms are not supported but have been tested for this release. SUSE 12.3 3.7.10-1.16-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux gcc (SUSE Linux) 4.7.2 - GNU Fortran (SUSE Linux) 4.7.2 + GNU Fortran (SUSE Linux) 4.7.2 (cmake and autotools) Ubuntu 13.04 3.8.0-30-generic #44-Ubuntu SMP x86_64 GNU/Linux gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 GNU Fortran (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 (cmake and autotools) - + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai @@ -4294,22 +4294,22 @@ Known Problems is built in place. The issue will be addressed in the 1.8.13 release. We recommend to use build directory to compile and test HDF5 as described in the INSTALL file, section 4.2. - + * Source directory names with spaces in them will cause failures in configure - or make on Mac (HDFFV-8152), Linux, and probably all other platforms. If a - configure command with a space is run from a build directory, it will exit - with an error message: "checking whether build environment is sane... - configure: error: unsafe srcdir value: '/scr/lrknox/hdf5 v1.8.12'". If - configure is run inside or below the directory with the space in the name, - libtool will get the directory path from the system, put the part of the - path before the space in the libdir variable in .../src/libhdf5.la, and - then fail to find the nonexistent directory. This is a known libtool issue - and the suggested workaround is to rename the directory without spaces. + or make on Mac (HDFFV-8152), Linux, and probably all other platforms. If a + configure command with a space is run from a build directory, it will exit + with an error message: "checking whether build environment is sane... + configure: error: unsafe srcdir value: '/scr/lrknox/hdf5 v1.8.12'". If + configure is run inside or below the directory with the space in the name, + libtool will get the directory path from the system, put the part of the + path before the space in the libdir variable in .../src/libhdf5.la, and + then fail to find the nonexistent directory. This is a known libtool issue + and the suggested workaround is to rename the directory without spaces. (LRK - 2013/10/22) * 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 (HDFFV-8147). This issue will be addressed in the + catches some undefined behavior in the alignment algorithm of the macro + DETECT_I in H5detect.c (HDFFV-8147). This issue will be addressed in the next release. (SLU - 2013/10/16) * Running make check for the tools can fail in the tools tests if make was not @@ -4327,7 +4327,7 @@ Known Problems * On OpenVMS, ZLIB 1.2.8 library doesn't work properly. ZLIB 1.2.5 works fine. So please use ZLIB 1.2.5 to build HDF5 library. (Issue VMS-5; - SLU 2013/09/19) + SLU 2013/09/19) * When building using the Cray compilers on Cray machines, HDF5 configure mistakenly thinks the compiler is an intel compiler and @@ -4344,15 +4344,15 @@ Known Problems spurious data values has only been encountered on Windows 32-bit systems. (Issue HDFFV-8247; JP - 2013/03/27) -* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It +* 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 + 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 Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler + But Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this identifier, try to compile the following simple C++ program: #include @@ -4373,7 +4373,7 @@ Known Problems h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 - + This is due to the embedded spaces in the dataset name being interpreted by the command script launcher as meta-characters, thus passing three arguments to h5dump's -d flag. The command passes if run by hand, just @@ -4384,21 +4384,21 @@ Known Problems to aprun -np X, because the H5lib_settings.c file was not generated properly. Not setting those environment variables works, because configure was able to automatically detect that it is a Cray system - and used the proper launch commands when necessary. + and used the proper launch commands when necessary. (MSC - 2012/04/18) * The data conversion test dt_arith.c fails in "long double" to integer conversion on Ubuntu 11.10 (3.0.0.13 kernel) with GCC 4.6.1 if the library is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernel - (3.2.2 on Fedora) do not have the problem. Users should lower the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of + (3.2.2 on Fedora) do not have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of "configure" like: CFLAGS=-O1 ./configure This will overwrite the library's default optimization level. (SLU - 2012/02/07 - HDFFV-7829) - This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with + This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with gcc 4.7.2. * The STDIO VFD does not work on some architectures, possibly due to 32/64 @@ -4421,7 +4421,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -4429,8 +4429,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -4465,42 +4465,42 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) * 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 + 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. (MAM - 2009/11/04) - + * 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) -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use -mp -O1 compilation flags to build the libraries. A higher level of - optimization causes failures in several HDF5 library tests. +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) -%%%%1.8.11%%%% +%%%%1.8.11%%%% HDF5 version 1.8.11 released on 2013-05-08 @@ -4509,10 +4509,10 @@ HDF5 version 1.8.11 released on 2013-05-08 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.10 and -HDF5-1.8.11-*, and contains information on the platforms tested and -known problems in HDF5-1.8.11-*. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.10 and +HDF5-1.8.11-*, and contains information on the platforms tested and +known problems in HDF5-1.8.11-*. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.11 source code, documentation, and additional materials @@ -4524,18 +4524,18 @@ The HDF5 1.8.11 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.11 can be accessed directly at this location: +User documentation for 1.8.11 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.11 (current +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.11 (current release) versus Release 1.8.10": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -4570,11 +4570,11 @@ New Features - A new tool, cmakehdf5, which is a build command script similar to buildhdf5 is added and is available in the bin directory. (AKC - 2013/01/16 HDFFV-8336) - + Library ------- - The library can load filter libraries dynamically during runtime. Users - can set the search path through environment variable HDF5_PLUGIN_PATH + can set the search path through environment variable HDF5_PLUGIN_PATH and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) - Added new API functions H5Dscatter and H5Dgather to scatter data to and and gather data from a selection within a memory buffer. @@ -4582,11 +4582,11 @@ New Features - The library now supports the data conversion from enumeration to numeric (integer and floating-point number) datatypes. See Issue HDFFV-8221. (SLU - 2012/10/23) - + Parallel Library ---------------- - None - + Tools ----- - h5dump: added new option -O or -ddl to output the ddl text to a file. This @@ -4595,8 +4595,8 @@ New Features High-Level APIs --------------- - - A new API function, H5DOwrite_chunk. This function writes a data chunk - directly into a file, bypassing hyperslab selection, data conversion, + - A new API function, H5DOwrite_chunk. This function writes a data chunk + directly into a file, bypassing hyperslab selection, data conversion, and the filter pipeline. The user must be careful with the function and clearly understand the I/O process of the library. (SLU - 2013/2/11) @@ -4605,11 +4605,11 @@ New Features - New API functions added (MSB - 2013/3/23): h5odecr_refcount_f, h5oexists_by_name_f, h5oget_comment_f, - h5oget_comment_by_name_f, h5oincr_refcount_f, h5oopen_by_idx_f, + h5oget_comment_by_name_f, h5oincr_refcount_f, h5oopen_by_idx_f, h5oset_comment_f, h5oset_comment_by_name_f, h5oset_comment_by_name_f F2003: h5oget_info_f, h5oget_info_by_idx_f, h5ovisit_by_name_f - + C++ API ------- @@ -4631,24 +4631,24 @@ Bug Fixes since HDF5-1.8.10 - Fixed Thread-safe configure failure for the AIX platform. (AKC - 2013/04/19 HDFFV-8390) - Configure will check the result of header searches before searching for - the library. + the library. Fixes HDFFV-8257 (ADB 2013/03/04) - - HDF does not support building SHARED Fortran libraries on OSX. Added - CMake code to check for this condition. + - HDF does not support building SHARED Fortran libraries on OSX. Added + CMake code to check for this condition. Fixes HDFFV-8227 (ADB 2013/03/04) - - CMake builds on Windows will no longer use legacy naming for libraries. + - CMake builds on Windows will no longer use legacy naming for libraries. The "dll" tag will no longer be added to the name of *.lib and *.dll. The option HDF_LEGACY_NAMING is now OFF by default. Fixes HDFFV-8292 (ADB 2013/01/30) Library ------- - - The library now behaves correctly when performing large I/O operations - on Mac OS-X. Previously, single I/O operations > 2 GB would fail - since the Darwin read/write calls cannot handle the number of bytes + - The library now behaves correctly when performing large I/O operations + on Mac OS-X. Previously, single I/O operations > 2 GB would fail + since the Darwin read/write calls cannot handle the number of bytes that their parameter types imply. Fixes HDFFV-7975 and HDFFV-8240 (DER 2013/01/07) - - Fixed a bug in the core VFD that causes failures when opening files + - Fixed a bug in the core VFD that causes failures when opening files > 2 GB. Fixes HDFFV-8124 and HDFFV-8158 (DER 2013/01/07) - Fixed a bug where unintialized memory was read during variable-length @@ -4656,9 +4656,9 @@ Bug Fixes since HDF5-1.8.10 (DER 2013/03/30) - Removed the H5Pset/get_dxpl_multi functions from the library. The intended functionality for them was never fully implemented, and they - have always been fundamentally broken. NOTE: This does not affect - setting the multi VFD or any expected VFD functionality. Multi VFD - usage remains unchanged. + have always been fundamentally broken. NOTE: This does not affect + setting the multi VFD or any expected VFD functionality. Multi VFD + usage remains unchanged. Fixes HDFFV-8296. (DER 2013/03/30) Parallel Library @@ -4679,15 +4679,15 @@ Bug Fixes since HDF5-1.8.10 includedir header files, default is . This allows users to just change the first line of prefix=<...> and the effect will change libdir and includedir too. (AKC 2013/04/05 HDFFV-8358) - - h5repack: Fixed failure to convert the layout of a small chunked + - h5repack: Fixed failure to convert the layout of a small chunked dataset (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/26) - - h5dump: Fixed displaying compression ratio for unknown or user-defined + - h5dump: Fixed displaying compression ratio for unknown or user-defined filters. HDFFV-8344 (XCAO 2013/03/19) - - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined + - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined filter. HDFFV-8346 (XCAO 2013/03/19) - - h5diff: Fixed to return the correct exit code 1 when the program - detects a unique extra attribute. Prior to this fix, h5diff returned - exit code 0 indicating the two files are identical. + - h5diff: Fixed to return the correct exit code 1 when the program + detects a unique extra attribute. Prior to this fix, h5diff returned + exit code 0 indicating the two files are identical. HDFFV-7643 (JKM 2013/02/15) - h5dump: Fixed writing nulls to a binary file when exporting a dataset with compound string datatype. HDFFV-8169 (ADB 2013/1/31) @@ -4695,10 +4695,10 @@ Bug Fixes since HDF5-1.8.10 other machines that display extra output if an MPI task returns with a non-zero code.) Testing h5stat notexist.h5 - The test script was fixed to ignore the extra output. HDFFV-8233 + The test script was fixed to ignore the extra output. HDFFV-8233 (AKC - 2012/11/30) - h5diff: Improved speed when comparing HDF5 files with lots of - attributes. Much slower performance was identified with release versions + attributes. Much slower performance was identified with release versions from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) F90 API @@ -4706,28 +4706,28 @@ Bug Fixes since HDF5-1.8.10 - The integer type of the 'offset' argument in h5pset_external_f and h5pget_external_f was changed to INTEGER(KIND=OFF_T) to support 8-byte integers, matching the C type definition of off_t. (MSB - 2013/3/23) - - h5fc updated to recognize .f95, .f03 and .f08 file extensions. + - h5fc updated to recognize .f95, .f03 and .f08 file extensions. C++ API ------ - - The C++ wrappers DSetMemXferPropList::setMulti/getMulti were removed - because the C functions H5Pset/get_dxpl_multi functions are removed + - The C++ wrappers DSetMemXferPropList::setMulti/getMulti were removed + because the C functions H5Pset/get_dxpl_multi functions are removed from the library. Fixes HDFFV-8296 by DER. (BMR 2013/03/30) - An exception thrown by an internal function was not propagating to the test program during stack unwinding, so it couldn't be caught by the - test, and the program terminated "without an active exception." It - seemed that the problem happened when c_str() was used to generate - an equivalent const char* from a std::string and the resulting string - was passed to the internal function. As a work-around, we added a - try/catch around the the call to the internal function and when the - exception is caught there, it is re-thrown. Fixes HDFFV-8067. + test, and the program terminated "without an active exception." It + seemed that the problem happened when c_str() was used to generate + an equivalent const char* from a std::string and the resulting string + was passed to the internal function. As a work-around, we added a + try/catch around the the call to the internal function and when the + exception is caught there, it is re-thrown. Fixes HDFFV-8067. (BMR 2013/03/30) High-Level APIs: ------ - - Fixed a problem with H5DSget_scale_name including the NULL terminator - in the size calculation returned by the function. The API was changed - to NOT include the NULL terminator in the size of name returned + - Fixed a problem with H5DSget_scale_name including the NULL terminator + in the size calculation returned by the function. The API was changed + to NOT include the NULL terminator in the size of name returned (MSB- 2013/2/10) Fortran High-Level APIs: @@ -4773,12 +4773,12 @@ They are built with the configure process unless specified otherwise. #1 SMP x86_64 GNU/Linux compilers for 64-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-52) Version 4.6.3 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 11.9-0 + Version 11.9-0 Version 12.5-0 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 12.1 (Build 20110811) Version 12.1 (Build 20120212) @@ -4830,14 +4830,14 @@ Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel @@ -4862,27 +4862,27 @@ CentOS 6.4 Linux 2.6.32 x86_64 Intel n y/y n y y y Linux 2.6.32-358.2.1.el6.ppc64 n y/n n y y y -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.11 32-bit y y y y -Solaris2.11 64-bit y y y y +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y Windows 7 Cygwin n n n y Windows 7 x64 Cygwin n n n y -Mac OS X Snow Leopard 10.6.8 64-bit y n y n -Mac OS X Lion 10.7.3 64-bit y n y y -Mac OS X Mountain Lion 10.8.1 64-bit y n y y -AIX 5.3 32- and 64-bit y n n y -CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n -CentOS 5.9 Linux 2.6.18 x86_64 PGI y y y n +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +AIX 5.3 32- and 64-bit y n n y +CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.9 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.9 Linux 2.6.18 x86_64 Intel y y y n +CentOS 5.9 Linux 2.6.18 x86_64 PGI y y y n CentOS 6.4 Linux 2.6.32 x86_64 GNU y y y n CentOS 6.4 Linux 2.6.32 x86_64 Intel y y y n -Linux 2.6.32-358.2.1.el6.ppc64 y y y n +Linux 2.6.32-358.2.1.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. @@ -4899,7 +4899,7 @@ The following platforms are not supported but have been tested for this release. Linux 2.6.18-308.16.1.el5 MPICH mpich2-1.4.1p1 compiled with #1 SMP x86_64 GNU/Linux gcc 4.1.2 and gfortran 4.1.2 (koala) g95 (GCC 4.0.3 (g95 0.94!) - + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 (loyalty) gcc 4.6.1 20110422 g++ 4.6.1 20110422 @@ -4922,14 +4922,14 @@ The following platforms are not supported but have been tested for this release. SUSE 12.3 3.7.10-1.1-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux gcc (SUSE Linux) 4.7.2 - GNU Fortran (SUSE Linux) 4.7.2 + GNU Fortran (SUSE Linux) 4.7.2 (cmake and autotools) Ubuntu 12.10 3.5.0-25-generic #39-Ubuntu SMP x86_64 GNU/Linux gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 GNU Fortran (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 (cmake and autotools) - + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai @@ -4954,15 +4954,15 @@ Known Problems spurious data values has only been encountered on Windows 32-bit systems. (Issue HDFFV-8247; JP - 2013/03/27) -* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It +* 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 + 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 Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler + But Sun's 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this identifier, try to compile the following simple C++ program: #include @@ -4983,7 +4983,7 @@ Known Problems h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 - + This is due to the embedded spaces in the dataset name being interpreted by the command script launcher as meta-characters, thus passing three arguments to h5dump's -d flag. The command passes if run by hand, just @@ -4994,21 +4994,21 @@ Known Problems to aprun -np X, because the H5lib_settings.c file was not generated properly. Not setting those environment variables works, because configure was able to automatically detect that it's a Cray system - and used the proper launch commands when necessary. + and used the proper launch commands when necessary. (MSC - 2012/04/18) * The data conversion test dt_arith.c fails in "long double" to integer conversion on Ubuntu 11.10 (3.0.0.13 kernel) 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 the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of "configure" like: CFLAGS=-O1 ./configure This will overwrite the library's default optimization level. (SLU - 2012/02/07 - HDFFV-7829) - This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with + This issue is no longer present on Ubuntu 12.10 (3.5.0 kernel) with gcc 4.7.2. * The STDIO VFD does not work on some architectures, possibly due to 32/64 @@ -5031,7 +5031,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -5039,8 +5039,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -5071,7 +5071,7 @@ Known Problems (NAF - 2011/01/19) * The library's test dt_arith.c showed a compiler's rounding problem on - Cygwin when converting from unsigned long long to long double. The + Cygwin when converting from unsigned long long to long double. The library's own conversion works fine. We defined a macro for Cygwin to skip this test until we can solve the problem. (SLU - 2010/05/05 - HDFFV-1264) @@ -5081,42 +5081,42 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) * 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 + 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. (MAM - 2009/11/04) - + * 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) -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use -mp -O1 compilation flags to build the libraries. A higher level of - optimization causes failures in several HDF5 library tests. +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) -%%%%1.8.10-patch1%%%% +%%%%1.8.10-patch1%%%% HDF5 version 1.8.10-patch1 released on 2013-01-22 @@ -5125,10 +5125,10 @@ HDF5 version 1.8.10-patch1 released on 2013-01-22 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.9 and -HDF5 1.8.10, and contains information on the platforms tested and -known problems in HDF5-1.8.10. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.9 and +HDF5 1.8.10, and contains information on the platforms tested and +known problems in HDF5-1.8.10. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.10 source code, documentation, and additional materials @@ -5140,18 +5140,18 @@ The HDF5 1.8.10 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.10 can be accessed directly at this location: +User documentation for 1.8.10 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.10 (current +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.10 (current release) versus Release 1.8.9": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -5194,25 +5194,25 @@ New Features size. Now the library picks the smaller one between the dataset size and the sieve buffer size from the file access property. See Issue 7934. (SLU - 2012/4/11) - + Parallel Library ---------------- - - Added the H5Pget_mpio_no_collective_cause() function that retrieves - reasons why the collective I/O was broken during read/write IO access. + - Added the H5Pget_mpio_no_collective_cause() function that retrieves + reasons why the collective I/O was broken during read/write IO access. (JKM - 2012/08/30 HDFFV-8143) - Added H5Pget_mpio_actual_io_mode_f (MSB - 2012/09/27) - + Tools ----- - - h5import: Changed to allow the use of h5dump output as input files to - h5import. h5dump must include the "-p" option to print the properties; - configuration file is captured output of h5dump. The restrictions are - that only one dataset with a simple datatype (integer, floating-point, - or string) can be processed. Integers and floating-point imports from - h5dump must use the "binary" option for the data file. The string version - uses the h5dump "-y --width=1" options to disable the indexing printouts, - print single columns, and obviously NOT use the "binary" option. + - h5import: Changed to allow the use of h5dump output as input files to + h5import. h5dump must include the "-p" option to print the properties; + configuration file is captured output of h5dump. The restrictions are + that only one dataset with a simple datatype (integer, floating-point, + or string) can be processed. Integers and floating-point imports from + h5dump must use the "binary" option for the data file. The string version + uses the h5dump "-y --width=1" options to disable the indexing printouts, + print single columns, and obviously NOT use the "binary" option. (ADB - 2012/07/19 HDFFV-721) High-Level APIs @@ -5221,7 +5221,7 @@ New Features Fortran API ----------- - - Fixed a typo in return value of the nh5dread_f_c function (was 1 + - Fixed a typo in return value of the nh5dread_f_c function (was 1 instead of 0 on success); fixed the return value to make it consistent with other Fortran functions; cleaned debug statements from the code. (EIP - 2012/06/23) @@ -5255,9 +5255,9 @@ Bug Fixes since HDF5-1.8.10 Testing h5stat notexist.h5 The test script was fixed to ignore the extra output. HDFFV-8233 (AKC - 2012/12/17) - - h5diff: Fixed slowness when comparing HDF5 files with many attributes. - Much slower performance was identified with later release version - (from 1.8.7 to 1.8.10) compared to 1.8.6. The issue was introduced + - h5diff: Fixed slowness when comparing HDF5 files with many attributes. + Much slower performance was identified with later release version + (from 1.8.7 to 1.8.10) compared to 1.8.6. The issue was introduced from fixing an attribute related bug for 1.8.7 release in the past. HDFFV-8145 (JKM 2012/12/13) @@ -5276,7 +5276,7 @@ Bug Fixes since HDF5-1.8.9 the hard conversion code in test/dt_arith.c to fail. HDFFV-8017. (AKC - 2012/10/10) - Fixed AIX Fortran compiler flags to use appropriate settings for - debugging, profiling, and optimization situations. HDFFV-8069. + debugging, profiling, and optimization situations. HDFFV-8069. (AKC 2012/09/27) Library @@ -5287,7 +5287,7 @@ Bug Fixes since HDF5-1.8.9 the core VFD" sub-test if the source directory is read-only as the test fails to create its test files in the build directory. This has been fixed. HDFFV-8009 (AKC - 2012/07/06) - + Parallel Library ---------------- @@ -5306,27 +5306,27 @@ Bug Fixes since HDF5-1.8.9 Tools ----- - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if - source file contains chunked dataset and a chunk dim is bigger than + source file contains chunked dataset and a chunk dim is bigger than the dataset dim. Another issue is that the command changed max dims - if chunk dim is smaller than the dataset dim. These issue occurred + if chunk dim is smaller than the dataset dim. These issue occurred when dataset size is smaller than 64k (compact size limit) Fixed both. HDFFV-8012 (JKM 2012/09/24) - - h5diff: Fixed the counter in verbose mode (-v, -r) so that it will no - longer add together the differences between datasets and the differences - between attributes of those datasets. This change makes the output of - verbose mode consistent for datasets, groups, and committed datatypes. + - h5diff: Fixed the counter in verbose mode (-v, -r) so that it will no + longer add together the differences between datasets and the differences + between attributes of those datasets. This change makes the output of + verbose mode consistent for datasets, groups, and committed datatypes. HDFFV-5919 (JKM 2012/09/10) - - h5diff: Fixed the incorrect result when comparing attribute data + - h5diff: Fixed the incorrect result when comparing attribute data values and the data type has the same class but different sizes. HDFFV-7942 (JKM 2012/08/15) - h5dump: Replaced single element fwrite with block writes. HDFFV-1208 (ADB 2012/08/13) - - h5diff: Fixed test failure for "make check" due to failure of + - h5diff: Fixed test failure for "make check" due to failure of copying test files when performed in HDF5 source tree. Also applied to other tools. HDFFV-8107 (JKM 2012/08/01) - - ph5diff: Fixed intermittent hang issue on a certain operation in - parallel mode. It was detected by daily test for comparing - non-comparable objects, but it could have occurred in other + - ph5diff: Fixed intermittent hang issue on a certain operation in + parallel mode. It was detected by daily test for comparing + non-comparable objects, but it could have occurred in other operations depending on machine condition. HDFFV-8003 (JKM 2012/08/01) - h5diff: Fixed the function COPY_TESTFILES_TO_TESTDIR() of testh5diff.sh to better report when there is an error in the file copying. @@ -5334,22 +5334,22 @@ Bug Fixes since HDF5-1.8.9 - h5dump: Fixed the sort by name display to maintain correct parent/child relationships between ascending/descending order. HDFFV-8095 (ADB 2012/07/12) - - h5dump: Fixed the display by creation order when using option -n + - h5dump: Fixed the display by creation order when using option -n (print contents). HDFFV-5942 (ADB 2012/07/09) - - h5dump: Changed to allow H5T_CSET_UTF8 to be displayed in h5dump output. - Used technique similar to what was done in h5ls (matches library + - h5dump: Changed to allow H5T_CSET_UTF8 to be displayed in h5dump output. + Used technique similar to what was done in h5ls (matches library options). HDFFV-7999 (ADB 2012/05/23) - - h5diff: Fixed the tool so that it will not check and display the status - of dangling links without setting the --follow-symlinks option. This - also improved performance when comparing lots of external links without - the --follow-symlinks option. + - h5diff: Fixed the tool so that it will not check and display the status + of dangling links without setting the --follow-symlinks option. This + also improved performance when comparing lots of external links without + the --follow-symlinks option. HDFFV-7998 (JKM 2012/04/26) F90 API ------- - + - Fixed a typo in return value of the nh5dread_f_c function (was 1 instead of 0 on success); fixed the return value to make it consistent with other Fortran functions; cleaned debug statements from the code. @@ -5372,15 +5372,15 @@ Bug Fixes since HDF5-1.8.9 High-Level APIs: ------ - - Fixed problem with H5TBdelete_record destroying all data following the + - Fixed problem with H5TBdelete_record destroying all data following the deletion of a row. (MSB- 2012/7/26) - - Fixed H5LTget_attribute_string not closing an object identifier when an + - Fixed H5LTget_attribute_string not closing an object identifier when an error occurs. (MSB- 2012/7/21) - - Corrected the return type of H5TBAget_fill from herr_t to htri_t to - reflect that a return value of 1 indicates that a fill value is - present, 0 indicates a fill value is not present, and <0 indicates an + - Corrected the return type of H5TBAget_fill from herr_t to htri_t to + reflect that a return value of 1 indicates that a fill value is + present, 0 indicates a fill value is not present, and <0 indicates an error. Fortran High-Level APIs: @@ -5410,19 +5410,19 @@ Supported Platforms #1 SMP x86_64 GNU/Linux compilers for 32-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-52) Version 4.6.3 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 11.9-0 + Version 11.9-0 Version 12.5-0 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 12.1 (Build 20110811) Version 12.1 (Build 20120212) MPICH mpich2-1.4.1p1 compiled with gcc 4.1.2 and gfortran 4.1.2 - Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) - #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 + Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 (ostrich) GNU Fortran (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers @@ -5481,14 +5481,14 @@ Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel @@ -5496,7 +5496,7 @@ Solaris2.10 32-bit n y/y n y y y Solaris2.10 64-bit n y/n n y y y Windows 7 y y/n n y y y Windows 7 x64 y y/n n y y y -Mac OS X Snow Leopard 10.6.8 32-bit n y/y n y y n +Mac OS X Snow Leopard 10.6.8 32-bit n y/y n y y n Mac OS X Snow Leopard 10.6.8 64-bit n y/y n y y y Mac OS X Lion 10.7.3 32-bit n y/y n y y n Mac OS X Lion 10.7.3 64-bit n y/y n y y y @@ -5511,25 +5511,25 @@ CentOS 5.5 Linux 2.6.18 x86_64 PGI n y/y n y y y Linux 2.6.32-220.7.1.el6.ppc64 n y/n n y y y -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit n n n n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit n n n n Windows 7 y y y y Windows 7 x64 y y y y -Mac OS X Snow Leopard 10.6.8 32-bit y n y n -Mac OS X Snow Leopard 10.6.8 64-bit y n y n -Mac OS X Lion 10.7.3 32-bit y n y y -Mac OS X Lion 10.7.3 64-bit y n y y -Mac OS X Mountain Lion 10.8.1 64-bit y n y y -AIX 5.3 32- and 64-bit n n n y -CentOS 5.5 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.5 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.5 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.5 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.5 Linux 2.6.18 x86_64 Intel y y y n -CentOS 5.5 Linux 2.6.18 x86_64 PGI y y y n -Linux 2.6.32-220.7.1.el6.ppc64 y y y n +Mac OS X Snow Leopard 10.6.8 32-bit y n y n +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +AIX 5.3 32- and 64-bit n n n y +CentOS 5.5 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.5 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.5 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.5 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel y y y n +CentOS 5.5 Linux 2.6.18 x86_64 PGI y y y n +Linux 2.6.32-220.7.1.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. @@ -5576,7 +5576,7 @@ The following platforms are not supported but have been tested for this release. SUSE 12.2 3.4.6-2.10-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux gcc (SUSE Linux) 4.7.1 - GNU Fortran (SUSE Linux) 4.7.1 + GNU Fortran (SUSE Linux) 4.7.1 (cmake and autotools) Ubuntu 12.04 3.2.0-29-generic #46-Ubuntu SMP i686 GNU/Linux @@ -5589,12 +5589,12 @@ The following platforms are not supported but have been tested for this release. GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 (cmake and autotools) (Use optimization level -O1) - + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai - + Known Problems ============== @@ -5608,7 +5608,7 @@ Known Problems h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 - + This is due to the embedded spaces in the dataset name being interpreted by the command script launcher as meta-characters, thus passing three arguments to h5dump's -d flag. The command passes if run by hand, just @@ -5619,14 +5619,14 @@ Known Problems to aprun -np X, because the H5lib_settings.c file was not generated properly. Not setting those environment variables works, because configure was able to automatically detect that it's a Cray system - and used the proper launch commands when necessary. + and used the proper launch commands when necessary. (MSC - 2012/04/18) * 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 the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of "configure" like: CFLAGS=-O1 ./configure @@ -5654,7 +5654,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -5662,8 +5662,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -5694,7 +5694,7 @@ Known Problems (NAF - 2011/01/19) * The library's test dt_arith.c showed a compiler's rounding problem on - Cygwin when converting from unsigned long long to long double. The + Cygwin when converting from unsigned long long to long double. The library's own conversion works fine. We defined a macro for Cygwin to skip this test until we can solve the problem. (SLU - 2010/05/05 - HDFFV-1264) @@ -5704,42 +5704,42 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) * 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 + 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. (MAM - 2009/11/04) - + * 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) -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use -mp -O1 compilation flags to build the libraries. A higher level of - optimization causes failures in several HDF5 library tests. +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) -%%%%1.8.10%%%% +%%%%1.8.10%%%% HDF5 version 1.8.10 released on 2012-10-26 @@ -5748,10 +5748,10 @@ HDF5 version 1.8.10 released on 2012-10-26 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.9 and -HDF5 1.8.10, and contains information on the platforms tested and -known problems in HDF5-1.8.10. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.9 and +HDF5 1.8.10, and contains information on the platforms tested and +known problems in HDF5-1.8.10. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.10 source code, documentation, and additional materials @@ -5763,18 +5763,18 @@ The HDF5 1.8.10 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.10 can be accessed directly at this location: +User documentation for 1.8.10 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.10 (current +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.10 (current release) versus Release 1.8.9": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -5802,7 +5802,7 @@ New Features Configuration ------------- - None - + Library ------- - Updated to latest autotools and changed all hard *.sh scripts to @@ -5814,25 +5814,25 @@ New Features size. Now the library picks the smaller one between the dataset size and the sieve buffer size from the file access property. See Issue 7934. (SLU - 2012/4/11) - + Parallel Library ---------------- - - Added the H5Pget_mpio_no_collective_cause() function that retrieves - reasons why the collective I/O was broken during read/write IO access. + - Added the H5Pget_mpio_no_collective_cause() function that retrieves + reasons why the collective I/O was broken during read/write IO access. (JKM - 2012/08/30 HDFFV-8143) - Added H5Pget_mpio_actual_io_mode_f (MSB - 2012/09/27) - + Tools ----- - - h5import: Changed to allow the use of h5dump output as input files to - h5import. h5dump must include the "-p" option to print the properties; - configuration file is captured output of h5dump. The restrictions are - that only one dataset with a simple datatype (integer, floating-point, - or string) can be processed. Integers and floating-point imports from - h5dump must use the "binary" option for the data file. The string version - uses the h5dump "-y --width=1" options to disable the indexing printouts, - print single columns, and obviously NOT use the "binary" option. + - h5import: Changed to allow the use of h5dump output as input files to + h5import. h5dump must include the "-p" option to print the properties; + configuration file is captured output of h5dump. The restrictions are + that only one dataset with a simple datatype (integer, floating-point, + or string) can be processed. Integers and floating-point imports from + h5dump must use the "binary" option for the data file. The string version + uses the h5dump "-y --width=1" options to disable the indexing printouts, + print single columns, and obviously NOT use the "binary" option. (ADB - 2012/07/19 HDFFV-721) High-Level APIs @@ -5841,7 +5841,7 @@ New Features Fortran API ----------- - - Fixed a typo in return value of the nh5dread_f_c function (was 1 + - Fixed a typo in return value of the nh5dread_f_c function (was 1 instead of 0 on success); fixed the return value to make it consistent with other Fortran functions; cleaned debug statements from the code. (EIP - 2012/06/23) @@ -5866,7 +5866,7 @@ Bug Fixes since HDF5-1.8.9 the hard conversion code in test/dt_arith.c to fail. HDFFV-8017. (AKC - 2012/10/10) - Fixed AIX Fortran compiler flags to use appropriate settings for - debugging, profiling, and optimization situations. HDFFV-8069. + debugging, profiling, and optimization situations. HDFFV-8069. (AKC 2012/09/27) Library @@ -5877,7 +5877,7 @@ Bug Fixes since HDF5-1.8.9 the core VFD" sub-test if the source directory is read-only as the test fails to create its test files in the build directory. This has been fixed. HDFFV-8009 (AKC - 2012/07/06) - + Parallel Library ---------------- @@ -5896,27 +5896,27 @@ Bug Fixes since HDF5-1.8.9 Tools ----- - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if - source file contains chunked dataset and a chunk dim is bigger than + source file contains chunked dataset and a chunk dim is bigger than the dataset dim. Another issue is that the command changed max dims - if chunk dim is smaller than the dataset dim. These issue occurred + if chunk dim is smaller than the dataset dim. These issue occurred when dataset size is smaller than 64k (compact size limit) Fixed both. HDFFV-8012 (JKM 2012/09/24) - - h5diff: Fixed the counter in verbose mode (-v, -r) so that it will no - longer add together the differences between datasets and the differences - between attributes of those datasets. This change makes the output of - verbose mode consistent for datasets, groups, and committed datatypes. + - h5diff: Fixed the counter in verbose mode (-v, -r) so that it will no + longer add together the differences between datasets and the differences + between attributes of those datasets. This change makes the output of + verbose mode consistent for datasets, groups, and committed datatypes. HDFFV-5919 (JKM 2012/09/10) - - h5diff: Fixed the incorrect result when comparing attribute data + - h5diff: Fixed the incorrect result when comparing attribute data values and the data type has the same class but different sizes. HDFFV-7942 (JKM 2012/08/15) - h5dump: Replaced single element fwrite with block writes. HDFFV-1208 (ADB 2012/08/13) - - h5diff: Fixed test failure for "make check" due to failure of + - h5diff: Fixed test failure for "make check" due to failure of copying test files when performed in HDF5 source tree. Also applied to other tools. HDFFV-8107 (JKM 2012/08/01) - - ph5diff: Fixed intermittent hang issue on a certain operation in - parallel mode. It was detected by daily test for comparing - non-comparable objects, but it could have occurred in other + - ph5diff: Fixed intermittent hang issue on a certain operation in + parallel mode. It was detected by daily test for comparing + non-comparable objects, but it could have occurred in other operations depending on machine condition. HDFFV-8003 (JKM 2012/08/01) - h5diff: Fixed the function COPY_TESTFILES_TO_TESTDIR() of testh5diff.sh to better report when there is an error in the file copying. @@ -5924,22 +5924,22 @@ Bug Fixes since HDF5-1.8.9 - h5dump: Fixed the sort by name display to maintain correct parent/child relationships between ascending/descending order. HDFFV-8095 (ADB 2012/07/12) - - h5dump: Fixed the display by creation order when using option -n + - h5dump: Fixed the display by creation order when using option -n (print contents). HDFFV-5942 (ADB 2012/07/09) - - h5dump: Changed to allow H5T_CSET_UTF8 to be displayed in h5dump output. - Used technique similar to what was done in h5ls (matches library + - h5dump: Changed to allow H5T_CSET_UTF8 to be displayed in h5dump output. + Used technique similar to what was done in h5ls (matches library options). HDFFV-7999 (ADB 2012/05/23) - - h5diff: Fixed the tool so that it will not check and display the status - of dangling links without setting the --follow-symlinks option. This - also improved performance when comparing lots of external links without - the --follow-symlinks option. + - h5diff: Fixed the tool so that it will not check and display the status + of dangling links without setting the --follow-symlinks option. This + also improved performance when comparing lots of external links without + the --follow-symlinks option. HDFFV-7998 (JKM 2012/04/26) F90 API ------- - + - Fixed a typo in return value of the nh5dread_f_c function (was 1 instead of 0 on success); fixed the return value to make it consistent with other Fortran functions; cleaned debug statements from the code. @@ -5962,15 +5962,15 @@ Bug Fixes since HDF5-1.8.9 High-Level APIs: ------ - - Fixed problem with H5TBdelete_record destroying all data following the + - Fixed problem with H5TBdelete_record destroying all data following the deletion of a row. (MSB- 2012/7/26) - - Fixed H5LTget_attribute_string not closing an object identifier when an + - Fixed H5LTget_attribute_string not closing an object identifier when an error occurs. (MSB- 2012/7/21) - - Corrected the return type of H5TBAget_fill from herr_t to htri_t to - reflect that a return value of 1 indicates that a fill value is - present, 0 indicates a fill value is not present, and <0 indicates an + - Corrected the return type of H5TBAget_fill from herr_t to htri_t to + reflect that a return value of 1 indicates that a fill value is + present, 0 indicates a fill value is not present, and <0 indicates an error. Fortran High-Level APIs: @@ -6000,19 +6000,19 @@ Supported Platforms #1 SMP x86_64 GNU/Linux compilers for 32-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-52) Version 4.6.3 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; - Version 11.9-0 + Version 11.9-0 Version 12.5-0 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 12.1 (Build 20110811) Version 12.1 (Build 20120212) MPICH mpich2-1.4.1p1 compiled with gcc 4.1.2 and gfortran 4.1.2 - Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) - #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 + Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 (ostrich) GNU Fortran (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers @@ -6071,14 +6071,14 @@ Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel @@ -6086,7 +6086,7 @@ Solaris2.10 32-bit n y/y n y y y Solaris2.10 64-bit n y/n n y y y Windows 7 y y/n n y y y Windows 7 x64 y y/n n y y y -Mac OS X Snow Leopard 10.6.8 32-bit n y/y n y y n +Mac OS X Snow Leopard 10.6.8 32-bit n y/y n y y n Mac OS X Snow Leopard 10.6.8 64-bit n y/y n y y y Mac OS X Lion 10.7.3 32-bit n y/y n y y n Mac OS X Lion 10.7.3 64-bit n y/y n y y y @@ -6101,25 +6101,25 @@ CentOS 5.5 Linux 2.6.18 x86_64 PGI n y/y n y y y Linux 2.6.32-220.7.1.el6.ppc64 n y/n n y y y -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit n n n n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit n n n n Windows 7 y y y y Windows 7 x64 y y y y -Mac OS X Snow Leopard 10.6.8 32-bit y n y n -Mac OS X Snow Leopard 10.6.8 64-bit y n y n -Mac OS X Lion 10.7.3 32-bit y n y y -Mac OS X Lion 10.7.3 64-bit y n y y -Mac OS X Mountain Lion 10.8.1 64-bit y n y y -AIX 5.3 32- and 64-bit n n n y -CentOS 5.5 Linux 2.6.18-308 i686 GNU y y y y -CentOS 5.5 Linux 2.6.18-308 i686 Intel y y y n -CentOS 5.5 Linux 2.6.18-308 i686 PGI y y y n -CentOS 5.5 Linux 2.6.18 x86_64 GNU y y y y -CentOS 5.5 Linux 2.6.18 x86_64 Intel y y y n -CentOS 5.5 Linux 2.6.18 x86_64 PGI y y y n -Linux 2.6.32-220.7.1.el6.ppc64 y y y n +Mac OS X Snow Leopard 10.6.8 32-bit y n y n +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +Mac OS X Mountain Lion 10.8.1 64-bit y n y y +AIX 5.3 32- and 64-bit n n n y +CentOS 5.5 Linux 2.6.18-308 i686 GNU y y y y +CentOS 5.5 Linux 2.6.18-308 i686 Intel y y y n +CentOS 5.5 Linux 2.6.18-308 i686 PGI y y y n +CentOS 5.5 Linux 2.6.18 x86_64 GNU y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel y y y n +CentOS 5.5 Linux 2.6.18 x86_64 PGI y y y n +Linux 2.6.32-220.7.1.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. @@ -6166,7 +6166,7 @@ The following platforms are not supported but have been tested for this release. SUSE 12.2 3.4.6-2.10-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux gcc (SUSE Linux) 4.7.1 - GNU Fortran (SUSE Linux) 4.7.1 + GNU Fortran (SUSE Linux) 4.7.1 (cmake and autotools) Ubuntu 12.04 3.2.0-29-generic #46-Ubuntu SMP i686 GNU/Linux @@ -6179,12 +6179,12 @@ The following platforms are not supported but have been tested for this release. GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 (cmake and autotools) (Use optimization level -O1) - + Cray Linux Environment (CLE) PrgEnv-pgi/4.0.46 hopper.nersc.gov pgcc 12.5-0 64-bit target on x86-64 Linux -tp shanghai pgf90 12.5-0 64-bit target on x86-64 Linux -tp shanghai pgCC 12.5-0 64-bit target on x86-64 Linux -tp shanghai - + Known Problems ============== @@ -6192,7 +6192,7 @@ Known Problems machines that display extra output if an MPI task returns with a non-zero code.) Testing h5stat notexist.h5 - + The test actually runs and passes as expected. It is the extra output from the MPI process that causes the test script to fail. This will be fixed in the next release. (AKC - 2012/10/25 - HDFFV-8233) @@ -6207,7 +6207,7 @@ Known Problems h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 - + This is due to the embedded spaces in the dataset name being interpreted by the command script launcher as meta-characters, thus passing three arguments to h5dump's -d flag. The command passes if run by hand, just @@ -6218,14 +6218,14 @@ Known Problems to aprun -np X, because the H5lib_settings.c file was not generated properly. Not setting those environment variables works, because configure was able to automatically detect that it's a Cray system - and used the proper launch commands when necessary. + and used the proper launch commands when necessary. (MSC - 2012/04/18) * 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 the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of "configure" like: CFLAGS=-O1 ./configure @@ -6253,7 +6253,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -6261,8 +6261,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -6293,7 +6293,7 @@ Known Problems (NAF - 2011/01/19) * The library's test dt_arith.c showed a compiler's rounding problem on - Cygwin when converting from unsigned long long to long double. The + Cygwin when converting from unsigned long long to long double. The library's own conversion works fine. We defined a macro for Cygwin to skip this test until we can solve the problem. (SLU - 2010/05/05 - HDFFV-1264) @@ -6303,42 +6303,42 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) * 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 + 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. (MAM - 2009/11/04) - + * 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) -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use -mp -O1 compilation flags to build the libraries. A higher level of - optimization causes failures in several HDF5 library tests. +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) -%%%%1.8.9%%%% +%%%%1.8.9%%%% HDF5 version 1.8.9 released on 2012-05-09 @@ -6347,11 +6347,11 @@ HDF5 version 1.8.9 released on 2012-05-09 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.8 and -HDF5 1.8.9. It also contains information on the platforms tested and -known problems in HDF5-1.8.9. +This document describes the differences between HDF5-1.8.8 and +HDF5 1.8.9. It also contains information on the platforms tested and +known problems in HDF5-1.8.9. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.9 source code, documentation, and additional materials @@ -6363,18 +6363,18 @@ The HDF5 1.8.9 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.9 can be accessed directly at this location: +User documentation for 1.8.9 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.9 (current +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.9 (current release) versus Release 1.8.8": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -6401,7 +6401,7 @@ New Features Configuration ------------- - None - + Library ------- - Added new feature to merge committed datatypes when copying objects, @@ -6409,12 +6409,12 @@ New Features routines: H5Padd_merge_committed_dtype_path(), H5Pfree_merge_committed_dtype_paths(), H5Pset_mcdt_search_cb() and H5Pget_mcdt_search_cb(). (QAK - 2012/03/30) - - Added new feature which allows working with files in memory in the - same ways files are worked with on disk. New API routines include - H5Pset_file_image, H5Pget_file_image, H5Pset_file_image_callbacks, - H5Pget_file_image_callbacks, H5Fget_file_image, and + - Added new feature which allows working with files in memory in the + same ways files are worked with on disk. New API routines include + H5Pset_file_image, H5Pget_file_image, H5Pset_file_image_callbacks, + H5Pget_file_image_callbacks, H5Fget_file_image, and H5LTopen_file_image. (QAK - 2012/04/17) - + Parallel Library ---------------- - Corrected memory allocation error in MPI datatype construction code. @@ -6423,7 +6423,7 @@ New Features MPI library to perform atomic operations. Some file systems (for example PVFS2) do not support atomic updates, so those routines would not be supported. (MSC - 2012/03/27 - HDFFV-7961) - + Tools ----- - h5repack: Added ability to set the metadata block size of the output @@ -6431,29 +6431,29 @@ New Features (QAK - 2012/03/30) - h5stat: Added ability to display a summary of the file space usage for a file, with the '-S'/'--summary' command line parameter. (QAK - 2012/03/28) - - h5dump: Added capability for "-a" option to show attributes containing "/" - by using an escape character. For example, for a dataset "/dset" - containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" + - h5dump: Added capability for "-a" option to show attributes containing "/" + by using an escape character. For example, for a dataset "/dset" + containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" to show the content of the attribute. (PC - 2012/03/12 - HDFFV-7523) - h5dump: Added ability to apply command options across multiple files using a wildcard in the filename. Unix example; "h5dump -H -d Dataset1 tarr*.h5". Cross platform example; "h5dump -H -d Dataset1 tarray1.h5 tarray2.h5 tarray3.h5". (ADB - 2012/03/12 - HDFFV-7876). - h5dump: Added new option --no-compact-subset. This option will not - interpret the '[' character as starting the compact form of - subsetting. This is useful when the "h5dump error: unable to + interpret the '[' character as starting the compact form of + subsetting. This is useful when the "h5dump error: unable to open dataset "datset_name"" message is output because a dataset name contains a '[' character. (ADB - 2012/03/05 - HDFFV-7689). - h5repack: Improved performance for big chunked datasets (size > 128MB) - when used with the layout (-l) or compression (-f) options. - Before this change, repacking datasets with chunks with a large first - dimension would take extremely long. For example, repacking a dataset - with chunk dimensions of 1024x5x1 might take many hours to process - while changing a dataset with chunk dimensions set to 1x5x1024 - might take under an hour. After this change, processing the dataset - with chunk dimensions of 1024x5x1 takes about 15 minutes, and processing + when used with the layout (-l) or compression (-f) options. + Before this change, repacking datasets with chunks with a large first + dimension would take extremely long. For example, repacking a dataset + with chunk dimensions of 1024x5x1 might take many hours to process + while changing a dataset with chunk dimensions set to 1x5x1024 + might take under an hour. After this change, processing the dataset + with chunk dimensions of 1024x5x1 takes about 15 minutes, and processing a dataset with chunk dimensions of 1x5x1024 takes about 14 minutes. - (JKM - 2012/03/01 - HDFFV-7862) + (JKM - 2012/03/01 - HDFFV-7862) High-Level APIs --------------- @@ -6483,7 +6483,7 @@ Bug Fixes since HDF5-1.8.8 ------------- - Fixed Makefile issue in which "-Wl," was not properly specified prior to -rpath when building parallel Fortran libraries with - an Intel compiler. (MAM - 2012/03/26) + an Intel compiler. (MAM - 2012/03/26) - Makefiles generated by other packages using h5cc as the compiler no longer error when 'make' is invoked more than once in order to 'rebuild' after changes to source. (MAM - 2012/03/26) @@ -6514,30 +6514,30 @@ Bug Fixes since HDF5-1.8.8 runs out of memory, the library had a segmentation fault. The fix is to return the error stack with proper information. (SLU - 2012/03/23 - HDFFV-7785) - - H5Pset_data_transform had a segmentation fault in some cases like x*-100. + - H5Pset_data_transform had a segmentation fault in some cases like x*-100. It works correctly now and handles other cases like 100-x or 2/x. (SLU - 2012/03/15 - HDFFV-7922) - Fixed rare corruption bugs that could occur when using the new object header format. (NAF - 2012/03/15 - HDFFV-7879) - - Fixed an error that occurred when creating a contiguous dataset with a - zero-sized dataspace and space allocation time set to 'early'. + - Fixed an error that occurred when creating a contiguous dataset with a + zero-sized dataspace and space allocation time set to 'early'. (QAK - 2012/03/12) - Changed Windows thread creation to use _beginthread() instead of CreateThread(). Threads created by the latter can be killed in low-memory situations. (DER - 2012/02/10 - HDFFV-7780) - - Creating a dataset in a read-only file caused a segmentation fault when - the file is closed. It's fixed. The attempt to create a dataset will + - Creating a dataset in a read-only file caused a segmentation fault when + the file is closed. It's fixed. The attempt to create a dataset will fail with an error indicating the file is read-only. - (SLU - 2012/01/25 - HDFFV-7756) - - Fixed a segmentation fault that could occur when shrinking a dataset + (SLU - 2012/01/25 - HDFFV-7756) + - Fixed a segmentation fault that could occur when shrinking a dataset with chunks larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) - Fixed a bug that could cause H5Oget_info to return the wrong address after copying a committed (named) datatype. (NAF - 2011/11/14) - The library allowed the conversion of strings between ASCII and UTF8 We have corrected it to report an error under this situation. (SLU - 2011/11/8 - HDFFV-7582) - - Fixed a segmentation fault when the library tried to shrink the size - of a compound datatype through H5Tset_size immediately after the + - Fixed a segmentation fault when the library tried to shrink the size + of a compound datatype through H5Tset_size immediately after the datatype was created. (SLU - 2011/11/4 - HDFFV-7618) Parallel Library @@ -6546,43 +6546,43 @@ Bug Fixes since HDF5-1.8.8 Tools ----- - - h5unjam: Fixed a segmentation fault that occurred when h5unjam was used + - h5unjam: Fixed a segmentation fault that occurred when h5unjam was used with the -V (show version) option. (JKM - 2012/04/19 - HDFFV-8001) - - h5repack: Fixed a failure that occurred when repacking the chunk size - of a specified chunked dataset with unlimited max dims. - (JKM - 2012/04/11 - HDFFV-7993) - - h5diff: Fixed a failure when comparing groups. Before the fix, if an - object in a group was compared with an object in another group where + - h5repack: Fixed a failure that occurred when repacking the chunk size + of a specified chunked dataset with unlimited max dims. + (JKM - 2012/04/11 - HDFFV-7993) + - h5diff: Fixed a failure when comparing groups. Before the fix, if an + object in a group was compared with an object in another group where both had the same name but the object type was different, then h5diff would fail. After the fix, h5diff detects such cases as non-comparable - and displays appropriate error messages. + and displays appropriate error messages. (JKM - 2012/03/28 - HDFFV-7644) - - h5diff: If unique objects exist only in one file and if h5diff is set to - exclude the unique objects with the --exclude-path option, then h5diff - might miss excluding some objects. This was fixed to correctly exclude + - h5diff: If unique objects exist only in one file and if h5diff is set to + exclude the unique objects with the --exclude-path option, then h5diff + might miss excluding some objects. This was fixed to correctly exclude objects. (JKM - 2012/03/20 - HDFFV-7837) - - h5diff: When two symbolic dangling links are compared with the - --follow-symlinks option, the result should be the same. This worked when + - h5diff: When two symbolic dangling links are compared with the + --follow-symlinks option, the result should be the same. This worked when comparing two files, but didn't work when comparing two objects. h5diff now works when comparing two objects. (JKM - 2012/03/09 - HDFFV-7835) - h5dump: Added the tools library error stack to properly catch error information generated within the library. (ADB - 2012/03/12 - HDFFV-7958) - - h5dump: Changed the process where an open link used to fail. Now dangling + - h5dump: Changed the process where an open link used to fail. Now dangling links no longer throw error messages. (ADB - 2012/03/12 - HDFFV-7839) - - h5dump: Refactored code to remove duplicated functions. Split XML + - h5dump: Refactored code to remove duplicated functions. Split XML functions from DDL functions. Corrected indentation and formatting errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified all tools call tools_init() in main. The USER_BLOCK data now correctly displays within the SUPER_BLOCK info. NOTE: WHITESPACE IN THE OUTPUT HAS CHANGED. (ADB - 2012/02/17 - HDFFV-7560) - - h5diff: Fixed to prevent from displaying error stack message when + - h5diff: Fixed to prevent from displaying error stack message when comparing two dangling symbolic links with the follow-symlinks option. (JKM - 2012/01/13 - HDFFV-7836) - - h5repack: Fixed a memory leak that occurred with the handling of + - h5repack: Fixed a memory leak that occurred with the handling of variable length strings in attributes. (JKM - 2012/01/10 - HDFFV-7840) - - h5ls: Fixed a segmentation fault that occurred when accessing region + - h5ls: Fixed a segmentation fault that occurred when accessing region reference data in an attribute. (JKM - 2012/01/06 - HDFFV-7838) F90 API @@ -6599,9 +6599,9 @@ Bug Fixes since HDF5-1.8.8 Fortran High-Level APIs: ------ - - h5ltget_attribute_string_f: The h5ltget_attribute_string_f used to return - the C NULL character in the returned character buffer. The returned - charactor buffer now does not return the C NULL character; the buffer + - h5ltget_attribute_string_f: The h5ltget_attribute_string_f used to return + the C NULL character in the returned character buffer. The returned + charactor buffer now does not return the C NULL character; the buffer is blank-padded if needed. (MSB - 2012/03/23) @@ -6644,19 +6644,19 @@ The following platforms and compilers have been tested for this release. #1 SMP x86_64 GNU/Linux compilers for 32-bit applications; (koala) Version 4.1.2 20080704 (Red Hat 4.1.2-52) Version 4.5.2 - PGI C, Fortran, C++ for 64-bit target on + PGI C, Fortran, C++ for 64-bit target on x86-64; Version 11.9-0 (64-bit) Version 11.8-0 (32-bit) - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64; + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64; Version 12.0 Version 12.1 MPICH mpich2-1.3.1 compiled with gcc 4.1.2 and gfortran 4.1.2 - Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) - #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 + Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20110731 (ostrich) GNU Fortran (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) Linux 2.6.18-108chaos Intel C, C++, Fortran Compilers Version 11.1 @@ -6677,7 +6677,7 @@ The following platforms and compilers have been tested for this release. SGI Altix UV Intel(R) C, Fortran Compilers SGI ProPack 7 Linux Version 11.1 20100806 2.6.32.24-0.2.1.2230.2.PTF- SGI MPT 2.02 - default #1 SMP + default #1 SMP (NCSA ember) Dell NVIDIA Cluster Intel(R) C, Fortran Compilers @@ -6741,7 +6741,7 @@ The following platforms and compilers have been tested for this release. SUSE 12.1 3.1.9-1.4-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux gcc (SUSE Linux) 4.6.2 - GNU Fortran (SUSE Linux) 4.6.2 + GNU Fortran (SUSE Linux) 4.6.2 Ubuntu 11.10 3.0.0-16-generic #29-Ubuntu SMP i686 GNU/Linux gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 @@ -6755,20 +6755,20 @@ The following platforms and compilers have been tested for this release. hopper.nersc.gov pgcc 11.9-0 64-bit target on x86-64 Linux -tp k8e pgf90 11.9-0 64-bit target on x86-64 Linux -tp k8e pgCC 11.9-0 64-bit target on x86-64 Linux -tp k8e - + Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -6778,7 +6778,7 @@ Windows XP n y(4) n y y Windows XP x64 n y(4) n y y y Windows Vista n y(4) n y y y Windows Vista x64 n y(4) n y y y -Mac OS X Snow Leopard 10.6.8 32-bit n y n y y n +Mac OS X Snow Leopard 10.6.8 32-bit n y n y y n Mac OS X Snow Leopard 10.6.8 64-bit n y n y y y Mac OS X Lion 10.7.3 32-bit n y n y y n Mac OS X Lion 10.7.3 64-bit n y n y y y @@ -6796,28 +6796,28 @@ Red Hat Enterprise Linux 6 y y y y y CLE hopper.nersc.gov y y(3) y y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit n n n n -Windows XP y y(4) y n -Windows XP x64 y y(4) y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit n n n n +Windows XP y y(4) y n +Windows XP x64 y y(4) y n Windows Vista y y(4) y y Windows Vista x64 y y(4) y y -Mac OS X Snow Leopard 10.6.8 32-bit y n y n -Mac OS X Snow Leopard 10.6.8 64-bit y n y n -Mac OS X Lion 10.7.3 32-bit y n y y -Mac OS X Lion 10.7.3 64-bit y n y y -AIX 5.3 32- and 64-bit n n n y -FreeBSD 8.2-STABLE 32&64 bit y x x y -CentOS 5.5 Linux 2.6.18-194 i686 GNU (1)W y y(2) y y -CentOS 5.5 Linux 2.6.18-194 i686 Intel W y y y n -CentOS 5.5 Linux 2.6.18-194 i686 PGI W y y y n -CentOS 5.5 Linux 2.6.18 x86_64 GNU (1) W y y y y -CentOS 5.5 Linux 2.6.18 x86_64 Intel W y y y n -CentOS 5.5 Linux 2.6.18 x86_64 PGI W y y y n -Linux 2.6.32-220.7.1.el6.ppc64 y y y n -SGI ProPack 7 Linux 2.6.32.24 y y y n +Mac OS X Snow Leopard 10.6.8 32-bit y n y n +Mac OS X Snow Leopard 10.6.8 64-bit y n y n +Mac OS X Lion 10.7.3 32-bit y n y y +Mac OS X Lion 10.7.3 64-bit y n y y +AIX 5.3 32- and 64-bit n n n y +FreeBSD 8.2-STABLE 32&64 bit y x x y +CentOS 5.5 Linux 2.6.18-194 i686 GNU (1)W y y(2) y y +CentOS 5.5 Linux 2.6.18-194 i686 Intel W y y y n +CentOS 5.5 Linux 2.6.18-194 i686 PGI W y y y n +CentOS 5.5 Linux 2.6.18 x86_64 GNU (1) W y y y y +CentOS 5.5 Linux 2.6.18 x86_64 Intel W y y y n +CentOS 5.5 Linux 2.6.18 x86_64 PGI W y y y n +Linux 2.6.32-220.7.1.el6.ppc64 y y y n +SGI ProPack 7 Linux 2.6.32.24 y y y n Red Hat Enterprise Linux 6 y y y n CLE hopper.nersc.gov n n n n @@ -6850,7 +6850,7 @@ Known Problems fails to create its test files in the build directory. This will be resolved in a future release. (AKC - 2012/05/05 - HDFFV-8009) - + * The dt_arith test reports several errors involving "long double" on Mac OS X 10.7 Lion when any level of optimization is enabled. The test does not fail in debug mode. This will be addressed in a future release. @@ -6861,7 +6861,7 @@ Known Problems h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 - + This is due to the embedded spaces in the dataset name being interpreted by the command script launcher as meta-characters, thus passing three arguments to h5dump's -d flag. The command passes if run by hand, just @@ -6877,14 +6877,14 @@ Known Problems to aprun -np X, because the H5lib_settings.c file was not generated properly. Not setting those environment variables works, because configure was able to automatically detect that it's a Cray system - and used the proper launch commands when necessary. + and used the proper launch commands when necessary. (MSC - 2012/04/18) * 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 the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of + (3.2.2 on Fedora) doesn't have the problem. Users should lower the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of "configure" like: CFLAGS=-O1 ./configure @@ -6912,7 +6912,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -6920,8 +6920,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -6952,7 +6952,7 @@ Known Problems (NAF - 2011/01/19) * The library's test dt_arith.c showed a compiler's rounding problem on - Cygwin when converting from unsigned long long to long double. The + Cygwin when converting from unsigned long long to long double. The library's own conversion works fine. We defined a macro for Cygwin to skip this test until we can solve the problem. (SLU - 2010/05/05 - HDFFV-1264) @@ -6962,8 +6962,8 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) @@ -6975,18 +6975,18 @@ Known Problems * 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 + 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. (MAM - 2009/11/04) - + * The PathScale MPI implementation, accessing a Panasas file system, would cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not exist. This is due to the MPI_File_open() call failing if the mode has the MPI_MODE_EXCL bit set. (AKC - 2009/08/11 - HDFFV-988) - + * 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 @@ -7022,30 +7022,30 @@ Known Problems echo SKIP H5LSTEST $FILEOUT ================================================== (AKC - 2008/11/10) - + * For Red Storm, a Cray XT3 system, the yod command sometimes gives the message, "yod allocation delayed for node recovery". This interferes with test suites that do not expect to see this message. See the section of "Red Storm" in file INSTALL_parallel for a way to deal with this problem. (AKC - 2008/05/28) -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use -mp -O1 compilation flags to build the libraries. A higher level of - optimization causes failures in several HDF5 library tests. +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. -* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) * On IBM AIX systems, parallel HDF5 mode will fail some tests with error @@ -7053,17 +7053,17 @@ Known Problems 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", - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. (AKC - 2004/12/08) -%%%%1.8.8%%%% +%%%%1.8.8%%%% HDF5 version 1.8.8 released on 2011-11-15 @@ -7072,10 +7072,10 @@ HDF5 version 1.8.8 released on 2011-11-15 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.7 and -HDF5 1.8.8, and contains information on the platforms tested and -known problems in HDF5-1.8.8. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.7 and +HDF5 1.8.8, and contains information on the platforms tested and +known problems in HDF5-1.8.8. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.8 source code, documentation, and additional materials @@ -7087,18 +7087,18 @@ The HDF5 1.8.8 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.8 can be accessed directly at this location: +User documentation for 1.8.8 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.8 (current +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.8 (current release) versus Release 1.8.7": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -7124,15 +7124,15 @@ New Features Configuration ------------- - - Added the --enable-fortran2003 flag to enable Fortran2003 support + - Added the --enable-fortran2003 flag to enable Fortran2003 support in the HDF5 Fortran library. The flag should be used along with the - --enable-fortran flag and takes affect only when the Fortran compiler + --enable-fortran flag and takes affect only when the Fortran compiler is Fortran2003 compliant. (EIP - 2011/11/14) - Added checks for clock_gettime and mach/mach_time.h to both configure and CMake. This will support the move from gettimeofday to clock_gettime's monotonic timer in the profiling code in a future release. (DER - 2011/10/12) - + Library ------- - The Windows VFD code has been removed with the exception of the functions @@ -7144,13 +7144,13 @@ New Features (DER - 2011/10/12 - HDFFV-7740, HDFFV-7744) - H5Tcreate now supports the string type (fixed-length and variable- length). (SLU - 2011/05/20) - + Parallel Library ---------------- - Added new H5Pget_mpio_actual_chunk_opt_mode and H5Pget_mpio_actual_io_mode API routines for querying whether/how a collective I/O operation completed. (QAK - 2011/10/12) - + Tools ----- - None @@ -7187,8 +7187,8 @@ New Features h5rderefrence_f h5rget_name_f h5rget_obj_type_f - - Subroutines overloaded with the C_PTR derived type - and simplified signatures: + - Subroutines overloaded with the C_PTR derived type + and simplified signatures: h5aread_f h5awrite_f h5dread_f @@ -7228,7 +7228,7 @@ Bug Fixes since HDF5-1.8.7 trace statement fixup. (DER - 2011/08/25) - The --enable-h5dump-packed-bits configure option has been removed. The h5dump code that this option conditionally enabled is now always - compiled into h5dump. Please refer to the h5dump reference manual for + compiled into h5dump. Please refer to the h5dump reference manual for usage of the packed bits feature. (MAM - 2011/06/23 - HDFFV-7592) - Configure now uses the same flags and symbols in its tests that are used to build the library. (DER - 2011/05/24) @@ -7250,14 +7250,14 @@ Bug Fixes since HDF5-1.8.7 I/O sizes (and remove compiler warnings) between Windows and true POSIX systems. (DER - 2011/10/12) - Corrected some Windows behavior in the SEC2 and log VFDs. This mainly - involved datatype correctness fixes, Windows API call error checks, + involved datatype correctness fixes, Windows API call error checks, and adding the volume serial number to the VFD cmp functions. (DER - 2011/10/12) - - Converted post-checks for the appropriate POSIX I/O sizes to pre-checks - in order to avoid platform-specific or undefined behavior. + - Converted post-checks for the appropriate POSIX I/O sizes to pre-checks + in order to avoid platform-specific or undefined behavior. (DER - 2011/10/12) - - #ifdef _WIN32 instances have been changed to #ifdef H5_HAVE_WIN32_API. - H5_HAVE_VISUAL_STUDIO checks have been added where necessary. This is in + - #ifdef _WIN32 instances have been changed to #ifdef H5_HAVE_WIN32_API. + H5_HAVE_VISUAL_STUDIO checks have been added where necessary. This is in CMake only as configure never sets _WIN32. (ADB - 2011/09/12) - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv discovered 3 problems in tests and tools' library: @@ -7265,7 +7265,7 @@ Bug Fixes since HDF5-1.8.7 caused undefined behavior. 2. In dt_arith.c, the INIT_INTEGER macro definition has an overflow when the value is a negative minimal and is being subtracted from one. - 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits + 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits or more caused undefined behavior. All the problems have been corrected. (SLU - 2011/09/02 - HDFFV-7674) - H5Epush2() now has the correct trace functionality (this is related to the @@ -7273,17 +7273,17 @@ Bug Fixes since HDF5-1.8.7 (DER - 2011/08/25) - Corrected mismatched function name typo of h5pget_dxpl_mpio_c and h5pfill_value_defined_c. (AKC - 2011/08/22 - HDFFV-7641) - - Corrected an internal error in the library where objects that use committed + - Corrected an internal error in the library where objects that use committed (named) datatypes and were accessed from two different file IDs could confuse the two and cause erroneous failures. (QAK - 2011/07/18 - HDFFV-7638) - - In v1.6 of the library, there was an EOA for the whole MULTI file saved in the - super block. We took it out in v1.8 of the library because it's meaningless - for the MULTI file. v1.8 of the library saves the EOA for the metadata file + - In v1.6 of the library, there was an EOA for the whole MULTI file saved in the + super block. We took it out in v1.8 of the library because it's meaningless + for the MULTI file. v1.8 of the library saves the EOA for the metadata file instead, but this caused a backward compatibility problem. A v1.8 library couldn't open the file created with the v1.6 library. We fixed the problem by checking the EOA value to detect the file - created with v1.6 library. (SLU - 2011/06/22) - - When a dataset had filters and reading data failed, the error message + created with v1.6 library. (SLU - 2011/06/22) + - When a dataset had filters and reading data failed, the error message didn't say which filter wasn't registered. It's fixed now. (SLU - 2011/06/03) Parallel Library @@ -7298,71 +7298,71 @@ Bug Fixes since HDF5-1.8.7 Tools ----- - - h5diff: fixed segfault over non-comparable attribute with different + - h5diff: fixed segfault over non-comparable attribute with different dimention or rank, along with '-c' option to display details. (JKM - 2011/10/24 - HDFFV-7770) - - Fixed h5diff to display all the comparable objects and attributes + - Fixed h5diff to display all the comparable objects and attributes regardless of detecting non-comparables. (JKM - 2011/09/16 - HDFFV-7693) - - Fixed h5repack to update the values of references(object and region) of - attributes in h5repack for 1) references, 2) arrays of references, - 3) variable-length references, and 4) compound references. + - Fixed h5repack to update the values of references(object and region) of + attributes in h5repack for 1) references, 2) arrays of references, + 3) variable-length references, and 4) compound references. (PC - 2011/09/14 - HDFFV-5932) - - h5diff: fixed a segfault over a dataset with container types - array and variable-length (vlen) along with multiple nested compound types. + - h5diff: fixed a segfault over a dataset with container types + array and variable-length (vlen) along with multiple nested compound types. Example: compound->array->compound, compound->vlen->compound. (JKM - 2011/09/01 - HDFFV-7712) - h5repack: added macro to handle a failure in H5Dread/write when memory allocation failed inside the library. (PC - 2011/08/19) - - Fixed h5jam to not to allow the specifying of an HDF5 formatted file as - an input file for the -u (user block file) option. The original HDF5 file - would not be accessible if this behavior was allowed. + - Fixed h5jam to not to allow the specifying of an HDF5 formatted file as + an input file for the -u (user block file) option. The original HDF5 file + would not be accessible if this behavior was allowed. (JKM - 2011/08/19 - HDFFV-5941) - Revised the command help pages of h5jam and h5unjam. The descriptions - were not up to date and some were missing. + were not up to date and some were missing. (JKM - 2011/08/15 - HDFFV-7515) - - Fixed h5dump to correct the schema location: - (ADB - 2011/08/10) - - h5repack: h5repack failed to copy a dataset if the layout is changed + - h5repack: h5repack failed to copy a dataset if the layout is changed from chunked with unlimited dimensions to contiguous. (PC - 2011/07/15 - HDFFV-7649) - - Fixed h5diff: the "--delta" option considers two NaN of the same type - are different. This is wrong based on the h5diff description in the + - Fixed h5diff: the "--delta" option considers two NaN of the same type + are different. This is wrong based on the h5diff description in the Reference Manual. (PC - 2011/07/15 - HDFFV-7656) - Fixed h5diff to display an instructive error message and exit with - an instructive error message when mutually exclusive options - (-d, -p and --use-system-epsilon) are used together. + an instructive error message when mutually exclusive options + (-d, -p and --use-system-epsilon) are used together. (JKM - 2011/07/07 - HDFFV-7600) - Fixed h5dump so that it displays the first line of each element in correct - position for multiple dimention array types. Before this fix, + position for multiple dimention array types. Before this fix, the first line of each element in an array was displayed after the last line of previous element without moving to the next line (+indentation). (JKM - 2011/06/15 - HDFFV-5878) - - Fixed h5dump so that it will display the correct value for - H5T_STD_I8LE datasets on the Blue-gene system (ppc64, linux, Big-Endian, + - Fixed h5dump so that it will display the correct value for + H5T_STD_I8LE datasets on the Blue-gene system (ppc64, linux, Big-Endian, clustering). (AKC & JKM - 2011/05/12 - HDFFV-7594) - Fixed h5diff to compare a file to itself correctly. Previously h5diff - reported either the files were different or not compatible in certain - cases even when comparing a file to itself. This fix also improves - performance when comparing the same target objects through verifying - the object and file addresses before comparing the details - in the objects. Examples of details are datasets and attributes. + reported either the files were different or not compatible in certain + cases even when comparing a file to itself. This fix also improves + performance when comparing the same target objects through verifying + the object and file addresses before comparing the details + in the objects. Examples of details are datasets and attributes. (XCAO & JKM - 2011/05/06 - HDFFV-5928) F90 API ------- - - Modified the h5open_f and h5close_f subroutines to not to call H5open - and H5close correspondingly. While the H5open call just adds overhead, - the H5close call called by a Fortran application shuts down the HDF5 - library. This makes the library inaccessible to the application. + - Modified the h5open_f and h5close_f subroutines to not to call H5open + and H5close correspondingly. While the H5open call just adds overhead, + the H5close call called by a Fortran application shuts down the HDF5 + library. This makes the library inaccessible to the application. (EIP & SB - 2011/10/13 - HDFFV-915) - - Fixed h5tget_tag_f where the length of the C string was used to - repack the C string into the Fortran string. This lead to memory + - Fixed h5tget_tag_f where the length of the C string was used to + repack the C string into the Fortran string. This lead to memory corruption in the calling program. (SB - 2011/07/26) - Added defined constants: H5T_ORDER_MIXED_F (HDFFV-2767) @@ -7382,13 +7382,13 @@ Bug Fixes since HDF5-1.8.7 High-Level APIs: ------ - - Fixed the H5LTdtype_to_text function. It had some memory problems when + - Fixed the H5LTdtype_to_text function. It had some memory problems when dealing with some complicated data types. (SLU - 2011/10/19 - HDFFV-7701) - - Fixed H5DSset_label seg faulting when retrieving the length of a + - Fixed H5DSset_label seg faulting when retrieving the length of a dimension label that was not set. (SB - 2011/08/07 - HDFFV-7673) - - Fixed a dimension scale bug where if you create a dimscale, attach two - datasets to it, and then unattach them, you get an error if they are - unattached in order, but no error if you unattach them in reverse order. + - Fixed a dimension scale bug where if you create a dimscale, attach two + datasets to it, and then unattach them, you get an error if they are + unattached in order, but no error if you unattach them in reverse order. (SB - 2011/06/07 - HDFFV-7605) Fortran High-Level APIs: @@ -7422,7 +7422,7 @@ The following platforms and compilers have been tested for this release. Linux 2.6.16.60-0.54.5-smp Intel(R) C, C++, Fortran Compilers x86_64 Version 11.1 20090630 - (INL Icestorm) + (INL Icestorm) Linux 2.6.18-194.el5 x86_64 Intel(R) C, C++, Fortran Compilers (INL Fission) Version 12.0.2 20110112 @@ -7432,11 +7432,11 @@ The following platforms and compilers have been tested for this release. Linux 2.6.18-194.3.1.el5PAE gcc (GCC) 4.1.2 and 4.4.2 #1 SMP i686 i686 i386 GNU Fortran (GCC) 4.1.2 20080704 - (jam) (Red Hat 4.1.2-48) and 4.4.2 + (jam) (Red Hat 4.1.2-48) and 4.4.2 PGI C, Fortran, C++ 10.4-0 32-bit PGI C, Fortran, C++ 10.6-0 32-bit Intel(R) C Compiler for 32-bit - applications, Version 11.1 + applications, Version 11.1 Intel(R) C++ Compiler for 32-bit applications, Version 11.1 Intel(R) Fortran Compiler for 32-bit @@ -7448,8 +7448,8 @@ The following platforms and compilers have been tested for this release. #1 SMP x86_64 GNU/Linux GNU Fortran (GCC) 4.1.2 20080704 (koala) (Red Hat 4.1.2-46) and 4.4.2 tested for both 32- and 64-bit binaries - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64, + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, Version 11.1. PGI C, Fortran, C++ Version 9.0-4 for 64-bit target on x86-64 @@ -7459,7 +7459,7 @@ The following platforms and compilers have been tested for this release. SGI Altix UV Intel(R) C, Fortran Compilers SGI ProPack 7 Linux Version 11.1 20100806 2.6.32.24-0.2.1.2230.2.PTF- SGI MPT 2.02 - default #1 SMP + default #1 SMP (NCSA ember) Dell NVIDIA Cluster Intel(R) C, Fortran Compilers @@ -7532,7 +7532,7 @@ The following platforms and compilers have been tested for this release. Ubuntu 11.10 3.0.0-12-generic #20-Ubuntu SMP x86_64 GNU/Linux gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 GNU Fortran (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 - + OpenVMS Alpha 8.3 HP C V7.3-009 HP Fortran V8.2-104679-48H9K HP C++ V7.3-009 @@ -7546,14 +7546,14 @@ Tested Configuration Features Summary ===================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -7577,31 +7577,31 @@ CentOS 5.5 Linux 2.6.16 x86_64 PGI W n y n y y y Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 n y n y y y SGI ProPack 7 Linux 2.6.32.24 y y y y y y Red Hat Enterprise Linux 6 y y y y y y -CLE hopper.nersc.gov y y(3) y y y n -CLE franklin.nersc.gov y y(3) y y y n +CLE hopper.nersc.gov y y(3) y y y n +CLE franklin.nersc.gov y y(3) y y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit y y y y -Windows XP y y(4) y n -Windows XP x64 y y(4) y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y n +Windows XP x64 y y(4) y n Windows Vista y y(4) y y Windows Vista x64 y y(4) y y OpenVMS Alpha n n n n -Mac OS X 10.8 Intel 32-bit y(5) n y n -Mac OS X 10.8 Intel 64-bit y(5) n y n -AIX 5.3 32- and 64-bit n n n y -FreeBSD 8.2-STABLE 32&64 bit y x x y -CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y -CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n -CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n -CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y -CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n -CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n -Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y -SGI ProPack 7 Linux 2.6.32.24 y y y n +Mac OS X 10.8 Intel 32-bit y(5) n y n +Mac OS X 10.8 Intel 64-bit y(5) n y n +AIX 5.3 32- and 64-bit n n n y +FreeBSD 8.2-STABLE 32&64 bit y x x y +CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y +CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n +CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y +SGI ProPack 7 Linux 2.6.32.24 y y y n Red Hat Enterprise Linux 6 y y y n CLE hopper.nersc.gov n n n n CLE franklin.nersc.gov n n n n @@ -7638,7 +7638,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 - HDFFV-7583) @@ -7646,8 +7646,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -7675,7 +7675,7 @@ Known Problems (NAF - 2011/01/19) * The library's test dt_arith.c showed a compiler's rounding problem on - Cygwin when converting from unsigned long long to long double. The + Cygwin when converting from unsigned long long to long double. The library's own conversion works fine. We defined a macro for Cygwin to skip this test until we can solve the problem. (SLU - 2010/05/05 - HDFFV-1264) @@ -7685,8 +7685,8 @@ Known Problems get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. (SLU - 2010/02/02) @@ -7697,17 +7697,17 @@ Known Problems * 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 + 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. (MAM - 2009/11/04) - + * The PathScale MPI implementation, accessing a Panasas file system, would cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not exist. This is due to the MPI_File_open() call failing if the mode has the MPI_MODE_EXCL bit set. (AKC - 2009/08/11 - HDFFV-988) - + * 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 @@ -7742,30 +7742,30 @@ Known Problems echo SKIP H5LSTEST $FILEOUT ================================================== (AKC - 2008/11/10) - + * For Red Storm, a Cray XT3 system, the yod command sometimes gives the message, "yod allocation delayed for node recovery". This interferes with test suites that do not expect to see this message. See the section of "Red Storm" in file INSTALL_parallel for a way to deal with this problem. (AKC - 2008/05/28) -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use -mp -O1 compilation flags to build the libraries. A higher level of - optimization causes failures in several HDF5 library tests. +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. -* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. (SLU - 2005/06/30) * On IBM AIX systems, parallel HDF5 mode will fail some tests with error @@ -7773,17 +7773,17 @@ Known Problems 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", - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. (AKC - 2004/12/08) -%%%%1.8.7%%%% +%%%%1.8.7%%%% HDF5 version 1.8.7 released on Tue May 10 09:24:44 CDT 2011 @@ -7792,10 +7792,10 @@ HDF5 version 1.8.7 released on Tue May 10 09:24:44 CDT 2011 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.6 and -HDF5 1.8.7, and contains information on the platforms tested and -known problems in HDF5-1.8.7. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.6 and +HDF5 1.8.7, and contains information on the platforms tested and +known problems in HDF5-1.8.7. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.7 source code, documentation, and additional materials @@ -7807,18 +7807,18 @@ The HDF5 1.8.7 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.7 can be accessed directly at this location: +User documentation for 1.8.7 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.7 (current +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.7 (current release) versus Release 1.8.6": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -7856,50 +7856,50 @@ New Features - Added a new configure option, "--enable-unsupported", which can be used to stop configure from preventing the use of unsupported configure option combinations, such as c++ in parallel or Fortran - with threadsafe. Use at your own risk, as it may result in a + with threadsafe. Use at your own risk, as it may result in a library that won't compile or run as expected! (MAM - 2010/11/17 - Bug 2061) Library ------- - - The library allows the dimension size of a dataspace to be zero. In - the past, the library would allow this only if the maximal dimension - size was unlimited. Now there is no such restriction, but no data + - The library allows the dimension size of a dataspace to be zero. In + the past, the library would allow this only if the maximal dimension + size was unlimited. Now there is no such restriction, but no data can be written to this kind of dataset. (SLU - 2011/4/20) - We added two new macros, H5_VERSION_GE and H5_VERSION_LE, to let users compare certain version numbers with the library being used. (SLU - - 2011/4/20) + 2011/4/20) - Added ability to cache files opened through external links. Added new public functions H5Pset_elink_file_cache_size(), H5Pget_elink_file_cache_size(), and H5Fclear_elink_file_cache(). (NAF - 2011/02/17) - Finished implementing all options for 'log' VFD. (QAK - 2011/1/25) - Removed all old code for Metrowerks compilers, bracketed by - __MWERKS__). Metrowerks compiler is long gone. (AKC - 2010/11/17) + __MWERKS__). Metrowerks compiler is long gone. (AKC - 2010/11/17) Parallel Library ---------------- - None - + Tools ----- - h5diff: Added new "verbose with levels" option, '-vN, --verbose=N'. The old '-v, --verbose' option is deprecated but remains available; it is exactly equivalent to '-v0, --verbose=0'. - The new levels 1 ('-v1' or '--verbose=1') and 2 ('-v2' or - '--verbose=2') can be specified to view more information regarding + The new levels 1 ('-v1' or '--verbose=1') and 2 ('-v2' or + '--verbose=2') can be specified to view more information regarding attributes differences. Bug #2121 (JKM 2011/3/23) - - h5dump: Added new option --enable-error-stack. This option will - display error stack information in the output stream. This is + - h5dump: Added new option --enable-error-stack. This option will + display error stack information in the output stream. This is useful when the "h5dump: Unable to print data" message is output. (ADB - 2011/03/03) High-Level APIs --------------- - - Fortran LT make datasets routines (H5LTmake_dataset_f, - h5ltmake_dataset_int_f, h5ltmake_dataset_float_f, h5ltmake_dataset_double_f) + - Fortran LT make datasets routines (H5LTmake_dataset_f, + h5ltmake_dataset_int_f, h5ltmake_dataset_float_f, h5ltmake_dataset_double_f) and LT read datasets routines (h5ltread_dataset_f,h5ltread_dataset_int_f, - h5ltread_dataset_float_f, 5ltread_dataset_double_f) can now handle + h5ltread_dataset_float_f, 5ltread_dataset_double_f) can now handle 4-dimensional to 7-dimensional rank datasets. HDFFV-1217 (MSB-2011/4/24/2011) F90 API @@ -7914,7 +7914,7 @@ New Features Support for New Platforms, Languages, and Compilers =================================================== - Intel V11.1 uses now -O3 optimization in production mode (EIP - 2010/10/08) - + Bug Fixes since HDF5-1.8.6 @@ -7923,7 +7923,7 @@ Bug Fixes since HDF5-1.8.6 Configuration ------------- - Shared C++ and HL libraries on AIX should now be working correctly. - Note that Fortran shared libraries are still not working on AIX. + Note that Fortran shared libraries are still not working on AIX. (See the Known Problems section, below). (MAM - 2011/4/20) - Removed config/ibm-aix6.x. All IBM-AIX settings are in one file, ibm-aix. (AKC - 2011/4/14) @@ -7931,7 +7931,7 @@ Bug Fixes since HDF5-1.8.6 is enabled. Shared Fortran libraries are still not supported on Mac, so configure will disable them by default, but this is overrideable with the new --enable-unsupported configure option. The configure - summary has been updated to reflect the fact that the shared-ness of + summary has been updated to reflect the fact that the shared-ness of the C++/Fortran wrapper libraries may not align with the C library. (MAM - 2011/04/11 - HDFFV-4353). @@ -7940,12 +7940,12 @@ Bug Fixes since HDF5-1.8.6 - Changed assertion failure when decoding a compound datatype with no fields into a normal error failure. Also prohibit using this sort of datatype for creating an attribute (as is already the case for - datasets and committed (named) datatypes). (QAK - 2011/04/15, Jira + datasets and committed (named) datatypes). (QAK - 2011/04/15, Jira issue #HDFFV-2766) - Tell the VFL flush call that the file will be closing, allowing the VFDs to avoid sync'ing the file (particularly valuable in parallel). (QAK - 2011/03/09) - - The datatype handler created with H5Tencode/decode used to have the + - The datatype handler created with H5Tencode/decode used to have the reference count 0 (zero); it now has the reference count 1 (one). (SLU - 2011/2/18) - Fixed the definition of H5_HAVE_GETTIMEOFDAY on Windows so that @@ -7960,20 +7960,20 @@ Bug Fixes since HDF5-1.8.6 Tools ----- - - Updated h5dump test case script to prevent entire test failure when + - Updated h5dump test case script to prevent entire test failure when source directory is read-only. Bug #HDFFV-4342 (JKM 2011/4/12) - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in attribute on Big-Endian machine. H5T_STD_I8BE is unsigned 8bit type, so h5dump is supposed to display -2 instead of 254. It worked correctly on Little-Endian system , but not on Big-Endian system. Bug #HDFFV-4358 (JKM 04/08/2011) - - Updated some HDF5 tools to standardize the option name as - '--enable-error-stack' for printing HDF5 error stack messages. h5ls and - h5dump have been updated. For h5ls, this replaces "-e/--errors" option, - which is deprecated. For h5dump, this is a new option. Bug #2182 + - Updated some HDF5 tools to standardize the option name as + '--enable-error-stack' for printing HDF5 error stack messages. h5ls and + h5dump have been updated. For h5ls, this replaces "-e/--errors" option, + which is deprecated. For h5dump, this is a new option. Bug #2182 (JKM 2011/3/30) - - Fixed the h5diff --use-system-epsilon option. The formula used in the - calculation was changed from ( |a - b| / b ) to ( |a - b| ). + - Fixed the h5diff --use-system-epsilon option. The formula used in the + calculation was changed from ( |a - b| / b ) to ( |a - b| ). This was done to improve performance. Bug #2184 (JKM 2011/3/24) - Fixed output for H5T_REFERENCE in h5dump. According to the BNF document the output of a H5T_REFERENCE should be followed by the type; @@ -7981,41 +7981,41 @@ Bug Fixes since HDF5-1.8.6 ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG Previously this was only displayed if the -R option was used. Bug #1725 (ADB 2011/3/28) - - Fixed two h5diff issues. 1) h5diff compared attributes correctly only - when two objects had the same number of attributes and the attribute - names were identical. 2) h5diff did not display useful information about + - Fixed two h5diff issues. 1) h5diff compared attributes correctly only + when two objects had the same number of attributes and the attribute + names were identical. 2) h5diff did not display useful information about attribute differences. Bug #2121 (JKM 2011/3/17) - - Fixed a memory leak in h5diff that occurred when accessing symbolic links + - Fixed a memory leak in h5diff that occurred when accessing symbolic links with the --follow-symlink option. Bug #2214 (JKM 2011/3/18) - - Fixed a memory leak in h5diff that occurred when accessing variable length + - Fixed a memory leak in h5diff that occurred when accessing variable length string data. Bug #2216 (JKM 2011/3/18) - - Fixed and improved the help page for h5ls -a, --address option. + - Fixed and improved the help page for h5ls -a, --address option. Bug #1904 (JKM 2011/3/11) - Fixed h5copy to enable copying an object into the same HDF5 file. - Previously h5copy displayed an error message when the target file + Previously h5copy displayed an error message when the target file was the same as the source file. (XCAO 2011/3/8) - - Fixed an h5dump problem that caused the tool to skip some data elements - in large datasets with a large array datatype on Windows. This issue - arose only on Windows due to the different return behavior of the + - Fixed an h5dump problem that caused the tool to skip some data elements + in large datasets with a large array datatype on Windows. This issue + arose only on Windows due to the different return behavior of the _vsnprintf() function. Bug #2161 (JKM 2011/3/3) - - Fixed h5dump which was skipping some array indices in large datasets + - Fixed h5dump which was skipping some array indices in large datasets with a relatively large array datatype. The interval of skipped indices varied according to the size of the array. Bug #2092 (JKM 2011/2/15) - Fixed h5diff which was segfaulting when comparing compound datasets with a combination of fixed-length string datatypes and variable-length string datatypes in certain orders. Bug #2089 (JKM 2010/12/28) - - Improved h5diff performance. 1) Now use HDmemcmp() before comparing two + - Improved h5diff performance. 1) Now use HDmemcmp() before comparing two elements. 2) Replace expensive H5Tequals() calls. 3) Retrieve datatype - information at dataset level, not at each element level for compound - datasets. HDFFV-7516 (JKM 2011/4/18) - - Fixed h5ls to display nested compound types with curly brackets - when -S (--simple) option is used with -l (--label), so it shows - which members (in curly brackets) belong to which nested compound type, + information at dataset level, not at each element level for compound + datasets. HDFFV-7516 (JKM 2011/4/18) + - Fixed h5ls to display nested compound types with curly brackets + when -S (--simple) option is used with -l (--label), so it shows + which members (in curly brackets) belong to which nested compound type, making the output clearer. Bug #1979 (JKM 2010/11/09) - - Fixed h5diff to handle variable-length strings in a compound dataset + - Fixed h5diff to handle variable-length strings in a compound dataset and variable-length string arrays in a compound dataset correctly. - Garbage values were previously displayed when h5diff compared multiple - variable-length strings in a compound type dataset. + Garbage values were previously displayed when h5diff compared multiple + variable-length strings in a compound type dataset. Bug #1989 (JKM 2010/10/28) - Fixed h5copy to fail gracefully when copying an object to a non- existing group without the -p option. Bug #2040 (JKM 2010/10/18) @@ -8034,10 +8034,10 @@ Bug Fixes since HDF5-1.8.6 Fortran High-Level APIs: ------ - - h5tbmake_table_f: Fixed error in passing an array of characters with different + - h5tbmake_table_f: Fixed error in passing an array of characters with different length field names. - - h5tget_field_info_f: Fixed error with packing the C strings into a Fortran - array of strings. Added optional argument called 'maxlen_out' which returns + - h5tget_field_info_f: Fixed error with packing the C strings into a Fortran + array of strings. Added optional argument called 'maxlen_out' which returns the maximum string character length in a field name element. Bug HDFFV-1255 (MSB- 4/17/2011) @@ -8068,12 +8068,12 @@ The following platforms and compilers have been tested for this release. Linux 2.6.18-194.3.1.el5PAE gcc (GCC) 4.1.2 and 4.4.2 #1 SMP i686 i686 i386 G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) - (jam) GNU Fortran (GCC) 4.1.2 20080704 + (jam) GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48) and 4.4.2 PGI C, Fortran, C++ 10.4-0 32-bit PGI C, Fortran, C++ 10.6-0 32-bit Intel(R) C Compiler for 32-bit - applications, Version 11.1 + applications, Version 11.1 Intel(R) C++ Compiler for 32-bit applications, Version 11.1 Intel(R) Fortran Compiler for 32-bit @@ -8087,8 +8087,8 @@ The following platforms and compilers have been tested for this release. (amani) tested for both 32- and 64-bit binaries GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) and 4.4.2 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64, + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, Version 11.1. PGI C, Fortran, C++ Version 9.0-4 for 64-bit target on x86-64 @@ -8137,7 +8137,7 @@ The following platforms and compilers have been tested for this release. Intel C, C++ and Fortran compilers 12.0.1.122 20101110 Mac OS X 10.7.0 (Intel 32-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) - Darwin Kernel Version 10.7.0 GNU Fortran (GCC) version 4.4.0 20090123 (experimental) + Darwin Kernel Version 10.7.0 GNU Fortran (GCC) version 4.4.0 20090123 (experimental) [trunk revision 143587] Fedora 12 2.6.32.16-150.fc12.ppc64 #1 SMP ppc64 GNU/Linux @@ -8175,7 +8175,7 @@ The following platforms and compilers have been tested for this release. Ubuntu 10.10 2.6.35-28-generic #50-Ubuntu SMP x86_64 GNU/Linux gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 GNU Fortran (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 - + OpenVMS Alpha 8.3 HP C V7.3-009 HP Fortran V8.2-104679-48H9K HP C++ V7.3-009 @@ -8184,14 +8184,14 @@ Tested Configuration Features Summary ======================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -8217,28 +8217,28 @@ Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 n y n y y SGI Linux 2.6.32.19 y y y y y y -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit y y y y -Windows XP y y(4) y n -Windows XP x64 y y(4) y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y n +Windows XP x64 y y(4) y n Windows Vista y y(4) y y Windows Vista x64 y y(4) y y OpenVMS Alpha n n n n -Mac OS X 10.7 Intel 32-bit y(5) n y n -Mac OS X 10.7 Intel 64-bit y(5) n y n -AIX 6.1 32- and 64-bit n n n y -FreeBSD 8.2-STABLE 32&64 bit y x x y -CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y -CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n -CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n -CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y -CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n -CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n +Mac OS X 10.7 Intel 32-bit y(5) n y n +Mac OS X 10.7 Intel 64-bit y(5) n y n +AIX 6.1 32- and 64-bit n n n y +FreeBSD 8.2-STABLE 32&64 bit y x x y +CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y +CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n +CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n RedHat EL4 2.6.18 Xeon Lustre C y y y n -Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y -SGI Linux 2.6.32.19 y y y y +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y +SGI Linux 2.6.32.19 y y y y (1) Fortran compiled with gfortran. (2) With PGI and Absoft compilers. @@ -8255,7 +8255,7 @@ Known Problems that "make prefix=XXX install" no longer works for shared libraries. It still works correctly for static libraries. Therefore, if you want to install the HDF5 shared libraries in a location such as /usr/local/hdf5, - you need to specify the location via the --prefix option during configure + you need to specify the location via the --prefix option during configure time. E.g, ./configure --prefix=/usr/local/hdf5 ... (AKC - 2011/05/07 HDFFV-7583) @@ -8263,8 +8263,8 @@ Known Problems be terminated by the alarm signal. If that happens, one can increase the alarm seconds (default is 1200 seconds = 20 minutes) by setting the environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 - (60 minutes). Note that the t_shapesame test may fail in some systems - (see the "While working on the 1.8.6 release..." problem below). If + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If it does, it will waste more time if $HDF5_ALARM_SECONDS is set to a larger value. (AKC - 2011/05/07) @@ -8297,30 +8297,30 @@ Known Problems http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ * The library's test dt_arith.c showed a compiler's rounding problem on - Cygwin when converting from unsigned long long to long double. The + Cygwin when converting from unsigned long long to long double. The library's own conversion works fine. We defined a macro for Cygwin to skip this test until we can solve the problem. Please see bug #1813. - SLU - 2010/5/5 + SLU - 2010/5/5 * All the VFL drivers aren't backward compatible. In H5FDpublic.h, the structure H5FD_class_t changed in 1.8. There is new parameter added to get_eoa and set_eoa callback functions. A new callback function get_type_map was added in. The public function H5FDrealloc was taken out in 1.8. The problem only happens when users define their own driver - for 1.6 and try to plug in 1.8 library. Because there's only one user - complaining about it, we (Elena, Quincey, and I) decided to leave it as + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as it is (see bug report #1279). Quincey will make a plan for 1.10. SLU - 2010/2/2 * MinGW has a missing libstdc++.dll.a library file and will not successfully link C++ applications/tests. Do not use the enable-cxx configure option. Read all of the INSTALL_MINGW.txt file for all restrictions. ADB - 2009/11/11 - + * The PathScale MPI implementation, accessing a Panasas file system, would cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not exist. This is due to the MPI_File_open() call failing if the mode 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 @@ -8362,23 +8362,23 @@ Known Problems Storm" in file INSTALL_parallel for a way to deal with this problem. AKC - 2008/05/28 -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use -mp -O1 compilation flags to build the libraries. A higher level of - optimization causes failures in several HDF5 library tests. +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use -mp -O1 compilation flags to build the libraries. A higher level of + optimization causes failures in several HDF5 library tests. -* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. SLU - 2005/6/30 * On IBM AIX systems, parallel HDF5 mode will fail some tests with error @@ -8386,23 +8386,23 @@ Known Problems 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", - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. * 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 + 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. -* There is also a configure error on Altix machines that incorrectly reports +* There is also a configure error on Altix machines that incorrectly reports when a version of Szip without an encoder is being used. * On cobalt, an SGI Altix SMP ia64 system, Intel compiler version 10.1 (which @@ -8418,7 +8418,7 @@ Known Problems and it will be fixed in 1.8.8. DER - 2011/04/27 -%%%%1.8.6%%%% +%%%%1.8.6%%%% HDF5 version 1.8.6 released on Mon Feb 14 10:26:30 CST 2011 @@ -8427,10 +8427,10 @@ HDF5 version 1.8.6 released on Mon Feb 14 10:26:30 CST 2011 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.5 and -HDF5 1.8.6, and contains information on the platforms tested and -known problems in HDF5-1.8.6. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.5 and +HDF5 1.8.6, and contains information on the platforms tested and +known problems in HDF5-1.8.6. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.6 source code, documentation, and additional materials @@ -8442,18 +8442,18 @@ The HDF5 1.8.6 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.6 can be accessed directly at this location: +User documentation for 1.8.6 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.6 (current +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.6 (current release) versus Release 1.8.5": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -8481,43 +8481,43 @@ New Features ------------- - CMake: Improved CPack packaging, added parallel commands, improved configuration options (better similarity to configure), added more - tests, better support for use in external cmake projects. + tests, better support for use in external cmake projects. (ADB - 2010/10/07) - - The default configuration setting for official releases is - --enable-production. For unofficial releases, the default configuration + - The default configuration setting for official releases is + --enable-production. For unofficial releases, the default configuration setting has been --disable-production. (AKC - 2010/05/28) Library ------- - - Added support for thread safety on Windows using the Windows threads - library. Use the HDF5_ENABLE_THREADSAFE option in CMake on a Windows - platform to enable this functionality. This is supported on Windows + - Added support for thread safety on Windows using the Windows threads + library. Use the HDF5_ENABLE_THREADSAFE option in CMake on a Windows + platform to enable this functionality. This is supported on Windows Vista and newer Windows operating systems. (MAM - 2010/09/10) - - H5Tset_order and H5Tget_order now support all datatypes. A new byte - order, H5T_ORDER_MIXED, has been added specifically for a compound - datatype and its derived type. (SLU - 2010/8/23) - - Improved performance of metadata I/O by changing the default algorithm - to perform I/O from all processes (instead of just process 0) when using + - H5Tset_order and H5Tget_order now support all datatypes. A new byte + order, H5T_ORDER_MIXED, has been added specifically for a compound + datatype and its derived type. (SLU - 2010/8/23) + - Improved performance of metadata I/O by changing the default algorithm + to perform I/O from all processes (instead of just process 0) when using parallel I/O drivers. (QAK - 2010/07/19) - - Improved performance of I/O on datasets with the same shape, but + - Improved performance of I/O on datasets with the same shape, but different rank. (QAK - 2010/07/19) - - Improved performance of the chunk cache by avoiding unnecessary b-tree - lookups of chunks already in cache. (NAF - 2010/06/15) - + - Improved performance of the chunk cache by avoiding unnecessary b-tree + lookups of chunks already in cache. (NAF - 2010/06/15) + Parallel Library ---------------- - None - + Tools ----- - - h5diff: Added a new flag: --exclude-path. The specified path to an - object will be excluded when comparing two files or two groups. If a - group is specified to be excluded, all member objects of that group + - h5diff: Added a new flag: --exclude-path. The specified path to an + object will be excluded when comparing two files or two groups. If a + group is specified to be excluded, all member objects of that group will be excluded. (JKM - 2010/09/16). - - h5ls: Added a new flag: --no-dangling-links. See --help output for + - h5ls: Added a new flag: --no-dangling-links. See --help output for details. (JKM - 2010/06/15) - - h5ls: Added a new flag --follow-symlinks. See --help output for + - h5ls: Added a new flag --follow-symlinks. See --help output for details. (JKM - 2010/05/25) - + High-Level APIs --------------- - None @@ -8542,9 +8542,9 @@ Bug Fixes since HDF5-1.8.5 Configuration ------------- - - The default number of MPI processes for testing purposes has been + - The default number of MPI processes for testing purposes has been changed from 3 to 6. (AKC - 2010/11/11) - - Some tests in tools/h5repack may fail in AIX systems when -q32 mode is + - Some tests in tools/h5repack may fail in AIX systems when -q32 mode is used. The error is caused by not requesting enough memory in default. Added "env LDR_CNTRL=MAXDATA=0x20000000@DSA" into the $RUNSERIAL and $RUNPARALLE in the AIX config file so that executables are tested with @@ -8552,10 +8552,10 @@ Bug Fixes since HDF5-1.8.5 - Removed recognition of the parallel compilers of LAM(hcc) and ChMPIon(cmpicc) since we have no access to these two MPI implementations and cannot verify their correctness. (AKC - 2010/07/14 - Bug 1921) - - PHDF5 was changed to use "mpiexec" instead of mpirun as the default - MPI applications startup command as defined in the MPI-2 definition, + - PHDF5 was changed to use "mpiexec" instead of mpirun as the default + MPI applications startup command as defined in the MPI-2 definition, section 4.1. (AKC - 2010/06/11 - Bug 1921) - + Library ------- - Fixed a bug that caused big endian machines to generate corrupt files @@ -8563,15 +8563,15 @@ Bug Fixes since HDF5-1.8.5 values. Note that such datasets will no longer be readable by any by any machine after this patch. (NAF - 2010/02/02 - Bug 2131) - Retrieving a link's name by index in the case where the link is external - and the file that the link refers to doesn't exist will now fail + and the file that the link refers to doesn't exist will now fail gracefully rather than cause a segmentation fault. (MAM - 2010/11/17) - - Modified metadata accumulator to better track accumulated dirty metadata - in an effort to reduce unnecessary I/O in certain situations and to + - Modified metadata accumulator to better track accumulated dirty metadata + in an effort to reduce unnecessary I/O in certain situations and to fix some other corner cases which were prone to error. (MAM - 2010/10/15) - - Added a new set of unit tests that are run during 'make check' to verify + - Added a new set of unit tests that are run during 'make check' to verify the behavior of the metadata accumulator. (MAM - 2010/10/15) - Modified library to always cache symbol table information. Libraries - from version 1.6.3 and earler have a bug which causes them to require + from version 1.6.3 and earler have a bug which causes them to require this information for some operations. (NAF - 2010/09/21 - Bug 1864) - Fixed a bug where the library could generate an assertion/core dump when a file that had been created with H5Pset_libver_bounds(fapl, @@ -8585,9 +8585,9 @@ Bug Fixes since HDF5-1.8.5 CMake to build the library. (ADB - 2010/09/13 - Bug 1938) - When a mandatory filter failed to write data chunks, the dataset couldn't close (bug 1260). The fix releases all resources and closes - the dataset but returns a failure. (SLU - 2010/09/08) - - H5Eset_current_stack now also closes the error stack set as the - default. This is to avoid a potential problem. + the dataset but returns a failure. (SLU - 2010/09/08) + - H5Eset_current_stack now also closes the error stack set as the + default. This is to avoid a potential problem. (SLU - 2010/09/07 - Bug 1799) - Corrected situation where 1-D chunked dataset could get created by an application without calling H5Pset_chunk(). H5Pset_chunk is now @@ -8595,12 +8595,12 @@ Bug Fixes since HDF5-1.8.5 - Fixed many memory issues that valgrind exposed. (QAK - 2010/08/24) - Fixed the bug in the filter's public CAN_APPLY function. The return value should be htri_t not herr_t. (SLU - 2010/08/05 - Bug 1239) - - Fixed the STDIO VFD to use fseeko64 instead of fseek64 for 64-bit I/O + - Fixed the STDIO VFD to use fseeko64 instead of fseek64 for 64-bit I/O support. (AKC - 2010/7/30) - Fixed a bug in the direct I/O driver that could render files with certain kinds of unaligned data unreadable or corrupt them. (NAF - 2010/07/28) - - valgrind reported an error of copying data to itself when a new attribute - is written. Fixed by taking out the memcpy step in the attribute code. + - valgrind reported an error of copying data to itself when a new attribute + is written. Fixed by taking out the memcpy step in the attribute code. (SLU - 2010/07/28 - Bug 1956) - Corrected various issues in the MPI datatype creation code which could cause resource leaks or incorrect behavior (and may improve the @@ -8616,23 +8616,23 @@ Bug Fixes since HDF5-1.8.5 Tools ----- - - Fixed h5diff to compare member objects and groups recursively when + - Fixed h5diff to compare member objects and groups recursively when two files or groups are compared. (JKM - 2010/9/16 - Bug 1975) - Fixed h5repack to be able to convert a dataset to COMPACT layout. (JKM - 2010/09/15 - Bug 1896) - Changed h5ls to not interpret special characters in object or attribute names for output. (JKM - 2010/06/28 - Bug 1784) - - Revised the order of arguments for h5cc, h5fc, h5c++, h5pcc and h5pfc. - CPPFLAGS, CFLAGS, LDFLAGS, and LIBS have been duplicated with an H5BLD_ - prefix to put the flags and paths from the hdf5 build in the correct - places and allow the script user to add entries in CPPFLAGS, CFLAGS, - LDFLAGS, and LIBS that will take precedence over those from the hdf5 - build. The user can make these entries persistent by editing - CFLAGSBASE, CPPFLAGSBASE, LDFLAGSBASE, and LIBSBASE near the top of - the script or temporary by setting HDF5_CFLAGS, HDF5_CPPFLAGS, - HDF5_LDFLAGS, or HDF5_LIBS in the environment. The new order of - arguments in these scripts is $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS - $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args + - Revised the order of arguments for h5cc, h5fc, h5c++, h5pcc and h5pfc. + CPPFLAGS, CFLAGS, LDFLAGS, and LIBS have been duplicated with an H5BLD_ + prefix to put the flags and paths from the hdf5 build in the correct + places and allow the script user to add entries in CPPFLAGS, CFLAGS, + LDFLAGS, and LIBS that will take precedence over those from the hdf5 + build. The user can make these entries persistent by editing + CFLAGSBASE, CPPFLAGSBASE, LDFLAGSBASE, and LIBSBASE near the top of + the script or temporary by setting HDF5_CFLAGS, HDF5_CPPFLAGS, + HDF5_LDFLAGS, or HDF5_LIBS in the environment. The new order of + arguments in these scripts is $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS + $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link. (LRK - 2010/10/25 - Bug 1973) F90 API @@ -8676,12 +8676,12 @@ The following platforms and compilers have been tested for this release. Linux 2.6.18-194.3.1.el5PAE gcc (GCC) 4.1.2 and 4.4.2 #1 SMP i686 i686 i386 G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) - (jam) GNU Fortran (GCC) 4.1.2 20080704 + (jam) GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48) and 4.4.2 PGI C, Fortran, C++ 10.4-0 32-bit PGI C, Fortran, C++ 10.6-0 32-bit Intel(R) C Compiler for 32-bit - applications, Version 11.1 + applications, Version 11.1 Intel(R) C++ Compiler for 32-bit applications, Version 11.1 Intel(R) Fortran Compiler for 32-bit @@ -8695,8 +8695,8 @@ The following platforms and compilers have been tested for this release. (amani) tested for both 32- and 64-bit binaries GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) and 4.4.2 - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64, + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, Version 11.1. PGI C, Fortran, C++ Version 9.0-4 for 64-bit target on x86-64 @@ -8743,7 +8743,7 @@ The following platforms and compilers have been tested for this release. Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11.1 (cmake) Mac OS X 10.6.3 (Intel 64-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 - Darwin Kernel Version 10.3.1 GNU Fortran (GCC) 4.5.0 20090910 + Darwin Kernel Version 10.3.1 GNU Fortran (GCC) 4.5.0 20090910 Intel C, C++ and Fortran compilers 11.1 20100806 Mac OS X 10.6.4 (Intel 32-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 @@ -8751,7 +8751,7 @@ The following platforms and compilers have been tested for this release. Intel C, C++ and Fortran compilers 12.0.0 20101110 Mac OS X 10.6.4 (Intel 64-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659) - Darwin Kernel Version 10.6.0 GNU Fortran (GCC) 4.5.0 20090910 + Darwin Kernel Version 10.6.0 GNU Fortran (GCC) 4.5.0 20090910 Intel C, C++ and Fortran compilers 11.1 20100806 Fedora 12 2.6.32.16-150.fc12.ppc64 #1 SMP ppc64 GNU/Linux @@ -8789,7 +8789,7 @@ The following platforms and compilers have been tested for this release. Ubuntu 10.10 2.6.35-25-generic #44-Ubuntu SMP x86_64 GNU/Linux gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 GNU Fortran (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 - + OpenVMS Alpha 8.3 HP C V7.3-009 HP Fortran V8.2-104679-48H9K HP C++ V7.3-009 @@ -8798,14 +8798,14 @@ Tested Configuration Features Summary ======================================== In the tables below - y = tested + y = tested n = not tested in this release C = Cluster W = Workstation x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -8830,27 +8830,27 @@ Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 n y n y y SGI Linux 2.6.32.19 y y y y y y -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit y y y y -Windows XP y y(4) y n -Windows XP x64 y y(4) y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y n +Windows XP x64 y y(4) y n Windows Vista y y(4) y y Windows Vista x64 y y(4) y y OpenVMS Alpha n n n n -Mac OS X 10.6 y(5) n y n -AIX 6.1 32- and 64-bit n n n y -FreeBSD 6.3-STABLE 32&64 bit y n y y -CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y -CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n -CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n -CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y -CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n -CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n +Mac OS X 10.6 y(5) n y n +AIX 6.1 32- and 64-bit n n n y +FreeBSD 6.3-STABLE 32&64 bit y n y y +CentOS 5.5 Linux 2.6.18-128 i686 GNU (1)W y y(2) y y +CentOS 5.5 Linux 2.6.18-128 i686 Intel W y y y n +CentOS 5.5 Linux 2.6.18-128 i686 PGI W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 GNU (1) W y y y y +CentOS 5.5 Linux 2.6.16 x86_64 Intel W y y y n +CentOS 5.5 Linux 2.6.16 x86_64 PGI W y y y n RedHat EL4 2.6.18 Xeon Lustre C y y y n -Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y -SGI Linux 2.6.32.19 y y y y +Fedora 12 Linux 2.6.32.16-150.fc12.ppc64 y y y y +SGI Linux 2.6.32.19 y y y y (1) Fortran compiled with gfortran. (2) With PGI and Absoft compilers. @@ -8876,7 +8876,7 @@ Known Problems library. We have fixed these failures. But it's too late to put the fixes into this release. If you install the 1.8.6 library, it should still work despite of these test failures. If you want the working copy without any - test failure, you can request it from us. SLU - 2011/01/26 + test failure, you can request it from us. SLU - 2011/01/26 * If parallel gmake (e.g., gmake -j 4) is used, the "gmake clean" command sometimes fails in the perform directory due to the attempt to remove the @@ -8896,41 +8896,41 @@ Known Problems These programs can be found at: http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ -* The h5diff tool can display garbage values when variable-length strings in - a compound type dataset are compared. This also occurs with variable-length - string arrays in a compound type dataset. See bug #1989. This will be fixed +* The h5diff tool can display garbage values when variable-length strings in + a compound type dataset are compared. This also occurs with variable-length + string arrays in a compound type dataset. See bug #1989. This will be fixed in the next release. JKM - 2010/11/05 -* The AIX --enable-shared setting does not quite work. It can produce a shared - library, but there cannot be more than one shared library that is - interlinked. This means that the high level APIs will not work which is not - very useful. We hope to have a solution in the next release. +* The AIX --enable-shared setting does not quite work. It can produce a shared + library, but there cannot be more than one shared library that is + interlinked. This means that the high level APIs will not work which is not + very useful. We hope to have a solution in the next release. (AKC - 2010/10/15) - + * H5Eset_auto can cause a seg fault for a library API call if the application - compiles with -DH5_USE_16_API (see bug 1707). It will be fixed in the + compiles with -DH5_USE_16_API (see bug 1707). It will be fixed in the next release. SLU - 2010/10/5 - -* The library's test dt_arith.c showed a compiler's rounding problem on - Cygwin when converting an unsigned long long to a long double. The - library's own conversion works fine. We defined a macro for Cygwin to - skip this test until we can solve the problem. Please see bug #1813. + +* The library's test dt_arith.c showed a compiler's rounding problem on + Cygwin when converting an unsigned long long to a long double. The + library's own conversion works fine. We defined a macro for Cygwin to + skip this test until we can solve the problem. Please see bug #1813. SLU - 2010/5/5 - -* All the VFL drivers aren't backwardly compatible. In H5FDpublic.h, the - structure H5FD_class_t changed in 1.8. A new parameter was added to the - get_eoa and set_eoa callback functions, and a new callback function - get_type_map was added. The public function H5FDrealloc was taken out in - 1.8. The problem only happens when users define their own driver for 1.6 + +* All the VFL drivers aren't backwardly compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. A new parameter was added to the + get_eoa and set_eoa callback functions, and a new callback function + get_type_map was added. The public function H5FDrealloc was taken out in + 1.8. The problem only happens when users define their own driver for 1.6 and try to plug in a 1.8 library. This will be fixed in 1.10. SLU - 2010/2/2 * MinGW has a missing libstdc++.dll.a library file and will not successfully link C++ applications/tests. Do not use the enable-cxx configure option. Read all of the INSTALL_MINGW.txt file for all restrictions. ADB - 2009/11/11 - -* The PathScale MPI implementation, accessing a Panasas file system, would - cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not - exist. This is due to the MPI_File_open() call failing if the amode has + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file does not + exist. 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 @@ -8938,15 +8938,15 @@ Known Problems collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks with MPI IO. CMC - 2009/04/28 -* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and - tools/h5copy/testh5copy.sh will fail some of their sub-tests. These - sub-tests are expected to fail and should exit with a non-zero code but - the yod command does not propagate the exit code of the executables. Yod - always returns 0 if it can launch the executable. The test suite shell - expects a non-zero for this particular test. Therefore, it concludes the - test has failed when it receives 0 from yod. To skip all the "failing" +* For Red Storm, a Cray XT3 system, the tools/h5ls/testh5ls.sh and + tools/h5copy/testh5copy.sh will fail some of their sub-tests. These + sub-tests are expected to fail and should exit with a non-zero code but + the yod command does not propagate the exit code of the executables. Yod + always returns 0 if it can launch the executable. The test suite shell + expects a non-zero for this particular test. Therefore, it concludes the + test has failed when it receives 0 from yod. To skip all the "failing" tests for now, change them as shown below. - + ======== Original tools/h5ls/testh5ls.sh ========= TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 ======== Change to =============================== @@ -8968,71 +8968,71 @@ Known Problems ================================================== AKC - 2008/11/10 -* For Red Storm, a Cray XT3 system, the yod command sometimes gives the - message "yod allocation delayed for node recovery." This interferes - with test suites that do not expect to see this message. See the "Red Storm" - section in file INSTALL_parallel for a way to deal with this problem. +* For Red Storm, a Cray XT3 system, the yod command sometimes gives the + message "yod allocation delayed for node recovery." This interferes + with test suites that do not expect to see this message. See the "Red Storm" + section in file INSTALL_parallel for a way to deal with this problem. AKC - 2008/05/28 - -* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, - use the -mp -O1 compilation flags to build the libraries. A higher level + +* On an Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers, + use the -mp -O1 compilation flags to build the libraries. A higher level of optimization causes failures in several HDF5 library tests. - -* On mpich 1.2.5 and 1.2.6 on a system using four processors, if more than - two processes contribute no I/O and the application asks to do collective - I/O, we have found that a simple collective write will sometimes hang. This + +* On mpich 1.2.5 and 1.2.6 on a system using four processors, if more than + two processes contribute no I/O and the application asks to do collective + I/O, we have found that a simple collective write will sometimes hang. This can be verified with the t_mpi test under testpar. - -* A dataset created or rewritten with a v1.6.3 or later library cannot be - read with the v1.6.2 or earlier library when the Fletcher32 EDC filter - is enabled. There was a bug in the calculation of the Fletcher32 checksum - in the library before v1.6.3; the checksum value was not 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 was no - longer the same as before on little-endian system. Library releases after - 1.6.4 can still read datasets created or rewritten with an HDF5 library of + +* A dataset created or rewritten with a v1.6.3 or later library cannot be + read with the v1.6.2 or earlier library when the Fletcher32 EDC filter + is enabled. There was a bug in the calculation of the Fletcher32 checksum + in the library before v1.6.3; the checksum value was not 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 was no + longer the same as before on little-endian system. Library releases after + 1.6.4 can still read datasets created or rewritten with an HDF5 library of v1.6.2 or earlier. SLU - 2005/6/30 - -* On IBM AIX systems, parallel HDF5 mode will fail some tests with error - messages like "INFO: 0031-XXX ...". This is from the command `poe'. To - work around this, 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", but HDF5 does not use - sockets. This failure is due to problems with the poe command trying to - set up the debug socket. To resolve this problem, check to see whether - there are any old /tmp/s.pedb.* files around. These are sockets used by - the poe command and left behind if the command failed at some point. To - resolve this, ask your system administrator to remove the - old/tmp/s.pedb.* files, and then ask IBM to provide a means to run poe + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command `poe'. To + work around this, 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", but HDF5 does not use + sockets. This failure is due to problems with the poe command trying to + set up the debug socket. To resolve this problem, check to see whether + there are any old /tmp/s.pedb.* files around. These are sockets used by + the poe command and left behind if the command failed at some point. To + resolve this, ask your system administrator to remove the + old/tmp/s.pedb.* files, and then ask IBM to provide a means to run poe without the debug socket. -* 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 --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. - -* On an SGI Altix SMP ia64 system, the Intel compiler version 10.1 (which - is the default on that system) does not work properly and results in - failures during the make check (in a static build) and the make - installcheck (in a shared build). This appears to be a compiler - optimization problem. Reducing the optimization by setting CFLAGS to - -O1 or below resolves the issue. Using a newer version of the compiler + +* On an SGI Altix SMP ia64 system, the Intel compiler version 10.1 (which + is the default on that system) does not work properly and results in + failures during the make check (in a static build) and the make + installcheck (in a shared build). This appears to be a compiler + optimization problem. Reducing the optimization by setting CFLAGS to + -O1 or below resolves the issue. Using a newer version of the compiler (11.0) avoids the issue. MAM - 2010/06/01 - + * On solaris systems, when running the examples with the scripts installed in - .../share/hdf5_examples, two of the c tests, h5_extlink and h5_elink_unix2win - may fail or generate HDF5 errors because the script commands in c/run-c-ex.sh - fail to create test directories red, blue, and u2w. Moving the '!' in lines - 67, 70, 73 of run-c-ex.sh will fix the problem. For example the script command - "if ! test -d red; then" will work on solaris if changed to + .../share/hdf5_examples, two of the c tests, h5_extlink and h5_elink_unix2win + may fail or generate HDF5 errors because the script commands in c/run-c-ex.sh + fail to create test directories red, blue, and u2w. Moving the '!' in lines + 67, 70, 73 of run-c-ex.sh will fix the problem. For example the script command + "if ! test -d red; then" will work on solaris if changed to "if test ! -d red; then". -%%%%1.8.5%%%% +%%%%1.8.5%%%% HDF5 version 1.8.5 released on Fri Jun 4 13:27:31 CDT 2010 @@ -9042,8 +9042,8 @@ INTRODUCTION ============ This document describes the differences between HDF5-1.8.4 and HDF5 1.8.5, and -contains information on the platforms tested and known problems in HDF5-1.8.5. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt +contains information on the platforms tested and known problems in HDF5-1.8.5. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.5 source code, documentation, and additional materials @@ -9055,18 +9055,18 @@ The HDF5 1.8.5 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.5 can be accessed directly at this location: +User documentation for 1.8.5 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.5 (current +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.5 (current release) versus Release 1.8.4": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -9098,11 +9098,11 @@ New Features 2.8.1 of CMake is required. - Configure now adds appropriate defines for supporting large (64-bit) files on all systems, where supported, by default, instead of only Linux. - This large file support is controllable with the --enable-largefile - configure option. The Linux-specific --enable-linux-lfs option has been + This large file support is controllable with the --enable-largefile + configure option. The Linux-specific --enable-linux-lfs option has been deprecated in favor of this new option. Please note that specifying --disable-large does NOT attempt to "turn off" largefile support if it - is natively supported by the compiler, but rather just disables + is natively supported by the compiler, but rather just disables configure from actively trying to add any additional compiler flags. (MAM - 2010/05/05 - Bug # 1772/1434) - Fixed an signal handling mask error in H5detect that might result in @@ -9112,7 +9112,7 @@ New Features of compiler optimization (in particular, allowing '-O3' to work with recent versions of GCC). (QAK - 2010/04/26) - Upgraded versions of autotools used to generate configuration suite. - We now use Automake 1.11.1, Autoconf 2.65, and Libtool 2.2.6b. + We now use Automake 1.11.1, Autoconf 2.65, and Libtool 2.2.6b. (MAM - 2010/04/15) - Added the xlc-* and mpcc_r-* BASENAME patterns to be recognized as IBM compilers so that the IBM compiler options can be added properly. This @@ -9121,7 +9121,7 @@ New Features Library ------- - - Performance is substantially improved when extending a dataset with early + - Performance is substantially improved when extending a dataset with early allocation. (NAF - 2010/03/24 - Bug # 1637) - Added support for filtering densely stored groups. Many of the API functions related to filters have been extended to support dense groups @@ -9131,18 +9131,18 @@ New Features Parallel Library ---------------- - None - + Tools ----- - h5dump: Added the new packed bits feature which prints packed bits stored - in an integer dataset. (AKC/ADB - 2010/5/7) - - h5diff: Fixed incorrect behavior (hang) in parallel mode when specifying + in an integer dataset. (AKC/ADB - 2010/5/7) + - h5diff: Fixed incorrect behavior (hang) in parallel mode when specifying invalid options (ex: -v and -q). (JKM - 2010/02/17) - h5diff: Added new flag --no-dangling-links (see --help for details). - (JKM - 2010/02/10) + (JKM - 2010/02/10) - h5diff: Added new flag --follow-symlinks (see --help for details). (JKM - 2010/01/25) - - h5diff: Added a fix to correct the display of garbage values when + - h5diff: Added a fix to correct the display of garbage values when displaying big-endian data on a little-endian machine. (JKM - 2009/11/20) High-Level APIs @@ -9183,12 +9183,12 @@ Bug Fixes since HDF5-1.8.4 dataset. (NAF - 2010/05/20) - Fixed some memory leaks in VL datatype conversion when strings are used as fill values. (MAM - 2010/05/12 - Bug # 1826) - - Fixed an H5Rcreate failure when passing in a -1 for the dataspace + - Fixed an H5Rcreate failure when passing in a -1 for the dataspace identifier. (ADB - 2010/4/28) - Fixed a bug when copying objects with NULL references with the H5O_COPY_EXPAND_REFERENCE_FLAG flag set. (NAF - 2010/04/08 - Bug # 1815) - - Added a mechanism to the H5I interface to save returned object identifier - structures for immediate re-use if needed. This addresses a potential + - Added a mechanism to the H5I interface to save returned object identifier + structures for immediate re-use if needed. This addresses a potential performance issue by delaying the case when the next identifier to be registered has grown so large that it wraps around and needs to be checked to see whether it is available for distribution. @@ -9200,18 +9200,18 @@ Bug Fixes since HDF5-1.8.4 (NAF - 2010/03/05 - Bug # 1733) - Fixed a bug where the library, when traversing an external link, would reopen the source file if nothing else worked. (NAF - 2010/03/05) - - Fixed a bug where fractal heap identifiers for attributes and shared - object header messages could be incorrectly encoded in the file for - files created on big-endian platforms. - Please see http://www.hdfgroup.org/HDF5/release/known_problems if you - suspect you have a file with this problem. + - Fixed a bug where fractal heap identifiers for attributes and shared + object header messages could be incorrectly encoded in the file for + files created on big-endian platforms. + Please see http://www.hdfgroup.org/HDF5/release/known_problems if you + suspect you have a file with this problem. (QAK - 2010/02/23 - Bug # 1755) - Fixed an intermittent bug in the b-tree code which could be triggered by expanding and shrinking chunked datasets in certain ways. (NAF - 2010/02/16) - H5Tdetect_class said a VL string is a string type. But when it's in - a compound type, it said it's a VL type. THis has been fixed to be - consistent; it now always returns a string type. + a compound type, it said it's a VL type. THis has been fixed to be + consistent; it now always returns a string type. (SLU - 2009/12/10 - Bug # 1584) - Allow "child" files from external links to be correctly located when relative to a "parent" file that is opened through a symbolic link. @@ -9227,23 +9227,23 @@ Bug Fixes since HDF5-1.8.4 ----- - Fixed h5ls to return exit code 1 (error) when a non-existent file is specified. (JKM - 2010/04/27 - Bug # 1793) - - Fixed h5copy failure when copying a dangling link that is specified + - Fixed h5copy failure when copying a dangling link that is specified directly. (JKM - 2010/04/22 - Bug # 1817) - - Fixed an h5repack failure that lost attributes from a dataset of + - Fixed an h5repack failure that lost attributes from a dataset of reference type. (JKM - 2010/3/25 - Bug # 1726) - Fixed h5repack error that set NULL for object reference values for datasets, groups, or named datatypes. (JKM - 2010/03/19 - Bug # 1814) F90 API ------ - - None + - None C++ API ------ - The constructor PropList::PropList(id) was fixed to act properly - according to the nature of 'id'. When 'id' is a property class - identifier, a new property list will be created. When 'id' is a - property list identifier, a copy of the property list will be made. + according to the nature of 'id'. When 'id' is a property class + identifier, a new property list will be created. When 'id' is a + property list identifier, a copy of the property list will be made. (BMR - 2010/5/9) - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and CommonFG::getComment, respectively, now have default values for the @@ -9257,17 +9257,17 @@ Bug Fixes since HDF5-1.8.4 - Fixed a bug in H5DSattach_scale, H5DSis_attached, and H5DSdetach_scale caused by using the H5Tget_native_type function to determine the native type for reading the REFERENCE_LIST attribute. This bug was exposed - on Mac PPC. (EIP - 2010/05/22 - Bug # 1851) - - Fixed a bug in the H5DSdetach_scale function when 0 bytes were - allocated after the last reference to a dimension scale was removed - from the list of references in a VL element of the DIMENSION_LIST - attribute. Modified the function to comply with the specification: - the DIMENSION_LIST attribute is now deleted when no dimension scales + on Mac PPC. (EIP - 2010/05/22 - Bug # 1851) + - Fixed a bug in the H5DSdetach_scale function when 0 bytes were + allocated after the last reference to a dimension scale was removed + from the list of references in a VL element of the DIMENSION_LIST + attribute. Modified the function to comply with the specification: + the DIMENSION_LIST attribute is now deleted when no dimension scales are left attached. (EIP - 2010/05/14 - Bug # 1822) Fortran High-Level APIs: ------ - - None + - None Platforms Tested @@ -9311,12 +9311,12 @@ The following platforms and compilers have been tested for this release. MPICH mpich2-1.0.8 compiled with gcc 4.1.2 and GNU Fortran (GCC) 4.1.2 - Linux 2.6.18-164.el5 #1 SMP gcc 4.1.2 20080704 and gcc 4.4.2 + Linux 2.6.18-164.el5 #1 SMP gcc 4.1.2 20080704 and gcc 4.4.2 x86_64 GNU/Linux GNU Fortran (GCC) 4.1.2 20080704 and 4.4.2 - (amani) g++ (GCC) 4.1.2 20080704 and 4.4.2 + (amani) g++ (GCC) 4.1.2 20080704 and 4.4.2 G95 (GCC 4.0.3 (g95 0.93!) Apr 21 2010) - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64, + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, Version 11.1 Build 20090827. PGI C, Fortran, C++ Version 10.4-0 for 32 & 64-bit target on x86-64 @@ -9328,22 +9328,22 @@ The following platforms and compilers have been tested for this release. (cobalt) SGI MPI 1.38 SunOS 5.10 32- and 64-bit Sun C 5.9 SunOS_sparc Patch 124867-14 - (linew) Sun Fortran 95 8.3 SunOS_sparc - Patch 127000-13 + (linew) Sun Fortran 95 8.3 SunOS_sparc + Patch 127000-13 Sun C++ 5.9 SunOS_sparc Patch 124863-23 - + Intel Xeon Linux 2.6.18- Intel(R) C++ Version 10.0.026 92.1.10.el5_lustre.1.6.6smp- Intel(R) Fortran Compiler Version 10.0.026 perfctr #7 SMP Open MPI 1.2.2 (abe) MVAPICH2-0.9.8p28p2patched-intel-ofed-1.2 compiled with icc v10.0.026 and ifort 10.0.026 - - Linux 2.6.18-76chaos #1 SMP Intel(R) C, C++, Fortran Compilers for - SMP x86_64 GNU/Linux applications running on Intel(R) 64, + + Linux 2.6.18-76chaos #1 SMP Intel(R) C, C++, Fortran Compilers for + SMP x86_64 GNU/Linux applications running on Intel(R) 64, (SNL Glory) Versions 11.1. - + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 - Cygwin(1.7.5 native gcc(4.3.4) compiler and + Cygwin(1.7.5 native gcc(4.3.4) compiler and gfortran) Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 @@ -9352,11 +9352,11 @@ The following platforms and compilers have been tested for this release. Windows Vista x64 Visual Studio 2008 w/ Intel Fortran 10.1 - MAC OS 10.6.3 (Intel) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + MAC OS 10.6.3 (Intel) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (pahra) GNU Fortran (GCC) 4.5.0 20090910 - i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 + i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 Intel C, C++ and Fortran compilers 11.1 - + MAC OS 10.5.8 (Intel) i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (tejeda) @@ -9365,7 +9365,7 @@ The following platforms and compilers have been tested for this release. OpenVMS Alpha V8.3 HP C V7.3-009 HP C++ V7.3-009 - HP Fortran V8.0-1-104669-48GBT + HP Fortran V8.0-1-104669-48GBT Supported Configuration Features Summary ======================================== @@ -9378,7 +9378,7 @@ Supported Configuration Features Summary x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -9388,7 +9388,7 @@ Windows XP n y(4) n(4) y y y Windows XP x64 n y(4) n(4) y y y Windows Vista n y(4) n(4) y y y Windows Vista x64 n y(4) n(4) y y y -Mac OS X 10.5 PPC n n n n y n +Mac OS X 10.5 PPC n n n n y n Mac OS X 10.5 Intel n y n y y y Mac OS X 10.6 Intel n y n y y y AIX 5.3 32- and 64-bit n y n y y n @@ -9406,28 +9406,28 @@ RedHat EL4 2.6.18 Xeon Lustre C y y y y y n Cray XT3 2.1.56 y y y y y n OpenVMS Alpha V8.3 n y n y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit y y y y -Windows XP y y(4) y n -Windows XP x64 y y(4) y n -Windows Vista y y(4) y n -Windows Vista x64 y y(4) y n -Mac OS X 10.5 PPC y n n n -Mac OS X 10.5 (Intel) y(5) n y n -Mac OS X 10.6 (Intel) y(5) n y n -AIX 5.3 32- and 64-bit n n n n -AIX 6.1 32- and 64-bit n n n n -FreeBSD 6.3-STABLE 32&64 bit y n y y -RedHat EL4 2.6.9-42 i686 GNU (1) W y y y y -RedHat EL5 2.6.18-128 i686 GNU (1)W y y(2) y y -RedHat EL5 2.6.18-128 i686 Intel W y y y n -RedHat EL5 2.6.18-128 i686 PGI W y y y n -SuSe Linux 2.6.16 x86_64 GNU (1) W y y y y -SuSe Linux 2.6.16 x86_64 Intel W y y y n -SuSe Linux 2.6.16 x86_64 PGI W y y y n -SuSe Linux 2.6.16 SGI Altix ia64 C y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y n +Windows XP x64 y y(4) y n +Windows Vista y y(4) y n +Windows Vista x64 y y(4) y n +Mac OS X 10.5 PPC y n n n +Mac OS X 10.5 (Intel) y(5) n y n +Mac OS X 10.6 (Intel) y(5) n y n +AIX 5.3 32- and 64-bit n n n n +AIX 6.1 32- and 64-bit n n n n +FreeBSD 6.3-STABLE 32&64 bit y n y y +RedHat EL4 2.6.9-42 i686 GNU (1) W y y y y +RedHat EL5 2.6.18-128 i686 GNU (1)W y y(2) y y +RedHat EL5 2.6.18-128 i686 Intel W y y y n +RedHat EL5 2.6.18-128 i686 PGI W y y y n +SuSe Linux 2.6.16 x86_64 GNU (1) W y y y y +SuSe Linux 2.6.16 x86_64 Intel W y y y n +SuSe Linux 2.6.16 x86_64 PGI W y y y n +SuSe Linux 2.6.16 SGI Altix ia64 C y n RedHat EL4 2.6.18 Xeon Lustre C y y y n Cray XT3 2.1.56 n n n n OpenVMS Alpha V8.3 n n n n @@ -9435,7 +9435,7 @@ OpenVMS Alpha V8.3 n n n n (1) Fortran compiled with g95. (2) With PGI and Absoft compilers. (3) With PGI compiler for Fortran. - (4) Using Visual Studio 2008. (Cygwin shared libraries are not + (4) Using Visual Studio 2008. (Cygwin shared libraries are not supported.) (5) Shared C and C++ are disabled when Fortran is configured in. Compiler versions for each platform are listed in the preceding @@ -9445,10 +9445,10 @@ OpenVMS Alpha V8.3 n n n n Known Problems ============== * The library's test dt_arith.c exposed a compiler's rounding problem on - Cygwin when converting from unsigned long long to long double. The - library's own conversion works correctly. A macro is defined for Cygwin + Cygwin when converting from unsigned long long to long double. The + library's own conversion works correctly. A macro is defined for Cygwin to skip this test until we can solve the problem. (Please see bug #1813.) - SLU - 2010/5/5 + SLU - 2010/5/5 * All the VFL drivers aren't backward compatible. In H5FDpublic.h, the structure H5FD_class_t changed in 1.8. There is a new parameter added to @@ -9458,11 +9458,11 @@ Known Problems for 1.6 and try to plug it into a 1.8 library. This affects a very small number of users. (See bug report #1279.) SLU - 2010/2/2 -* MinGW has a missing libstdc++.dll.a library file and will not successfully - link C++ applications/tests. Do not use the enable-cxx configure option. - Read all of the INSTALL_MINGW.txt file for all restrictions. +* MinGW has a missing libstdc++.dll.a library file and will not successfully + link C++ applications/tests. Do not use the enable-cxx configure option. + Read all of the INSTALL_MINGW.txt file for all restrictions. ADB - 2009/11/11 - + * Some tests in tools/h5repack may fail in AIX systems when -q32 mode is used. The error is due to insufficient memory requested. Request a large amount of runtime memory by setting the following environment variable for more @@ -9474,7 +9474,7 @@ Known Problems 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 @@ -9523,23 +9523,23 @@ Known Problems Storm" in file INSTALL_parallel for a way to deal with this problem. AKC - 2008/05/28 -* 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. A higher level of - optimization causes failures in several HDF5 library tests. +* 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. A higher level of + optimization causes failures in several HDF5 library tests. -* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. SLU - 2005/6/30 * On IBM AIX systems, parallel HDF5 mode will fail some tests with error @@ -9547,23 +9547,23 @@ Known Problems 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," - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use," + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. * 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 + 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. -* There is also a configure error on Altix machines that incorrectly reports +* There is also a configure error on Altix machines that incorrectly reports when a version of Szip without an encoder is being used. * On FREE-BSD systems when shared libraries are disabled, make install fails @@ -9582,7 +9582,7 @@ Known Problems intended. MAM - 2010/06/01 -%%%%1.8.4%%%% +%%%%1.8.4%%%% HDF5 version 1.8.4 released on Tue Nov 10 15:33:14 CST 2009 @@ -9591,10 +9591,10 @@ HDF5 version 1.8.4 released on Tue Nov 10 15:33:14 CST 2009 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.3 and -HDF5 1.8.4, and contains information on the platforms tested and +This document describes the differences between HDF5-1.8.3 and +HDF5 1.8.4, and contains information on the platforms tested and known problems in HDF5-1.8.4 -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.4 source code, documentation, and additional materials @@ -9606,18 +9606,18 @@ The HDF5 1.8.4 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.4 can be accessed directly at this location: +User documentation for 1.8.4 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.4 (current +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.4 (current release) versus Release 1.8.3": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -9646,7 +9646,7 @@ New Features - Configuration suite now uses Automake 1.11 and Autoconf 2.64. MAM 2009/08/31. - Changed default Gnu fortran compiler from g95 to gfortran since - gfortran is more likely installed with gcc now. -AKC 2009/07/19- + gfortran is more likely installed with gcc now. -AKC 2009/07/19- Library ------- @@ -9662,14 +9662,14 @@ New Features Parallel Library ---------------- - None - + Tools ----- - h5diff: h5diff treats two INFINITY values different. Fixed by checking - (value==expect) before call ABS(...) at h5diff_array.c. This will make - that (INF==INF) is true (INF is treated as an number instead of NaN) + (value==expect) before call ABS(...) at h5diff_array.c. This will make + that (INF==INF) is true (INF is treated as an number instead of NaN) (PC -- 2009/07/28) - - h5diff: add option "--use-system-epsilon" to print difference if + - h5diff: add option "--use-system-epsilon" to print difference if (|a-b| > EPSILON). Change default to use strict equality (PC -- 2009/09/12) @@ -9698,27 +9698,27 @@ Bug Fixes since HDF5-1.8.3 Configuration ------------- - Removed the following config files, as we no longer support them: - config/dec-osf*, config/hpux11.00, config/irix5.x, + config/dec-osf*, config/hpux11.00, config/irix5.x, config/powerpc-ibm-aix4.x config/rs6000-ibm-aix5.x config/unicos* MAM - 2009/10/08 - Modified configure and make process to properly preserve user's CFLAGS (and company) environment variables. Build will now properly use automake's AM_CFLAGS for any compiler flags set by the configure - process. Configure will no longer modify CFLAGS directly, nor will + process. Configure will no longer modify CFLAGS directly, nor will setting CFLAGS during make completely replace what configure has set up. MAM - 2009/10/08 - Support for TFLOPS, config/intel-osf1, is removed since the TFLOPS machine has long retired. AKC - 2009/10/06. - Added $(EXEEXT) extension to H5detect when it's executed in the - src/Makefile to generate H5Tinit.c so it works correctly on platforms + src/Makefile to generate H5Tinit.c so it works correctly on platforms that require the full extension when running executables. MAM - 2009/10/01 - BZ #1613 - Configure will now set FC and CXX to "no" when fortran and c++ are not being compiled, respectively, so configure will not run - some of the compiler tests for these languages when they are not + some of the compiler tests for these languages when they are not being used. MAM - 2009/10/01 - The --enable-static-exec flag will now properly place the -static flag - on the link line of all installed executables. This will force the + on the link line of all installed executables. This will force the executable to link with static libraries over shared libraries, provided the static libraries are available. MAM - 2009/08/31 - BZ #1583 - The PathScale compiler (v3.2) was mistaken as gcc v4.2.0 but it fails to @@ -9756,13 +9756,13 @@ Bug Fixes since HDF5-1.8.3 ----- - h5dump/h5ls display buffer resize fixed in tools library. ADB - 2009/7/21 - 1520 - - perf_serial test added to Windows projects and check batch file. + - perf_serial test added to Windows projects and check batch file. ADB - 2009/06/11 -1504 F90 API ------ - - Fixed bug in h5lget_info_by_idx_f by adding missing arguments, + - Fixed bug in h5lget_info_by_idx_f by adding missing arguments, consequently changing the API. New API is: SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, & @@ -9770,7 +9770,7 @@ Bug Fixes since HDF5-1.8.3 MSB - 2009/9/17 - 1652 - - Corrected the values for the H5L_flags FORTRAN constants: + - Corrected the values for the H5L_flags FORTRAN constants: H5L_LINK_ERROR_F, H5L_LINK_HARD_F, H5L_LINK_SOFT_F, H5L_LINK_EXTERNAL_F MSB - 2009-09-17 - 1653 @@ -9790,7 +9790,7 @@ Bug Fixes since HDF5-1.8.3 Fortran High-Level APIs: ------ - - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions + - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions had memory problems with the g95 fortran compiler. (PVN � 5/13/2009) 1522 @@ -9823,7 +9823,7 @@ The following platforms and compilers have been tested for this release. Linux 2.6.18-164.el5 gcc (GCC) 4.1.2 20080704 #1 SMP i686 i686 i386 G95 (GCC 4.0.3 (g95 0.92!) Jun 24 2009) - (jam) GNU Fortran (GCC) 4.1.2 20080704 + (jam) GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) PGI C, Fortran, C++ 8.0-5 32-bit PGI C, Fortran, C++ 8.0-1 32-bit @@ -9835,14 +9835,14 @@ The following platforms and compilers have been tested for this release. applications, Version 11.0, 11.1 Absoft 32-bit Fortran 95 10.0.7 MPICH mpich2-1.0.8 compiled with - gcc (GCC) 4.1.2 and G95 + gcc (GCC) 4.1.2 and G95 (GCC 4.0.3 (g95 0.92!) Linux 2.6.18-164.el5 #1 SMP gcc 4.1.2 20080704 x86_64 GNU/Linux G95 (GCC 4.0.3 (g95 0.92!) Jun 24 2009) (amani) tested for both 32- and 64-bit binaries - Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64, + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, Versions 11.1. PGI C, Fortran, C++ Version 9.0-4 for 64-bit target on x86-64 @@ -9858,10 +9858,10 @@ The following platforms and compilers have been tested for this release. (cobalt) SGI MPI 1.38 SunOS 5.10 32- and 64-bit Sun C 5.9 SunOS_sparc Patch 124867-11 2009/04/30 - (linew) Sun Fortran 95 8.3 SunOS_sparc + (linew) Sun Fortran 95 8.3 SunOS_sparc Patch 127000-11 2009/10/06 - Sun C++ 5.9 SunOS_sparc - Patch 124863-16 2009/09/15 + Sun C++ 5.9 SunOS_sparc + Patch 124863-16 2009/09/15 Intel Xeon Linux 2.6.18- Intel(R) C++ Version 10.0.026 92.1.10.el5_lustre.1.6.6smp- Intel(R) Fortran Compiler Version 10.0.026 @@ -9874,15 +9874,15 @@ The following platforms and compilers have been tested for this release. (NCSA tg-login) Intel(R) Fortran Compiler Version 8.1.033 mpich-gm-1.2.7p1..16-intel-8.1.037-r1 - Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for - .1.4.11.1smp #1 SMP applications running on Intel(R) 64, + Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for + .1.4.11.1smp #1 SMP applications running on Intel(R) 64, SMP x86_64 GNU/Linux Versions 10.1. - (SNL Thunderbird) - - Linux 2.6.18-76chaos #1 SMP Intel(R) C, C++, Fortran Compilers for - SMP x86_64 GNU/Linux applications running on Intel(R) 64, + (SNL Thunderbird) + + Linux 2.6.18-76chaos #1 SMP Intel(R) C, C++, Fortran Compilers for + SMP x86_64 GNU/Linux applications running on Intel(R) 64, (SNL Glory) Versions 10.1. - + Windows XP Visual Studio 2005 w/ Intel Fortran 9.1 Cygwin(native gcc compiler and g95) @@ -9909,7 +9909,7 @@ Supported Configuration Features Summary x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -9933,25 +9933,25 @@ SuSe Linux 2.4.21 ia64 Intel C y y y y y n Cray XT3 2.0.62 y y y y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit y y y y -Windows XP y y(4) y y -Windows XP x64 y y(4) y y -Windows Vista y n n y -Mac OS X 10.5 y n y n -AIX 5.3 32- and 64-bit n n n n -FreeBSD 6.3-STABLE 32&64 bit y y y y -RedHat EL5 2.6.18-164 i686 GNU (1)W y y(2) y y -RedHat EL5 2.6.18-164 i686 Intel W y y y n -RedHat EL5 2.6.18-164 i686 PGI W y y y n -RedHat EL5 2.6.18-164 x86_64 GNU(1)W y y y y -RedHat EL5 2.6.18-164 x86_64 IntelW y y y n -RedHat EL5 2.6.18-164 x86_64 PGI W y y y n -SuSe Linux 2.6.16 SGI Altix ia64 C y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +Windows XP y y(4) y y +Windows XP x64 y y(4) y y +Windows Vista y n n y +Mac OS X 10.5 y n y n +AIX 5.3 32- and 64-bit n n n n +FreeBSD 6.3-STABLE 32&64 bit y y y y +RedHat EL5 2.6.18-164 i686 GNU (1)W y y(2) y y +RedHat EL5 2.6.18-164 i686 Intel W y y y n +RedHat EL5 2.6.18-164 i686 PGI W y y y n +RedHat EL5 2.6.18-164 x86_64 GNU(1)W y y y y +RedHat EL5 2.6.18-164 x86_64 IntelW y y y n +RedHat EL5 2.6.18-164 x86_64 PGI W y y y n +SuSe Linux 2.6.16 SGI Altix ia64 C y n RedHat EL4 2.6.18 Xeon Lustre C y y y n -SuSe Linux 2.4.21 ia64 Intel C y y y n +SuSe Linux 2.4.21 ia64 Intel C y y y n Cray XT3 2.0.62 n n n n (1) Fortran compiled with g95. @@ -9979,15 +9979,15 @@ Known Problems 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 -* There is a known issue in which HDF5 will change the timestamp on a file +* There is a known issue in which HDF5 will change the timestamp on a file simply by opening it with read/write permissions, even if the file is not - modified in any way. This is due to the way in which HDF5 manages the file + modified in any way. This is due to the way in which HDF5 manages the file superblock. A fix is currently underway and should be included in the 1.8.4 release of HDF5. MAM - 2009/04/28 @@ -10034,23 +10034,23 @@ Known Problems Storm" in file INSTALL_parallel for a way to deal with this problem. AKC - 2008/05/28 -* 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. A higher level of - optimization causes failures in several HDF5 library tests. +* 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. A higher level of + optimization causes failures in several HDF5 library tests. -* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. SLU - 2005/6/30 * On IBM AIX systems, parallel HDF5 mode will fail some tests with error @@ -10058,26 +10058,26 @@ Known Problems 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", - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. * 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 + 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. -* There is also a configure error on Altix machines that incorrectly reports +* There is also a configure error on Altix machines that incorrectly reports when a version of Szip without an encoder is being used. -%%%%1.8.3%%%% +%%%%1.8.3%%%% HDF5 version 1.8.3 released on Mon May 4 09:21:00 CDT 2009 @@ -10086,10 +10086,10 @@ HDF5 version 1.8.3 released on Mon May 4 09:21:00 CDT 2009 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.2 and -HDF5 1.8.3, and contains information on the platforms tested and -known problems in HDF5-1.8.3. -For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.2 and +HDF5 1.8.3, and contains information on the platforms tested and +known problems in HDF5-1.8.3. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.3 source code, documentation, and additional materials @@ -10101,18 +10101,18 @@ The HDF5 1.8.3 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.3 can be accessed directly at this location: +User documentation for 1.8.3 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.3 (current +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.3 (current release) versus Release 1.8.2": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -10138,7 +10138,7 @@ New Features Configuration ------------- - - Added libtool version numbers to generated c++, fortran, and + - Added libtool version numbers to generated c++, fortran, and hl libraries. MAM 2009/04/19. - Regenerated Makefile.ins using Automake 1.10.2. MAM 2009/04/19. - Added a Make target of check-all-install to test the correctness of @@ -10178,7 +10178,7 @@ New Features (chunk allocation), and t_posix_compliant (posix compliance). The rest of the parallel tests already use in the code the number of processes available in the communicator. (CMC - 2009/04/28) - + Tools ----- - h5diff new flag, -c, --compare, list objects that are not comparable. @@ -10186,16 +10186,16 @@ New Features - h5diff new flag, -N, --nan, avoids NaNs detection. PVN - 2009/4/2 - h5dump correctly specifies XML dtd / schema urls ADB - 2009/4/3 - 1519 - h5repack now handles group creation order. PVN - 2009/4/2 - 1402 - - h5repack: When user doesn't specify a chunk size, h5repack now - defines a default chunk size as the same size of the size of the - hyperslab used to read the chunks. The size of the hyperslabs are - defined as the size of each dimension or a predefined constant, - whatever is smaller. This assures that the chunk read fits in the + - h5repack: When user doesn't specify a chunk size, h5repack now + defines a default chunk size as the same size of the size of the + hyperslab used to read the chunks. The size of the hyperslabs are + defined as the size of each dimension or a predefined constant, + whatever is smaller. This assures that the chunk read fits in the chunk cache. PVN - 2008/11/21 High-Level APIs --------------- - - Table: In version 3.0 of Table, the writing of the "NROWS" attribute + - Table: In version 3.0 of Table, the writing of the "NROWS" attribute (used to store number of records) was deprecated. PVN - 2008/11/24 F90 API @@ -10221,12 +10221,12 @@ Bug Fixes since HDF5-1.8.2 Configuration ------------- - - The --includedir=DIR configuration option now works as intended, and + - The --includedir=DIR configuration option now works as intended, and can be used to specify the location to install C header files. The default location remains unchanged, residing at ${prefix}/include. MAM - 2009/03/10 - BZ #1381 - Configure no longer removes the '-g' flag from CFLAGS when in production - mode if it has been explicitly set in the CFLAGS environment variable + mode if it has been explicitly set in the CFLAGS environment variable prior to configuration. MAM - 2009/03/09 - BZ #1401 Library @@ -10235,7 +10235,7 @@ Bug Fixes since HDF5-1.8.2 API. NAF - 2009/04/20 - 1533 - Fixed a problem with using data transforms with non-native types in the file. NAF - 2009/04/20 - 1548 - - Added direct.h include file to windows section of H5private.h + - Added direct.h include file to windows section of H5private.h to fix _getcwd() warning. ADB - 2009/04/14 - 1536 - Fixed a bug that prevented external links from working after calling H5close(). NAF - 2009/04/10 - 1539 @@ -10253,8 +10253,8 @@ Bug Fixes since HDF5-1.8.2 - Modified library to be able to open files with corrupt root group symbol table messages, and correct these errors if they are found. Such files can only be successfully opened with write access. NAF - 2009/03/23 - 1189 - - Removed the long_long #define and replaced all instances with - "long long". This caused problems with third party products. All + - Removed the long_long #define and replaced all instances with + "long long". This caused problems with third party products. All currently supported compliers support the type. ADB - 2009/03/05 - Fixed various bugs that could prevent the fill value from being written in certain rare cases. NAF - 2009/02/26 - 1469 @@ -10274,12 +10274,12 @@ Bug Fixes since HDF5-1.8.2 - Fixed a bug where H5Tpack wouldn't remove trailing space from an otherwise packed compound type. NAF - 2009/01/14 - Fixed up some old v2 btree assertions that get run in debug mode that - were previously failing on compilation, and removed some of the + were previously failing on compilation, and removed some of the more heavily outdated and non-rewritable ones. MAM - 2008/12/15 - Fixed a bug that could cause problems when "automatically" unmounting multiple files. NAF - 2008/11/17 - - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. - PVN - 2009/01/8 + - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. + PVN - 2009/01/8 Parallel Library ---------------- @@ -10289,11 +10289,11 @@ Bug Fixes since HDF5-1.8.2 ----- - Fixed many problems that could occur when using h5repack with named datatypes. NAF - 2009/4/20 - 1516/1466 - - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets + - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets that have a datatype datum size greater than H5TOOLS_BUFSIZE, a constant - defined as 1024Kb, such as array types with large dimensions. + defined as 1024Kb, such as array types with large dimensions. PVN - 2009/4/1 - 1501 - - h5import: By selecting a compression type, a big endian byte order + - h5import: By selecting a compression type, a big endian byte order was being selected. PVN - 2009/3/11 - 1462 - zip_perf.c had missing argument on one of the open() calls. Fixed. AKC - 2008/12/9 @@ -10308,13 +10308,13 @@ Bug Fixes since HDF5-1.8.2 High-Level APIs: ------ - - Dimension scales: The scale index return value in H5DSiterate_scales + - Dimension scales: The scale index return value in H5DSiterate_scales was not always incremented. PVN - 2009/4/8 - 1538 Fortran High-Level APIs: ------ - - Lite: The h5ltget_dataset_info_f function (gets information about - a dataset) was not correctly returning the dimension array + - Lite: The h5ltget_dataset_info_f function (gets information about + a dataset) was not correctly returning the dimension array PVN - 2009/3/23 @@ -10345,7 +10345,7 @@ The following platforms and compilers have been tested for this release. gfortran 4.4.1 20090421 IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m - F90 MIPSpro 7.4.4m + F90 MIPSpro 7.4.4m C++ MIPSpro cc 7.4.4m Linux 2.6.18-128.1.6.el5xen gcc (GCC) 4.1.2 @@ -10369,8 +10369,8 @@ The following platforms and compilers have been tested for this release. Linux 2.6.16.60-0.37-smp #1 gcc 4.1.2 SMP x86_64 GNU/Linux G95 (GCC 4.0.3 (g95 0.92!) Feb 4 2009) - (smirom) Intel(R) C, C++, Fortran Compilers for - applications running on Intel(R) 64, + (smirom) Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, Versions 10.1, 11.0. PGI C, Fortran, C++ Version 7.2-1, 8.0-1 for 64-bit target on x86-64 @@ -10384,9 +10384,9 @@ The following platforms and compilers have been tested for this release. (cobalt) SGI MPI 1.38 SunOS 5.10 32- and 64-bit Sun WorkShop 6 update 2 C 5.9 Patch 124867-09 - (linew) Sun WorkShop 6 update 2 Fortran 95 8.3 + (linew) Sun WorkShop 6 update 2 Fortran 95 8.3 Patch 127000-07 - Sun WorkShop 6 update 2 C++ 5.8 + Sun WorkShop 6 update 2 C++ 5.8 Patch 124863-11 Intel Xeon Linux 2.6.18- gcc 3.4.6 20060404 @@ -10401,22 +10401,22 @@ The following platforms and compilers have been tested for this release. (NCSA tg-login) Intel(R) Fortran Compiler Version 8.1.033 mpich-gm-1.2.7p1..16-intel-8.1.037-r1 - Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for - .1.4.11.1smp #1 SMP applications running on Intel(R) 64, + Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for + .1.4.11.1smp #1 SMP applications running on Intel(R) 64, SMP x86_64 GNU/Linux Versions 9.1. - (SNL Spirit) - - Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for - .1.4.11.1smp #1 SMP applications running on Intel(R) 64, + (SNL Spirit) + + Linux 2.6.9-55.0.9.EL_lustre Intel(R) C, C++, Fortran Compilers for + .1.4.11.1smp #1 SMP applications running on Intel(R) 64, SMP x86_64 GNU/Linux Versions 10.1. - (SNL Thunderbird) - - Linux 2.6.18-63chaos #1 SMP Intel(R) C, C++, Fortran Compilers for - SMP x86_64 GNU/Linux applications running on Intel(R) 64, + (SNL Thunderbird) + + Linux 2.6.18-63chaos #1 SMP Intel(R) C, C++, Fortran Compilers for + SMP x86_64 GNU/Linux applications running on Intel(R) 64, (SNL Glory) Versions 10.1. - - Linux 2.6.18-63chaos #1 SMP Intel(R) C, C++, Fortran Compilers for - SMP x86_64 GNU/Linux applications running on Intel(R) 64, + + Linux 2.6.18-63chaos #1 SMP Intel(R) C, C++, Fortran Compilers for + SMP x86_64 GNU/Linux applications running on Intel(R) 64, (LLNL Zeus) Versions 9.1. gcc/gfortran/g++ (GCC) 4.1.2. @@ -10445,7 +10445,7 @@ Supported Configuration Features Summary x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -10472,28 +10472,28 @@ SuSe Linux 2.4.21 ia64 Intel C y y y y y n Cray XT3 2.0.41 y y y y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit y y y y -IRIX64_6.5 32-bit y dna y y -IRIX64_6.5 64-bit y y n y -Windows XP y y(4) y y -Windows XP x64 y y(4) y y -Windows Vista y n n y -Mac OS X 10.5 y n y n -AIX 5.3 32- and 64-bit n n n n -FreeBSD 6.3-STABLE 32&64 bit y n y y -RedHat EL4 2.6.9-42 i686 GNU (1) W y y y y -RedHat EL5 2.6.18-128 i686 GNU (1)W y y(2) y y -RedHat EL5 2.6.18-128 i686 Intel W y y y n -RedHat EL5 2.6.18-128 i686 PGI W y y y n -SuSe Linux 2.6.16 x86_64 GNU (1) W y y y y -SuSe Linux 2.6.16 x86_64 Intel W y y y n -SuSe Linux 2.6.16 x86_64 PGI W y y y n -SuSe Linux 2.6.16 SGI Altix ia64 C y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +IRIX64_6.5 32-bit y dna y y +IRIX64_6.5 64-bit y y n y +Windows XP y y(4) y y +Windows XP x64 y y(4) y y +Windows Vista y n n y +Mac OS X 10.5 y n y n +AIX 5.3 32- and 64-bit n n n n +FreeBSD 6.3-STABLE 32&64 bit y n y y +RedHat EL4 2.6.9-42 i686 GNU (1) W y y y y +RedHat EL5 2.6.18-128 i686 GNU (1)W y y(2) y y +RedHat EL5 2.6.18-128 i686 Intel W y y y n +RedHat EL5 2.6.18-128 i686 PGI W y y y n +SuSe Linux 2.6.16 x86_64 GNU (1) W y y y y +SuSe Linux 2.6.16 x86_64 Intel W y y y n +SuSe Linux 2.6.16 x86_64 PGI W y y y n +SuSe Linux 2.6.16 SGI Altix ia64 C y n RedHat EL4 2.6.18 Xeon Lustre C y y y n -SuSe Linux 2.4.21 ia64 Intel C y y y n +SuSe Linux 2.4.21 ia64 Intel C y y y n Cray XT3 2.0.41 n n n n (1) Fortran compiled with g95. @@ -10511,9 +10511,9 @@ Known Problems collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks with MPI IO. CMC - 2009/04/28 -* There is a known issue in which HDF5 will change the timestamp on a file +* There is a known issue in which HDF5 will change the timestamp on a file simply by opening it with read/write permissions, even if the file is not - modified in any way. This is due to the way in which HDF5 manages the file + modified in any way. This is due to the way in which HDF5 manages the file superblock. A fix is currently underway and should be included in the 1.8.4 release of HDF5. MAM - 2009/04/28 @@ -10560,17 +10560,17 @@ Known Problems Storm" in file INSTALL_parallel for a way to deal with this problem. AKC - 2008/05/28 -* We have discovered two problems when running collective IO parallel HDF5 - tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a +* We have discovered two problems when running collective IO parallel HDF5 + tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a Linux cluster at NCSA. - Under some complex selection cases: + Under some complex selection cases: 1) MPI_Get_element returns the wrong value. - 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt data may be generated. - These issues arise only when turning on collective IO with chunking storage - with some complex selections. We have not found these problems on other - MPI-IO compilers. If you encounter these problems, you may use independent + These issues arise only when turning on collective IO with chunking storage + with some complex selections. We have not found these problems on other + MPI-IO compilers. If you encounter these problems, you may use independent IO instead. To avoid this behavior, change the following line in your code @@ -10579,33 +10579,33 @@ Known Problems H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); KY - 2007/08/24 -* 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. A higher level of - optimization causes failures in several HDF5 library tests. +* 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. A higher level of + optimization causes failures in several HDF5 library tests. -* For LLNL, uP: both serial and parallel tests pass. +* For LLNL, uP: both serial and parallel tests pass. Zeus: Serial tests pass but parallel tests fail with a known problem in MPI. - ubgl: Serial tests pass but parallel tests fail. + ubgl: Serial tests pass but parallel tests fail. -* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. * On IRIX6.5, when the C compiler version is greater than 7.4, complicated MPI derived datatype code will work. However, the user should increase - the value of the MPI_TYPE_MAX environment variable to some appropriate value - to use collective irregular selection code. For example, the current - parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. + the value of the MPI_TYPE_MAX environment variable to some appropriate value + to use collective irregular selection code. For example, the current + parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. SLU - 2005/6/30 * On IBM AIX systems, parallel HDF5 mode will fail some tests with error @@ -10613,34 +10613,34 @@ Known Problems 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", - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. * The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system libraries on + platforms. This is due to the fact that not all of the system libraries on Solaris are available in a static format. The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platforms for serial mode. The parallel mode works fine with + on IBM SP2 platforms for serial mode. The parallel mode works fine with this option. - + It is suggested that you do not use this option on these platforms during configuration. -* There is also a configure error on Altix machines that incorrectly reports +* There is also a configure error on Altix machines that incorrectly reports when a version of Szip without an encoder is being used. * Information about building with PGI and Intel compilers is available in the INSTALL file sections 4.7 and 4.8. -%%%%1.8.2%%%% - +%%%%1.8.2%%%% + HDF5 version 1.8.2 released on Mon Nov 10 15:43:09 CST 2008 ================================================================================ @@ -10648,9 +10648,9 @@ HDF5 version 1.8.2 released on Mon Nov 10 15:43:09 CST 2008 INTRODUCTION ============ -This document describes the differences between HDF5-1.8.1 and HDF5 1.8.2, -and contains information on the platforms tested and known problems in -HDF5-1.8.2. For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +This document describes the differences between HDF5-1.8.1 and HDF5 1.8.2, +and contains information on the platforms tested and known problems in +HDF5-1.8.2. For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.2 source code, documentation, and additional materials @@ -10662,18 +10662,18 @@ The HDF5 1.8.2 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.2 can be accessed directly at this location: +User documentation for 1.8.2 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.2 (current +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.2 (current release) versus Release 1.8.1": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -10714,41 +10714,41 @@ New Features Tools ----- - - h5repack: added new options -u and -b to add a userblock to an HDF5 + - h5repack: added new options -u and -b to add a userblock to an HDF5 file during the repack. (PVN - 2008/08/26) - - h5repack: added options -t and -a to call H5Pset_alignment while + - h5repack: added options -t and -a to call H5Pset_alignment while creating a repacked file. (PVN - 2008/08/29) - h5ls: added capability to traverse through external links when the -r (recursive) flag is given. (NAF - 2008/09/16) - - h5ls: added -E option to enable traversal of external links. + - h5ls: added -E option to enable traversal of external links. h5ls will not traverse external links without this flag being set. (NAF - 2008/10/06) - - h5dump: when -b flag is used without a keyword after it, binary - output defaults to NATIVE. MEMORY keyword was deprecated + - h5dump: when -b flag is used without a keyword after it, binary + output defaults to NATIVE. MEMORY keyword was deprecated and replaced by NATIVE keyword. (PVN - 2008/10/30) - - h5diff: returns 1 when file graphs differ by any object. + - h5diff: returns 1 when file graphs differ by any object. Error return code was changed to 2 from -1. (PVN - 2008/10/30) - - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP + - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP instead (PVN - 2008/10/30) F90 API ------ - - Added optional parameter 'mounted' to H5Gget_info_f, + - Added optional parameter 'mounted' to H5Gget_info_f, H5Gget_info_by_idx_f, H5Gget_info_by_name_f (MSB - 2008/09/24) - Added H5Tget_native_type_f (MSB - 2008/09/30) - - + + C++ API ------ - These member functions were added as wrapper for H5Rdereference to replace the incorrect IdComponent::dereference(). - void H5Object::dereference(H5Object& obj, void* ref, + void H5Object::dereference(H5Object& obj, void* ref, H5R_type_t ref_type=H5R_OBJECT) - void H5Object::dereference(H5File& h5file, void* ref, + void H5Object::dereference(H5File& h5file, void* ref, H5R_type_t ref_type=H5R_OBJECT) - void H5Object::dereference(Attribute& obj, void* ref, + void H5Object::dereference(Attribute& obj, void* ref, H5R_type_t ref_type=H5R_OBJECT) In addition, these constructors were added to create the associated @@ -10773,13 +10773,13 @@ Support for New Platforms, Languages, and Compilers disables the build of shared libraries (i.e., only static C and C++ HDF5 libraries will be built along with the static HDF5 Fortran library). - Intel 10.1 C and C++ compilers require + Intel 10.1 C and C++ compilers require "-no-multibyte-chars" compilation flag due to the known bug in the compilers. (EIP - 2008/10/30) -Bug Fixes since HDF5-1.8.1 +Bug Fixes since HDF5-1.8.1 ========================== Configuration @@ -10810,9 +10810,9 @@ Bug Fixes since HDF5-1.8.1 (NAF - 2008/10/06) - Fixed potential memory leak during compound conversion. (NAF - 2008/10/06) - - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. - Also changed the return value of H5Fget_obj_ids from HERR_T to - SSIZE_T and the type of the parameter MAX_OBJS from INT to SIZE_T. + - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. + Also changed the return value of H5Fget_obj_ids from HERR_T to + SSIZE_T and the type of the parameter MAX_OBJS from INT to SIZE_T. (SLU - 2008/09/26) - Fixed an issue that could cause data to be improperly overwritten during compound type conversion. (NAF - 2008/09/19) @@ -10827,23 +10827,23 @@ Bug Fixes since HDF5-1.8.1 (NAF - 2008/08/08) - Fixed an issue where mount point traversal would fail when using multiple handles for the child. (NAF - 2008/08/07) - - Fixed an issue where mount points were inaccessible when using - multiple file handles for the parent. The mount table is now in - the shared file structure (the parent pointer is still in the + - Fixed an issue where mount points were inaccessible when using + multiple file handles for the parent. The mount table is now in + the shared file structure (the parent pointer is still in the top structure). (NAF - 2008/08/07) - Fixed assertion failure caused by incorrect array datatype version. (NAF - 2008/08/04) - Fixed issue where a group could have a file mounted on it twice. (QAK - 2008/07/15) - - When an attribute was opened twice and data was written with - one of the handles, the file didn't have the data. It happened - because each handle had its own object structure, and the empty - one overwrote the data with fill value. This is fixed by making - some attribute information like the data be shared in the + - When an attribute was opened twice and data was written with + one of the handles, the file didn't have the data. It happened + because each handle had its own object structure, and the empty + one overwrote the data with fill value. This is fixed by making + some attribute information like the data be shared in the attribute structure. (SLU - 2008/07/07) - - Fixed a Windows-specific issue in the ohdr test which was causing - users in some timezones to get false errors. This a deficiency in - the Windows mktime() function, and has been handled properly. + - Fixed a Windows-specific issue in the ohdr test which was causing + users in some timezones to get false errors. This a deficiency in + the Windows mktime() function, and has been handled properly. (SJW - 2008/06/19) Parallel Library @@ -10861,46 +10861,46 @@ Bug Fixes since HDF5-1.8.1 (see bug #1253) (VC- 2008/10/13) - Fixed bug in h5ls that prevented relative group listings (like "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) - - h5dump: when doing binary output (-b), the stdout printing of - attributes was done incorrectly. Removed printing of attributes + - h5dump: when doing binary output (-b), the stdout printing of + attributes was done incorrectly. Removed printing of attributes when doing binary output. (PVN - 2008/06/05) F90 API ------ - - h5sselect_elements_f: Added additional operators H5S_SELECT_APPEND + - h5sselect_elements_f: Added additional operators H5S_SELECT_APPEND and H5S_SELECT_PREPEND (MSB - 2008/09/30) - - h5sget_select_elem_pointlist: Fixed list of returned points by - rearranging the point list correctly by accounting for C + - h5sget_select_elem_pointlist: Fixed list of returned points by + rearranging the point list correctly by accounting for C conventions. (MSB - 2008/09/30) - - h5sget_select_hyper_blocklist_f: Fixed error in transposed dimension + - h5sget_select_hyper_blocklist_f: Fixed error in transposed dimension of arrays.(MSB - 2008/9/30) - - h5sget_select_bounds_f: Swapped array bounds to account for C and + - h5sget_select_bounds_f: Swapped array bounds to account for C and Fortran reversed array notation (MSB - 2008/9/30) - - Changed to initializing string to a blank character instead of a - null type in tH5P.f90 to fix compiling error using AIX 5.3.0 + - Changed to initializing string to a blank character instead of a + null type in tH5P.f90 to fix compiling error using AIX 5.3.0 (MSB - 2008/7/29) - - Fixed missing commas in H5test_kind.f90 detected by NAG compiler + - Fixed missing commas in H5test_kind.f90 detected by NAG compiler (MSB - 2008/7/29) - - Fixed passing and array to a scalar in tH5A_1_8.f90 detected by + - Fixed passing and array to a scalar in tH5A_1_8.f90 detected by NAG compiler (MSB - 2008/7/29) - - Added the ability of the test programs to use the status of - HDF5_NOCLEANUP to determine if the *.h5 files should be removed + - Added the ability of the test programs to use the status of + HDF5_NOCLEANUP to determine if the *.h5 files should be removed or not after the tests are completed (MSB - 2008/10/1) - In nh5tget_offset_c: (MSB 9/12/2008) - If offset was equal to 0 it returned the error code of -1, - this was changed to return an error code of -1 when the offset + If offset was equal to 0 it returned the error code of -1, + this was changed to return an error code of -1 when the offset value is < 0. - - Uses intrinsic Fortran function SIZEOF if available when detecting + - Uses intrinsic Fortran function SIZEOF if available when detecting type of INTEGERs and REALs in H5test_kind.f90 (MSB - 2008/9/3) - - Put the DOUBLE PRECISION interfaces in a separate module and - added a USE statement for the module. The interfaces are + - Put the DOUBLE PRECISION interfaces in a separate module and + added a USE statement for the module. The interfaces are included/excluded depending on the state of FORTRAN_DEFAULT_REAL is DBLE_F which detects if the default REAL is DOUBLE PRECISION. - This allows the library to be compiled with -r8 Fortran flag - without the user needing to edit the source code. + This allows the library to be compiled with -r8 Fortran flag + without the user needing to edit the source code. (MSB - 200/8/27) - - Enable building shared library for fortran by adding the flag -fPIC + - Enable building shared library for fortran by adding the flag -fPIC to the compile flags for versions of Intel Fortran compiler >=9 (MSB - 2008/8/26) @@ -10946,7 +10946,7 @@ The following platforms and compilers have been tested for this release. gfortran 4.2.5 20080702 IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m - F90 MIPSpro 7.4.4m + F90 MIPSpro 7.4.4m C++ MIPSpro cc 7.4.4m Linux 2.6.9-42.0.10.ELsmp #1 gcc (GCC) 3.4.6 @@ -10964,9 +10964,9 @@ The following platforms and compilers have been tested for this release. MPICH mpich2-1.0.6p1 compiled with gcc 3.4.6 and G95 (GCC 4.0.3 (g95 0.92!) - Linux 2.6.16.46-0.14-smp #1 Intel(R) C++ for Intel(R) EM64T + Linux 2.6.16.46-0.14-smp #1 Intel(R) C++ for Intel(R) EM64T SMP x86_64 GNU/Linux Ver. 10.1.013 - (smirom) Intel(R) Fortran Intel(R) EM64T + (smirom) Intel(R) Fortran Intel(R) EM64T Ver. 10.1.013 PGI C, Fortran, C++ Version 7.2-1 for 64-bit target on x86-64 @@ -10990,7 +10990,7 @@ The following platforms and compilers have been tested for this release. Intel(R) Fortran Compiler Version 10.0.026 Open MPI 1.2.2 MVAPICH2-0.9.8p28p2patched-intel-ofed-1.2 - compiled with icc v10.0.026 and + compiled with icc v10.0.026 and ifort 10.0.026 IA-64 Linux 2.4.21-309.tg1 #1 SMP @@ -11017,7 +11017,7 @@ The following platforms and compilers have been tested for this release. GNU Fortran (GCC) 4.3.0 20070810 G95 (GCC 4.0.3 (g95 0.91!) Apr 24 2008) Intel C, C++ and Fortran compilers 10.1 - + Supported Configuration Features Summary ======================================== @@ -11028,7 +11028,7 @@ Supported Configuration Features Summary x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -11041,7 +11041,7 @@ Windows XP x64 n y(15) n(15) y y y Windows Vista n n n y y y Mac OS X 10.5 Intel n y n y y y AIX 5.3 32- and 64-bit n y n y y n -FreeBSD 6.3-STABLE +FreeBSD 6.3-STABLE 32&64 bit n y n y y y RedHat EL4 (3) W y(1) y(10) y(1) y y y RedHat EL4 Intel (3) W n y n y y n @@ -11049,49 +11049,49 @@ RedHat EL4 PGI (3) W n y n y y n SuSe x86_64 gcc(3,12) W y(2) y(11) y(2) y y y SuSe x86_64 Int(3,12) W n y(13) n y y n SuSe x86_64 PGI(3,12) W n y(8) n y y y -Linux 2.6 SuSE ia64 C +Linux 2.6 SuSE ia64 C Intel (3,7) y y y y y n -Linux 2.6 SGI Altix +Linux 2.6 SGI Altix ia64 Intel (3) y y y y y y Linux 2.6 RHEL C Lustre Intel (5) y(4) y y(4) y y n Cray XT3 2.0.41 y y y y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit y y y y -IRIX64_6.5 32-bit y dna y y -IRIX64_6.5 64-bit y y n y -Windows XP y y(15) y y -Windows XP x64 y y(15) y y -Windows Vista y n n y -Mac OS X 10.5 y n y n -AIX 5.3 32- and 64-bit n n n n -FreeBSD 6.2 32&64 bit y n y y -RedHat EL4 (3) W y y(10) y y -RedHat EL4 Intel (3) W y y y n -RedHat EL4 PGI (3) W y y y n -SuSe x86_64 GNU(3,12) W y y y y -SuSe x86_64 Int(3,12) W y y y n -SuSe x86_64 PGI(3,12) W y y y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 32-bit y y y y +Solaris2.10 64-bit y y y y +IRIX64_6.5 32-bit y dna y y +IRIX64_6.5 64-bit y y n y +Windows XP y y(15) y y +Windows XP x64 y y(15) y y +Windows Vista y n n y +Mac OS X 10.5 y n y n +AIX 5.3 32- and 64-bit n n n n +FreeBSD 6.2 32&64 bit y n y y +RedHat EL4 (3) W y y(10) y y +RedHat EL4 Intel (3) W y y y n +RedHat EL4 PGI (3) W y y y n +SuSe x86_64 GNU(3,12) W y y y y +SuSe x86_64 Int(3,12) W y y y n +SuSe x86_64 PGI(3,12) W y y y n Linux 2.4 SuSE C - ia64 C Intel (7) y y y n + ia64 C Intel (7) y y y n Linux 2.4 SGI Altix C - ia64 Intel y n + ia64 Intel y n Linux 2.6 RHEL C Lustre Intel (5) y y y n Cray XT3 2.0.41 n n n n Notes: (1) Using mpich2 1.0.6. (2) Using mpich2 1.0.7. - (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. + (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. W or C indicates workstation or cluster, respectively. (4) Using mvapich2 0.9.8. - (5) Linux 2.6.9-42.0.10. Xeon cluster with ELsmp_perfctr_lustre + (5) Linux 2.6.9-42.0.10. Xeon cluster with ELsmp_perfctr_lustre and Intel compilers - (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre and Intel compilers (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel compilers (8) pgf90 @@ -11145,17 +11145,17 @@ Known Problems Storm" in file INSTALL_parallel for a way to deal with this problem. AKC - 2008/05/28 -* We have discovered two problems when running collective IO parallel HDF5 - tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a +* We have discovered two problems when running collective IO parallel HDF5 + tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a Linux cluster at NCSA. - Under some complex selection cases: + Under some complex selection cases: 1) MPI_Get_element returns the wrong value. - 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt data may be generated. - These issues arise only when turning on collective IO with chunking storage - with some complex selections. We have not found these problems on other - MPI-IO compilers. If you encounter these problems, you may use independent + These issues arise only when turning on collective IO with chunking storage + with some complex selections. We have not found these problems on other + MPI-IO compilers. If you encounter these problems, you may use independent IO instead. To avoid this behavior, change the following line in your code @@ -11165,33 +11165,33 @@ Known Problems KY - 2007/08/24 -* 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. A higher level of - optimization causes failures in several HDF5 library tests. +* 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. A higher level of + optimization causes failures in several HDF5 library tests. -* For LLNL, uP: both serial and parallel tests pass. +* For LLNL, uP: both serial and parallel tests pass. Zeus: Serial tests pass but parallel tests fail with a known problem in MPI. - ubgl: Serial tests pass but parallel tests fail. + ubgl: Serial tests pass but parallel tests fail. -* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. * On IRIX6.5, when the C compiler version is greater than 7.4, complicated MPI derived datatype code will work. However, the user should increase - the value of the MPI_TYPE_MAX environment variable to some appropriate value - to use collective irregular selection code. For example, the current - parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. + the value of the MPI_TYPE_MAX environment variable to some appropriate value + to use collective irregular selection code. For example, the current + parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. SLU - 2005/6/30 * On IBM AIX systems, parallel HDF5 mode will fail some tests with error @@ -11199,26 +11199,26 @@ Known Problems 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", - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. * The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system libraries on + platforms. This is due to the fact that not all of the system libraries on Solaris are available in a static format. The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platforms for serial mode. The parallel mode works fine with + on IBM SP2 platforms for serial mode. The parallel mode works fine with this option. - + It is suggested that you do not use this option on these platforms during configuration. -* There is also a configure error on Altix machines that incorrectly reports +* There is also a configure error on Altix machines that incorrectly reports when a version of Szip without an encoder is being used. * Information about building with PGI and Intel compilers is available in @@ -11227,7 +11227,7 @@ Known Problems -%%%%1.8.1%%%% +%%%%1.8.1%%%% HDF5 version 1.8.1 released on Thu May 29 15:28:55 CDT 2008 @@ -11236,10 +11236,10 @@ HDF5 version 1.8.1 released on Thu May 29 15:28:55 CDT 2008 INTRODUCTION ============ -This document describes the differences between the HDF5-1.8.1 release -and HDF5 1.8.0, and contains information on the platforms tested and known +This document describes the differences between the HDF5-1.8.1 release +and HDF5 1.8.0, and contains information on the platforms tested and known problems in HDF5-1.8.1. For more details, see the files -HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory +HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.1 source code, documentation, and additional materials @@ -11251,18 +11251,18 @@ The HDF5 1.8.1 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.1 can be accessed directly at this location: +User documentation for 1.8.1 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in the HDF5-1.8.x release series, including brief general -descriptions of some new and modified APIs, are described in the "What's New +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.1 (current +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.1 (current release) versus Release 1.8.0": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -11291,12 +11291,12 @@ New Features - The lib/libhdf5.settings file contains much more configure information. (AKC - 2008/05/18) - - The new configure option "--disable-sharedlib-rpath" disables - embedding the '-Wl,-rpath' information into executables when - shared libraries are produced, and instead solely relies on the + - The new configure option "--disable-sharedlib-rpath" disables + embedding the '-Wl,-rpath' information into executables when + shared libraries are produced, and instead solely relies on the information in LD_LIBRARY_PATH. (MAM - 2008/05/15) - - Configuration suite now uses Autoconf 2.61, Automake 1.10.1, and + - Configuration suite now uses Autoconf 2.61, Automake 1.10.1, and Libtool 2.2.2 (MAM - 2008/05/01) Source code distribution @@ -11312,24 +11312,24 @@ New Features Tools ----- - - h5repack: Reinstated the -i and -o command line flags to specify + - h5repack: Reinstated the -i and -o command line flags to specify input and output files. h5repack now understands both the old syntax (with -i and -o) and the new syntax introduced in Release 1.8.0. (PVN - 2008/05/23) - - h5dump: Added support for external links, displaying the object that + - h5dump: Added support for external links, displaying the object that an external link points to. (PVN - 2008/05/12) - - h5dump: Added an option, -m, to allow user-defined formatting in the + - h5dump: Added an option, -m, to allow user-defined formatting in the output of floating point numbers. (PVN - 2008/05/06) - - h5dump, in output of the -p option: Added effective data compression - ratio to the dataset storage layout output when a compression filter + - h5dump, in output of the -p option: Added effective data compression + ratio to the dataset storage layout output when a compression filter has been applied to a dataset. (PVN - 2008/05/01) F90 API ------ New H5A, H5G, H5L, H5O, and H5P APIs to enable 1.8 features were - added. See "Release 1.8.1 (current release) versus Release 1.8.0" in + added. See "Release 1.8.1 (current release) versus Release 1.8.0" in the document "HDF5 Software Changes from Release to Release" - (http://hdfgroup.org/HDF5/doc/ADGuide/Changes.html) for the + (http://hdfgroup.org/HDF5/doc/ADGuide/Changes.html) for the complete list of the new APIs. C++ API @@ -11339,15 +11339,15 @@ New Features Support for New Platforms, Languages, and Compilers =================================================== - - Both serial and parallel HDF5 are supported for the Red Storm machine + - Both serial and parallel HDF5 are supported for the Red Storm machine which is a Cray XT3 system. - - The Fortran library will work correctly if compiled with the -i8 - flag. This has been tested with the g95, PGI and Intel Fortran + - The Fortran library will work correctly if compiled with the -i8 + flag. This has been tested with the g95, PGI and Intel Fortran compilers. -Bug Fixes since HDF5-1.8.0 +Bug Fixes since HDF5-1.8.0 ========================== Configuration @@ -11359,12 +11359,12 @@ Bug Fixes since HDF5-1.8.0 Library ------- - - Chunking: Chunks greater than 4GB are disallowed. + - Chunking: Chunks greater than 4GB are disallowed. (QAK - 2008/05/16) - - Fixed the problem with searching for a target file when following - an external link. The search pattern will depend on whether the - target file's pathname is an absolute or a relative path. - Please see the H5Lcreate_external description in the "HDF5 + - Fixed the problem with searching for a target file when following + an external link. The search pattern will depend on whether the + target file's pathname is an absolute or a relative path. + Please see the H5Lcreate_external description in the "HDF5 Reference Manual" (http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html). (VC - 2008/04/08) - Fixed possible file corruption bug when encoding datatype @@ -11372,7 +11372,7 @@ Bug Fixes since HDF5-1.8.0 256 and 511 bytes and the file was opened with the "use the latest format" property enabled (with H5Pset_libver_bounds). (QAK - 2008/03/13) - - Fixed bug in H5Aget_num_attrs() routine to correctly handle an + - Fixed bug in H5Aget_num_attrs() routine to correctly handle an invalid location identifier. (QAK - 2008/03/11) Parallel Library @@ -11384,13 +11384,13 @@ Bug Fixes since HDF5-1.8.0 - Fixed bug in h5diff that prevented datasets and attributes with variable-length string elements from comparing correctly. (QAK - 2008/02/28) - - Fixed bug in h5dump that caused binary output to be made only for + - Fixed bug in h5dump that caused binary output to be made only for the first dataset, when several datasets were requested. (PVN - 2008/04/07) F90 API ------ - - The h5tset(get)_fields subroutines were missing the parameter to + - The h5tset(get)_fields subroutines were missing the parameter to specify a sign position; fixed. (EIP - 2008/05/23) - Many APIs were fixed to work with the 8-byte integers in Fortran vs. 4-byte integers in C. This change is trasparent to user applications. @@ -11439,7 +11439,7 @@ The following platforms and compilers have been tested for this release. gfortran 4.2.1 20080123 IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m - F90 MIPSpro 7.4.4m + F90 MIPSpro 7.4.4m C++ MIPSpro cc 7.4.4m Linux 2.6.9 (RHEL4) Intel 10.0 compilers @@ -11448,26 +11448,26 @@ The following platforms and compilers have been tested for this release. Linux 2.4.21-47 gcc 3.2.3 20030502 (osage) - Linux 2.6.9-42.0.10 gcc,g++ 3.4.6 20060404, G95 (GCC 4.0.3) + Linux 2.6.9-42.0.10 gcc,g++ 3.4.6 20060404, G95 (GCC 4.0.3) (kagiso) PGI 7.1-6 (pgcc, pgf90, pgCC) Intel 9.1 (icc, ifort, icpc) - Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, + Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, (smirom) g95 (GCC 4.0.3) PGI 7.1-6 (pgcc, pgf90, pgCC) Intel 9.1 (icc, ifort, icpc) Linux 2.6.5-7.252.1-rtgfx #1 Intel(R) C++ Version 9.0 - SMP ia64 Intel(R) Fortran Itanium(R) Version 9.0 + SMP ia64 Intel(R) Fortran Itanium(R) Version 9.0 (cobalt) SGI MPI SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 95 6.2 Sun WorkShop 6 update 2 C++ 5.3 - SunOS 5.10 cc: Sun C 5.8 - (linew) f90: Sun Fortran 95 8.2 - CC: Sun C++ 5.8 + SunOS 5.10 cc: Sun C 5.8 + (linew) f90: Sun Fortran 95 8.2 + CC: Sun C++ 5.8 Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre (tungsten) gcc 3.2.2 20030222 @@ -11509,7 +11509,7 @@ Supported Configuration Features Summary x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -11528,52 +11528,52 @@ RedHat EL3 W PGI (3) n y n y y n SuSe x86_64 gcc (3,12) y(2) y(11) y(2) y y y SuSe x86_64 Int (3,12) n y(13) n y y n SuSe x86_64 PGI (3,12) n y(8) n y y y -Linux 2.4 Xeon C +Linux 2.4 Xeon C Lustre Intel (3,6) n y n y y n -Linux 2.6 SuSE ia64 C +Linux 2.6 SuSE ia64 C Intel (3,7) y y y y y n -Linux 2.6 SGI Altix +Linux 2.6 SGI Altix ia64 Intel (3) y y y y y y Linux 2.6 RHEL C Lustre Intel (5) y(4) y y(4) y y n Cray XT3 2.0.41 y y y y y n -Platform Shared Shared Shared Thread- - C libs F90 libs C++ libs safe -Solaris2.10 64-bit y y y y -Solaris2.10 32-bit y y y y -IRIX64_6.5 64-bit y y n y -IRIX64_6.5 32-bit y dna y y -Windows XP y y(15) y y -Windows XP x64 y y(15) y y -Windows Vista y n n y -Mac OS X 10.3 y n -FreeBSD 4.11 y n y y -RedHat EL3 W (3) y y(10) y y -RedHat EL3 W Intel (3) y y y n -RedHat EL3 W PGI (3) y y y n -SuSe x86_64 W GNU (3,12) y y y y -SuSe x86_64 W Int (3,12) y y y n -SuSe x86_64 W PGI (3,12) y y y n -Linux 2.4 Xeon C - Lustre Intel (6) y y y n -Linux 2.4 SuSE - ia64 C Intel (7) y y y n -Linux 2.4 SGI Altix - ia64 Intel y n +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.10 64-bit y y y y +Solaris2.10 32-bit y y y y +IRIX64_6.5 64-bit y y n y +IRIX64_6.5 32-bit y dna y y +Windows XP y y(15) y y +Windows XP x64 y y(15) y y +Windows Vista y n n y +Mac OS X 10.3 y n +FreeBSD 4.11 y n y y +RedHat EL3 W (3) y y(10) y y +RedHat EL3 W Intel (3) y y y n +RedHat EL3 W PGI (3) y y y n +SuSe x86_64 W GNU (3,12) y y y y +SuSe x86_64 W Int (3,12) y y y n +SuSe x86_64 W PGI (3,12) y y y n +Linux 2.4 Xeon C + Lustre Intel (6) y y y n +Linux 2.4 SuSE + ia64 C Intel (7) y y y n +Linux 2.4 SGI Altix + ia64 Intel y n Linux 2.6 RHEL C Lustre Intel (5) y y y n Cray XT3 2.0.41 n n n n n Notes: (1) Using mpich2 1.0.6. (2) Using mpich2 1.0.7. - (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. + (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. W or C indicates workstation or cluster, respectively. (4) Using mvapich2 0.9.8. - (5) Linux 2.6.9-42.0.10. Xeon cluster with ELsmp_perfctr_lustre + (5) Linux 2.6.9-42.0.10. Xeon cluster with ELsmp_perfctr_lustre and Intel compilers - (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre and Intel compilers (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel compilers (8) pgf90 @@ -11614,17 +11614,17 @@ Known Problems ======== end of bypass ======== AKC - 2008/05/28 -* We have discovered two problems when running collective IO parallel HDF5 - tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a +* We have discovered two problems when running collective IO parallel HDF5 + tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a Linux cluster at NCSA. - Under some complex selection cases: + Under some complex selection cases: 1) MPI_Get_element returns the wrong value. - 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt data may be generated. - These issues arise only when turning on collective IO with chunking storage - with some complex selections. We have not found these problems on other - MPI-IO compilers. If you encounter these problems, you may use independent + These issues arise only when turning on collective IO with chunking storage + with some complex selections. We have not found these problems on other + MPI-IO compilers. If you encounter these problems, you may use independent IO instead. To avoid this behavior, change the following line in your code @@ -11637,13 +11637,13 @@ Known Problems * 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. A higher level of - optimization causes failures in several HDF5 library tests. +* 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. A higher level of + optimization causes failures in several HDF5 library tests. -* For LLNL, uP: both serial and parallel tests pass. +* For LLNL, uP: both serial and parallel tests pass. Zeus: Serial tests pass but parallel tests fail with a known problem in MPI. - ubgl: Serial tests pass but parallel tests fail. + ubgl: Serial tests pass but parallel tests fail. * Configuring with --enable-debug=all produces compiler errors on most platforms: Users who want to run HDF5 in debug mode should use @@ -11651,66 +11651,66 @@ Known Problems 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. + 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, the Scaleoffset filter is not supported. The Scaleoffset filter - supports only the IEEE standard for floating-point data; it cannot be applied - to HDF5 data generated on VAX. +* On VAX, the Scaleoffset filter is not supported. The Scaleoffset filter + supports only the IEEE standard for floating-point data; it cannot be applied + to HDF5 data generated on VAX. * 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, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. * On IRIX6.5, when the C compiler version is greater than 7.4, complicated MPI derived datatype code will work. However, the user should increase - the value of the MPI_TYPE_MAX environment variable to some appropriate value - to use collective irregular selection code. For example, the current - parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. + the value of the MPI_TYPE_MAX environment variable to some appropriate value + to use collective irregular selection code. For example, the current + parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculation of the Fletcher32 checksum in the + There was a bug in the calculation of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. SLU - 2005/6/30 -* For version 6 (6.02 and 6.04) of the Portland Group compiler on the AMD - Opteron processor, there is a bug in the compiler for optimization(-O2). - The library failed in several tests, all related to the MULTI driver. - The problem has been reported to the vendor. +* For version 6 (6.02 and 6.04) of the Portland Group compiler on the AMD + Opteron processor, there is a bug in the compiler for optimization(-O2). + The library failed in several tests, all related to the 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", - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. * The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system libraries on + platforms. This is due to the fact that not all of the system libraries on Solaris are available in a static format. The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platforms for serial mode. The parallel mode works fine with + on IBM SP2 platforms for serial mode. The parallel mode works fine with this option. - + It is suggested that you do not use this option on these platforms during configuration. @@ -11719,7 +11719,7 @@ Known Problems 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. * The ./dsets tests fail on the TFLOPS machine if the test program, @@ -11731,42 +11731,42 @@ Known Problems * 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. + used when shared libraries are unavailable. - There is also a configure error on Altix machines that incorrectly reports + 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 the HDF5 - Fortran library, compilation may fail for fortranlib_test.f90, fflush1.f90 - and fflush2.f90 complaining about the exit subroutine. Comment out the line +* On some platforms that use Intel and Absoft compilers to build the HDF5 + Fortran library, compilation may fail for fortranlib_test.f90, fflush1.f90 + and fflush2.f90 complaining about the 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 the INSTALL file sections 4.7 and 4.8. * On at least one system, SDSC DataStar, the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run + 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 + 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. + 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 + 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. + 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 + 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. @@ -11788,11 +11788,11 @@ Known Problems exit $RETURN_VALUE You get the HDF5 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 + 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 + Note that the RUNSERIAL environment variable exists so that we 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 @@ -11811,7 +11811,7 @@ Known Problems available. -%%%%1.8.0%%%% +%%%%1.8.0%%%% HDF5 version 1.8.0 released on Tue Feb 12 20:41:19 CST 2008 @@ -11821,9 +11821,9 @@ INTRODUCTION ============ This document describes the differences between the HDF5-1.6.x release series -and HDF5 1.8.0, and contains information on the platforms tested and known +and HDF5 1.8.0, and contains information on the platforms tested and known problems in HDF5-1.8.0. For more details, see the HISTORY-1_0-1_8_0_rc3.txt -file in the +file in the release_docs/ directory of the HDF5 source. Links to the HDF5 1.8.0 source code, documentation, and additional materials @@ -11835,17 +11835,17 @@ The HDF5 1.8.0 release can be obtained from: http://www.hdfgroup.org/HDF5/release/obtain5.html -User documentation for 1.8.0 can be accessed directly at this location: +User documentation for 1.8.0 can be accessed directly at this location: http://www.hdfgroup.org/HDF5/doc/ -New features in 1.8.0, including brief general descriptions of some new +New features in 1.8.0, including brief general descriptions of some new and modified APIs, are described in the "What's New in 1.8.0?" document: http://www.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.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.0 (current +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.0 (current release) versus Release 1.6.x": http://www.hdfgroup.org/HDF5/doc/ADGuide/Changes.html @@ -11872,7 +11872,7 @@ New Features HDF5 Release 1.8.0 is a major release with many changes and new features. - New format and interface features discussed in the "What's New in + New format and interface features discussed in the "What's New in HDF5 1.8.0" document include the following: Enhanced group object management @@ -11884,7 +11884,7 @@ New Features New I/O filters: n-bit and scale+offset compression New link (H5L) and object (H5O) interfaces and features External and user-defined links - New high-level APIs: + New high-level APIs: HDF5 Packet Table (H5PT) and HDF5 Dimension Scale (H5DS) C++ and Fortran interfaces for older high-level APIs: H5Lite (H5LT), H5Image (H5IM), and H5Table (H5TB) @@ -11894,33 +11894,33 @@ New Features http://hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html - New APIs associated with these features, other interface changes + New APIs associated with these features, other interface changes (e.g., ENUM and struct definitions), and new library configuration flags - are listed in the "Release 1.8.0 (current release) versus Release 1.6.x" + are listed in the "Release 1.8.0 (current release) versus Release 1.6.x" section of "HDF5 Software Changes from Release to Release." http://hdfgroup.org/HDF5/doc/ADGuide/Changes.html Compatibility ------------- - Many HDF5 users and user communities have existing applications that - they may wish to port to Release 1.8.0. Alternatively, some users may + Many HDF5 users and user communities have existing applications that + they may wish to port to Release 1.8.0. Alternatively, some users may wish to take advantage of Release 1.8.0's improved performance without having to port such applications. To facilitate managing application - compatibility and porting applications from release to release, the HDF + compatibility and porting applications from release to release, the HDF Team has implemented the following features: - Individually-configurable macros that selectively map common + Individually-configurable macros that selectively map common interface names to the old and new interfaces Library configuration options to configure the macro mappings Two related documents accompany this release: - "API Compatibility Macros in HDF5" discusses the specifics of the - new individually-configurable macros and library configuration + "API Compatibility Macros in HDF5" discusses the specifics of the + new individually-configurable macros and library configuration options. http://hdfgroup.org/HDF5/doc/RM/APICompatMacros.html - + "New Features in HDF5 Release 1.8.0 and Backward/Forward Format - Compatibility Issues" discusses each new feature with regard to + Compatibility Issues" discusses each new feature with regard to its impact on format compatibility. http://hdfgroup.org/HDF5/doc/ADGuide/CompatFormat180.html @@ -11943,13 +11943,13 @@ Referenced documents Removed Feature =============== -The stream virtual file driver (H5FD_STREAM) have been removed in this -release. This affects the functions H5Pset_fapl_stream and H5Pget_fapl_stream +The stream virtual file driver (H5FD_STREAM) have been removed in this +release. This affects the functions H5Pset_fapl_stream and H5Pget_fapl_stream and the constant H5FD_STREAM. -This virtual file driver will be available at -http://hdf5-addons.origo.ethz.ch/. Note that at the time of this release, -the transition is still in progress; the necessary integration tools may +This virtual file driver will be available at +http://hdf5-addons.origo.ethz.ch/. Note that at the time of this release, +the transition is still in progress; the necessary integration tools may not be available when HDF5 Release 1.8.0 first comes out. @@ -11958,9 +11958,9 @@ Support for New Platforms, Languages, and Compilers - Support for Open VMS 7.3 was added. -Bug Fixes since HDF5-1.6.0 +Bug Fixes since HDF5-1.6.0 ========================== - This release contains numerous bug fixes. For details, see the + This release contains numerous bug fixes. For details, see the "Changes from 1.6.0 to 1.8.0-rc3" section of the HISTORY.txt file for this release. @@ -11971,7 +11971,7 @@ The following platforms and compilers have been tested for for this release. AIX 5.2 (32/64 bit) xlc 8.0.0.11 xlC 8.0 - xlf 10.01.0000.0 + xlf 10.01.0000.0 mpcc_r 6.0.0.8 mpxlf_r 8.1.1.7 @@ -11988,7 +11988,7 @@ The following platforms and compilers have been tested for for this release. gfortran 4.2.1 20080123 IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m - F90 MIPSpro 7.4.4m + F90 MIPSpro 7.4.4m C++ MIPSpro cc 7.4.4m Linux 2.6.9 (RHEL4) Intel 10.0 compilers @@ -12001,22 +12001,22 @@ The following platforms and compilers have been tested for for this release. (kagiso) PGI 7.0-7 (pgcc, pgf90, pgCC) Intel 9.1 (icc, ifort, icpc) - Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, + Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, (smirom) g95 (GCC 4.0.3) PGI 6.2-5 (pgcc, pgf90, pgCC) Intel 9.1 (icc, iort, icpc) Linux 2.6.5-7.252.1-rtgfx #1 Intel(R) C++ Version 9.0 - SMP ia64 Intel(R) Fortran Itanium(R) Version 9.0 + SMP ia64 Intel(R) Fortran Itanium(R) Version 9.0 (cobalt) SGI MPI SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 95 6.2 Sun WorkShop 6 update 2 C++ 5.3 - SunOS 5.10 cc: Sun C 5.8 - (linew) f90: Sun Fortran 95 8.2 - CC: Sun C++ 5.8 + SunOS 5.10 cc: Sun C 5.8 + (linew) f90: Sun Fortran 95 8.2 + CC: Sun C++ 5.8 Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre (tungsten) gcc 3.2.2 20030222 @@ -12038,7 +12038,7 @@ The following platforms and compilers have been tested for for this release. Windows Vista Visual Studio 2005 - MAC OS 10.4 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 + MAC OS 10.4 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) Alpha Open VMS 7.3 Compaq C V6.5-001-48BCD @@ -12055,7 +12055,7 @@ Supported Configuration Features Summary x = not working in this release dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform + = testing incomplete on this feature or platform Platform C F90 F90 C++ zlib SZIP parallel parallel @@ -12079,52 +12079,52 @@ RedHat EL3 W PGI (3) n y n y y n SuSe x86_64 gcc (3,12) y(1a) y(11) n y y y SuSe x86_64 Int (3,12) n y(13) n y y n SuSe x86_64 PGI (3,12) n y(8) n y y y -Linux 2.4 Xeon C +Linux 2.4 Xeon C Lustre Intel (3,6) n y n y y n -Linux 2.6 SuSE ia64 C +Linux 2.6 SuSE ia64 C Intel (3,7) y y y y y n -Linux 2.6 SGI Altix +Linux 2.6 SGI Altix ia64 Intel (3) y y y y y y Alpha OpenVMS 7.3.2 n y n y n n -Platform Shared Shared Shared static- Thread- - C libs F90 libs C++ libs exec safe -Solaris2.8 64-bit y y y x y -Solaris2.8 32-bit y y y x y -Solaris2.10 64-bit y x y -Solaris2.10 32-bit y x y -IRIX64_6.5 64-bit y y n y y -IRIX64_6.5 32-bit y dna y y y -AIX-5.2 & 5.3 32-bit n n n y n -AIX-5.2 & 5.3 64-bit n n n y n -Windows XP y y(15) y y y -Windows XP x64 y y(15) y y y -Windows Vista y n n y y -Mac OS X 10.3 y y n -FreeBSD 4.11 y n y y y -RedHat EL3 W (3) y y(10) y y y -RedHat EL3 W Intel (3) y y y y n -RedHat EL3 W PGI (3) y y y y n -SuSe x86_64 W GNU (3,12) y y y y y -SuSe x86_64 W Int (3,12) y y y y(14) n -SuSe x86_64 W PGI (3,12) y y y y(14) n -Linux 2.4 Xeon C - Lustre Intel (6) y y y y n -Linux 2.4 SuSE - ia64 C Intel (7) y y y y n -Linux 2.4 SGI Altix - ia64 Intel y y n -Alpha OpenVMS 7.3.2 n n n y n +Platform Shared Shared Shared static- Thread- + C libs F90 libs C++ libs exec safe +Solaris2.8 64-bit y y y x y +Solaris2.8 32-bit y y y x y +Solaris2.10 64-bit y x y +Solaris2.10 32-bit y x y +IRIX64_6.5 64-bit y y n y y +IRIX64_6.5 32-bit y dna y y y +AIX-5.2 & 5.3 32-bit n n n y n +AIX-5.2 & 5.3 64-bit n n n y n +Windows XP y y(15) y y y +Windows XP x64 y y(15) y y y +Windows Vista y n n y y +Mac OS X 10.3 y y n +FreeBSD 4.11 y n y y y +RedHat EL3 W (3) y y(10) y y y +RedHat EL3 W Intel (3) y y y y n +RedHat EL3 W PGI (3) y y y y n +SuSe x86_64 W GNU (3,12) y y y y y +SuSe x86_64 W Int (3,12) y y y y(14) n +SuSe x86_64 W PGI (3,12) y y y y(14) n +Linux 2.4 Xeon C + Lustre Intel (6) y y y y n +Linux 2.4 SuSE + ia64 C Intel (7) y y y y n +Linux 2.4 SGI Altix + ia64 Intel y y n +Alpha OpenVMS 7.3.2 n n n y n Notes: (1) Using mpich 1.2.6. (1a) Using mpich2 1.0.6. (2) Using mpt and mpich 1.2.6. - (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. + (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. W or C indicates workstation or cluster, respectively. - (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre and Intel compilers (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel compilers @@ -12143,17 +12143,17 @@ compilers Known Problems ============== -* We have discovered two problems when running collective IO parallel HDF5 - tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a +* We have discovered two problems when running collective IO parallel HDF5 + tests with chunking storage on the ChaMPIon MPI compiler on tungsten, a Linux cluster at NCSA. - Under some complex selection cases: + Under some complex selection cases: 1) MPI_Get_element returns the wrong value. - 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt data may be generated. - These issues arise only when turning on collective IO with chunking storage - with some complex selections. We have not found these problems on other - MPI-IO compilers. If you encounter these problems, you may use independent + These issues arise only when turning on collective IO with chunking storage + with some complex selections. We have not found these problems on other + MPI-IO compilers. If you encounter these problems, you may use independent IO instead. To avoid this behavior, change the following line in your code @@ -12167,20 +12167,20 @@ Known Problems * 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. A higher level of - optimization causes failures in several HDF5 library tests. +* 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. A higher level of + optimization causes failures in several HDF5 library tests. * For SNL, Red Storm: Only parallel HDF5 is supported. The serial tests pass when run against the parallel library; the parallel tests also pass, but with lots of non-fatal error messages. -* For LLNL, uP: both serial and parallel tests pass. +* For LLNL, uP: both serial and parallel tests pass. Zeus: Serial tests pass but parallel tests fail with a known problem in MPI. - ubgl: Serial tests pass but parallel tests fail. + ubgl: Serial tests pass but parallel tests fail. -* On SUN 5.10 C++, testing fails in the "Testing Shared Datatypes with - Attributes" test. +* On SUN 5.10 C++, testing 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 @@ -12188,66 +12188,66 @@ Known Problems 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. + 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, the Scaleoffset filter is not supported. The filter cannot be - applied to HDF5 data generated on VAX. The Scaleoffset filter only supports +* On VAX, the Scaleoffset filter is not supported. The filter cannot be + applied to HDF5 data generated on VAX. The Scaleoffset filter only supports the 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, if more than two processes contribute no IO and - the application asks to do collective IO, we have found that when using 4 - processors, a simple collective write will sometimes be hung. This can be +* On mpich 1.2.5 and 1.2.6, if more than two processes contribute no IO and + the application asks to do collective IO, we have found that when using 4 + processors, a simple collective write will sometimes be hung. This can be verified with t_mpi test under testpar. * On IRIX6.5, when the C compiler version is greater than 7.4, complicated MPI derived datatype code will work. However, the user should increase - the value of the MPI_TYPE_MAX environment variable to some appropriate value - to use collective irregular selection code. For example, the current - parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. + the value of the MPI_TYPE_MAX environment variable to some appropriate value + to use collective irregular selection code. For example, the current + parallel HDF5 test needs to raise MPI_TYPE_MAX to 200,000 to pass the test. -* A dataset created or rewritten with a v1.6.3 library or after cannot be read +* A dataset created or rewritten with a v1.6.3 library or after cannot be read with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. - There was a bug in the calculating code of the Fletcher32 checksum in the + There was a bug in the calculating code of the Fletcher32 checksum in the library before v1.6.3; the checksum value was not 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 was no longer the same as - before on little-endian system. Library releases after 1.6.4 can still read - datasets created or rewritten with an HDF5 library of v1.6.2 or before. + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. SLU - 2005/6/30 -* For version 6 (6.02 and 6.04) of the Portland Group compiler on the AMD - Opteron processor, there is a bug in the compiler for optimization(-O2). - The library failed in several tests, all related to the MULTI driver. - The problem has been reported to the vendor. +* For version 6 (6.02 and 6.04) of the Portland Group compiler on the AMD + Opteron processor, there is a bug in the compiler for optimization(-O2). + The library failed in several tests, all related to the 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", - but HDF5 does not use sockets. This failure is due to problems with the - poe command trying to set up the debug socket. To resolve this problem, - check to see whether there are many old /tmp/s.pedb.* files staying around. - These are sockets used by the poe command and left behind due to failed - commands. First, ask your system administrator to clean them out. + The tests may fail with messages like "The socket name is already in use", + but HDF5 does not use sockets. This failure is due to problems with the + poe command trying to set up the debug socket. To resolve this problem, + check to see whether there are many old /tmp/s.pedb.* files staying around. + These are sockets used by the poe command and left behind due to failed + commands. First, ask your system administrator to clean them out. Lastly, request IBM to provide a means to run poe without the debug socket. * The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system libraries on + platforms. This is due to the fact that not all of the system libraries on Solaris are available in a static format. The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platform for the serial mode. The parallel mode works fine with + on IBM SP2 platform for the serial mode. The parallel mode works fine with this option. - + It is suggested that you do not use this option on these platforms during configuration. @@ -12256,7 +12256,7 @@ Known Problems 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. * The ./dsets tests fail on the TFLOPS machine if the test program, @@ -12268,42 +12268,42 @@ Known Problems * 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. + used when shared libraries are unavailable. - There is also a configure error on Altix machines that incorrectly reports + 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 the HDF5 - Fortran library, compilation may fail for fortranlib_test.f90, fflush1.f90 - and fflush2.f90 complaining about the exit subroutine. Comment out the line +* On some platforms that use Intel and Absoft compilers to build the HDF5 + Fortran library, compilation may fail for fortranlib_test.f90, fflush1.f90 + and fflush2.f90 complaining about the 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 the INSTALL file sections 4.7 and 4.8. * On at least one system, SDSC DataStar, the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run + 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 + 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. + 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 + 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. + 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 + 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. @@ -12325,11 +12325,11 @@ Known Problems exit $RETURN_VALUE You get the HDF5 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 + 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 + 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 diff --git a/release_docs/HISTORY-1_8_0-1_10_0.txt b/release_docs/HISTORY-1_8_0-1_10_0.txt index a364274..b0377b1 100644 --- a/release_docs/HISTORY-1_8_0-1_10_0.txt +++ b/release_docs/HISTORY-1_8_0-1_10_0.txt @@ -417,7 +417,7 @@ New Features --------------- C Packet Table API - ------------------ + ------------------ - Replacement of a public function The existing function H5PTcreate_fl limits applications to deflate @@ -448,7 +448,7 @@ New Features (BMR, 2016/03/04, HDFFV-442) C++ Packet Table API - -------------------- + -------------------- - New constructor An overloaded constructor is added to FL_PacketTable and takes a property @@ -484,7 +484,7 @@ New Features Internal header file - -------------------- + -------------------- - A new API function H5DOwrite_chunk. It writes a data chunk directly into a file bypassing hyperslab selection, data conversion, and filter pipeline. The user must be careful with the function and diff --git a/src/H5.c b/src/H5.c index 59882e3..bd78ca2 100644 --- a/src/H5.c +++ b/src/H5.c @@ -138,8 +138,8 @@ H5_init_library(void) if (mpi_initialized && !mpi_finalized) { int key_val; - if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, - (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb, + if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, + (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb, &key_val, NULL))) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_create_keyval failed", mpi_code) @@ -209,7 +209,7 @@ H5_init_library(void) * The link interface needs to be initialized so that link property lists * have their properties registered. * The FS module needs to be initialized as a result of the fix for HDFFV-10160: - * It might not be initialized during normal file open. + * It might not be initialized during normal file open. * When the application does not close the file, routines in the module might * be called via H5_term_library() when shutting down the file. */ @@ -745,7 +745,7 @@ H5_debug_mask(const char *s) /*------------------------------------------------------------------------- * Function: H5_mpi_delete_cb * - * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 + * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 * library when the communicator is destroyed, i.e. on MPI_Finalize. * * Return: MPI_SUCCESS @@ -991,7 +991,7 @@ H5close(void) * Return: * * Success: A pointer to the allocated buffer. - * + * * Failure: NULL * *------------------------------------------------------------------------- @@ -1032,7 +1032,7 @@ H5allocate_memory(size_t size, hbool_t clear) * Return: * * Success: A pointer to the resized buffer. - * + * * Failure: NULL (the input buffer will be unchanged) * *------------------------------------------------------------------------- @@ -1093,7 +1093,7 @@ H5is_library_threadsafe(hbool_t *is_ts) H5TRACE1("e", "*b", is_ts); HDassert(is_ts); - + /* At this time, it is impossible for this to fail. */ #ifdef H5_HAVE_THREADSAFE *is_ts = TRUE; diff --git a/src/H5A.c b/src/H5A.c index f99fb7d..2986466 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -439,7 +439,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) { void *attr = NULL; /* attr object from VOL connector */ H5VL_object_t *vol_obj = NULL; /* object of loc_id */ - H5VL_loc_params_t loc_params; + H5VL_loc_params_t loc_params; hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_API(H5I_INVALID_HID) diff --git a/src/H5AC.c b/src/H5AC.c index f6243ad..1756107 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -228,10 +228,10 @@ H5AC_term_package(void) * * Function: H5AC_cache_image_pending() * - * Purpose: Debugging function that tests to see if the load of a + * Purpose: Debugging function that tests to see if the load of a * metadata cache image load is pending (i.e. will be executed * on the next protect or insert) - * + * * Returns TRUE if a cache image load is pending, and FALSE * if not. Throws an assertion failure on error. * @@ -421,8 +421,8 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "auto resize configuration failed") /* Don't need to get the current H5C image config here since the - * cache has just been created, and thus f->shared->cache->image_ctl - * must still set to its initial value (H5C__DEFAULT_CACHE_IMAGE_CTL). + * cache has just been created, and thus f->shared->cache->image_ctl + * must still set to its initial value (H5C__DEFAULT_CACHE_IMAGE_CTL). * Note that this not true as soon as control returns to the application * program, as some test code modifies f->shared->cache->image_ctl. */ @@ -517,10 +517,10 @@ H5AC_dest(H5F_t *f) /* Sanity check */ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - /* If the file was opened R/W, attempt to flush all entries + /* If the file was opened R/W, attempt to flush all entries * from rank 0 & Bcast clean list to other ranks. * - * Must not flush in the R/O case, as this will trigger the + * Must not flush in the R/O case, as this will trigger the * free space manager settle routines. */ if(H5F_ACC_RDWR & H5F_INTENT(f)) @@ -1963,10 +1963,10 @@ done: * and flag an error and return FAIL otherwise. * * At present, this function operates by packing the data - * from the instance of H5AC_cache_image_config_t into an + * from the instance of H5AC_cache_image_config_t into an * instance of H5C_cache_image_ctl_t, and then calling - * H5C_validate_cache_image_config(). If and when - * H5AC_cache_image_config_t and H5C_cache_image_ctl_t + * H5C_validate_cache_image_config(). If and when + * H5AC_cache_image_config_t and H5C_cache_image_ctl_t * diverge, we may have to change this. * * Return: Non-negative on success/Negative on failure @@ -1992,7 +1992,7 @@ H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown image config version") /* don't need to get the current H5C image config here since the - * default values of fields not in the H5AC config will always be + * default values of fields not in the H5AC config will always be * valid. */ internal_config.version = config_ptr->version; @@ -2132,11 +2132,11 @@ done: /*------------------------------------------------------------------------------ * Function: H5AC_ignore_tags() * - * Purpose: Override all assertion frameworks and force application of + * Purpose: Override all assertion frameworks and force application of * global tag everywhere. This should really only be used in the - * tests that need to access functions without going through + * tests that need to access functions without going through * API paths. - * + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Mike McGreevy @@ -2159,7 +2159,7 @@ H5AC_ignore_tags(const H5F_t *f) /* Set up a new metadata tag */ if(H5C_ignore_tags(f->shared->cache) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_ignore_tags() */ @@ -2169,7 +2169,7 @@ done: * Function: H5AC_tag() * * Purpose: Sets the metadata tag property in the provided property list. - * + * * Return: void * * Programmer: Mike McGreevy @@ -2197,9 +2197,9 @@ H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag) * Function: H5AC_retag_copied_metadata() * * Purpose: Searches through cache index for all entries with the - * H5AC__COPIED_TAG, indicating that it was created as a + * H5AC__COPIED_TAG, indicating that it was created as a * result of an object copy, and applies the provided tag. - * + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Mike McGreevy @@ -2208,7 +2208,7 @@ H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag) *------------------------------------------------------------------------------ */ herr_t -H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) +H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2217,7 +2217,7 @@ H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) /* Sanity checks */ HDassert(f); HDassert(f->shared); - + /* Call cache-level function to re-tag entries with the COPIED tag */ if(H5C_retag_entries(f->shared->cache, H5AC__COPIED_TAG, metadata_tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "Can't retag metadata") @@ -2231,8 +2231,8 @@ done: * Function: H5AC_flush_tagged_metadata() * * Purpose: Wrapper for cache level function which flushes all metadata - * that contains the specific tag. - * + * that contains the specific tag. + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Mike McGreevy @@ -2245,8 +2245,8 @@ H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag) { /* Variable Declarations */ herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ + + /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Assertions */ @@ -2266,8 +2266,8 @@ done: * Function: H5AC_evict_tagged_metadata() * * Purpose: Wrapper for cache level function which flushes all metadata - * that contains the specific tag. - * + * that contains the specific tag. + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Mike McGreevy @@ -2280,8 +2280,8 @@ H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, hbool_t match_global) { /* Variable Declarations */ herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ + + /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Assertions */ @@ -2302,7 +2302,7 @@ done: * * Purpose: Wrapper for cache level function which expunge entries with * a specific tag and type id. - * + * * Return: SUCCEED on success, FAIL otherwise. * * Programmer: Vailin Choi; May 2016 @@ -2314,8 +2314,8 @@ H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flag { /* Variable Declarations */ herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ + + /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Assertions */ @@ -2335,7 +2335,7 @@ done: * Function: H5AC_get_tag() * * Purpose: Get the tag for a metadata cache entry. - * + * * Return: SUCCEED/FAIL * * Programmer: Dana Robinson @@ -2348,8 +2348,8 @@ H5AC_get_tag(const void *thing, haddr_t *tag) { /* Variable Declarations */ herr_t ret_value = SUCCEED; - - /* Function Enter Macro */ + + /* Function Enter Macro */ FUNC_ENTER_NOAPI(FAIL) /* Assertions */ diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index 1235206..b40f8d0 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -253,8 +253,8 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, * type field contains the expected value. * * If the specified entry is in cache, *in_cache_ptr is set - * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending - * on whether the entries type field matches the + * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending + * on whether the entries type field matches the * expected_type parameter * * If the target entry is not in cache, *in_cache_ptr is @@ -278,8 +278,8 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, */ #ifndef NDEBUG herr_t -H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, - const H5AC_class_t *expected_type, hbool_t *in_cache_ptr, +H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, + const H5AC_class_t *expected_type, hbool_t *in_cache_ptr, hbool_t *type_ok_ptr) { H5C_t * cache_ptr; @@ -304,7 +304,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_get_serialization_in_progress * - * Purpose: Return the current value of + * Purpose: Return the current value of * cache_ptr->serialization_in_progress. * * Return: Current value of cache_ptr->serialization_in_progress. diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index fadde28..f097e83 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -135,7 +135,7 @@ H5FL_DEFINE_STATIC(H5AC_slist_entry_t); /*------------------------------------------------------------------------- * Function: H5AC__set_sync_point_done_callback * - * Purpose: Set the value of the sync_point_done callback. This + * Purpose: Set the value of the sync_point_done callback. This * callback is used by the parallel test code to verify * that the expected writes and only the expected writes * take place during a sync point. @@ -204,7 +204,7 @@ H5AC__set_write_done_callback(H5C_t * cache_ptr, void (* write_done)(void)) * Function: H5AC_add_candidate() * * Purpose: Add the supplied metadata entry address to the candidate - * list. Verify that each entry added does not appear in + * list. Verify that each entry added does not appear in * the list prior to its insertion. * * This function is intended for used in constructing list @@ -261,11 +261,11 @@ done: * * Purpose: Broadcast the contents of the process 0 candidate entry * slist. In passing, also remove all entries from said - * list. As the application of this will be handled by - * the same functions on all processes, construct and + * list. As the application of this will be handled by + * the same functions on all processes, construct and * return a copy of the list in the same format as that * received by the other processes. Note that if this - * copy is returned in *haddr_buf_ptr_ptr, the caller + * copy is returned in *haddr_buf_ptr_ptr, the caller * must free it. * * This function must only be called by the process with @@ -317,7 +317,7 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, unsigned chk_num_entries = 0; /* convert the candidate list into the format we - * are used to receiving from process 0, and also load it + * are used to receiving from process 0, and also load it * into a buffer for transmission. */ if(H5AC__copy_candidate_list_to_buffer(cache_ptr, &chk_num_entries, &haddr_buf_ptr) < 0) @@ -331,7 +331,7 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) } /* end if */ - /* Pass the number of entries and the buffer pointer + /* Pass the number of entries and the buffer pointer * back to the caller. Do this so that we can use the same code * to apply the candidate list to all the processes. */ @@ -481,10 +481,10 @@ done: /*------------------------------------------------------------------------- * Function: H5AC__construct_candidate_list() * - * Purpose: In the parallel case when the metadata_write_strategy is + * Purpose: In the parallel case when the metadata_write_strategy is * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, process 0 uses - * this function to construct the list of cache entries to - * be flushed. This list is then propagated to the other + * this function to construct the list of cache entries to + * be flushed. This list is then propagated to the other * caches, and then flushed in a distributed fashion. * * The sync_point_op parameter is used to determine the extent @@ -581,22 +581,22 @@ H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key, * Function: H5AC__copy_candidate_list_to_buffer * * Purpose: Allocate buffer(s) and copy the contents of the candidate - * entry slist into it (them). In passing, remove all - * entries from the candidate slist. Note that the + * entry slist into it (them). In passing, remove all + * entries from the candidate slist. Note that the * candidate slist must not be empty. * * If MPI_Offset_buf_ptr_ptr is not NULL, allocate a buffer * of MPI_Offset, copy the contents of the candidate - * entry list into it with the appropriate conversions, - * and return the base address of the buffer in + * entry list into it with the appropriate conversions, + * and return the base address of the buffer in * *MPI_Offset_buf_ptr. Note that this is the buffer - * used by process 0 to transmit the list of entries to + * used by process 0 to transmit the list of entries to * be flushed to all other processes (in this file group). * * Similarly, allocate a buffer of haddr_t, load the contents - * of the candidate list into this buffer, and return its - * base address in *haddr_buf_ptr_ptr. Note that this - * latter buffer is constructed unconditionally. + * of the candidate list into this buffer, and return its + * base address in *haddr_buf_ptr_ptr. Note that this + * latter buffer is constructed unconditionally. * * In passing, also remove all entries from the candidate * entry slist. @@ -635,8 +635,8 @@ H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entri num_entries = (unsigned)H5SL_count(aux_ptr->candidate_slist_ptr); - /* allocate a buffer(s) to store the list of candidate entry - * base addresses in + /* allocate a buffer(s) to store the list of candidate entry + * base addresses in */ buf_size = sizeof(haddr_t) * num_entries; if(NULL == (haddr_buf_ptr = (haddr_t *)H5MM_malloc(buf_size))) @@ -651,7 +651,7 @@ H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entri if(H5SL_free(aux_ptr->candidate_slist_ptr, H5AC__copy_candidate_list_to_buffer_cb, &udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "Can't build address list for candidate entries") - /* Pass the number of entries and the buffer pointer + /* Pass the number of entries and the buffer pointer * back to the caller. */ *num_entries_ptr = num_entries; @@ -1131,32 +1131,32 @@ done: /*------------------------------------------------------------------------- * Function: H5AC__propagate_and_apply_candidate_list * - * Purpose: Prior to the addition of support for multiple metadata - * write strategies, in PHDF5, only the metadata cache with - * mpi rank 0 was allowed to write to file. All other - * metadata caches on processes with rank greater than 0 - * were required to retain dirty entries until they were + * Purpose: Prior to the addition of support for multiple metadata + * write strategies, in PHDF5, only the metadata cache with + * mpi rank 0 was allowed to write to file. All other + * metadata caches on processes with rank greater than 0 + * were required to retain dirty entries until they were * notified that the entry was clean. * - * This constraint is relaxed with the distributed + * This constraint is relaxed with the distributed * metadata write strategy, in which a list of candidate * metadata cache entries is constructed by the process 0 * cache and then distributed to the caches of all the other - * processes. Once the listed is distributed, many (if not - * all) processes writing writing a unique subset of the - * entries, and marking the remainder clean. The subsets - * are chosen so that each entry in the list of candidates - * is written by exactly one cache, and all entries are + * processes. Once the listed is distributed, many (if not + * all) processes writing writing a unique subset of the + * entries, and marking the remainder clean. The subsets + * are chosen so that each entry in the list of candidates + * is written by exactly one cache, and all entries are * marked as being clean in all caches. * - * While the list of candidate cache entries is prepared + * While the list of candidate cache entries is prepared * elsewhere, this function is the main routine for distributing - * and applying the list. It must be run simultaniously on + * and applying the list. It must be run simultaniously on * all processes that have the relevant file open. To ensure - * proper synchronization, there is a barrier at the beginning + * proper synchronization, there is a barrier at the beginning * of this function. * - * At present, this function is called under one of two + * At present, this function is called under one of two * circumstances: * * 1) Dirty byte creation exceeds some user specified value. @@ -1167,10 +1167,10 @@ done: * and therefore the same dirty data creation. * * This fact is used to synchronize the caches for purposes - * of propagating the list of candidate entries, by simply - * calling this function from all caches whenever some user - * specified threshold on dirty data is exceeded. (the - * process 0 cache creates the candidate list just before + * of propagating the list of candidate entries, by simply + * calling this function from all caches whenever some user + * specified threshold on dirty data is exceeded. (the + * process 0 cache creates the candidate list just before * calling this function). * * 2) Under direct user control -- this operation must be @@ -1185,20 +1185,20 @@ done: * * For the process with mpi rank 0: * - * 1) Load the contents of the candidate list + * 1) Load the contents of the candidate list * (candidate_slist_ptr) into a buffer, and broadcast that * buffer to all the other caches. Clear the candidate * list in passing. * - * If there is a positive number of candidates, proceed with + * If there is a positive number of candidates, proceed with * the following: * * 2) Apply the candidate entry list. * * 3) Particpate in a closing barrier. * - * 4) Remove from the dirty list (d_slist_ptr) and from the - * flushed and still clean entries list (c_slist_ptr), + * 4) Remove from the dirty list (d_slist_ptr) and from the + * flushed and still clean entries list (c_slist_ptr), * all addresses that appeared in the candidate list, as * these entries are now clean. * @@ -1207,7 +1207,7 @@ done: * * 1) Receive the candidate entry list broadcast * - * If there is a positive number of candidates, proceed with + * If there is a positive number of candidates, proceed with * the following: * * 2) Apply the candidate entry list. @@ -1264,8 +1264,8 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f) if(num_candidates > 0) { herr_t result; - /* all processes apply the candidate list. - * H5C_apply_candidate_list() handles the details of + /* all processes apply the candidate list. + * H5C_apply_candidate_list() handles the details of * distributing the writes across the processes. */ @@ -1284,7 +1284,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't apply candidate list.") /* this code exists primarily for the test bed -- it allows us to - * enforce posix semantics on the server that pretends to be a + * enforce posix semantics on the server that pretends to be a * file system in our parallel tests. */ if(aux_ptr->write_done) @@ -1323,16 +1323,16 @@ done: * Function: H5AC__propagate_flushed_and_still_clean_entries_list * * Purpose: In PHDF5, if the process 0 only metadata write strategy - * is selected, only the metadata cache with mpi rank 0 is - * allowed to write to file. All other metadata caches on - * processes with rank greater than 0 must retain dirty - * entries until they are notified that the entry is now + * is selected, only the metadata cache with mpi rank 0 is + * allowed to write to file. All other metadata caches on + * processes with rank greater than 0 must retain dirty + * entries until they are notified that the entry is now * clean. * - * This function is the main routine for handling this - * notification procedure. It must be called - * simultaniously on all processes that have the relevant - * file open. To this end, it is called only during a + * This function is the main routine for handling this + * notification procedure. It must be called + * simultaniously on all processes that have the relevant + * file open. To this end, it is called only during a * sync point, with a barrier prior to the call. * * Note that any metadata entry writes by process 0 will @@ -1428,7 +1428,7 @@ done: * * Purpose: Receive the list of entry addresses from process 0, * and return it in a buffer pointed to by *haddr_buf_ptr_ptr. - * Note that the caller must free this buffer if it is + * Note that the caller must free this buffer if it is * returned. * * This function must only be called by the process with @@ -1479,7 +1479,7 @@ H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) } /* end if */ - /* finally, pass the number of entries and the buffer pointer + /* finally, pass the number of entries and the buffer pointer * back to the caller. */ *num_entries_ptr = num_entries; @@ -1562,7 +1562,7 @@ done: * * Purpose: Receive the list of candidate entries from process 0, * and return it in a buffer pointed to by *haddr_buf_ptr_ptr. - * Note that the caller must free this buffer if it is + * Note that the caller must free this buffer if it is * returned. * * This function must only be called by the process with @@ -1612,38 +1612,38 @@ done: * Purpose: Routine for handling the details of running a sync point * that is triggered by a flush -- which in turn must have been * triggered by either a flush API call or a file close -- - * when the distributed metadata write strategy is selected. - * - * Upon entry, each process generates it own candidate list, - * being a sorted list of all dirty metadata entries currently - * in the metadata cache. Note that this list must be idendical - * across all processes, as all processes see the same stream - * of dirty metadata coming in, and use the same lists of - * candidate entries at each sync point. (At first glance, this + * when the distributed metadata write strategy is selected. + * + * Upon entry, each process generates it own candidate list, + * being a sorted list of all dirty metadata entries currently + * in the metadata cache. Note that this list must be idendical + * across all processes, as all processes see the same stream + * of dirty metadata coming in, and use the same lists of + * candidate entries at each sync point. (At first glance, this * argument sounds circular, but think of it in the sense of * a recursive proof). * - * If this this list is empty, we are done, and the function + * If this this list is empty, we are done, and the function * returns * - * Otherwise, after the sorted list dirty metadata entries is - * constructed, each process uses the same algorithm to assign - * each entry on the candidate list to exactly one process for + * Otherwise, after the sorted list dirty metadata entries is + * constructed, each process uses the same algorithm to assign + * each entry on the candidate list to exactly one process for * flushing. * * At this point, all processes participate in a barrier to * avoid messages from the past/future bugs. * - * Each process then flushes the entries assigned to it, and + * Each process then flushes the entries assigned to it, and * marks all other entries on the candidate list as clean. * - * Finally, all processes participate in a second barrier to + * Finally, all processes participate in a second barrier to * avoid messages from the past/future bugs. * * At the end of this process, process 0 and only process 0 - * must tidy up its lists of dirtied and cleaned entries. + * must tidy up its lists of dirtied and cleaned entries. * These lists are not used in the distributed metadata write - * strategy, but they must be maintained should we shift + * strategy, but they must be maintained should we shift * to a strategy that uses them. * * Return: Success: non-negative @@ -1676,7 +1676,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); - /* first construct the candidate list -- initially, this will be in the + /* first construct the candidate list -- initially, this will be in the * form of a skip list. We will convert it later. */ if(H5C_construct_candidate_list__clean_cache(cache_ptr) < 0) @@ -1692,7 +1692,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.") /* Initial sync point barrier - * + * * When flushing from within the close operation from a file, * it's possible to skip this barrier (on the second flush of the cache). */ @@ -1715,7 +1715,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't apply candidate list.") /* this code exists primarily for the test bed -- it allows us to - * enforce posix semantics on the server that pretends to be a + * enforce posix semantics on the server that pretends to be a * file system in our parallel tests. */ if(aux_ptr->write_done) @@ -1752,45 +1752,45 @@ done: * Function: H5AC__rsp__dist_md_write__flush_to_min_clean * * Purpose: Routine for handling the details of running a sync point - * triggered by the accumulation of dirty metadata (as + * triggered by the accumulation of dirty metadata (as * opposed to a flush call to the API) when the distributed * metadata write strategy is selected. * * After invocation and initial sanity checking this function - * first checks to see if evictions are enabled -- if they + * first checks to see if evictions are enabled -- if they * are not, the function does nothing and returns. * - * Otherwise, process zero constructs a list of entries to + * Otherwise, process zero constructs a list of entries to * be flushed in order to bring the process zero cache back - * within its min clean requirement. Note that this list + * within its min clean requirement. Note that this list * (the candidate list) may be empty. * * Then, all processes participate in a barrier. * - * After the barrier, process 0 broadcasts the number of - * entries in the candidate list prepared above, and all + * After the barrier, process 0 broadcasts the number of + * entries in the candidate list prepared above, and all * other processes receive this number. * * If this number is zero, we are done, and the function * returns without further action. * - * Otherwise, process 0 broadcasts the sorted list of + * Otherwise, process 0 broadcasts the sorted list of * candidate entries, and all other processes receive it. * - * Then, each process uses the same algorithm to assign - * each entry on the candidate list to exactly one process + * Then, each process uses the same algorithm to assign + * each entry on the candidate list to exactly one process * for flushing. * - * Each process then flushes the entries assigned to it, and + * Each process then flushes the entries assigned to it, and * marks all other entries on the candidate list as clean. * - * Finally, all processes participate in a second barrier to + * Finally, all processes participate in a second barrier to * avoid messages from the past/future bugs. * * At the end of this process, process 0 and only process 0 - * must tidy up its lists of dirtied and cleaned entries. + * must tidy up its lists of dirtied and cleaned entries. * These lists are not used in the distributed metadata write - * strategy, but they must be maintained should we shift + * strategy, but they must be maintained should we shift * to a strategy that uses them. * * Return: Success: non-negative @@ -1846,25 +1846,25 @@ done: * * Purpose: Routine for handling the details of running a sync point * that is triggered a flush -- which in turn must have been - * triggered by either a flush API call or a file close -- - * when the process 0 only metadata write strategy is selected. + * triggered by either a flush API call or a file close -- + * when the process 0 only metadata write strategy is selected. * * First, all processes participate in a barrier. * * Then process zero flushes all dirty entries, and broadcasts - * they number of clean entries (if any) to all the other + * they number of clean entries (if any) to all the other * caches. * * If this number is zero, we are done. * - * Otherwise, process 0 broadcasts the list of cleaned + * Otherwise, process 0 broadcasts the list of cleaned * entries, and all other processes which are part of this * file group receive it, and mark the listed entries as * clean in their caches. * - * Since all processes have the same set of dirty + * Since all processes have the same set of dirty * entries at the beginning of the sync point, and all - * entries that will be written are written before + * entries that will be written are written before * process zero broadcasts the number of cleaned entries, * there is no need for a closing barrier. * @@ -1896,8 +1896,8 @@ H5AC__rsp__p0_only__flush(H5F_t *f) HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); - /* To prevent "messages from the future" we must - * synchronize all processes before we start the flush. + /* To prevent "messages from the future" we must + * synchronize all processes before we start the flush. * Hence the following barrier. * * However, when flushing from within the close operation from a file, @@ -1925,7 +1925,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") /* this code exists primarily for the test bed -- it allows us to - * enforce POSIX semantics on the server that pretends to be a + * enforce POSIX semantics on the server that pretends to be a * file system in our parallel tests. */ if(aux_ptr->write_done) @@ -1945,32 +1945,32 @@ done: * Function: H5AC__rsp__p0_only__flush_to_min_clean * * Purpose: Routine for handling the details of running a sync point - * triggered by the accumulation of dirty metadata (as + * triggered by the accumulation of dirty metadata (as * opposed to a flush call to the API) when the process 0 * only metadata write strategy is selected. * * After invocation and initial sanity checking this function - * first checks to see if evictions are enabled -- if they + * first checks to see if evictions are enabled -- if they * are not, the function does nothing and returns. * * Otherwise, all processes participate in a barrier. * - * After the barrier, if this is process 0, the function - * causes the cache to flush sufficient entries to get the - * cache back within its minimum clean fraction, and broadcast - * the number of entries which have been flushed since + * After the barrier, if this is process 0, the function + * causes the cache to flush sufficient entries to get the + * cache back within its minimum clean fraction, and broadcast + * the number of entries which have been flushed since * the last sync point, and are still clean. * * If this number is zero, we are done. * - * Otherwise, process 0 broadcasts the list of cleaned + * Otherwise, process 0 broadcasts the list of cleaned * entries, and all other processes which are part of this * file group receive it, and mark the listed entries as * clean in their caches. * - * Since all processes have the same set of dirty + * Since all processes have the same set of dirty * entries at the beginning of the sync point, and all - * entries that will be written are written before + * entries that will be written are written before * process zero broadcasts the number of cleaned entries, * there is no need for a closing barrier. * @@ -2026,9 +2026,9 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f) if(0 == aux_ptr->mpi_rank) { herr_t result; - /* here, process 0 flushes as many entries as necessary to + /* here, process 0 flushes as many entries as necessary to * comply with the currently specified min clean size. - * Note that it is quite possible that no entries will be + * Note that it is quite possible that no entries will be * flushed. */ @@ -2066,23 +2066,23 @@ done: * Function: H5AC__run_sync_point * * Purpose: Top level routine for managing a sync point between all - * meta data caches in the parallel case. Since all caches + * meta data caches in the parallel case. Since all caches * see the same sequence of dirty metadata, we simply count * bytes of dirty metadata, and run a sync point whenever the * number of dirty bytes of metadata seen since the last * sync point exceeds a threshold that is common across all - * processes. We also run sync points in response to + * processes. We also run sync points in response to * HDF5 API calls triggering either a flush or a file close. * - * In earlier versions of PHDF5, only the metadata cache with - * mpi rank 0 was allowed to write to file. All other + * In earlier versions of PHDF5, only the metadata cache with + * mpi rank 0 was allowed to write to file. All other * metadata caches on processes with rank greater than 0 were - * required to retain dirty entries until they were notified + * required to retain dirty entries until they were notified * that the entry is was clean. * - * This function was created to make it easier for us to - * experiment with other options, as it is a single point - * for the execution of sync points. + * This function was created to make it easier for us to + * experiment with other options, as it is a single point + * for the execution of sync points. * * Return: Success: non-negative * @@ -2197,13 +2197,13 @@ done: * * Purpose: In the distributed metadata write strategy, not all dirty * entries are written by process 0 -- thus we must tidy - * up the dirtied, and flushed and still clean lists + * up the dirtied, and flushed and still clean lists * maintained by process zero after each sync point. * * This procedure exists to tend to this issue. * * At this point, all entries that process 0 cleared should - * have been removed from both the dirty and flushed and + * have been removed from both the dirty and flushed and * still clean lists, and entries that process 0 has flushed * should have been removed from the dirtied list and added * to the flushed and still clean list. @@ -2214,7 +2214,7 @@ done: * them to be used should the metadata write strategy change * to one that uses these lists. * - * Thus for our purposes, all we need to do is remove from + * Thus for our purposes, all we need to do is remove from * the dirtied and flushed and still clean lists all * references to entries that appear in the candidate list. * @@ -2246,11 +2246,11 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, HDassert(num_candidates > 0); HDassert(candidates_list_ptr != NULL); - /* clean up dirtied and flushed and still clean lists by removing - * all entries on the candidate list. Cleared entries should - * have been removed from both the dirty and cleaned lists at - * this point, flushed entries should have been added to the - * cleaned list. However, for this metadata write strategy, + /* clean up dirtied and flushed and still clean lists by removing + * all entries on the candidate list. Cleared entries should + * have been removed from both the dirty and cleaned lists at + * this point, flushed entries should have been added to the + * cleaned list. However, for this metadata write strategy, * we just want to remove all references to the candidate entries. */ for(u = 0; u < num_candidates; u++) { @@ -2260,7 +2260,7 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, addr = candidates_list_ptr[u]; - /* addr may be either on the dirtied list, or on the flushed + /* addr may be either on the dirtied list, or on the flushed * and still clean list. Remove it. */ if(NULL != (d_slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)&addr))) diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 8997382..86ff385 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -153,23 +153,23 @@ H5FL_EXTERN(H5AC_aux_t); * * Update: When the above was written, I planned to allow the process * 0 metadata cache to write dirty metadata between sync points. - * However, testing indicated that this allowed occasional + * However, testing indicated that this allowed occasional * messages from the future to reach the caches on other processes. * * To resolve this, the code was altered to require that all metadata * writes take place during sync points -- which solved the problem. - * Initially all writes were performed by the process 0 cache. This + * Initially all writes were performed by the process 0 cache. This * approach was later replaced with a distributed write approach - * in which each process writes a subset of the metadata to be - * written. - * - * After thinking on the matter for a while, I arrived at the - * conclusion that the process 0 cache could be allowed to write - * dirty metadata between sync points if it restricted itself to - * entries that had been dirty at the time of the previous sync point. - * + * in which each process writes a subset of the metadata to be + * written. + * + * After thinking on the matter for a while, I arrived at the + * conclusion that the process 0 cache could be allowed to write + * dirty metadata between sync points if it restricted itself to + * entries that had been dirty at the time of the previous sync point. + * * To date, there has been no attempt to implement this optimization. - * However, should it be attempted, much of the supporting code + * However, should it be attempted, much of the supporting code * should still be around. * * JRM -- 1/6/15 @@ -206,14 +206,14 @@ H5FL_EXTERN(H5AC_aux_t); * broadcast. This field is reset to zero after each such * broadcast. * - * metadata_write_strategy: Integer code indicating how we will be - * writing the metadata. In the first incarnation of + * metadata_write_strategy: Integer code indicating how we will be + * writing the metadata. In the first incarnation of * this code, all writes were done from process 0. This - * field exists to facilitate experiments with other + * field exists to facilitate experiments with other * strategies. * * At present, this field must be set to either - * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY or + * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY or * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. * * dirty_bytes_propagations: This field only exists when the @@ -267,7 +267,7 @@ H5FL_EXTERN(H5AC_aux_t); * * Things have changed a bit since the following four fields were defined. * If metadata_write_strategy is H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, - * all comments hold as before -- with the caviate that pending further + * all comments hold as before -- with the caviate that pending further * coding, the process 0 metadata cache is forbidden to flush entries outside * of a sync point. * @@ -337,16 +337,16 @@ H5FL_EXTERN(H5AC_aux_t); * needed. * * Note: This field has been extended for use by all processes - * with the addition of support for the distributed - * metadata write strategy. + * with the addition of support for the distributed + * metadata write strategy. * JRM -- 5/9/10 * * sync_point_done: In the parallel test bed, it is necessary to verify * that the expected writes, and only the expected writes, * have taken place at the end of each sync point. * - * The sync_point_done callback allows t_cache to perform - * this verification. The field is set to NULL when the + * The sync_point_done callback allows t_cache to perform + * this verification. The field is set to NULL when the * callback is not needed. * * The following field supports the metadata cache image feature. @@ -402,7 +402,7 @@ typedef struct H5AC_aux_t void (* write_done)(void); - void (* sync_point_done)(unsigned num_writes, + void (* sync_point_done)(unsigned num_writes, haddr_t * written_entries_tbl); unsigned p0_image_len; diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 691f7c6..b932e16 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -88,18 +88,18 @@ typedef enum { * * Hence the following, somewhat odd set of #defines. * - * NOTE: test/cache plays games with the f->shared->cache, and thus - * setting H5AC_DUMP_STATS_ON_CLOSE will generate constant, - * irrelevant data when run with that test program. See + * NOTE: test/cache plays games with the f->shared->cache, and thus + * setting H5AC_DUMP_STATS_ON_CLOSE will generate constant, + * irrelevant data when run with that test program. See * comments on setup_cache() / takedown_cache() in test/cache_common.c. * for details. * * If you need to dump stats at file close in test/cache.c, - * use the dump_stats parameter to takedown_cache(), or call + * use the dump_stats parameter to takedown_cache(), or call * H5C_stats() directly. * JRM -- 4/12/15 * - * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much + * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much * the same way as H5AC_DUMP_STATS_ON_CLOSE. However, the set of stats * displayed is much smaller, and directed purely at the cache image feature. * @@ -419,7 +419,7 @@ H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr); /* Cache image routines */ -H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, +H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw); H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr); H5_DLL hbool_t H5AC_cache_image_pending(const H5F_t *f); diff --git a/src/H5Adense.c b/src/H5Adense.c index 7491dd2..a73fcc6 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -310,17 +310,17 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) HDassert(took_ownership); /* - * If there is an attribute already stored in "user_attr", - * we need to free the dynamially allocated spaces for the - * attribute, otherwise we got infinite loop closing library due to + * If there is an attribute already stored in "user_attr", + * we need to free the dynamially allocated spaces for the + * attribute, otherwise we got infinite loop closing library due to * outstanding allocation. (HDFFV-10659) * * This callback is used by H5A__dense_remove() to close/free the * attribute stored in "user_attr" (via H5O__msg_free_real()) after * the attribute node is deleted from the name index v2 B-tree. - * The issue is: - * When deleting the attribute node from the B-tree, - * if the attribute is found in the intermediate B-tree nodes, + * The issue is: + * When deleting the attribute node from the B-tree, + * if the attribute is found in the intermediate B-tree nodes, * which may be merged/redistributed, we need to free the dynamically * allocated spaces for the intermediate decoded attribute. */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index e0a0f55..dd5eae3 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -192,7 +192,7 @@ H5Aopen_name(hid_t loc_id, const char *name) { void *attr = NULL; /* attr object from VOL connector */ H5VL_object_t *vol_obj = NULL; /* Object of loc_id */ - H5VL_loc_params_t loc_params; + H5VL_loc_params_t loc_params; hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) diff --git a/src/H5B2.c b/src/H5B2.c index 6b0d7a3..c9ed303 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -507,7 +507,7 @@ H5B2_find(H5B2_t *bt2, void *udata, H5B2_found_t op, void *op_data) if((hdr->cls->compare)(udata, hdr->min_native_rec, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") if(cmp < 0) - HGOTO_DONE(FALSE) /* Less than the least record--not found */ + HGOTO_DONE(FALSE) /* Less than the least record--not found */ else if(cmp == 0) { /* Record is found */ if(op && (op)(hdr->min_native_rec, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") @@ -518,7 +518,7 @@ H5B2_find(H5B2_t *bt2, void *udata, H5B2_found_t op, void *op_data) if((hdr->cls->compare)(udata, hdr->max_native_rec, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") if(cmp > 0) - HGOTO_DONE(FALSE) /* Less than the least record--not found */ + HGOTO_DONE(FALSE) /* Less than the least record--not found */ else if(cmp == 0) { /* Record is found */ if(op && (op)(hdr->max_native_rec, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") @@ -1601,7 +1601,7 @@ done: * Function: H5B2_patch_file * * Purpose: Patch the top-level file pointer contained in bt2 - * to point to idx_info->f if they are different. + * to point to idx_info->f if they are different. * This is possible because the file pointer in bt2 can be * closed out if bt2 remains open. * diff --git a/src/H5B2int.c b/src/H5B2int.c index ea03ed6..53ac835 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -57,7 +57,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, +static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, void *old_parent, void *new_parent); @@ -1757,7 +1757,7 @@ H5B2__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(parent_entry); HDassert(child_entry); @@ -1794,7 +1794,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE - + /* Sanity checks */ HDassert(hdr); HDassert(depth > 0); @@ -1884,14 +1884,14 @@ done: */ static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, - const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, + const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, void *old_parent, void *new_parent) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - + /* Sanity checks */ HDassert(hdr); HDassert(depth > 1); @@ -1929,7 +1929,7 @@ H5B2__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(parent_entry); HDassert(child_entry); diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 92c802e..1fee0af 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -388,7 +388,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in size_t split_nrec; /* Number of records to split node at */ /* Locate node pointer for child */ - if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, + if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") if(cmp == 0) @@ -444,7 +444,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in /* Locate node pointer for child (after split/redistribute) */ /* Actually, this can be easily updated (for 2-node redistrib.) and shouldn't require re-searching */ - if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, + if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") if(cmp == 0) diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index c1221ba..1fde36d 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -1027,7 +1027,7 @@ done: *------------------------------------------------------------------------- */ H5_ATTR_PURE herr_t -H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, +H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_leaf_t H5_ATTR_NDEBUG_UNUSED *leaf) { /* General sanity checking on node */ diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 27229f1..338db5a 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -433,7 +433,7 @@ H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, +H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, diff --git a/src/H5B2test.c b/src/H5B2test.c index 0f4a39c..7affd49 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -562,7 +562,7 @@ H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) } /* end if */ /* Locate node pointer for child */ - if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, + if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") @@ -616,7 +616,7 @@ H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) } /* end if */ /* Locate record */ - if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, + if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") diff --git a/src/H5C.c b/src/H5C.c index 2a90bd1..91e4158 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -171,7 +171,7 @@ static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t * type, haddr_t addr, size_t *len, hbool_t actual); #if H5C_DO_SLIST_SANITY_CHECKS -static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, +static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr); #endif /* H5C_DO_SLIST_SANITY_CHECKS */ @@ -722,10 +722,10 @@ H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED * * Function: H5C_prep_for_file_close * - * Purpose: This function should be called just prior to the cache - * flushes at file close. There should be no protected + * Purpose: This function should be called just prior to the cache + * flushes at file close. There should be no protected * entries in the cache at this point. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -750,8 +750,8 @@ H5C_prep_for_file_close(H5F_t *f) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - /* For now at least, it is possible to receive the - * close warning more than once -- the following + /* For now at least, it is possible to receive the + * close warning more than once -- the following * if statement handles this. */ if(cache_ptr->close_warning_received) @@ -767,8 +767,8 @@ H5C_prep_for_file_close(H5F_t *f) #ifdef H5_HAVE_PARALLEL if ( ( H5F_INTENT(f) & H5F_ACC_RDWR ) && - ( ! image_generated ) && - ( cache_ptr->aux_ptr != NULL ) && + ( ! image_generated ) && + ( cache_ptr->aux_ptr != NULL ) && ( f->shared->fs_persist ) ) { /* If persistent free space managers are enabled, flushing the * metadata cache may result in the deletion, insertion, and/or @@ -1011,31 +1011,31 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Changes: Modified function to test for slist chamges in + * Changes: Modified function to test for slist chamges in * pre_serialize and serialize callbacks, and re-start * scans through the slist when such changes occur. * * This has been a potential problem for some time, - * and there has been code in this function to deal - * with elements of this issue. However the shift + * and there has been code in this function to deal + * with elements of this issue. However the shift * to the V3 cache in combination with the activities - * of some of the cache clients (in particular the + * of some of the cache clients (in particular the * free space manager and the fractal heap) have * made this re-work necessary. * * JRM -- 12/13/14 * - * Modified function to support rings. Basic idea is that + * Modified function to support rings. Basic idea is that * every entry in the cache is assigned to a ring. Entries - * in the outermost ring are flushed first, followed by - * those in the next outermost ring, and so on until the - * innermost ring is flushed. See header comment on - * H5C_ring_t in H5Cprivate.h for a more detailed + * in the outermost ring are flushed first, followed by + * those in the next outermost ring, and so on until the + * innermost ring is flushed. See header comment on + * H5C_ring_t in H5Cprivate.h for a more detailed * discussion. * * JRM -- 8/30/15 * - * Modified function to call the free space manager + * Modified function to call the free space manager * settling functions. * JRM -- 6/9/16 * @@ -1111,7 +1111,7 @@ H5C_flush_cache(H5F_t *f, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed") } /* end if */ else { - /* flush each ring, starting from the outermost ring and + /* flush each ring, starting from the outermost ring and * working inward. */ ring = H5C_RING_USER; @@ -2245,7 +2245,7 @@ H5C_protect(H5F_t * f, if(entry_ptr->prefetched) { /* This call removes the prefetched entry from the cache, - * and replaces it with an entry deserialized from the + * and replaces it with an entry deserialized from the * image of the prefetched entry. */ if(H5C__deserialize_prefetched_entry(f, cache_ptr, &entry_ptr, type, addr, udata) < 0) @@ -2314,7 +2314,7 @@ H5C_protect(H5F_t * f, if(cache_ptr->ignore_tags != TRUE) { haddr_t tag; /* Tag value */ - /* The entry is already in the cache, but make sure that the tag value + /* The entry is already in the cache, but make sure that the tag value * is still legal. This will ensure that had the entry NOT been in the * cache, tagging was still set up correctly and it would have received * a legal tag value after getting loaded from disk. @@ -2322,7 +2322,7 @@ H5C_protect(H5F_t * f, /* Get the tag */ tag = H5CX_get_tag(); - + if(H5C_verify_tag(entry_ptr->type->id, tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "tag verification failed") } /* end if */ @@ -2338,9 +2338,9 @@ H5C_protect(H5F_t * f, hit = FALSE; - if(NULL == (thing = H5C_load_entry(f, + if(NULL == (thing = H5C_load_entry(f, #ifdef H5_HAVE_PARALLEL - coll_access, + coll_access, #endif /* H5_HAVE_PARALLEL */ type, addr, udata))) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't load entry") @@ -2449,12 +2449,12 @@ H5C_protect(H5F_t * f, * ******************************************* * * Set the flush_last field - * of the newly loaded entry before inserting it into the - * index. Must do this, as the index tracked the number of - * entries with the flush_last field set, but assumes that + * of the newly loaded entry before inserting it into the + * index. Must do this, as the index tracked the number of + * entries with the flush_last field set, but assumes that * the field will not change after insertion into the index. * - * Note that this means that the H5C__FLUSH_LAST_FLAG flag + * Note that this means that the H5C__FLUSH_LAST_FLAG flag * is ignored if the entry is already in cache. */ entry_ptr->flush_me_last = flush_last; @@ -2486,7 +2486,7 @@ H5C_protect(H5F_t * f, HDassert(entry_ptr->ro_ref_count > 0); (entry_ptr->ro_ref_count)++; } /* end if */ - else + else HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Target already protected & not read only?!?") } /* end if */ else { @@ -2890,7 +2890,7 @@ done: * 3/22/06 * * Changes: Added extreme sanity checks on entry and exit. - JRM -- 4/26/14 + JRM -- 4/26/14 * *------------------------------------------------------------------------- */ @@ -3112,7 +3112,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) if(entry_ptr->flush_dep_nparents > 0) if(H5C__mark_flush_dep_dirty(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep dirty flag") - } /* end if */ + } /* end if */ /* Check for newly clean entry */ else if(!was_clean && !entry_ptr->is_dirty) { /* If the entry's type has a 'notify' callback send a 'entry cleaned' @@ -3969,8 +3969,8 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) HDassert( (cache_ptr->resize_ctl).min_clean_fraction <= (double)100.0f ); /* check to see if cache_ptr->resize_in_progress is TRUE. If it, this - * is a re-entrant call via a client callback called in the resize - * process. To avoid an infinite recursion, set reentrant_call to + * is a re-entrant call via a client callback called in the resize + * process. To avoid an infinite recursion, set reentrant_call to * TRUE, and goto done. */ if(cache_ptr->resize_in_progress) { @@ -5157,7 +5157,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) while(entry_ptr) { /* Check ring */ HDassert(entry_ptr->ring == H5C_RING_SB); - + /* Advance to next entry in pinned entry list */ entry_ptr = entry_ptr->next; } /* end while */ @@ -5199,7 +5199,7 @@ done: * until either the cache is empty, or the number of pinned * entries stops decreasing on each pass. * - * If flush dependencies appear in the target ring, the + * If flush dependencies appear in the target ring, the * function makes repeated passes through the cache flushing * entries in flush dependency order. * @@ -5252,8 +5252,8 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) /* The flush procedure here is a bit strange. * * In the outer while loop we make at least one pass through the - * cache, and then repeat until either all the pinned entries in - * the ring unpin themselves, or until the number of pinned entries + * cache, and then repeat until either all the pinned entries in + * the ring unpin themselves, or until the number of pinned entries * in the ring stops declining. In this later case, we scream and die. * * Since the fractal heap can dirty, resize, and/or move entries @@ -5309,9 +5309,9 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) /* There is also the possibility that entries will be * dirtied, resized, moved, and/or removed from the cache - * as the result of calls to the flush callbacks. We use - * the slist_len_increase and slist_size_increase increase - * fields in struct H5C_t to track these changes for purpose + * as the result of calls to the flush callbacks. We use + * the slist_len_increase and slist_size_increase increase + * fields in struct H5C_t to track these changes for purpose * of sanity checking. * * To this end, we must zero these fields before we start @@ -5326,8 +5326,8 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * This flag is set to TRUE by H5C__flush_single_entry if the slist * is modified by a pre_serialize, serialize, or notify callback. * - * H5C_flush_invalidate_ring() uses this flag to detect any - * modifications to the slist that might corrupt the scan of + * H5C_flush_invalidate_ring() uses this flag to detect any + * modifications to the slist that might corrupt the scan of * the slist -- and restart the scan in this event. */ cache_ptr->slist_changed = FALSE; @@ -5357,14 +5357,14 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) entry_ptr = next_entry_ptr; - /* It is possible that entries will be dirtied, resized, + /* It is possible that entries will be dirtied, resized, * flushed, or removed from the cache via the take ownership - * flag as the result of pre_serialize or serialized callbacks. - * + * flag as the result of pre_serialize or serialized callbacks. + * * This in turn can corrupt the scan through the slist. * - * We test for slist modifications in the pre_serialize - * and serialize callbacks, and restart the scan of the + * We test for slist modifications in the pre_serialize + * and serialize callbacks, and restart the scan of the * slist if we find them. However, best we do some extra * sanity checking just in case. */ @@ -5497,8 +5497,8 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) if((!entry_ptr->flush_me_last || (entry_ptr->flush_me_last && cache_ptr->num_last_entries >= cache_ptr->slist_len)) && entry_ptr->flush_dep_nchildren == 0 && entry_ptr->ring == ring) { if(entry_ptr->is_protected) { - /* we have major problems -- but lets flush and - * destroy everything we can before we flag an + /* we have major problems -- but lets flush and + * destroy everything we can before we flag an * error. */ protected_entries++; @@ -5506,9 +5506,9 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HDassert(!(entry_ptr->is_dirty)); } /* end if */ else if(!(entry_ptr->is_pinned)) { - /* if *entry_ptr is dirty, it is possible - * that one or more other entries may be - * either removed from the cache, loaded + /* if *entry_ptr is dirty, it is possible + * that one or more other entries may be + * either removed from the cache, loaded * into the cache, or moved to a new location * in the file as a side effect of the flush. * @@ -5517,14 +5517,14 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * entry, allowing it to be removed also and * invalidating the next_entry_ptr. * - * If either of these happen, and one of the target - * or proxy entries happens to be the next entry in + * If either of these happen, and one of the target + * or proxy entries happens to be the next entry in * the hash bucket, we could either find ourselves * either scanning a non-existant entry, scanning * through a different bucket, or skipping an entry. * - * Neither of these are good, so restart the - * the scan at the head of the hash bucket + * Neither of these are good, so restart the + * the scan at the head of the hash bucket * after the flush if we detect that the next_entry_ptr * becomes invalid. * @@ -5538,11 +5538,11 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed") /* Restart the index list scan if necessary. Must - * do this if the next entry is evicted, and also if + * do this if the next entry is evicted, and also if * one or more entries are inserted, loaded, or moved * as these operations can result in part of the scan * being skipped -- which can cause a spurious failure - * if this results in the size of the pinned entry + * if this results in the size of the pinned entry * failing to decline during the pass. */ if((NULL != next_entry_ptr && NULL == cache_ptr->entry_watched_for_removal) @@ -5585,7 +5585,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) entry_ptr = entry_ptr->next; } /* end while */ - /* Check if the number of pinned entries in the ring is positive, and + /* Check if the number of pinned entries in the ring is positive, and * it is not declining. Scream and die if so. */ if(cur_ring_pel_len > 0 && cur_ring_pel_len >= old_ring_pel_len) { @@ -5628,16 +5628,16 @@ done: /*------------------------------------------------------------------------- * Function: H5C__flush_ring * - * Purpose: Flush the entries contained in the specified cache and + * Purpose: Flush the entries contained in the specified cache and * ring. All entries in rings outside the specified ring * must have been flushed on entry. * * If the cache contains protected entries in the specified - * ring, the function will fail, as protected entries cannot + * ring, the function will fail, as protected entries cannot * be flushed. However all unprotected entries in the target * ring should be flushed before the function returns failure. * - * If flush dependencies appear in the target ring, the + * If flush dependencies appear in the target ring, the * function makes repeated passes through the slist flushing * entries in flush dependency order. * @@ -5703,10 +5703,10 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) /* Set the cache_ptr->slist_changed to false. * - * This flag is set to TRUE by H5C__flush_single_entry if the + * This flag is set to TRUE by H5C__flush_single_entry if the * slist is modified by a pre_serialize, serialize, or notify callback. * H5C_flush_cache uses this flag to detect any modifications - * to the slist that might corrupt the scan of the slist -- and + * to the slist that might corrupt the scan of the slist -- and * restart the scan in this event. */ cache_ptr->slist_changed = FALSE; @@ -5726,8 +5726,8 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * * To make things more entertaining, with the advent of the * fractal heap, the entry serialize callback can cause entries - * to be dirtied, resized, and/or moved. Also, the - * pre_serialize callback can result in an entry being + * to be dirtied, resized, and/or moved. Also, the + * pre_serialize callback can result in an entry being * removed from the cache via the take ownership flag. * * To deal with this, we first make note of the initial @@ -5778,24 +5778,24 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); } /* end if */ - + entry_ptr = next_entry_ptr; /* With the advent of the fractal heap, the free space * manager, and the version 3 cache, it is possible - * that the pre-serialize or serialize callback will - * dirty, resize, or take ownership of other entries - * in the cache. + * that the pre-serialize or serialize callback will + * dirty, resize, or take ownership of other entries + * in the cache. * * To deal with this, I have inserted code to detect any * change in the skip list not directly under the control * of this function. If such modifications are detected, - * we must re-start the scan of the skip list to avoid + * we must re-start the scan of the skip list to avoid * the possibility that the target of the next_entry_ptr * may have been flushed or deleted from the cache. * * To verify that all such possibilities have been dealt - * with, we do a bit of extra sanity checking on + * with, we do a bit of extra sanity checking on * entry_ptr. */ HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); @@ -5825,20 +5825,20 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) else next_entry_ptr = NULL; - if((!flush_marked_entries || entry_ptr->flush_marker) + if((!flush_marked_entries || entry_ptr->flush_marker) && (!entry_ptr->flush_me_last || - (entry_ptr->flush_me_last + (entry_ptr->flush_me_last && (cache_ptr->num_last_entries >= cache_ptr->slist_len - || (flush_marked_entries && entry_ptr->flush_marker)))) + || (flush_marked_entries && entry_ptr->flush_marker)))) && (entry_ptr->flush_dep_nchildren == 0 - || entry_ptr->flush_dep_ndirty_children == 0) + || entry_ptr->flush_dep_ndirty_children == 0) && entry_ptr->ring == ring) { HDassert(entry_ptr->flush_dep_nunser_children == 0); if(entry_ptr->is_protected) { - /* we probably have major problems -- but lets - * flush everything we can before we decide + /* we probably have major problems -- but lets + * flush everything we can before we decide * whether to flag an error. */ tried_to_flush_protected_entry = TRUE; @@ -5850,9 +5850,9 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if(cache_ptr->slist_changed) { /* The slist has been modified by something - * other than the simple removal of the + * other than the simple removal of the * of the flushed entry after the flush. - * + * * This has the potential to corrupt the * scan through the slist, so restart it. */ @@ -5980,11 +5980,11 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) else write_entry = FALSE; - /* if we have received close warning, and we have been instructed to + /* if we have received close warning, and we have been instructed to * generate a metadata cache image, and we have actually constructed * the entry images, set suppress_image_entry_frees to TRUE. * - * Set suppress_image_entry_writes to TRUE if indicated by the + * Set suppress_image_entry_writes to TRUE if indicated by the * image_ctl flags. */ if(cache_ptr->close_warning_received && cache_ptr->image_ctl.generate_image @@ -6063,11 +6063,11 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) } /* end if ( ! (entry_ptr->image_up_to_date) ) */ } /* end if */ - /* Finally, write the image to disk. - * - * Note that if the H5AC__CLASS_SKIP_WRITES flag is set in the + /* Finally, write the image to disk. + * + * Note that if the H5AC__CLASS_SKIP_WRITES flag is set in the * in the entry's type, we silently skip the write. This - * flag should only be used in test code. + * flag should only be used in test code. */ if(write_entry) { HDassert(entry_ptr->is_dirty); @@ -6079,8 +6079,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Write the image to disk unless the write is suppressed. * - * This happens if both suppress_image_entry_writes and - * entry_ptr->include_in_image are TRUE, or if the + * This happens if both suppress_image_entry_writes and + * entry_ptr->include_in_image are TRUE, or if the * H5AC__CLASS_SKIP_WRITES is set in the entry's type. This * flag should only be used in test code */ @@ -6113,7 +6113,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) #endif /* H5_HAVE_PARALLEL */ } /* end if */ - /* if the entry has a notify callback, notify it that we have + /* if the entry has a notify callback, notify it that we have * just flushed the entry. */ if(entry_ptr->type->notify && @@ -6125,7 +6125,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * made if it was appropriate to make them. Similarly, the entry * has been written to disk if desired. * - * Thus it is now safe to update the cache data structures for the + * Thus it is now safe to update the cache data structures for the * flush. */ @@ -6179,7 +6179,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * * 5) Remove it from the tag list for this object * - * Finally, if the destroy_entry flag is set, discard the + * Finally, if the destroy_entry flag is set, discard the * entry. */ H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL) @@ -6213,7 +6213,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* We are either doing a flush or a clear. * * A clear and a flush are the same from the point of - * view of the replacement policy and the slist. + * view of the replacement policy and the slist. * Hence no differentiation between them. * * JRM -- 7/7/07 @@ -6223,8 +6223,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) - /* mark the entry as clean and update the index for - * entry clean. Also, call the clear callback + /* mark the entry as clean and update the index for + * entry clean. Also, call the clear callback * if defined. */ entry_ptr->is_dirty = FALSE; @@ -6256,8 +6256,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) end before the entry_ptr gets freed */ entry_addr = entry_ptr->addr; - /* Internal cache data structures should now be up to date, and - * consistent with the status of the entry. + /* Internal cache data structures should now be up to date, and + * consistent with the status of the entry. * * Now discard the entry if appropriate. */ @@ -6266,18 +6266,18 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(0 == entry_ptr->flush_dep_nparents); /* if both suppress_image_entry_frees and entry_ptr->include_in_image - * are true, simply set entry_ptr->image_ptr to NULL, as we have + * are true, simply set entry_ptr->image_ptr to NULL, as we have * another pointer to the buffer in an instance of H5C_image_entry_t * in cache_ptr->image_entries. * * Otherwise, free the buffer if it exists. */ - if(suppress_image_entry_frees && entry_ptr->include_in_image) + if(suppress_image_entry_frees && entry_ptr->include_in_image) entry_ptr->image_ptr = NULL; else if(entry_ptr->image_ptr != NULL) entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); - /* If the entry is not a prefetched entry, verify that the flush + /* If the entry is not a prefetched entry, verify that the flush * dependency parents addresses array has been transferred. * * If the entry is prefetched, the free_isr routine will dispose of @@ -6288,8 +6288,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(NULL == entry_ptr->fd_parent_addrs); } /* end if */ - /* Check whether we should free the space in the file that - * the entry occupies + /* Check whether we should free the space in the file that + * the entry occupies */ if(free_file_space) { hsize_t fsf_size; @@ -6326,14 +6326,14 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Reset the pointer to the cache the entry is within. -QAK */ entry_ptr->cache_ptr = NULL; - /* increment entries_removed_counter and set - * last_entry_removed_ptr. As we are likely abuut to - * free the entry, recall that last_entry_removed_ptr + /* increment entries_removed_counter and set + * last_entry_removed_ptr. As we are likely abuut to + * free the entry, recall that last_entry_removed_ptr * must NEVER be dereferenced. * * Recall that these fields are maintained to allow functions - * that perform scans of lists of entries to detect the - * unexpected removal of entries (via expunge, eviction, + * that perform scans of lists of entries to detect the + * unexpected removal of entries (via expunge, eviction, * or take ownership at present), so that they can re-start * their scans if necessary. * @@ -6377,15 +6377,15 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(take_ownership); /* client is taking ownership of the entry. - * set bad magic here too so the cache will choke + * set bad magic here too so the cache will choke * unless the entry is re-inserted properly */ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; } /* end else */ } /* if (destroy) */ - /* Check if we have to update the page buffer with cleared entries - * so it doesn't go out of date + /* Check if we have to update the page buffer with cleared entries + * so it doesn't go out of date */ if(update_page_buffer) { /* Sanity check */ @@ -6402,9 +6402,9 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed") done: - HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( ! entry_ptr->flush_in_progress ) ); - HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( take_ownership ) || ( ! entry_ptr->is_dirty ) ); FUNC_LEAVE_NOAPI(ret_value) @@ -6421,7 +6421,7 @@ done: * If exceed, adjust 'len' accordingly. * * Verify that 'len' should not exceed eoa when 'actual' is - * true i.e. 'len' is the actual length from get_load_size + * true i.e. 'len' is the actual length from get_load_size * callback with non-null image pointer. * If exceed, return error. * @@ -6442,7 +6442,7 @@ H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, FUNC_ENTER_STATIC - /* if type == H5FD_MEM_GHEAP, H5F_block_read() forces + /* if type == H5FD_MEM_GHEAP, H5F_block_read() forces * type to H5FD_MEM_DRAW via its call to H5F__accum_read(). * Thus we do the same for purposes of computing the EOA * for sanity checks. @@ -6574,7 +6574,7 @@ H5C_load_entry(H5F_t * f, /* Get the # of read attempts */ max_tries = tries = H5F_GET_READ_ATTEMPTS(f); - /* + /* * This do/while loop performs the following till the metadata checksum * is correct or the file's number of allowed read attempts are reached. * --read the metadata @@ -6874,8 +6874,8 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) HDassert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); /* check to see if cache_ptr->msic_in_progress is TRUE. If it, this - * is a re-entrant call via a client callback called in the make - * space in cache process. To avoid an infinite recursion, set + * is a re-entrant call via a client callback called in the make + * space in cache process. To avoid an infinite recursion, set * reentrant_call to TRUE, and goto done. */ if(cache_ptr->msic_in_progress) { @@ -6947,9 +6947,9 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) } #endif /* H5C_COLLECT_CACHE_STATS */ - /* reset entries_removed_counter and - * last_entry_removed_ptr prior to the call to - * H5C__flush_single_entry() so that we can spot + /* reset entries_removed_counter and + * last_entry_removed_ptr prior to the call to + * H5C__flush_single_entry() so that we can spot * unexpected removals of entries from the cache, * and set the restart_scan flag if proceeding * would be likely to cause us to scan an entry @@ -6966,7 +6966,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) restart_scan = TRUE; - } else if ( (cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size + } else if ( (cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size #ifdef H5_HAVE_PARALLEL && !(entry_ptr->coll_access) #endif /* H5_HAVE_PARALLEL */ @@ -7124,7 +7124,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) prev_ptr = entry_ptr->aux_prev; - if ( ( !(entry_ptr->prefetched_dirty) ) + if ( ( !(entry_ptr->prefetched_dirty) ) #ifdef H5_HAVE_PARALLEL && ( ! (entry_ptr->coll_access) ) #endif /* H5_HAVE_PARALLEL */ @@ -7174,7 +7174,7 @@ done: * * Changes: * - * Added code to verify that the LRU contains no pinned + * Added code to verify that the LRU contains no pinned * entries. JRM -- 4/25/14 * *------------------------------------------------------------------------- @@ -7254,7 +7254,7 @@ H5C_validate_lru_list(H5C_t * cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") } - if ( ( entry_ptr->is_pinned ) || + if ( ( entry_ptr->is_pinned ) || ( entry_ptr->pinned_from_client ) || ( entry_ptr->pinned_from_cache ) ) { @@ -7290,7 +7290,7 @@ done: * * Function: H5C_validate_pinned_entry_list * - * Purpose: Debugging function that scans the pinned entry list for + * Purpose: Debugging function that scans the pinned entry list for * errors. * * If an error is detected, the function generates a @@ -7422,7 +7422,7 @@ done: * * Function: H5C_validate_protected_entry_list * - * Purpose: Debugging function that scans the protected entry list for + * Purpose: Debugging function that scans the protected entry list for * errors. * * If an error is detected, the function generates a @@ -7547,11 +7547,11 @@ done: * * Function: H5C_entry_in_skip_list * - * Purpose: Debugging function that scans skip list to see if it - * is in present. We need this, as it is possible for + * Purpose: Debugging function that scans skip list to see if it + * is in present. We need this, as it is possible for * an entry to be in the skip list twice. * - * Return: FALSE if the entry is not in the skip list, and TRUE + * Return: FALSE if the entry is not in the skip list, and TRUE * if it is. * * Programmer: John Mainzer, 11/1/14 @@ -7617,7 +7617,7 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) */ herr_t H5C__flush_marked_entries(H5F_t * f) -{ +{ herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -7639,7 +7639,7 @@ done: * Function: H5C_cork * * Purpose: To cork/uncork/get cork status of an object depending on "action": - * H5C__SET_CORK: + * H5C__SET_CORK: * To cork the object * Return error if the object is already corked * H5C__UNCORK: @@ -7648,7 +7648,7 @@ done: * H5C__GET_CORKED: * To retrieve the cork status of an object in * the parameter "corked" - * + * * Return: Success: Non-negative * Failure: Negative * @@ -7658,7 +7658,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) +H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) { H5C_tag_info_t *tag_info; /* Points to a tag info struct */ herr_t ret_value = SUCCEED; @@ -7840,8 +7840,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__mark_flush_dep_serialized() * - * Purpose: Decrement the flush_dep_nunser_children fields of all the - * target entry's flush dependency parents in response to + * Purpose: Decrement the flush_dep_nunser_children fields of all the + * target entry's flush dependency parents in response to * the target entry becoming serialized. * * Return: Non-negative on success/Negative on failure @@ -7890,7 +7890,7 @@ done: * Function: H5C__mark_flush_dep_unserialized() * * Purpose: Increment the flush_dep_nunser_children fields of all the - * target entry's flush dependency parents in response to + * target entry's flush dependency parents in response to * the target entry becoming unserialized. * * Return: Non-negative on success/Negative on failure @@ -7916,7 +7916,7 @@ H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr) /* Sanity check */ HDassert(entry_ptr->flush_dep_parent); HDassert(entry_ptr->flush_dep_parent[u]->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children < + HDassert(entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children < entry_ptr->flush_dep_parent[u]->flush_dep_nchildren); /* increment parents number of usserialized children */ @@ -7976,11 +7976,11 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, /*------------------------------------------------------------------------- * Function: H5C__serialize_cache * - * Purpose: Serialize (i.e. construct an on disk image) for all entries - * in the metadata cache including clean entries. + * Purpose: Serialize (i.e. construct an on disk image) for all entries + * in the metadata cache including clean entries. * * Note that flush dependencies and "flush me last" flags - * must be observed in the serialization process. + * must be observed in the serialization process. * * Note also that entries may be loaded, flushed, evicted, * expunged, relocated, resized, or removed from the cache @@ -7988,17 +7988,17 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, * a regular flush. * * However, we are given that the cache will contain no protected - * entries on entry to this routine (although entries may be - * briefly protected and then unprotected during the serialize - * process). + * entries on entry to this routine (although entries may be + * briefly protected and then unprotected during the serialize + * process). * - * The objective of this routine is serialize all entries and - * to force all entries into their actual locations on disk. + * The objective of this routine is serialize all entries and + * to force all entries into their actual locations on disk. * - * The initial need for this routine is to settle all entries - * in the cache prior to construction of the metadata cache + * The initial need for this routine is to settle all entries + * in the cache prior to construction of the metadata cache * image so that the size of the cache image can be calculated. - * However, I gather that other uses for the routine are + * However, I gather that other uses for the routine are * under consideration. * * Return: Non-negative on success/Negative on failure or if there was @@ -8069,10 +8069,10 @@ H5C__serialize_cache(H5F_t *f) #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ #ifndef NDEBUG - /* if this is a debug build, set the serialization_count field of + /* if this is a debug build, set the serialization_count field of * each entry in the cache to zero before we start the serialization. * This allows us to detect the case in which any entry is serialized - * more than once (a performance issues), and more importantly, the + * more than once (a performance issues), and more importantly, the * case is which any flush depencency parent is serializes more than * once (a correctness issue). */ @@ -8088,10 +8088,10 @@ H5C__serialize_cache(H5F_t *f) } /* end block */ #endif /* NDEBUG */ - /* set cache_ptr->serialization_in_progress to TRUE, and back + /* set cache_ptr->serialization_in_progress to TRUE, and back * to FALSE at the end of the function. Must maintain this flag - * to support H5C_get_serialization_in_progress(), which is in - * turn required to support sanity checking in some cache + * to support H5C_get_serialization_in_progress(), which is in + * turn required to support sanity checking in some cache * clients. */ HDassert(!cache_ptr->serialization_in_progress); @@ -8169,16 +8169,16 @@ done: * * If the cache contains protected entries in the specified * ring, the function will fail, as protected entries cannot - * be serialized. However all unprotected entries in the - * target ring should be serialized before the function + * be serialized. However all unprotected entries in the + * target ring should be serialized before the function * returns failure. * * If flush dependencies appear in the target ring, the * function makes repeated passes through the index list * serializing entries in flush dependency order. * - * All entries outside the H5C_RING_SBE are marked for - * inclusion in the cache image. Entries in H5C_RING_SBE + * All entries outside the H5C_RING_SBE are marked for + * inclusion in the cache image. Entries in H5C_RING_SBE * and below are marked for exclusion from the image. * * Return: Non-negative on success/Negative on failure or if there was @@ -8213,76 +8213,76 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) /* The objective here is to serialize all entries in the cache ring * in flush dependency order. * - * The basic algorithm is to scan the cache index list looking for + * The basic algorithm is to scan the cache index list looking for * unserialized entries that are either not in a flush dependency * relationship, or which have no unserialized children. Any such - * entry is serialized and its flush dependency parents (if any) are + * entry is serialized and its flush dependency parents (if any) are * informed -- allowing them to decrement their userialized child counts. * * However, this algorithm is complicated by the ability - * of client serialization callbacks to perform operations on - * on the cache which can result in the insertion, deletion, + * of client serialization callbacks to perform operations on + * on the cache which can result in the insertion, deletion, * relocation, resize, dirty, flush, eviction, or removal (via the * take ownership flag) of entries. Changes in the flush dependency * structure are also possible. * - * On the other hand, the algorithm is simplified by the fact that - * we are serializing, not flushing. Thus, as long as all entries + * On the other hand, the algorithm is simplified by the fact that + * we are serializing, not flushing. Thus, as long as all entries * are serialized correctly, it doesn't matter if we have to go back * and serialize an entry a second time. * - * These possible actions result in the following modfications to + * These possible actions result in the following modfications to * tha basic algorithm: * - * 1) In the event of an entry expunge, eviction or removal, we must - * restart the scan as it is possible that the next entry in our + * 1) In the event of an entry expunge, eviction or removal, we must + * restart the scan as it is possible that the next entry in our * scan is no longer in the cache. Were we to examine this entry, * we would be accessing deallocated memory. * - * 2) A resize, dirty, or insertion of an entry may result in the - * the increment of a flush dependency parent's dirty and/or - * unserialized child count. In the context of serializing the - * the cache, this is a non-issue, as even if we have already - * serialized the parent, it will be marked dirty and its image - * marked out of date if appropriate when the child is serialized. - * + * 2) A resize, dirty, or insertion of an entry may result in the + * the increment of a flush dependency parent's dirty and/or + * unserialized child count. In the context of serializing the + * the cache, this is a non-issue, as even if we have already + * serialized the parent, it will be marked dirty and its image + * marked out of date if appropriate when the child is serialized. + * * However, this is a major issue for a flush, as were this to happen * in a flush, it would violate the invariant that the flush dependency - * feature is intended to enforce. As the metadata cache has no - * control over the behavior of cache clients, it has no way of + * feature is intended to enforce. As the metadata cache has no + * control over the behavior of cache clients, it has no way of * preventing this behaviour. However, it should detect it if at all - * possible. + * possible. * * Do this by maintaining a count of the number of times each entry is - * serialized during a cache serialization. If any flush dependency + * serialized during a cache serialization. If any flush dependency * parent is serialized more than once, throw an assertion failure. * - * 3) An entry relocation will typically change the location of the - * entry in the index list. This shouldn't cause problems as we - * will scan the index list until we make a complete pass without - * finding anything to serialize -- making relocations of either + * 3) An entry relocation will typically change the location of the + * entry in the index list. This shouldn't cause problems as we + * will scan the index list until we make a complete pass without + * finding anything to serialize -- making relocations of either * the current or next entries irrelevant. * - * Note that since a relocation may result in our skipping part of + * Note that since a relocation may result in our skipping part of * the index list, we must always do at least one more pass through * the index list after an entry relocation. * - * 4) Changes in the flush dependency structure are possible on + * 4) Changes in the flush dependency structure are possible on * entry insertion, load, expunge, evict, or remove. Destruction - * of a flush dependency has no effect, as it can only relax the + * of a flush dependency has no effect, as it can only relax the * flush dependencies. Creation of a flush dependency can create - * an unserialized child of a flush dependency parent where all + * an unserialized child of a flush dependency parent where all * flush dependency children were previously serialized. Should * this child dirty the flush dependency parent when it is serialized, * the parent will be re-serialized. * - * Per the discussion of 2) above, this is a non issue for cache + * Per the discussion of 2) above, this is a non issue for cache * serialization, and a major problem for cache flush. Using the - * same detection mechanism, throw an assertion failure if this - * condition appears. + * same detection mechanism, throw an assertion failure if this + * condition appears. * - * Observe that either eviction or removal of entries as a result of - * a serialization is not a problem as long as the flush depencency + * Observe that either eviction or removal of entries as a result of + * a serialization is not a problem as long as the flush depencency * tree does not change beyond the removal of a leaf. */ while(!done) { @@ -8300,7 +8300,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); /* Verify that either the entry is already serialized, or - * that it is assigned to either the target or an inner + * that it is assigned to either the target or an inner * ring. */ HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); @@ -8367,9 +8367,9 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) cache_ptr->entries_relocated_counter = 0; /* At this point, all entries not marked "flush me last" and in - * the current ring or outside it should be serialized and have up - * to date images. Scan the index list again to serialize the - * "flush me last" entries (if they are in the current ring) and to + * the current ring or outside it should be serialized and have up + * to date images. Scan the index list again to serialize the + * "flush me last" entries (if they are in the current ring) and to * verify that all other entries have up to date images. */ entry_ptr = cache_ptr->il_head; @@ -8422,7 +8422,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__serialize_single_entry * - * Purpose: Serialize the cache entry pointed to by the entry_ptr + * Purpose: Serialize the cache entry pointed to by the entry_ptr * parameter. * * Return: Non-negative on success/Negative on failure @@ -8487,12 +8487,12 @@ done: * Purpose: Serialize an entry and generate its image. * * Note: This may cause the entry to be re-sized and/or moved in - * the cache. + * the cache. * - * As we will not update the metadata cache's data structures - * until we we finish the write, we must touch up these - * data structures for size and location changes even if we - * are about to delete the entry from the cache (i.e. on a + * As we will not update the metadata cache's data structures + * until we we finish the write, we must touch up these + * data structures for size and location changes even if we + * are about to delete the entry from the cache (i.e. on a * flush destroy). * * Return: Non-negative on success/Negative on failure @@ -8528,7 +8528,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) old_addr = entry_ptr->addr; /* Call client's pre-serialize callback, if there's one */ - if(entry_ptr->type->pre_serialize && + if(entry_ptr->type->pre_serialize && (entry_ptr->type->pre_serialize)(f, (void *)entry_ptr, entry_ptr->addr, entry_ptr->size, &new_addr, &new_len, &serialize_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to pre-serialize entry") @@ -8596,7 +8596,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) */ H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); - /* As we haven't updated the cache data structures for + /* As we haven't updated the cache data structures for * for the flush or flush destroy yet, the entry should * be in the slist. Thus update it for the size change. */ @@ -8608,8 +8608,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) entry_ptr->size = new_len; } /* end if */ - /* If required, udate the entry and the cache data structures - * for a move + /* If required, udate the entry and the cache data structures + * for a move */ if(serialize_flags & H5C__SERIALIZE_MOVED_FLAG) { /* Update stats and entries relocated counter */ @@ -8641,7 +8641,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ entry_ptr->image_up_to_date = TRUE; - /* Propagate the fact that the entry is serialized up the + /* Propagate the fact that the entry is serialized up the * flush dependency chain if appropriate. Since the image must * have been out of date for this function to have been called * (see assertion on entry), no need to check that -- only check @@ -8766,8 +8766,8 @@ H5C_remove_entry(void *_entry) if(entry == cache->entry_watched_for_removal) cache->entry_watched_for_removal = NULL; - /* Internal cache data structures should now be up to date, and - * consistent with the status of the entry. + /* Internal cache data structures should now be up to date, and + * consistent with the status of the entry. * * Now clean up internal cache fields if appropriate. */ diff --git a/src/H5CX.c b/src/H5CX.c index 160aa84..df335ea 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -706,7 +706,7 @@ H5CX__get_context(void) /* No associated value with current thread - create one */ #ifdef H5_HAVE_WIN_THREADS /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ - ctx = (H5CX_node_t **)LocalAlloc(LPTR, sizeof(H5CX_node_t *)); + ctx = (H5CX_node_t **)LocalAlloc(LPTR, sizeof(H5CX_node_t *)); #else /* Use HDmalloc here since this has to match the HDfree in the * destructor and we want to avoid the codestack there. @@ -1784,7 +1784,7 @@ H5CX_get_mpi_file_flushing(void) /*------------------------------------------------------------------------- - * Function: H5CX_get_mpio_rank0_bcast + * Function: H5CX_get_mpio_rank0_bcast * * Purpose: Retrieves if the dataset meets read-with-rank0-and-bcast requirements for the current API call context. * @@ -3120,7 +3120,7 @@ H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chun /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); /* Cache the value for later, marking it to set in DXPL when context popped */ @@ -3152,7 +3152,7 @@ H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t mpio_actual_io_mode) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); /* Cache the value for later, marking it to set in DXPL when context popped */ @@ -3256,7 +3256,7 @@ H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) @@ -3290,7 +3290,7 @@ H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) @@ -3324,7 +3324,7 @@ H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) @@ -3358,7 +3358,7 @@ H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) @@ -3392,7 +3392,7 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_c /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) @@ -3426,7 +3426,7 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_in /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) @@ -3460,7 +3460,7 @@ H5CX_test_set_mpio_coll_rank0_bcast(hbool_t mpio_coll_rank0_bcast) /* Sanity checks */ HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_RANK0_BCAST_NAME, mpio_coll_rank0_bcast) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index cb1d0e2..d5599f2 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -185,7 +185,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_dump_cache_LRU * - * Purpose: Print a summary of the contents of the metadata cache + * Purpose: Print a summary of the contents of the metadata cache * LRU for debugging purposes. * * Return: Non-negative on success/Negative on failure @@ -209,9 +209,9 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) HDassert(cache_name != NULL ); HDfprintf(stdout, "\n\nDump of metadata cache LRU \"%s\"\n", cache_name); - HDfprintf(stdout, "LRU len = %d, LRU size = %d\n", + HDfprintf(stdout, "LRU len = %d, LRU size = %d\n", cache_ptr->LRU_list_len, (int)(cache_ptr->LRU_list_size)); - HDfprintf(stdout, "index_size = %d, max_cache_size = %d, delta = %d\n\n", + HDfprintf(stdout, "index_size = %d, max_cache_size = %d, delta = %d\n\n", (int)(cache_ptr->index_size), (int)(cache_ptr->max_cache_size), (int)(cache_ptr->max_cache_size) - (int)(cache_ptr->index_size)); @@ -238,12 +238,12 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) if(NULL == entry_ptr->tag_info) HDfprintf(stdout, " %16s ", "N/A"); else - HDfprintf(stdout, " 0x%16llx ", + HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag)); HDfprintf(stdout, " %5lld ", (long long)(entry_ptr->size)); HDfprintf(stdout, " %d ", (int)(entry_ptr->ring)); - HDfprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), + HDfprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), (entry_ptr->type->name)); HDfprintf(stdout, " %d", (int)(entry_ptr->is_dirty)); HDfprintf(stdout, "\n"); @@ -262,8 +262,8 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) /*------------------------------------------------------------------------- * Function: H5C_dump_cache_skip_list * - * Purpose: Debugging routine that prints a summary of the contents of - * the skip list used by the metadata cache metadata cache to + * Purpose: Debugging routine that prints a summary of the contents of + * the skip list used by the metadata cache metadata cache to * maintain an address sorted list of dirty entries. * * Return: Non-negative on success/Negative on failure @@ -343,9 +343,9 @@ 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 + * 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 @@ -381,7 +381,7 @@ H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn) list_len = (int)H5SL_count(cache_ptr->coll_write_list); - HDfprintf(stdout, "\n\nDumping MDC coll write list from %d:%s.\n", + 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); @@ -773,7 +773,7 @@ H5C_stats(H5C_t * cache_ptr, (((double)(cache_ptr->total_dirty_pf_entries_skipped_in_msic)) / ((double)(cache_ptr->calls_to_msic))); - HDfprintf(stdout, + HDfprintf(stdout, "%s MSIC: Average/max dirty pf entries skipped = %lf / %ld\n", cache_ptr->prefix, average_dirty_pf_entries_skipped_per_call_to_msic, @@ -798,9 +798,9 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->total_entries_scanned_in_msic - cache_ptr->entries_scanned_to_make_space)); - HDfprintf(stdout, + HDfprintf(stdout, "%s slist/LRU/index scan restarts = %lld / %lld / %lld.\n", - cache_ptr->prefix, + cache_ptr->prefix, (long long)(cache_ptr->slist_scan_restarts), (long long)(cache_ptr->LRU_scan_restarts), (long long)(cache_ptr->index_scan_restarts)); @@ -827,7 +827,7 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID])); if(cache_ptr->prefetches > 0) - prefetch_use_rate = + prefetch_use_rate = (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches)); else @@ -886,7 +886,7 @@ H5C_stats(H5C_t * cache_ptr, (int)(cache_ptr->max_read_protects[i])); HDfprintf(stdout, - "%s clears / flushes = %ld / %ld\n", + "%s clears / flushes = %ld / %ld\n", cache_ptr->prefix, (long)(cache_ptr->clears[i]), (long)(cache_ptr->flushes[i])); @@ -1158,21 +1158,21 @@ H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, /*------------------------------------------------------------------------- * Function: H5C_flush_dependency_exists() * - * Purpose: Test to see if a flush dependency relationship exists - * between the supplied parent and child. Both parties + * Purpose: Test to see if a flush dependency relationship exists + * between the supplied parent and child. Both parties * are indicated by addresses so as to avoid the necessity - * of protect / unprotect calls prior to this call. + * of protect / unprotect calls prior to this call. * - * If either the parent or the child is not in the metadata + * If either the parent or the child is not in the metadata * cache, the function sets *fd_exists_ptr to FALSE. * - * If both are in the cache, the childs list of parents is + * If both are in the cache, the childs list of parents is * searched for the proposed parent. If the proposed parent * is found in the childs parent list, the function sets - * *fd_exists_ptr to TRUE. In all other non-error cases, + * *fd_exists_ptr to TRUE. In all other non-error cases, * the function sets *fd_exists_ptr FALSE. * - * Return: SUCCEED on success/FAIL on failure. Note that + * Return: SUCCEED on success/FAIL on failure. Note that * *fd_exists_ptr is undefined on failure. * * Programmer: John Mainzer @@ -1355,30 +1355,30 @@ done: * * Function: H5C_get_entry_ptr_from_addr() * - * Purpose: Debugging function that attempts to look up an entry in the - * cache by its file address, and if found, returns a pointer - * to the entry in *entry_ptr_ptr. If the entry is not in the + * Purpose: Debugging function that attempts to look up an entry in the + * cache by its file address, and if found, returns a pointer + * to the entry in *entry_ptr_ptr. If the entry is not in the * cache, *entry_ptr_ptr is set to NULL. * - * WARNING: This call should be used only in debugging - * routines, and it should be avoided when + * WARNING: This call should be used only in debugging + * routines, and it should be avoided when * possible. * - * Further, if we ever multi-thread the cache, - * this routine will have to be either discarded + * Further, if we ever multi-thread the cache, + * this routine will have to be either discarded * or heavily re-worked. * - * Finally, keep in mind that the entry whose - * pointer is obtained in this fashion may not - * be in a stable state. + * Finally, keep in mind that the entry whose + * pointer is obtained in this fashion may not + * be in a stable state. * * Note that this function is only defined if NDEBUG * is not defined. * - * As heavy use of this function is almost certainly a - * bad idea, the metadata cache tracks the number of - * successful calls to this function, and (if - * H5C_DO_SANITY_CHECKS is defined) displays any + * As heavy use of this function is almost certainly a + * bad idea, the metadata cache tracks the number of + * successful calls to this function, and (if + * H5C_DO_SANITY_CHECKS is defined) displays any * non-zero count on cache shutdown. * * Return: FAIL if error is detected, SUCCEED otherwise. @@ -1425,7 +1425,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_serialization_in_progress * - * Purpose: Return the current value of + * Purpose: Return the current value of * cache_ptr->serialization_in_progress. * * Return: Current value of cache_ptr->serialization_in_progress. @@ -1454,7 +1454,7 @@ H5C_get_serialization_in_progress(const H5C_t *cache_ptr) * * Function: H5C_cache_is_clean() * - * Purpose: Debugging function that verifies that all rings in the + * Purpose: Debugging function that verifies that all rings in the * metadata cache are clean from the outermost ring, inwards * to the inner ring specified. * @@ -1499,16 +1499,16 @@ done: * * Function: H5C_verify_entry_type() * - * Purpose: Debugging function that attempts to look up an entry in the + * Purpose: Debugging function that attempts to look up an entry in the * cache by its file address, and if found, test to see if its * type field contains the expted value. * * If the specified entry is in cache, *in_cache_ptr is set - * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending - * on whether the entries type field matches the expected_type + * to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending + * on whether the entries type field matches the expected_type * parameter. * - * If the target entry is not in cache, *in_cache_ptr is + * If the target entry is not in cache, *in_cache_ptr is * set to FALSE, and *type_ok_ptr is undefined. * * Note that this function is only defined if NDEBUG diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index 8bcab9f..6451019 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -58,7 +58,7 @@ static herr_t H5C__epoch_marker_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr); static herr_t H5C__epoch_marker_get_final_load_size(const void *image_ptr, size_t image_len_ptr, void *udata_ptr, size_t *actual_len); -static htri_t H5C__epoch_marker_verify_chksum(const void *image_ptr, +static htri_t H5C__epoch_marker_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void * H5C__epoch_marker_deserialize(const void * image_ptr, size_t len, void * udata, hbool_t * dirty_ptr); @@ -71,7 +71,7 @@ static herr_t H5C__epoch_marker_serialize(const H5F_t *f, void * image_ptr, size_t len, void * thing); static herr_t H5C__epoch_marker_notify(H5C_notify_action_t action, void *thing); static herr_t H5C__epoch_marker_free_icr(void * thing); -static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, +static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, hsize_t H5_ATTR_UNUSED * fsf_size_ptr); @@ -143,8 +143,8 @@ H5C__epoch_marker_get_final_load_size(const void H5_ATTR_UNUSED *image_ptr, } /* end H5C__epoch_marker_final_get_load_size() */ -static htri_t -H5C__epoch_marker_verify_chksum(const void H5_ATTR_UNUSED *image_ptr, size_t H5_ATTR_UNUSED len, +static htri_t +H5C__epoch_marker_verify_chksum(const void H5_ATTR_UNUSED *image_ptr, size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED *udata_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ @@ -228,7 +228,7 @@ H5C__epoch_marker_free_icr(void H5_ATTR_UNUSED * thing) } /* end H5C__epoch_marker_free_icr() */ -static herr_t +static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, hsize_t H5_ATTR_UNUSED *fsf_size_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index db44c7a..ee286d9 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -102,11 +102,11 @@ static herr_t H5C__decode_cache_image_header(const H5F_t *f, static herr_t H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, const uint8_t **buf, unsigned entry_num); #endif /* NDEBUG */ /* only used in assertions */ -static herr_t H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, +static herr_t H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_entry_ptr, H5C_cache_entry_t **fd_children); static herr_t H5C__encode_cache_image_header(const H5F_t *f, const H5C_t *cache_ptr, uint8_t **buf); -static herr_t H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, +static herr_t H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, unsigned entry_num); static herr_t H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr); static void H5C__prep_for_file_close__compute_fd_heights_real( @@ -146,8 +146,8 @@ H5FL_DEFINE(H5C_cache_entry_t); * * Function: H5C_cache_image_pending() * - * Purpose: Tests to see if the load of a metadata cache image - * load is pending (i.e. will be executed on the next + * Purpose: Tests to see if the load of a metadata cache image + * load is pending (i.e. will be executed on the next * protect or insert) * * Returns TRUE if a cache image load is pending, and FALSE @@ -179,16 +179,16 @@ H5C_cache_image_pending(const H5C_t *cache_ptr) /*------------------------------------------------------------------------- * Function: H5C_cache_image_status() * - * Purpose: Examine the metadata cache associated with the supplied - * instance of H5F_t to determine whether the load of a - * cache image has either been queued or executed, and if + * Purpose: Examine the metadata cache associated with the supplied + * instance of H5F_t to determine whether the load of a + * cache image has either been queued or executed, and if * construction of a cache image has been requested. * * This done, it set *load_ci_ptr to TRUE if a cache image * has either been loaded or a load has been requested, and * to FALSE otherwise. * - * Similarly, set *write_ci_ptr to TRUE if construction of + * Similarly, set *write_ci_ptr to TRUE if construction of * a cache image has been requested, and to FALSE otherwise. * * Return: SUCCEED on success, and FAIL on failure. @@ -213,7 +213,7 @@ H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(load_ci_ptr); HDassert(write_ci_ptr); - + *load_ci_ptr = cache_ptr->load_image || cache_ptr->image_loaded; *write_ci_ptr = cache_ptr->image_ctl.generate_image; @@ -224,7 +224,7 @@ H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr) /*------------------------------------------------------------------------- * Function: H5C__construct_cache_image_buffer() * - * Purpose: Allocate a buffer of size cache_ptr->image_len, and + * Purpose: Allocate a buffer of size cache_ptr->image_len, and * load it with an image of the metadata cache image block. * * Note that by the time this function is called, the cache @@ -330,7 +330,7 @@ H5C__construct_cache_image_buffer(H5F_t * f, H5C_t *cache_ptr) HDassert((cache_ptr->image_entries)[u].type_id == (fake_cache_ptr->image_entries)[u].type_id); HDassert((cache_ptr->image_entries)[u].lru_rank == (fake_cache_ptr->image_entries)[u].lru_rank); HDassert((cache_ptr->image_entries)[u].is_dirty == (fake_cache_ptr->image_entries)[u].is_dirty); - /* don't check image_fd_height as it is not stored in + /* don't check image_fd_height as it is not stored in * the metadata cache image block. */ HDassert((cache_ptr->image_entries)[u].fd_child_count == (fake_cache_ptr->image_entries)[u].fd_child_count); @@ -346,7 +346,7 @@ H5C__construct_cache_image_buffer(H5F_t * f, H5C_t *cache_ptr) (fake_cache_ptr->image_entries)[u].fd_parent_addrs = (haddr_t *)H5MM_xfree((fake_cache_ptr->image_entries)[u].fd_parent_addrs); (fake_cache_ptr->image_entries)[u].fd_parent_count = 0; } /* end if */ - else + else HDassert((fake_cache_ptr->image_entries)[u].fd_parent_count == 0); HDassert((cache_ptr->image_entries)[u].image_ptr); @@ -431,28 +431,28 @@ done: * Function: H5C__deserialize_prefetched_entry() * * Purpose: Deserialize the supplied prefetched entry entry, and return - * a pointer to the deserialized entry in *entry_ptr_ptr. + * a pointer to the deserialized entry in *entry_ptr_ptr. * If successful, remove the prefetched entry from the cache, * and free it. Insert the deserialized entry into the cache. * - * Note that the on disk image of the entry is not freed -- + * Note that the on disk image of the entry is not freed -- * a pointer to it is stored in the deserialized entries' * image_ptr field, and its image_up_to_date field is set to * TRUE unless the entry is dirtied by the deserialize call. * * If the prefetched entry is a flush dependency child, - * destroy that flush dependency prior to calling the + * destroy that flush dependency prior to calling the * deserialize callback. If appropriate, the flush dependency * relationship will be recreated by the cache client. * * If the prefetched entry is a flush dependency parent, - * destroy the flush dependency relationship with all its + * destroy the flush dependency relationship with all its * children. As all these children must be prefetched entries, - * recreate these flush dependency relationships with + * recreate these flush dependency relationships with * deserialized entry after it is inserted in the cache. * - * Since deserializing a prefetched entry is semantically - * equivalent to a load, issue an entry loaded nofification + * Since deserializing a prefetched entry is semantically + * equivalent to a load, issue an entry loaded nofification * if the notify callback is defined. * * Return: SUCCEED on success, and FAIL on failure. @@ -468,22 +468,22 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t **entry_ptr_ptr, const H5C_class_t *type, haddr_t addr, void *udata) { - hbool_t dirty = FALSE; /* Flag indicating whether thing was - * dirtied during deserialize + hbool_t dirty = FALSE; /* Flag indicating whether thing was + * dirtied during deserialize */ size_t len; /* Size of image in file */ void * thing = NULL; /* Pointer to thing loaded */ H5C_cache_entry_t * pf_entry_ptr; /* pointer to the prefetched entry */ /* supplied in *entry_ptr_ptr. */ - H5C_cache_entry_t * ds_entry_ptr; /* Alias for thing loaded, as cache - * entry + H5C_cache_entry_t * ds_entry_ptr; /* Alias for thing loaded, as cache + * entry */ H5C_cache_entry_t** fd_children = NULL; /* Pointer to a dynamically */ /* allocated array of pointers to */ /* the flush dependency children of */ /* the prefetched entry, or NULL if */ /* that array does not exist. */ - unsigned flush_flags = (H5C__FLUSH_INVALIDATE_FLAG | + unsigned flush_flags = (H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG); int i; herr_t ret_value = SUCCEED; /* Return value */ @@ -513,8 +513,8 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, /* verify absence of prohibited or unsupported type flag combinations */ HDassert(!(type->flags & H5C__CLASS_SKIP_READS)); - - /* Can't see how skip reads could be usefully combined with + + /* Can't see how skip reads could be usefully combined with * either the speculative read flag. Hence disallow. */ HDassert(!((type->flags & H5C__CLASS_SKIP_READS) && @@ -535,7 +535,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, HDassert(pf_entry_ptr->flush_dep_parent[i]->flush_dep_nchildren > 0); HDassert(pf_entry_ptr->fd_parent_addrs); HDassert(pf_entry_ptr->flush_dep_parent[i]->addr == pf_entry_ptr->fd_parent_addrs[i]); - + if(H5C_destroy_flush_dependency(pf_entry_ptr->flush_dep_parent[i], pf_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "can't destroy pf entry parent flush dependency") @@ -543,11 +543,11 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, } /* end for */ HDassert(pf_entry_ptr->flush_dep_nparents == 0); - /* If *pf_entry_ptr is a flush dependency parent, destroy its flush - * dependency relationships with all its children (which must be + /* If *pf_entry_ptr is a flush dependency parent, destroy its flush + * dependency relationships with all its children (which must be * prefetched entries as well). * - * These flush dependency relationships will have to be restored + * These flush dependency relationships will have to be restored * after the deserialized entry is inserted into the cache in order * to transfer these relationships to the new entry. Hence save the * pointers to the flush dependency children of *pf_enty_ptr for later @@ -561,16 +561,16 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "can't destroy pf entry child flush dependency(s).") } /* end if */ - /* Since the size of the on disk image is known exactly, there is - * no need for either a call to the get_initial_load_size() callback, + /* Since the size of the on disk image is known exactly, there is + * no need for either a call to the get_initial_load_size() callback, * or retries if the H5C__CLASS_SPECULATIVE_LOAD_FLAG flag is set. * Similarly, there is no need to clamp possible reads beyond * EOF. */ len = pf_entry_ptr->size; - /* Deserialize the prefetched on-disk image of the entry into the - * native memory form + /* Deserialize the prefetched on-disk image of the entry into the + * native memory form */ if(NULL == (thing = type->deserialize(pf_entry_ptr->image_ptr, len, udata, &dirty))) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "Can't deserialize image") @@ -587,14 +587,14 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, * * HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); * - * note that type ids 5 & 6 are associated with object headers in the + * note that type ids 5 & 6 are associated with object headers in the * metadata cache. * * When we get to using H5C for other purposes, we may wish to * tighten up the assert so that the loophole only applies to the * metadata cache. * - * Note that at present, dirty can't be set to true with prefetched + * Note that at present, dirty can't be set to true with prefetched * entries. However this may change, so include this functionality * against that posibility. * @@ -682,8 +682,8 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, /* We have successfully deserialized the prefetched entry. * * Before we return a pointer to the deserialized entry, we must remove - * the prefetched entry from the cache, discard it, and replace it with - * the deserialized entry. Note that we do not free the prefetched + * the prefetched entry from the cache, discard it, and replace it with + * the deserialized entry. Note that we do not free the prefetched * entries image, as that has been transferred to the deserialized * entry. * @@ -695,11 +695,11 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, * 1) Set pf_entry_ptr->image_ptr to NULL. Since we have already * transferred the buffer containing the image to *ds_entry_ptr, * this is not a memory leak. - * + * * 2) Call H5C__flush_single_entry() with the H5C__FLUSH_INVALIDATE_FLAG * and H5C__FLUSH_CLEAR_ONLY_FLAG flags set. */ - pf_entry_ptr->image_ptr = NULL; + pf_entry_ptr->image_ptr = NULL; if(pf_entry_ptr->is_dirty) { HDassert(pf_entry_ptr->in_slist); flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; @@ -723,7 +723,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, ds_entry_ptr, FAIL) - /* Deserializing a prefetched entry is the conceptual equivalent of + /* Deserializing a prefetched entry is the conceptual equivalent of * loading it from file. If the deserialized entry has a notify callback, * send an "after load" notice now that the deserialized entry is fully * integrated into the cache. @@ -732,9 +732,9 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, (ds_entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_LOAD, ds_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry loaded into cache") - /* Restore flush dependencies with the flush dependency children of - * of the prefetched entry. Note that we must protect *ds_entry_ptr - * before the call to avoid triggering sanity check failures, and + /* Restore flush dependencies with the flush dependency children of + * of the prefetched entry. Note that we must protect *ds_entry_ptr + * before the call to avoid triggering sanity check failures, and * then unprotect it afterwards. */ i = 0; @@ -798,8 +798,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__free_image_entries_array * - * Purpose: If the image entries array exists, free the image - * associated with each entry, and then free the image + * Purpose: If the image entries array exists, free the image + * associated with each entry, and then free the image * entries array proper. * * Note that by the time this function is called, the cache @@ -834,7 +834,7 @@ H5C__free_image_entries_array(H5C_t * cache_ptr) /* Get pointer to image entry */ ie_ptr = &((cache_ptr->image_entries)[u]); - /* Sanity checks */ + /* Sanity checks */ HDassert(ie_ptr); HDassert(ie_ptr->magic == H5C_IMAGE_ENTRY_T_MAGIC); HDassert(ie_ptr->image_ptr); @@ -866,14 +866,14 @@ H5C__free_image_entries_array(H5C_t * cache_ptr) /*------------------------------------------------------------------------- * Function: H5C_force_cache_image_load() * - * Purpose: On rare occasions, it is necessary to run + * Purpose: On rare occasions, it is necessary to run * H5MF_tidy_self_referential_fsm_hack() prior to the first - * metadata cache access. This is a problem as if there is a - * cache image at the end of the file, that routine will + * metadata cache access. This is a problem as if there is a + * cache image at the end of the file, that routine will * discard it. * * We solve this issue by calling this function, which will - * load the cache image and then call + * load the cache image and then call * H5MF_tidy_self_referential_fsm_hack() to discard it. * * Return: SUCCEED on success, and FAIL on failure. @@ -1053,12 +1053,12 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) if ( ( NULL == aux_ptr ) || ( aux_ptr->mpi_rank == 0 ) ) { - HDassert((NULL == aux_ptr) || + 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, + if(H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, cache_ptr->image_len, cache_ptr->image_buffer) < 0) HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, "Can't read metadata cache image block") @@ -1068,9 +1068,9 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_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, + 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) @@ -1080,9 +1080,9 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_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, + 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", \ @@ -1128,14 +1128,14 @@ H5C__load_cache_image(H5F_t *f) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - /* If the image address is defined, load the image, decode it, - * and insert its contents into the metadata cache. + /* If the image address is defined, load the image, decode it, + * and insert its contents into the metadata cache. * - * Note that under normal operating conditions, it is an error if the + * Note that under normal operating conditions, it is an error if the * image address is HADDR_UNDEF. However, to facilitate testing, * we allow this special value of the image address which means that - * no image exists, and that the load operation should be skipped - * silently. + * no image exists, and that the load operation should be skipped + * silently. */ if(H5F_addr_defined(cache_ptr->image_addr)) { /* Sanity checks */ @@ -1184,25 +1184,25 @@ done: /*------------------------------------------------------------------------- * Function: H5C_load_cache_image_on_next_protect() * - * Purpose: Note the fact that a metadata cache image superblock + * Purpose: Note the fact that a metadata cache image superblock * extension message exists, along with the base address * and length of the metadata cache image block. * - * Once this notification is received the metadata cache - * image block must be read, decoded, and loaded into the + * Once this notification is received the metadata cache + * image block must be read, decoded, and loaded into the * cache on the next call to H5C_protect(). * - * Further, if the file is opened R/W, the metadata cache - * image superblock extension message must be deleted from + * Further, if the file is opened R/W, the metadata cache + * image superblock extension message must be deleted from * the superblock extension and the image block freed * * Contrawise, if the file is openened R/O, the metadata * cache image superblock extension message and image block * must be left as is. Further, any dirty entries in the - * cache image block must be marked as clean to avoid + * cache image block must be marked as clean to avoid * attempts to write them on file close. * - * Return: SUCCEED + * Return: SUCCEED * * Programmer: John Mainzer * 7/6/15 @@ -1291,41 +1291,41 @@ H5C__image_entry_cmp(const void *_entry1, const void *_entry2) /*------------------------------------------------------------------------- * Function: H5C__prep_image_for_file_close * - * Purpose: The objective of the call is to allow the metadata cache - * to do any preparatory work prior to generation of a + * Purpose: The objective of the call is to allow the metadata cache + * to do any preparatory work prior to generation of a * cache image. * - * In particular, the cache must + * In particular, the cache must * * 1) serialize all its entries, * - * 2) compute the size of the metadata cache image, + * 2) compute the size of the metadata cache image, * * 3) allocate space for the metadata cache image, and * * 4) setup the metadata cache image superblock extension - * message with the address and size of the metadata + * message with the address and size of the metadata * cache image. * - * The parallel case is complicated by the fact that - * while all metadata caches must contain the same set of - * dirty entries, there is no such requirement for clean + * The parallel case is complicated by the fact that + * while all metadata caches must contain the same set of + * dirty entries, there is no such requirement for clean * entries or the order that entries appear in the LRU. * * Thus, there is no requirement that different processes * will construct cache images of the same size. * - * This is not a major issue as long as all processes include - * the same set of dirty entries in the cache -- as they - * currently do (note that this will change when we implement - * the ageout feature). Since only the process zero cache - * writes the cache image, all that is necessary is to - * broadcast the process zero cache size for use in the - * superblock extension messages and cache image block + * This is not a major issue as long as all processes include + * the same set of dirty entries in the cache -- as they + * currently do (note that this will change when we implement + * the ageout feature). Since only the process zero cache + * writes the cache image, all that is necessary is to + * broadcast the process zero cache size for use in the + * superblock extension messages and cache image block * allocations. * - * Note: At present, cache image is disabled in the - * parallel case as the new collective metadata write + * Note: At present, cache image is disabled in the + * parallel case as the new collective metadata write * code must be modified to support cache image. * * Return: Non-negative on success/Negative on failure @@ -1354,8 +1354,8 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(image_generated); - /* If the file is opened and closed without any access to - * any group or data set, it is possible that the cache image (if + /* If the file is opened and closed without any access to + * any group or data set, it is possible that the cache image (if * it exists) has not been read yet. Do this now if required. */ if(cache_ptr->load_image) { @@ -1365,15 +1365,15 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) } /* end if */ /* Before we start to generate the cache image (if requested), verify - * that the superblock supports superblock extension messages, and + * that the superblock supports superblock extension messages, and * silently cancel any request for a cache image if it does not. * * Ideally, we would do this when the cache image is requested, - * but the necessary information is not necessary available at that + * but the necessary information is not necessary available at that * time -- hence this last minute check. * - * Note that under some error conditions, the superblock will be - * undefined in this case as well -- if so, assume that the + * Note that under some error conditions, the superblock will be + * undefined in this case as well -- if so, assume that the * superblock does not support superblock extension messages. * Also verify that the file's high_bound is at least release * 1.10.x, otherwise cancel the request for a cache image @@ -1390,17 +1390,17 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) /* Generate the cache image, if requested */ if(cache_ptr->image_ctl.generate_image) { /* Create the cache image super block extension message. - * + * * Note that the base address and length of the metadata cache * image are undefined at this point, and thus will have to be * updated later. * - * Create the super block extension message now so that space + * Create the super block extension message now so that space * is allocated for it (if necessary) before we allocate space * for the cache image block. * - * To simplify testing, do this only if the - * H5C_CI__GEN_MDCI_SBE_MESG bit is set in + * To simplify testing, do this only if the + * H5C_CI__GEN_MDCI_SBE_MESG bit is set in * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDCI_SBE_MESG) @@ -1411,20 +1411,20 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) if(H5C__serialize_cache(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "serialization of the cache failed") - /* Scan the cache and record data needed to construct the + /* Scan the cache and record data needed to construct the * cache image. In particular, for each entry we must record: * * 1) rank in LRU (if entry is in LRU) * - * 2) Whether the entry is dirty prior to flush of + * 2) Whether the entry is dirty prior to flush of * cache just prior to close. * * 3) Addresses of flush dependency parents (if any). * - * 4) Number of flush dependency children (if any). + * 4) Number of flush dependency children (if any). * - * In passing, also compute the size of the metadata cache - * image. With the recent modifications of the free space + * In passing, also compute the size of the metadata cache + * image. With the recent modifications of the free space * manager code, this size should be correct. */ if(H5C__prep_for_file_close__scan_entries(f, cache_ptr) < 0) @@ -1432,7 +1432,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) HDassert(HADDR_UNDEF == cache_ptr->image_addr); #ifdef H5_HAVE_PARALLEL - /* In the parallel case, overwrite the image_len with the + /* In the parallel case, overwrite the image_len with the * value computed by process 0. */ if(cache_ptr->aux_ptr) { /* we have multiple processes */ @@ -1453,17 +1453,17 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) else { if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&p0_image_len, 1, MPI_UNSIGNED, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) - + aux_ptr->p0_image_len = p0_image_len; } /* end else */ - /* Allocate space for a cache image of size equal to that - * computed by the process 0. This may be different from + /* Allocate space for a cache image of size equal to that + * computed by the process 0. This may be different from * cache_ptr->image_data_len if mpi_rank != 0. However, since - * cache image write is suppressed on all processes other than + * cache image write is suppressed on all processes other than * process 0, this doesn't matter. * - * Note that we allocate the cache image directly from the file + * Note that we allocate the cache image directly from the file * driver so as to avoid unsettling the free space managers. */ if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, f, @@ -1472,8 +1472,8 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) } /* end if */ else #endif /* H5_HAVE_PARALLEL */ - /* Allocate the cache image block. Note that we allocate this - * this space directly from the file driver so as to avoid + /* Allocate the cache image block. Note that we allocate this + * this space directly from the file driver so as to avoid * unsettling the free space managers. */ if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, f, @@ -1497,25 +1497,25 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * image block to the next alignment boundary, and then setting * the image_data_len to the actual size of the cache_image. * - * On the off chance that there is some other way to get a + * On the off chance that there is some other way to get a * a fragment on a cache image allocation, leave the following * assertion in the code so we will find out. */ HDassert((eoa_frag_size == 0) || (f->shared->alignment != 1)); /* Eventually it will be possible for the length of the cache image - * block on file to be greater than the size of the data it - * contains. However, for now they must be the same. Set + * block on file to be greater than the size of the data it + * contains. However, for now they must be the same. Set * cache_ptr->image_len accordingly. */ cache_ptr->image_len = cache_ptr->image_data_len; - /* update the metadata cache image superblock extension - * message with the new cache image block base address and + /* update the metadata cache image superblock extension + * message with the new cache image block base address and * length. * - * to simplify testing, do this only if the - * H5C_CI__GEN_MDC_IMAGE_BLK bit is set in + * to simplify testing, do this only if the + * H5C_CI__GEN_MDC_IMAGE_BLK bit is set in * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) @@ -1525,18 +1525,18 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) /* At this point: * * 1) space in the file for the metadata cache image - * is allocated, + * is allocated, * - * 2) the metadata cache image superblock extension - * message exists and (if so configured) contains + * 2) the metadata cache image superblock extension + * message exists and (if so configured) contains * the correct data, * - * 3) All entries in the cache that will appear in the + * 3) All entries in the cache that will appear in the * cache image are serialized with up to date images. * * Since we just updated the cache image message, * the super block extension message is dirty. However, - * since the superblock and the superblock extension + * since the superblock and the superblock extension * can't be included in the cache image, this is a non- * issue. * @@ -1544,16 +1544,16 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * the cache are marked as such, and we have a count * of same. * - * 5) Flush dependency heights are calculated for all + * 5) Flush dependency heights are calculated for all * entries that will be included in the cache image. * * If there are any entries to be included in the metadata cache - * image, allocate, populate, and sort the image_entries array. + * image, allocate, populate, and sort the image_entries array. * - * If the metadata cache image will be empty, delete the - * metadata cache image superblock extension message, set + * If the metadata cache image will be empty, delete the + * metadata cache image superblock extension message, set * cache_ptr->image_ctl.generate_image to FALSE. This will - * allow the file close to continue normally without the + * allow the file close to continue normally without the * unnecessary generation of the metadata cache image. */ if(cache_ptr->num_entries_in_image > 0) { @@ -1567,9 +1567,9 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) else { /* cancel creation of metadata cache image */ HDassert(cache_ptr->image_entries == NULL); - /* To avoid breaking the control flow tests, only delete - * the mdci superblock extension message if the - * H5C_CI__GEN_MDC_IMAGE_BLK flag is set in + /* To avoid breaking the control flow tests, only delete + * the mdci superblock extension message if the + * H5C_CI__GEN_MDC_IMAGE_BLK flag is set in * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) @@ -1591,8 +1591,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C_set_cache_image_config * - * Purpose: If *config_ptr contains valid data, copy it into the - * image_ctl field of *cache_ptr. Make adjustments for + * Purpose: If *config_ptr contains valid data, copy it into the + * image_ctl field of *cache_ptr. Make adjustments for * changes in configuration as required. * * If the file is open read only, silently @@ -1601,9 +1601,9 @@ done: * * Note that in addition to being inapplicable in the * read only case, cache image is also inapplicable if - * the superblock does not support superblock extension - * messages. Unfortunately, this information need not - * be available at this point. Thus we check for this + * the superblock does not support superblock extension + * messages. Unfortunately, this information need not + * be available at this point. Thus we check for this * later, in H5C_prep_for_file_close() and cancel the * cache image request if appropriate. * @@ -1638,7 +1638,7 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid cache image configuration") #ifdef H5_HAVE_PARALLEL - /* The collective metadata write code is not currently compatible + /* The collective metadata write code is not currently compatible * with cache image. Until this is fixed, suppress cache image silently * if there is more than one process. * JRM -- 11/8/16 @@ -1652,15 +1652,15 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, else { #endif /* H5_HAVE_PARALLEL */ /* A cache image can only be generated if the file is opened read / write - * and the superblock supports superblock extension messages. + * and the superblock supports superblock extension messages. * - * However, the superblock version is not available at this point -- + * However, the superblock version is not available at this point -- * hence we can only check the former requirement now. Do the latter - * check just before we construct the image.. + * check just before we construct the image.. * * If the file is opened read / write, apply the supplied configuration. * - * If it is not, set the image configuration to the default, which has + * If it is not, set the image configuration to the default, which has * the effect of silently disabling the cache image if it was requested. */ if(H5F_INTENT(f) & H5F_ACC_RDWR) @@ -1683,7 +1683,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_validate_cache_image_config() * - * Purpose: Run a sanity check on the provided instance of struct + * Purpose: Run a sanity check on the provided instance of struct * H5AC_cache_image_config_t. * * Do nothing and return SUCCEED if no errors are detected, @@ -1715,8 +1715,8 @@ H5C_validate_cache_image_config(H5C_cache_image_ctl_t * ctl_ptr) if(ctl_ptr->save_resize_status != FALSE) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unexpected value in save_resize_status field") - /* At present, we do not support prefetched entry ageouts. Thus - * the entry_ageout field must be set to + /* At present, we do not support prefetched entry ageouts. Thus + * the entry_ageout field must be set to * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. */ if(ctl_ptr->entry_ageout != H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE) @@ -1740,7 +1740,7 @@ done: * Purpose: Compute the size of the header of the metadata cache * image block, and return the value. * - * Return: Size of the header section of the metadata cache image + * Return: Size of the header section of the metadata cache image * block in bytes. * * Programmer: John Mainzer @@ -1777,7 +1777,7 @@ H5C__cache_image_block_entry_header_size(const H5F_t * f) * Purpose: Compute the size of the header of the metadata cache * image block, and return the value. * - * Return: Size of the header section of the metadata cache image + * Return: Size of the header section of the metadata cache image * block in bytes. * * Programmer: John Mainzer @@ -1806,9 +1806,9 @@ H5C__cache_image_block_header_size(const H5F_t * f) /*------------------------------------------------------------------------- * Function: H5C__decode_cache_image_header() * - * Purpose: Decode the metadata cache image buffer header from the + * Purpose: Decode the metadata cache image buffer header from the * supplied buffer and load the data into the supplied instance - * of H5C_t. Advances the buffer pointer to the first byte + * of H5C_t. Advances the buffer pointer to the first byte * after the header image, or unchanged on failure. * * Return: Non-negative on success/Negative on failure @@ -1853,7 +1853,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, /* Decode flags */ flags = *p++; - if(flags & H5C__MDCI_HEADER_HAVE_RESIZE_STATUS) + if(flags & H5C__MDCI_HEADER_HAVE_RESIZE_STATUS) have_resize_status = TRUE; if(have_resize_status) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "MDC resize status not yet supported") @@ -1867,7 +1867,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, /* Read num entries */ UINT32DECODE(p, cache_ptr->num_entries_in_image); - if(cache_ptr->num_entries_in_image == 0) + if(cache_ptr->num_entries_in_image == 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad metadata cache entry count") /* Verify expected length of header */ @@ -1888,13 +1888,13 @@ done: /*------------------------------------------------------------------------- * Function: H5C__decode_cache_image_entry() * - * Purpose: Decode the metadata cache image entry from the supplied + * Purpose: Decode the metadata cache image entry from the supplied * buffer into the supplied instance of H5C_image_entry_t. * This includes allocating a buffer for the entry image, - * loading it, and seting ie_ptr->image_ptr to point to + * loading it, and seting ie_ptr->image_ptr to point to * the buffer. * - * Advances the buffer pointer to the first byte + * Advances the buffer pointer to the first byte * after the entry, or unchanged on failure. * * Return: Non-negative on success/Negative on failure @@ -1998,8 +1998,8 @@ H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, /* Verify expected length of entry image */ if((size_t)(p - *buf) != H5C__cache_image_block_entry_header_size(f)) HGOTO_ERROR(H5E_CACHE, H5E_BADSIZE, FAIL, "Bad entry image len") - - /* If parent count greater than zero, allocate array for parent + + /* If parent count greater than zero, allocate array for parent * addresses, and decode addresses into the array. */ if(fd_parent_count > 0) { @@ -2053,9 +2053,9 @@ done: /*------------------------------------------------------------------------- * Function: H5C__destroy_pf_entry_child_flush_deps() * - * Purpose: Destroy all flush dependencies in this the supplied + * Purpose: Destroy all flush dependencies in this the supplied * prefetched entry is the parent. Note that the children - * in these flush dependencies must be prefetched entries as + * in these flush dependencies must be prefetched entries as * well. * * As this action is part of the process of transferring all @@ -2063,8 +2063,8 @@ done: * prefetched entry, ensure that the data necessary to complete * the transfer is retained. * - * Note: The current implementation of this function is - * quite inefficient -- mostly due to the current + * Note: The current implementation of this function is + * quite inefficient -- mostly due to the current * implementation of flush dependencies. This should * be fixed at some point. * @@ -2076,7 +2076,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, +H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_entry_ptr, H5C_cache_entry_t **fd_children) { H5C_cache_entry_t * entry_ptr; @@ -2103,8 +2103,8 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, while(entry_ptr != NULL) { HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - /* Here we look at entry_ptr->flush_dep_nparents and not - * entry_ptr->fd_parent_count as it is possible that some + /* Here we look at entry_ptr->flush_dep_nparents and not + * entry_ptr->fd_parent_count as it is possible that some * or all of the prefetched flush dependency child relationships * have already been destroyed. */ @@ -2145,9 +2145,9 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "can't destroy pf entry child flush dependency") #ifndef NDEBUG - /* Sanity check -- verify that the address of the parent + /* Sanity check -- verify that the address of the parent * appears in entry_ptr->fd_parent_addrs. Must do a search, - * as with flush dependency creates and destroys, + * as with flush dependency creates and destroys, * entry_ptr->fd_parent_addrs and entry_ptr->flush_dep_parent * can list parents in different order. */ @@ -2181,8 +2181,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__encode_cache_image_header() * - * Purpose: Encode the metadata cache image buffer header in the - * supplied buffer. Updates buffer pointer to the first byte + * Purpose: Encode the metadata cache image buffer header in the + * supplied buffer. Updates buffer pointer to the first byte * after the header image in the buffer, or unchanged on failure. * * Return: Non-negative on success/Negative on failure @@ -2259,8 +2259,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__encode_cache_image_entry() * - * Purpose: Encode the metadata cache image buffer header in the - * supplied buffer. Updates buffer pointer to the first byte + * Purpose: Encode the metadata cache image buffer header in the + * supplied buffer. Updates buffer pointer to the first byte * after the entry in the buffer, or unchanged on failure. * * Return: Non-negative on success/Negative on failure @@ -2271,7 +2271,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, +H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, unsigned entry_num) { H5C_image_entry_t * ie_ptr; /* Pointer to entry to encode */ @@ -2306,13 +2306,13 @@ H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, *p++ = (uint8_t)(ie_ptr->type_id); /* Compose and encode flags */ - if(ie_ptr->is_dirty) + if(ie_ptr->is_dirty) flags |= H5C__MDCI_ENTRY_DIRTY_FLAG; - if(ie_ptr->lru_rank > 0) + if(ie_ptr->lru_rank > 0) flags |= H5C__MDCI_ENTRY_IN_LRU_FLAG; if(ie_ptr->fd_child_count > 0) flags |= H5C__MDCI_ENTRY_IS_FD_PARENT_FLAG; - if(ie_ptr->fd_parent_count > 0) + if(ie_ptr->fd_parent_count > 0) flags |= H5C__MDCI_ENTRY_IS_FD_CHILD_FLAG; *p++ = flags; @@ -2377,51 +2377,51 @@ done: * flush dependency children. (Recall that the flush dependency * height of an entry in a flush dependency relationship is the * length of the longest path from the entry to a leaf entry -- - * that is an entry with flush dependency parents, but no - * flush dependency children. With the introduction of the + * that is an entry with flush dependency parents, but no + * flush dependency children. With the introduction of the * possibility of multiple flush dependency parents, we have - * a flush partial dependency latice, not a flush dependency - * tree. But since the partial latice is acyclic, the concept + * a flush partial dependency latice, not a flush dependency + * tree. But since the partial latice is acyclic, the concept * of flush dependency height still makes sense. * - * The purpose of this function is to compute the flush + * The purpose of this function is to compute the flush * dependency height of all entries that appear in the cache - * image. + * image. * - * At present, entries are included or excluded from the + * At present, entries are included or excluded from the * cache image depending upon the ring in which they reside. * Thus there is no chance that one side of a flush dependency * will be in the cache image, and the other side not. * * However, once we start placing a limit on the size of the * cache image, or start excluding prefetched entries from - * the cache image if they haven't been accessed in some - * number of file close / open cycles, this will no longer - * be the case. + * the cache image if they haven't been accessed in some + * number of file close / open cycles, this will no longer + * be the case. * * In particular, if a flush dependency child is dirty, and * one of its flush dependency parents is dirty and not in * the cache image, then the flush dependency child cannot * be in the cache image without violating flush ordering. * - * Observe that a clean flush dependency child can be either - * in or out of the cache image without effect on flush + * Observe that a clean flush dependency child can be either + * in or out of the cache image without effect on flush * dependencies. * - * Similarly, a flush dependency parent can always be part - * of a cache image, regardless of whether it is clean or + * Similarly, a flush dependency parent can always be part + * of a cache image, regardless of whether it is clean or * dirty -- but remember that a flush dependency parent can * also be a flush dependency child. - * + * * Finally, note that for purposes of the cache image, flush - * dependency height ends when a flush dependecy relation + * dependency height ends when a flush dependecy relation * passes off the cache image. * - * On exit, the flush dependency height of each entry in the + * On exit, the flush dependency height of each entry in the * cache image should be calculated and stored in the cache * entry. Entries will be removed from the cache image if * necessary to maintain flush ordering. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2447,10 +2447,10 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - /* Remove from the cache image all dirty entries that are + /* Remove from the cache image all dirty entries that are * flush dependency children of dirty entries that are not in the - * cache image. Must do this, as if we fail to do so, the parent - * will be written to file before the child. Since it is possible + * cache image. Must do this, as if we fail to do so, the parent + * will be written to file before the child. Since it is possible * that the child will have dirty children of its own, this may take * multiple passes through the index list. */ @@ -2484,17 +2484,17 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) entry_ptr = entry_ptr->il_next; } /* while ( entry_ptr != NULL ) */ - } /* while ( ! done ) */ + } /* while ( ! done ) */ /* at present, entries are included in the cache image if they reside - * in a specified set of rings. Thus it should be impossible for - * entries_removed_from_image to be positive. Assert that this is - * so. Note that this will change when we start aging entries out + * in a specified set of rings. Thus it should be impossible for + * entries_removed_from_image to be positive. Assert that this is + * so. Note that this will change when we start aging entries out * of the cache image. */ HDassert(entries_removed_from_image == 0); - /* Next, remove from entries in the cache image, references to + /* Next, remove from entries in the cache image, references to * flush dependency parents or children that are not in the cache image. */ entry_ptr = cache_ptr->il_head; @@ -2575,14 +2575,14 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) entry_ptr = entry_ptr->il_next; } /* while (entry_ptr != NULL) */ - /* At present, no extenal parent or child flush dependency links + /* At present, no extenal parent or child flush dependency links * should exist -- hence the following assertions. This will change * if we support ageout of entries in the cache image. */ HDassert(external_child_fd_refs_removed == 0); HDassert(external_parent_fd_refs_removed == 0); - /* At this point we should have removed all flush dependencies that + /* At this point we should have removed all flush dependencies that * cross cache image boundaries. Now compute the flush dependency * heights for all entries in the image. * @@ -2600,7 +2600,7 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) parent_ptr = entry_ptr->flush_dep_parent[u]; HDassert(parent_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - if(parent_ptr->include_in_image && parent_ptr->image_fd_height <= 0) + if(parent_ptr->include_in_image && parent_ptr->image_fd_height <= 0) H5C__prep_for_file_close__compute_fd_heights_real(parent_ptr, 1); } /* end for */ } /* end if */ @@ -2623,37 +2623,37 @@ done: * * The basic observation behind this function is as follows: * - * Suppose you have an entry E with a flush dependency - * height of X. Then the parents of E must all have + * Suppose you have an entry E with a flush dependency + * height of X. Then the parents of E must all have * flush dependency X + 1 or greater. * * Use this observation to compute flush dependency height * of all entries in the cache image via the following * recursive algorithm: * - * 1) On entry, set the flush dependency height of the + * 1) On entry, set the flush dependency height of the * supplied cache entry to the supplied value. * - * 2) Examine all the flush dependency parents of the - * supplied entry. + * 2) Examine all the flush dependency parents of the + * supplied entry. * - * If the parent is in the cache image, and has flush + * If the parent is in the cache image, and has flush * dependency height less than or equal to the flush - * dependency height of the current entry, call the + * dependency height of the current entry, call the * recursive routine on the parent with flush dependency - * height equal to the flush dependency height of the + * height equal to the flush dependency height of the * child plus 1. * * Otherwise do nothing. * * Observe that if the flush dependency height of all entries - * in the image is initialized to zero, and if this recursive - * function is called with flush dependency height 0 on all - * entries in the cache image with FD parents in the image, - * but without FD children in the image, the correct flush - * dependency height should be set for all entries in the + * in the image is initialized to zero, and if this recursive + * function is called with flush dependency height 0 on all + * entries in the cache image with FD parents in the image, + * but without FD children in the image, the correct flush + * dependency height should be set for all entries in the * cache image. - * + * * Return: void * * Programmer: John Mainzer @@ -2698,9 +2698,9 @@ H5C__prep_for_file_close__compute_fd_heights_real(H5C_cache_entry_t *entry_ptr, * Function: H5C__prep_for_file_close__setup_image_entries_array * * Purpose: Allocate space for the image_entries array, and load - * each instance of H5C_image_entry_t in the array with + * each instance of H5C_image_entry_t in the array with * the data necessary to construct the metadata cache image. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2758,14 +2758,14 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) image_entries[u].ring = entry_ptr->ring; /* When a prefetched entry is included in the image, store - * its underlying type id in the image entry, not + * its underlying type id in the image entry, not * H5AC_PREFETCHED_ENTRY_ID. In passing, also increment * the age (up to H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX). */ if(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID) { image_entries[u].type_id = entry_ptr->prefetch_type_id; image_entries[u].age = entry_ptr->age + 1; - + if(image_entries[u].age > H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX) image_entries[u].age = H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX; } /* end if */ @@ -2780,13 +2780,13 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) image_entries[u].fd_parent_count = entry_ptr->fd_parent_count; image_entries[u].fd_parent_addrs = entry_ptr->fd_parent_addrs; image_entries[u].fd_child_count = entry_ptr->fd_child_count; - image_entries[u].fd_dirty_child_count = + image_entries[u].fd_dirty_child_count = entry_ptr->fd_dirty_child_count; image_entries[u].image_ptr = entry_ptr->image_ptr; - /* Null out entry_ptr->fd_parent_addrs and set + /* Null out entry_ptr->fd_parent_addrs and set * entry_ptr->fd_parent_count to zero so that ownership of the - * flush dependency parents address array is transferred to the + * flush dependency parents address array is transferred to the * image entry. */ entry_ptr->fd_parent_count = 0; @@ -2819,8 +2819,8 @@ done: /*------------------------------------------------------------------------- * Function: H5C__prep_for_file_close__scan_entries * - * Purpose: Scan all entries in the metadata cache, and store all - * entry specific data required for construction of the + * Purpose: Scan all entries in the metadata cache, and store all + * entry specific data required for construction of the * metadata cache image block and likely to be discarded * or modified during the cache flush on file close. * @@ -2838,7 +2838,7 @@ done: * * Finally, compute the size of the metadata cache image * block. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -2891,7 +2891,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) HDassert(entry_ptr->image_ptr); /* Initially, we mark all entries in the rings included - * in the cache image as being included in the in the + * in the cache image as being included in the in the * image. Depending on circumstances, we may exclude some * of these entries later. */ @@ -2907,7 +2907,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) entry_ptr->image_fd_height = 0; /* will compute this later */ /* Initially, include all flush dependency parents in the - * the list of flush dependencies to be stored in the + * the list of flush dependencies to be stored in the * image. We may remove some or all of these later. */ if(entry_ptr->flush_dep_nparents > 0) { @@ -2915,7 +2915,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) * as needed. */ if(entry_ptr->flush_dep_nparents == entry_ptr->fd_parent_count ) { - /* parent addresses array should already be allocated + /* parent addresses array should already be allocated * and of the correct size. */ HDassert(entry_ptr->fd_parent_addrs); @@ -2947,8 +2947,8 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) HDassert(entry_ptr->fd_parent_addrs == NULL); /* Initially, all flush dependency children are included int - * the count of flush dependency child relationships to be - * represented in the cache image. Some or all of these + * the count of flush dependency child relationships to be + * represented in the cache image. Some or all of these * may be dropped from the image later. */ if(entry_ptr->flush_dep_nchildren > 0) { @@ -2970,23 +2970,23 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) /* Now compute the flush dependency heights of all flush dependency * relationships to be represented in the image. * - * If all entries in the target rings are included in the - * image, the flush dependency heights are simply the heights + * If all entries in the target rings are included in the + * image, the flush dependency heights are simply the heights * of all flush dependencies in the target rings. * - * However, if we restrict appearance in the cache image either - * by number of entries in the image, restrictions on the number - * of times a prefetched entry can appear in an image, or image + * However, if we restrict appearance in the cache image either + * by number of entries in the image, restrictions on the number + * of times a prefetched entry can appear in an image, or image * size, it is possible that flush dependency parents or children * of entries that are in the image may not be included in the - * the image. In this case, we must prune all flush dependency - * relationships that cross the image boundary, and all exclude - * from the image all dirty flush dependency children that have - * a dirty flush dependency parent that is not in the image. + * the image. In this case, we must prune all flush dependency + * relationships that cross the image boundary, and all exclude + * from the image all dirty flush dependency children that have + * a dirty flush dependency parent that is not in the image. * This is necessary to preserve the required flush ordering. - * - * These details are tended to by the following call to - * H5C__prep_for_file_close__compute_fd_heights(). Because the + * + * These details are tended to by the following call to + * H5C__prep_for_file_close__compute_fd_heights(). Because the * exact contents of the image cannot be known until after this * call, computation of the image size is delayed. */ @@ -2994,7 +2994,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "computation of flush dependency heights failed?!?") /* At this point, all entries that will appear in the cache - * image should be marked correctly. Compute the size of the + * image should be marked correctly. Compute the size of the * cache image. */ entries_visited = 0; @@ -3031,11 +3031,11 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) /* Now scan the LRU list to set the lru_rank fields of all entries * on the LRU. * - * Note that we start with rank 1, and increment by 1 with each - * entry on the LRU. + * Note that we start with rank 1, and increment by 1 with each + * entry on the LRU. * * Note that manually pinned entryies will have lru_rank -1, - * and no flush dependency. Putting these entries at the head of + * and no flush dependency. Putting these entries at the head of * the reconstructed LRU should be appropriate. */ entry_ptr = cache_ptr->LRU_head_ptr; @@ -3045,11 +3045,11 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) /* to avoid confusion, don't set lru_rank on epoch markers. * Note that we still increment the lru_rank, so that the holes - * in the sequence of entries on the LRU will indicate the - * locations of epoch markers (if any) when we reconstruct + * in the sequence of entries on the LRU will indicate the + * locations of epoch markers (if any) when we reconstruct * the LRU. * - * Do not set lru_rank or increment lru_rank for entries + * Do not set lru_rank or increment lru_rank for entries * that will not be included in the cache image. */ if(entry_ptr->type->id == H5AC_EPOCH_MARKER_ID) @@ -3076,9 +3076,9 @@ done: * Function: H5C__reconstruct_cache_contents() * * Purpose: Scan the image buffer, and create a prefetched - * cache entry for every entry in the buffer. Insert the - * prefetched entries in the index and the LRU, and - * reconstruct any flush dependencies. Order the entries + * cache entry for every entry in the buffer. Insert the + * prefetched entries in the index and the LRU, and + * reconstruct any flush dependencies. Order the entries * in the LRU as indicated by the stored lru_ranks. * * Return: SUCCEED on success, and FAIL on failure. @@ -3127,11 +3127,11 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) if(NULL == (pf_entry_ptr = H5C__reconstruct_cache_entry(f, cache_ptr, &p))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "reconstruction of cache entry failed") - /* Note that we make no checks on available cache space before + /* Note that we make no checks on available cache space before * inserting the reconstructed entry into the metadata cache. * * This is OK since the cache must be almost empty at the beginning - * of the process, and since we check cache size at the end of the + * of the process, and since we check cache size at the end of the * reconstruction process. */ @@ -3147,7 +3147,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, pf_entry_ptr->is_dirty) - /* If the prefetched entry is the child in one or more flush + /* If the prefetched entry is the child in one or more flush * dependency relationships, recreate those flush dependencies. */ for(v = 0; v < pf_entry_ptr->fd_parent_count; v++) { @@ -3171,7 +3171,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) */ H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, parent_ptr, FAIL) parent_ptr->is_protected = TRUE; - + /* Setup the flush dependency */ if(H5C_create_flush_dependency(parent_ptr, pf_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Can't restore flush dependency") @@ -3211,7 +3211,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) pf_entry_ptr = pf_entry_ptr->il_next; } /* end while */ - /* Scan the LRU, and verify the expected ordering of the + /* Scan the LRU, and verify the expected ordering of the * prefetched entries. */ { @@ -3233,7 +3233,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) HDassert((entry_ptr->lru_rank == -1) || (entry_ptr->lru_rank > i)); - if ( ( entry_ptr->lru_rank > 1 ) && + if ( ( entry_ptr->lru_rank > 1 ) && ( entry_ptr->lru_rank > i + 1 ) ) lru_rank_holes += entry_ptr->lru_rank - (i + 1); @@ -3245,9 +3245,9 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) entry_ptr = entry_ptr->next; } /* end while */ - /* Holes in the sequences of LRU ranks can appear 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 + * epoch markers on reconstruction of the cache -- thus * the following sanity check will have to be revised when * we add code to store and restore adaptive resize status. */ @@ -3255,7 +3255,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) } /* end block */ #endif /* NDEBUG */ - /* Check to see if the cache is oversize, and evict entries as + /* Check to see if the cache is oversize, and evict entries as * necessary to remain within limits. */ if(cache_ptr->index_size >= cache_ptr->max_cache_size) { @@ -3289,7 +3289,7 @@ done: * Return a pointer to the newly allocated cache entry, * or NULL on failure. * - * Return: Pointer to the new instance of H5C_cache_entry on success, + * Return: Pointer to the new instance of H5C_cache_entry on success, * or NULL on failure. * * Programmer: John Mainzer @@ -3347,7 +3347,7 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, is_fd_child = TRUE; #endif /* NDEBUG */ /* only used in assertions */ - /* Force dirty entries to clean if the file read only -- must do + /* Force dirty entries to clean if the file read only -- must do * this as otherwise the cache will attempt to write them on file * close. Since the file is R/O, the metadata cache image superblock * extension message and the cache image block will not be removed. @@ -3355,7 +3355,7 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, * * However, if the dirty entry (marked clean for purposes of the R/O * file open) is evicted and then referred to, the cache will read - * either invalid or obsolete data from the file. Handle this by + * either invalid or obsolete data from the file. Handle this by * setting the prefetched_dirty field, and hiding such entries from * the eviction candidate selection algorithm. */ @@ -3375,7 +3375,7 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, /* Decode dirty dependency child count */ UINT16DECODE(p, pf_entry_ptr->fd_dirty_child_count); - if(!file_is_rw) + if(!file_is_rw) pf_entry_ptr->fd_dirty_child_count = 0; if(pf_entry_ptr->fd_dirty_child_count > pf_entry_ptr->fd_child_count) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "invalid dirty flush dependency child count") @@ -3401,8 +3401,8 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, /* Verify expected length of entry image */ if((size_t)(p - *buf) != H5C__cache_image_block_entry_header_size(f)) HGOTO_ERROR(H5E_CACHE, H5E_BADSIZE, NULL, "Bad entry image len") - - /* If parent count greater than zero, allocate array for parent + + /* If parent count greater than zero, allocate array for parent * addresses, and decode addresses into the array. */ if(pf_entry_ptr->fd_parent_count > 0) { @@ -3457,7 +3457,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__write_cache_image_superblock_msg * - * Purpose: Write the cache image superblock extension message, + * Purpose: Write the cache image superblock extension message, * creating if specified. * * In general, the size and location of the cache image block @@ -3560,7 +3560,7 @@ H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr) } /* end if */ } /* end block */ #endif /* H5_HAVE_PARALLEL */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__write_cache_image() */ diff --git a/src/H5Clog.c b/src/H5Clog.c index cf9b7e8..794d6bb 100644 --- a/src/H5Clog.c +++ b/src/H5Clog.c @@ -313,7 +313,7 @@ H5C_get_logging_status(const H5C_t *cache, /*OUT*/ hbool_t *is_enabled, *------------------------------------------------------------------------- */ herr_t -H5C_log_write_create_cache_msg(H5C_t *cache, herr_t fxn_ret_value) +H5C_log_write_create_cache_msg(H5C_t *cache, herr_t fxn_ret_value) { herr_t ret_value = SUCCEED; /* Return value */ @@ -348,7 +348,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_log_write_destroy_cache_msg(H5C_t *cache) +H5C_log_write_destroy_cache_msg(H5C_t *cache) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index 5ac354d..ab25a55 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -143,7 +143,7 @@ static H5C_log_class_t H5C_json_log_class_g = { /*------------------------------------------------------------------------- * Function: H5C__json_write_log_message * - * Purpose: Write a message to the log file and flush the file. + * Purpose: Write a message to the log file and flush the file. * The message string is neither modified nor freed. * * Return: SUCCEED/FAIL @@ -171,7 +171,7 @@ H5C__json_write_log_message(H5C_log_json_udata_t *json_udata) if((int)n_chars != HDfprintf(json_udata->outfile, json_udata->message)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message") HDmemset((void *)(json_udata->message), 0, (size_t)(n_chars * sizeof(char))); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__json_write_log_message() */ @@ -222,7 +222,7 @@ H5C_log_json_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi if(NULL == (log_info->udata = H5MM_calloc(sizeof(H5C_log_json_udata_t)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") json_udata = (H5C_log_json_udata_t *)(log_info->udata); - + /* Allocate memory for the message buffer */ if(NULL == (json_udata->message = (char *)H5MM_calloc(H5C_MAX_JSON_LOG_MSG_SIZE * sizeof(char)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") @@ -341,7 +341,7 @@ H5C__json_write_start_log_msg(void *udata) HDassert(json_udata->message); /* Create the log message string (opens the JSON array) */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\n\ \"HDF5 metadata cache log messages\" : [\n\ @@ -386,7 +386,7 @@ H5C__json_write_stop_log_msg(void *udata) HDassert(json_udata->message); /* Create the log message string (closes the JSON array) */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -399,7 +399,7 @@ H5C__json_write_stop_log_msg(void *udata) /* Write the log message to the file */ if(H5C__json_write_log_message(json_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__json_write_stop_log_msg() */ @@ -418,7 +418,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__json_write_create_cache_log_msg(void *udata, herr_t fxn_ret_value) +H5C__json_write_create_cache_log_msg(void *udata, herr_t fxn_ret_value) { H5C_log_json_udata_t *json_udata = (H5C_log_json_udata_t *)(udata); herr_t ret_value = SUCCEED; /* Return value */ @@ -430,7 +430,7 @@ H5C__json_write_create_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -474,7 +474,7 @@ H5C__json_write_destroy_cache_log_msg(void *udata) HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -517,7 +517,7 @@ H5C__json_write_evict_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -562,7 +562,7 @@ H5C__json_write_expunge_entry_log_msg(void *udata, haddr_t address, HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -609,7 +609,7 @@ H5C__json_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -654,7 +654,7 @@ H5C__json_write_insert_entry_log_msg(void *udata, haddr_t address, HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -705,7 +705,7 @@ H5C__json_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t *e HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -752,7 +752,7 @@ H5C__json_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t *e HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -799,7 +799,7 @@ H5C__json_write_mark_unserialized_entry_log_msg(void *udata, HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -846,7 +846,7 @@ H5C__json_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entry HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -892,7 +892,7 @@ H5C__json_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_ad HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -903,7 +903,7 @@ H5C__json_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_ad \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)old_addr, + , (long long)HDtime(NULL), (unsigned long)old_addr, (unsigned long)new_addr, type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -942,7 +942,7 @@ H5C__json_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -951,7 +951,7 @@ H5C__json_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -992,7 +992,7 @@ H5C__json_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, HDassert(child); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1002,7 +1002,7 @@ H5C__json_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)parent->addr, + , (long long)HDtime(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1043,11 +1043,11 @@ H5C__json_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entr if(H5C__READ_ONLY_FLAG == flags) HDstrcpy(rw_s, "READ"); - else + else HDstrcpy(rw_s, "WRITE"); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1059,7 +1059,7 @@ H5C__json_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entr \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, type_id, rw_s, (int)entry->size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1098,7 +1098,7 @@ H5C__json_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1108,7 +1108,7 @@ H5C__json_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)new_size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1147,7 +1147,7 @@ H5C__json_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1156,7 +1156,7 @@ H5C__json_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1197,7 +1197,7 @@ H5C__json_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, HDassert(child); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1207,7 +1207,7 @@ H5C__json_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)parent->addr, + , (long long)HDtime(NULL), (unsigned long)parent->addr, (unsigned long)child->addr, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1245,7 +1245,7 @@ H5C__json_write_unprotect_entry_log_msg(void *udata, haddr_t address, HDassert(json_udata->message); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1256,7 +1256,7 @@ H5C__json_write_unprotect_entry_log_msg(void *udata, haddr_t address, \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)address, + , (long long)HDtime(NULL), (unsigned long)address, type_id, flags, (int)fxn_ret_value); /* Write the log message to the file */ @@ -1295,7 +1295,7 @@ H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t HDassert(config); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1342,7 +1342,7 @@ H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry HDassert(entry); /* Create the log message string */ - HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, + HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ {\ \"timestamp\":%lld,\ @@ -1351,7 +1351,7 @@ H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)entry->addr, (int)fxn_ret_value); /* Write the log message to the file */ diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index 713f333..63fe382 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -138,7 +138,7 @@ static H5C_log_class_t H5C_trace_log_class_g = { /*------------------------------------------------------------------------- * Function: H5C__trace_write_log_message * - * Purpose: Write a message to the log file and flush the file. + * Purpose: Write a message to the log file and flush the file. * The message string is neither modified nor freed. * * Return: SUCCEED/FAIL @@ -166,7 +166,7 @@ H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata) if((int)n_chars != HDfprintf(trace_udata->outfile, trace_udata->message)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message") HDmemset((void *)(trace_udata->message), 0, (size_t)(n_chars * sizeof(char))); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_log_message() */ @@ -217,7 +217,7 @@ H5C_log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int mp if(NULL == (log_info->udata = H5MM_calloc(sizeof(H5C_log_trace_udata_t)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") trace_udata = (H5C_log_trace_udata_t *)(log_info->udata); - + /* Allocate memory for the message buffer */ if(NULL == (trace_udata->message = (char *)H5MM_calloc(H5C_MAX_TRACE_LOG_MSG_SIZE * sizeof(char)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") @@ -340,7 +340,7 @@ H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_expunge_entry 0x%lx %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_expunge_entry 0x%lx %d %d\n", (unsigned long)address, type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -377,7 +377,7 @@ H5C__trace_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_flush %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_flush %d\n", (int)fxn_ret_value); /* Write the log message to the file */ @@ -415,7 +415,7 @@ H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_insert_entry 0x%lx %d 0x%x %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_insert_entry 0x%lx %d 0x%x %d %d\n", (unsigned long)address, type_id, flags, (int)size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -454,7 +454,7 @@ H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t * HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_dirty 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_dirty 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -493,7 +493,7 @@ H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t * HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_clean 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_clean 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -532,7 +532,7 @@ H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_unserialized 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_unserialized 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -571,7 +571,7 @@ H5C__trace_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entr HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_serialized 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_serialized 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -609,7 +609,7 @@ H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_a HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_move_entry 0x%lx 0x%lx %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_move_entry 0x%lx 0x%lx %d %d\n", (unsigned long)old_addr, (unsigned long)new_addr, type_id, (int)fxn_ret_value); /* Write the log message to the file */ @@ -648,7 +648,7 @@ H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_pin_protected_entry 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_pin_protected_entry 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -689,7 +689,7 @@ H5C__trace_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, HDassert(child); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_create_flush_dependency 0x%lx 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_create_flush_dependency 0x%lx 0x%lx %d\n", (unsigned long)(parent->addr), (unsigned long)(child->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -728,7 +728,7 @@ H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *ent HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_protect 0x%lx %d 0x%x %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_protect 0x%lx %d 0x%x %d %d\n", (unsigned long)(entry->addr), type_id, flags, (int)(entry->size), (int)fxn_ret_value); /* Write the log message to the file */ @@ -767,7 +767,7 @@ H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entr HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_resize_entry 0x%lx %d %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_resize_entry 0x%lx %d %d\n", (unsigned long)(entry->addr), (int)new_size, (int)fxn_ret_value); /* Write the log message to the file */ @@ -806,7 +806,7 @@ H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unpin_entry 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unpin_entry 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -847,7 +847,7 @@ H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent HDassert(child); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_destroy_flush_dependency 0x%lx 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_destroy_flush_dependency 0x%lx 0x%lx %d\n", (unsigned long)(parent->addr), (unsigned long)(child->addr), (int)fxn_ret_value); /* Write the log message to the file */ @@ -885,7 +885,7 @@ H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unprotect 0x%lx %d 0x%x %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unprotect 0x%lx %d 0x%x %d\n", (unsigned long)(address), type_id, flags, (int)fxn_ret_value); /* Write the log message to the file */ @@ -994,7 +994,7 @@ H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entr HDassert(entry); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_remove_entry 0x%lx %d\n", + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_remove_entry 0x%lx %d\n", (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 2c176e4..0ac4c4f 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -60,7 +60,7 @@ /* Local Prototypes */ /********************/ static herr_t H5C__collective_write(H5F_t *f); -static herr_t H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES], +static herr_t H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES], unsigned entries_to_clear[H5C_RING_NTYPES]); static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flush, unsigned entries_to_clear); @@ -87,20 +87,20 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * Purpose: Apply the supplied candidate list. * - * We used to do this by simply having each process write - * every mpi_size-th entry in the candidate list, starting - * at index mpi_rank, and mark all the others clean. + * We used to do this by simply having each process write + * every mpi_size-th entry in the candidate list, starting + * at index mpi_rank, and mark all the others clean. * - * However, this can cause unnecessary contention in a file - * system by increasing the number of processes writing to + * However, this can cause unnecessary contention in a file + * system by increasing the number of processes writing to * adjacent locations in the HDF5 file. * - * To attempt to minimize this, we now arange matters such - * that each process writes n adjacent entries in the + * To attempt to minimize this, we now arange matters such + * that each process writes n adjacent entries in the * candidate list, and marks all others clean. We must do - * this in such a fashion as to guarantee that each entry - * on the candidate list is written by exactly one process, - * and marked clean by all others. + * this in such a fashion as to guarantee that each entry + * on the candidate list is written by exactly one process, + * and marked clean by all others. * * To do this, first construct a table mapping mpi_rank * to the index of the first entry in the candidate list to @@ -110,7 +110,7 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * Note that the table must be identical on all processes, as * all see the same candidate list, mpi_size, and mpi_rank -- - * the inputs used to construct the table. + * the inputs used to construct the table. * * We construct the table as follows. Let: * @@ -118,18 +118,18 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * m = num_candidates % mpi_size; * - * Now allocate an array of integers of length mpi_size + 1, - * and call this array candidate_assignment_table. + * Now allocate an array of integers of length mpi_size + 1, + * and call this array candidate_assignment_table. * * Conceptually, if the number of candidates is a multiple * of the mpi_size, we simply pass through the candidate list - * and assign n entries to each process to flush, with the - * index of the first entry to flush in the location in + * and assign n entries to each process to flush, with the + * index of the first entry to flush in the location in * the candidate_assignment_table indicated by the mpi_rank - * of the process. + * of the process. * - * In the more common case in which the candidate list isn't - * isn't a multiple of the mpi_size, we pretend it is, and + * In the more common case in which the candidate list isn't + * isn't a multiple of the mpi_size, we pretend it is, and * give num_candidates % mpi_size processes one extra entry * each to make things work out. * @@ -138,22 +138,22 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * first_entry_to_flush = candidate_assignment_table[mpi_rank] * - * last_entry_to_flush = + * last_entry_to_flush = * candidate_assignment_table[mpi_rank + 1] - 1; - * - * With these values determined, we simply scan through the - * candidate list, marking all entries in the range + * + * With these values determined, we simply scan through the + * candidate list, marking all entries in the range * [first_entry_to_flush, last_entry_to_flush] for flush, * and all others to be cleaned. * - * Finally, we scan the LRU from tail to head, flushing + * Finally, we scan the LRU from tail to head, flushing * or marking clean the candidate entries as indicated. * If necessary, we scan the pinned list as well. * - * Note that this function will fail if any protected or + * Note that this function will fail if any protected or * clean entries appear on the candidate list. * - * This function is used in managing sync points, and + * This function is used in managing sync points, and * shouldn't be used elsewhere. * * Return: Success: SUCCEED @@ -246,7 +246,7 @@ H5C_apply_candidate_list(H5F_t * f, for(i = 1; i < mpi_size; i++) candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n; } /* end if */ - else { + else { for(i = 1; i <= m; i++) candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1; @@ -287,7 +287,7 @@ H5C_apply_candidate_list(H5F_t * f, HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); - HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", + HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", FUNC, mpi_rank, first_entry_to_flush, last_entry_to_flush); HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank); @@ -316,7 +316,7 @@ H5C_apply_candidate_list(H5F_t * f, if(entry_ptr->is_protected) /* For now at least, we can't deal with protected entries. * If we encounter one, scream and die. If it becomes an - * issue, we should be able to work around this. + * issue, we should be able to work around this. */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?") @@ -328,9 +328,9 @@ H5C_apply_candidate_list(H5F_t * f, HDassert(!entry_ptr->clear_on_unprotect); /* Determine whether the entry is to be cleared or flushed, - * and mark it accordingly. We will scan the protected and + * and mark it accordingly. We will scan the protected and * pinned list shortly, and clear or flush according to these - * markings. + * markings. */ if(u >= first_entry_to_flush && u <= last_entry_to_flush) { total_entries_to_flush++; @@ -347,7 +347,7 @@ H5C_apply_candidate_list(H5F_t * f, * candidate list to clear from the cache have to be * removed from the coll list. This is OK since the * candidate list is collective and uniform across all - * ranks. + * ranks. */ if(entry_ptr->coll_access) { entry_ptr->coll_access = FALSE; @@ -368,14 +368,14 @@ H5C_apply_candidate_list(H5F_t * f, #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG - HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", + HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", FUNC, mpi_rank, num_candidates, total_entries_to_clear, total_entries_to_flush); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - /* We have now marked all the entries on the candidate list for + /* We have now marked all the entries on the candidate list for * either flush or clear -- now scan the LRU and the pinned list - * for these entries and do the deed. Do this via a call to + * for these entries and do the deed. Do this via a call to * H5C__flush_candidate_entries(). * * Note that we are doing things in this round about manner so as @@ -412,10 +412,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_construct_candidate_list__clean_cache * - * Purpose: Construct the list of entries that should be flushed to + * Purpose: Construct the list of entries that should be flushed to * clean all entries in the cache. * - * This function is used in managing sync points, and + * This function is used in managing sync points, and * shouldn't be used elsewhere. * * Return: Success: SUCCEED @@ -448,9 +448,9 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) * point, it is possible that some dirty entries may reside on the * pinned list at this point. */ - HDassert( cache_ptr->slist_size <= + HDassert( cache_ptr->slist_size <= (cache_ptr->dLRU_list_size + cache_ptr->pel_size) ); - HDassert( cache_ptr->slist_len <= + HDassert( cache_ptr->slist_len <= (cache_ptr->dLRU_list_len + cache_ptr->pel_len) ); if(space_needed > 0) { /* we have work to do */ @@ -462,7 +462,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) HDassert( cache_ptr->slist_len > 0 ); /* Scan the dirty LRU list from tail forward and nominate sufficient - * entries to free up the necessary space. + * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; while((nominated_entries_size < space_needed) && @@ -484,7 +484,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) } /* end while */ HDassert( entry_ptr == NULL ); - /* it is possible that there are some dirty entries on the + /* it is possible that there are some dirty entries on the * protected entry list as well -- scan it too if necessary */ entry_ptr = cache_ptr->pel_head_ptr; @@ -521,10 +521,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_construct_candidate_list__min_clean * - * Purpose: Construct the list of entries that should be flushed to + * Purpose: Construct the list of entries that should be flushed to * get the cache back within its min clean constraints. * - * This function is used in managing sync points, and + * This function is used in managing sync points, and * shouldn't be used elsewhere. * * Return: Success: SUCCEED @@ -547,7 +547,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - /* compute the number of bytes (if any) that must be flushed to get the + /* compute the number of bytes (if any) that must be flushed to get the * cache back within its min clean constraints. */ if(cache_ptr->max_cache_size > cache_ptr->index_size) { @@ -575,7 +575,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) HDassert( cache_ptr->slist_len > 0 ); /* Scan the dirty LRU list from tail forward and nominate sufficient - * entries to free up the necessary space. + * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; while((nominated_entries_size < space_needed) && @@ -751,23 +751,23 @@ H5C_mark_entries_as_clean(H5F_t * f, * any protected entries will not be on the LRU, and therefore * will not be flushed at this time. * - * Note that unlike H5C_apply_candidate_list(), - * H5C_mark_entries_as_clean() makes all its calls to - * H5C__flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG - * set. As a result, the pre_serialize() and serialize calls are + * Note that unlike H5C_apply_candidate_list(), + * H5C_mark_entries_as_clean() makes all its calls to + * H5C__flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG + * set. As a result, the pre_serialize() and serialize calls are * not made. * - * This then implies that (assuming such actions were - * permitted in the parallel case) no loads, dirties, - * resizes, or removals of other entries can occur as + * This then implies that (assuming such actions were + * permitted in the parallel case) no loads, dirties, + * resizes, or removals of other entries can occur as * a side effect of the flush. Hence, there is no need - * for the checks for entry removal / status change + * for the checks for entry removal / status change * that I ported to H5C_apply_candidate_list(). * * However, if (in addition to allowing such operations * in the parallel case), we allow such operations outside - * of the pre_serialize / serialize routines, this may - * cease to be the case -- requiring a review of this + * of the pre_serialize / serialize routines, this may + * cease to be the case -- requiring a review of this * point. * JRM -- 4/7/15 */ @@ -813,7 +813,7 @@ H5C_mark_entries_as_clean(H5F_t * f, pinned_entries_cleared++; progress = TRUE; - if(H5C__flush_single_entry(f, clear_ptr, + if(H5C__flush_single_entry(f, clear_ptr, (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__UPDATE_PAGE_BUFFER_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") } /* end if */ @@ -860,7 +860,7 @@ done: * * Function: H5C_clear_coll_entries * - * Purpose: Clear half or the entire list of collective entries and + * Purpose: Clear half or the entire list of collective entries and * mark them as independent. * * Return: FAIL if error is detected, SUCCEED otherwise. @@ -872,7 +872,7 @@ done: */ herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) -{ +{ uint32_t clear_cnt; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; @@ -1042,8 +1042,8 @@ H5C__collective_write(H5F_t *f) info = *info_p; - /* just to match up with the 1st MPI_File_set_view from - * H5FD_mpio_write() + /* 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) @@ -1053,8 +1053,8 @@ H5C__collective_write(H5F_t *f) 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() + /* 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) diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 6608bc2..8712af5 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -149,8 +149,8 @@ * * JRM - 9/8/05 * - * - Added macros supporting the index list -- a doubly liked list of - * all entries in the index. This list is necessary to reduce the + * - Added macros supporting the index list -- a doubly liked list of + * all entries in the index. This list is necessary to reduce the * cost of visiting all entries in the cache, which was previously * done via a scan of the hash table. * @@ -963,16 +963,16 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ * * JRM -- 11/5/08 * - * - Updated existing index macros and sanity check macros to maintain + * - Updated existing index macros and sanity check macros to maintain * the index_ring_len, index_ring_size, clean_index_ring_size, and * dirty_index_ring_size fields of H5C_t. * * JRM -- 9/1/15 * - * - Updated existing index macros and sanity checks macros to + * - Updated existing index macros and sanity checks macros to * maintain an doubly linked list of all entries in the index. * This is necessary to reduce the computational cost of visiting - * all entries in the index, which used to be done by scanning + * all entries in the index, which used to be done by scanning * the hash table. * * JRM -- 10/15/15 @@ -1561,7 +1561,7 @@ if ( ( (cache_ptr)->index_size != \ * flush. * * JRM -- 12/13/14 - * Added code to set cache_ptr->slist_changed to TRUE + * Added code to set cache_ptr->slist_changed to TRUE * when an entry is inserted in the slist. * * JRM -- 9/1/15 @@ -1762,7 +1762,7 @@ if ( ( (cache_ptr)->index_size != \ * flush. * * JRM -- 12/13/14 - * Note that we do not set cache_ptr->slist_changed to TRUE + * Note that we do not set cache_ptr->slist_changed to TRUE * in this case, as the structure of the slist is not * modified. * @@ -2243,14 +2243,14 @@ if ( ( (cache_ptr)->index_size != \ * Macro: H5C__UPDATE_RP_FOR_INSERT_APPEND * * Purpose: Update the replacement policy data structures for an - * insertion of the specified cache entry. + * insertion of the specified cache entry. * - * Unlike H5C__UPDATE_RP_FOR_INSERTION below, mark the - * new entry as the LEAST recently used entry, not the - * most recently used. + * Unlike H5C__UPDATE_RP_FOR_INSERTION below, mark the + * new entry as the LEAST recently used entry, not the + * most recently used. * - * For now at least, this macro should only be used in - * the reconstruction of the metadata cache from a cache + * For now at least, this macro should only be used in + * the reconstruction of the metadata cache from a cache * image block. * * At present, we only support the modified LRU policy, so @@ -3491,7 +3491,7 @@ typedef struct H5C_tag_info_t { * * JRM - 9/26/05 * - * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. + * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. * This field is used to validate pointers to instances of * H5C_t. * @@ -3544,7 +3544,7 @@ typedef struct H5C_tag_info_t { * clean data so as to avoid case b) above. Again, this is * a soft limit. * - * close_warning_received: Boolean flag indicating that a file closing + * close_warning_received: Boolean flag indicating that a file closing * warning has been received. * * @@ -3576,7 +3576,7 @@ typedef struct H5C_tag_info_t { * this flag is set to FALSE, the metadata cache will not * attempt to evict entries to make space for newly protected * entries, and instead the will grow without limit. - * + * * Needless to say, this feature must be used with care. * * @@ -3586,12 +3586,12 @@ typedef struct H5C_tag_info_t { * Addendum: JRM -- 10/14/15 * * We sometimes need to visit all entries in the cache. In the past, this - * was done by scanning the hash table. However, this is expensive, and - * we have come to scan the hash table often enough that it has become a - * performance issue. To repair this, I have added code to maintain a - * list of all entries in the index -- call this list the index list. + * was done by scanning the hash table. However, this is expensive, and + * we have come to scan the hash table often enough that it has become a + * performance issue. To repair this, I have added code to maintain a + * list of all entries in the index -- call this list the index list. * - * The index list is maintained by the same macros that maintain the + * The index list is maintained by the same macros that maintain the * index, and must have the same length and size as the index proper. * * index_len: Number of entries currently in the hash table used to index @@ -3606,12 +3606,12 @@ typedef struct H5C_tag_info_t { * index_size by three should yield a conservative estimate * of the cache's memory footprint. * - * index_ring_len: Array of integer of length H5C_RING_NTYPES used to - * maintain a count of entries in the index by ring. Note - * that the sum of all the cells in this array must equal + * index_ring_len: Array of integer of length H5C_RING_NTYPES used to + * maintain a count of entries in the index by ring. Note + * that the sum of all the cells in this array must equal * the value stored in index_len above. * - * index_ring_size: Array of size_t of length H5C_RING_NTYPES used to + * index_ring_size: Array of size_t of length H5C_RING_NTYPES used to * maintain the sum of the sizes of all entries in the index * by ring. Note that the sum of all cells in this array must * equal the value stored in index_size above. @@ -3631,8 +3631,8 @@ typedef struct H5C_tag_info_t { * in the cache. * * clean_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all clean entries in the - * index by ring. Note that the sum of all cells in this array + * maintain the sum of the sizes of all clean entries in the + * index by ring. Note that the sum of all cells in this array * must equal the value stored in clean_index_size above. * * dirty_index_size: Number of bytes of dirty entries currently stored in @@ -3642,8 +3642,8 @@ typedef struct H5C_tag_info_t { * dirty_index_size == index_size. * * dirty_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all dirty entries in the - * index by ring. Note that the sum of all cells in this array + * maintain the sum of the sizes of all dirty entries in the + * index by ring. Note that the sum of all cells in this array * must equal the value stored in dirty_index_size above. * * index: Array of pointer to H5C_cache_entry_t of size @@ -3661,52 +3661,52 @@ typedef struct H5C_tag_info_t { * changing the H5C__HASH_FCN macro and the deletion of the * H5C__HASH_MASK #define. No other changes should be required. * - * il_len: Number of entries on the index list. + * il_len: Number of entries on the index list. * - * This must always be equal to index_len. As such, this - * field is redundant. However, the existing linked list - * management macros expect to maintain a length field, so + * This must always be equal to index_len. As such, this + * field is redundant. However, the existing linked list + * management macros expect to maintain a length field, so * this field exists primarily to avoid adding complexity to * these macros. * * il_size: Number of bytes of cache entries currently stored in the * index list. * - * This must always be equal to index_size. As such, this - * field is redundant. However, the existing linked list - * management macros expect to maintain a size field, so + * This must always be equal to index_size. As such, this + * field is redundant. However, the existing linked list + * management macros expect to maintain a size field, so * this field exists primarily to avoid adding complexity to * these macros. * * il_head: Pointer to the head of the doubly linked list of entries in - * the index list. Note that cache entries on this list are + * the index list. Note that cache entries on this list are * linked by their il_next and il_prev fields. * * This field is NULL if the index is empty. * * il_tail: Pointer to the tail of the doubly linked list of entries in - * the index list. Note that cache entries on this list are + * the index list. Note that cache entries on this list are * linked by their il_next and il_prev fields. * * This field is NULL if the index is empty. * * - * With the addition of the take ownership flag, it is possible that - * an entry may be removed from the cache as the result of the flush of - * a second entry. In general, this causes little trouble, but it is - * possible that the entry removed may be the next entry in the scan of - * a list. In this case, we must be able to detect the fact that the + * With the addition of the take ownership flag, it is possible that + * an entry may be removed from the cache as the result of the flush of + * a second entry. In general, this causes little trouble, but it is + * possible that the entry removed may be the next entry in the scan of + * a list. In this case, we must be able to detect the fact that the * entry has been removed, so that the scan doesn't attempt to proceed with * an entry that is no longer in the cache. * * The following fields are maintained to facilitate this. * * entries_removed_counter: Counter that is incremented each time an - * entry is removed from the cache by any means (eviction, + * entry is removed from the cache by any means (eviction, * expungement, or take ownership at this point in time). * Functions that perform scans on lists may set this field - * to zero prior to calling H5C__flush_single_entry(). - * Unexpected changes to the counter indicate that an entry + * to zero prior to calling H5C__flush_single_entry(). + * Unexpected changes to the counter indicate that an entry * was removed from the cache as a side effect of the flush. * * last_entry_removed_ptr: Pointer to the instance of H5C_cache_entry_t @@ -3715,11 +3715,11 @@ typedef struct H5C_tag_info_t { * performing a scan of a list has set this field to NULL prior * to calling H5C__flush_single_entry(). * - * WARNING!!! This field must NEVER be dereferenced. It is + * WARNING!!! This field must NEVER be dereferenced. It is * maintained to allow functions that perform scans of lists * to compare this pointer with their pointers to next, thus * allowing them to avoid unnecessary restarts of scans if the - * pointers don't match, and if entries_removed_counter is + * pointers don't match, and if entries_removed_counter is * one. * * entry_watched_for_removal: Pointer to an instance of H5C_cache_entry_t @@ -3740,11 +3740,11 @@ typedef struct H5C_tag_info_t { * are flushed. (this has been changed -- dirty entries are now removed from * the skip list as they are flushed. JRM - 10/25/05) * - * slist_changed: Boolean flag used to indicate whether the contents of + * slist_changed: Boolean flag used to indicate whether the contents of * the slist has changed since the last time this flag was - * reset. This is used in the cache flush code to detect + * reset. This is used in the cache flush code to detect * conditions in which pre-serialize or serialize callbacks - * have modified the slist -- which obliges us to restart + * have modified the slist -- which obliges us to restart * the scan of the slist from the beginning. * * slist_len: Number of entries currently in the skip list @@ -3755,14 +3755,14 @@ typedef struct H5C_tag_info_t { * skip list used to maintain a sorted list of * dirty entries in the cache. * - * slist_ring_len: Array of integer of length H5C_RING_NTYPES used to - * maintain a count of entries in the slist by ring. Note - * that the sum of all the cells in this array must equal + * slist_ring_len: Array of integer of length H5C_RING_NTYPES used to + * maintain a count of entries in the slist by ring. Note + * that the sum of all the cells in this array must equal * the value stored in slist_len above. * * slist_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all entries in the - * slist by ring. Note that the sum of all cells in this + * maintain the sum of the sizes of all entries in the + * slist by ring. Note that the sum of all cells in this * array must equal the value stored in slist_size above. * * slist_ptr: pointer to the instance of H5SL_t used maintain a sorted @@ -3826,7 +3826,7 @@ typedef struct H5C_tag_info_t { * num_objs_corked: Unsigned integer field containing the number of objects * that are "corked". The "corked" status of an object is * found by searching the "tag_list". This field is added - * for optimization so that the skip list search on "tag_list" + * for optimization so that the skip list search on "tag_list" * can be skipped if this field is zero, i.e. no "corked" * objects. * @@ -3867,7 +3867,7 @@ typedef struct H5C_tag_info_t { * * 2) A pinned entry can be accessed or modified at any time. * This places an additional burden on the associated pre-serialize - * and serialize callbacks, which must ensure the the entry is in + * and serialize callbacks, which must ensure the the entry is in * a consistent state before creating an image of it. * * 3) A pinned entry can be marked as dirty (and possibly @@ -3878,7 +3878,7 @@ typedef struct H5C_tag_info_t { * flush. * * Since pinned entries cannot be evicted, they must be kept on a pinned - * entry list (pel), instead of being entrusted to the replacement policy + * entry list (pel), instead of being entrusted to the replacement policy * code. * * Maintaining the pinned entry list requires the following fields: @@ -3907,7 +3907,7 @@ typedef struct H5C_tag_info_t { * * While there has been interest in several replacement policies for * this cache, the initial development schedule is tight. Thus I have - * elected to support only a modified LRU (least recently used) policy + * elected to support only a modified LRU (least recently used) policy * for the first cut. * * To further simplify matters, I have simply included the fields needed @@ -3926,7 +3926,7 @@ typedef struct H5C_tag_info_t { * be collective and the other processes will not know to participate. * * To deal with this issue, I have modified the usual LRU policy by adding - * clean and dirty LRU lists to the usual LRU list. In general, these + * clean and dirty LRU lists to the usual LRU list. In general, these * lists are only exist in parallel builds. * * The clean LRU list is simply the regular LRU list with all dirty cache @@ -3954,13 +3954,13 @@ typedef struct H5C_tag_info_t { * * LRU_list_len: Number of cache entries currently on the LRU list. * - * Observe that LRU_list_len + pl_len + pel_len must always + * Observe that LRU_list_len + pl_len + pel_len must always * equal index_len. * * LRU_list_size: Number of bytes of cache entries currently residing on the * LRU list. * - * Observe that LRU_list_size + pl_size + pel_size must always + * Observe that LRU_list_size + pl_size + pel_size must always * equal index_size. * * LRU_head_ptr: Pointer to the head of the doubly linked LRU list. Cache @@ -4071,25 +4071,25 @@ typedef struct H5C_tag_info_t { * size is decreased. The flag triggers a call to * H5C__make_space_in_cache() on the next call to H5C_protect(). * - * resize_in_progress: As the metadata cache has become re-entrant, it is - * possible that a protect may trigger a call to + * resize_in_progress: As the metadata cache has become re-entrant, it is + * possible that a protect may trigger a call to * H5C__auto_adjust_cache_size(), which may trigger a flush, - * which may trigger a protect, which will result in another - * call to H5C__auto_adjust_cache_size(). + * which may trigger a protect, which will result in another + * call to H5C__auto_adjust_cache_size(). * * The resize_in_progress boolean flag is used to detect this, * and to prevent the infinite recursion that would otherwise * occur. * - * Note that this issue is not hypothetical -- this field - * was added 12/29/15 to fix a bug exposed in the testing + * Note that this issue is not hypothetical -- this field + * was added 12/29/15 to fix a bug exposed in the testing * of changes to the file driver info superblock extension * management code needed to support rings. * * msic_in_progress: As the metadata cache has become re-entrant, and as - * the free space manager code has become more tightly - * integrated with the metadata cache, it is possible that - * a call to H5C_insert_entry() may trigger a call to + * the free space manager code has become more tightly + * integrated with the metadata cache, it is possible that + * a call to H5C_insert_entry() may trigger a call to * H5C_make_space_in_cache(), which, via H5C__flush_single_entry() * and client callbacks, may trigger an infinite regression * of calls to H5C_make_space_in_cache(). @@ -4098,9 +4098,9 @@ typedef struct H5C_tag_info_t { * and prevent the infinite regression that would otherwise * occur. * - * Note that this is issue is not hypothetical -- this field - * was added 2/16/17 to address this issue when it was - * exposed by modifications to test/fheap.c to cause it to + * Note that this is issue is not hypothetical -- this field + * was added 2/16/17 to address this issue when it was + * exposed by modifications to test/fheap.c to cause it to * use paged allocation. * * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration @@ -4184,45 +4184,45 @@ typedef struct H5C_tag_info_t { * data for generation of a cache image on file close. * * serialization_in_progress: Boolean field that is set to TRUE iff - * the cache is in the process of being serialized. This + * the cache is in the process of being serialized. This * field is needed to support the H5C_serialization_in_progress() * call, which is in turn required for sanity checks in some * cache clients. * - * load_image: Boolean flag indicating that the metadata cache image - * superblock extension message exists and should be + * load_image: Boolean flag indicating that the metadata cache image + * superblock extension message exists and should be * read, and the image block read and decoded on the next - * call to H5C_protect(). + * call to H5C_protect(). * - * image_loaded: Boolean flag indicating that the metadata cache has - * loaded the metadata cache image as directed by the + * image_loaded: Boolean flag indicating that the metadata cache has + * loaded the metadata cache image as directed by the * MDC cache image superblock extension message. * * delete_image: Boolean flag indicating whether the metadata cache image * superblock message should be deleted and the cache image * file space freed after they have been read and decoded. * - * This flag should be set to TRUE iff the file is opened + * This flag should be set to TRUE iff the file is opened * R/W and there is a cache image to be read. * - * image_addr: haddr_t containing the base address of the on disk - * metadata cache image, or HADDR_UNDEF if that value is - * undefined. Note that this field is used both in the - * construction and write, and the read and decode of + * image_addr: haddr_t containing the base address of the on disk + * metadata cache image, or HADDR_UNDEF if that value is + * undefined. Note that this field is used both in the + * construction and write, and the read and decode of * metadata cache image blocks. * - * image_len: hsize_t containing the size of the on disk metadata cache - * image, or zero if that value is undefined. Note that this - * field is used both in the construction and write, and the + * image_len: hsize_t containing the size of the on disk metadata cache + * image, or zero if that value is undefined. Note that this + * field is used both in the construction and write, and the * read and decode of metadata cache image blocks. * - * image_data_len: size_t containing the number of bytes of data in the - * on disk metadata cache image, or zero if that value is + * image_data_len: size_t containing the number of bytes of data in the + * on disk metadata cache image, or zero if that value is * undefined. * * In most cases, this value is the same as the image_len * above. It exists to allow for metadata cache image blocks - * that are larger than the actual image. Thus in all + * that are larger than the actual image. Thus in all * cases image_data_len <= image_len. * * To create the metadata cache image, we must first serialize all the @@ -4232,27 +4232,27 @@ typedef struct H5C_tag_info_t { * height in increasing order. * * This operation is complicated by the fact that entries other the the - * target may be inserted, loaded, relocated, or removed from the cache - * (either by eviction or the take ownership flag) as the result of a - * pre_serialize or serialize callback. While entry removals are not + * target may be inserted, loaded, relocated, or removed from the cache + * (either by eviction or the take ownership flag) as the result of a + * pre_serialize or serialize callback. While entry removals are not * a problem for the scan of the index, insertions, loads, and relocations - * are. Hence the entries loaded, inserted, and relocated counters - * listed below have been implemented to allow these conditions to be + * are. Hence the entries loaded, inserted, and relocated counters + * listed below have been implemented to allow these conditions to be * detected and dealt with by restarting the scan. * - * The serialization operation is further complicated by the fact that - * the flush dependency height of a given entry may increase (as the - * result of an entry load or insert) or decrease (as the result of an + * The serialization operation is further complicated by the fact that + * the flush dependency height of a given entry may increase (as the + * result of an entry load or insert) or decrease (as the result of an * entry removal -- via either eviction or the take ownership flag). The * entry_fd_height_change_counter field is maintained to allow detection * of this condition, and a restart of the scan when it occurs. * * Note that all these new fields would work just as well as booleans. * - * entries_loaded_counter: Number of entries loaded into the cache + * entries_loaded_counter: Number of entries loaded into the cache * since the last time this field was reset. * - * entries_inserted_counter: Number of entries inserted into the cache + * entries_inserted_counter: Number of entries inserted into the cache * since the last time this field was reset. * * entries relocated_counter: Number of entries whose base address has @@ -4261,32 +4261,32 @@ typedef struct H5C_tag_info_t { * entry_fd_height_change_counter: Number of entries whose flush dependency * height has changed since the last time this field was reset. * - * The following fields are used assemble the cache image prior to + * The following fields are used assemble the cache image prior to * writing it to disk. * * num_entries_in_image: Unsigned integer field containing the number of entries - * to be copied into the metadata cache image. Note that - * this value will be less than the number of entries in - * the cache, and the superblock and its related entries + * to be copied into the metadata cache image. Note that + * this value will be less than the number of entries in + * the cache, and the superblock and its related entries * are not written to the metadata cache image. * * image_entries: Pointer to a dynamically allocated array of instance of * H5C_image_entry_t of length num_entries_in_image, or NULL * if that array does not exist. This array is used to - * assemble entry data to be included in the image, and to + * assemble entry data to be included in the image, and to * sort them by flush dependency height and LRU rank. - * + * * image_buffer: Pointer to the dynamically allocated buffer of length - * image_len in which the metadata cache image is assembled, + * image_len in which the metadata cache image is assembled, * or NULL if that buffer does not exist. * * * Free Space Manager Related fields: * - * The free space managers must be informed when we are about to close + * The free space managers must be informed when we are about to close * or flush the file so that they order themselves accordingly. This used - * to be done much later in the close process, but with cache image and - * page buffering, this is no longer viable, as we must finalize the on + * to be done much later in the close process, but with cache image and + * page buffering, this is no longer viable, as we must finalize the on * disk image of all metadata much sooner. * * This is handled by the H5MF_settle_raw_data_fsm() and @@ -4300,11 +4300,11 @@ typedef struct H5C_tag_info_t { * flush is complete. * * rdfsm_settled: Boolean flag indicating whether the raw data free space - * manager is settled -- i.e. whether the correct space has + * manager is settled -- i.e. whether the correct space has * been allocated for it in the file. * - * Note that the name of this field is deceptive. In the - * multi file case, the flag applies to all free space + * Note that the name of this field is deceptive. In the + * multi file case, the flag applies to all free space * managers that are not involved in allocating space for * free space manager metadata. * @@ -4312,9 +4312,9 @@ typedef struct H5C_tag_info_t { * manager is settled -- i.e. whether the correct space has * been allocated for it in the file. * - * Note that the name of this field is deceptive. In the - * multi file case, the flag applies only to free space - * managers that are involved in allocating space for free + * Note that the name of this field is deceptive. In the + * multi file case, the flag applies only to free space + * managers that are involved in allocating space for free * space managers. * * @@ -4358,7 +4358,7 @@ typedef struct H5C_tag_info_t { * id equal to the array index has been inserted into the * cache in the current epoch. * - * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. * The cells are used to record the number of times an entry * with type id equal to the array index has been inserted * pinned into the cache in the current epoch. @@ -4378,9 +4378,9 @@ typedef struct H5C_tag_info_t { * equal to the array index has been evicted from the cache in * the current epoch. * - * take_ownerships: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry with - * type id equal to the array index has been removed from the + * take_ownerships: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * cells are used to record the number of times an entry with + * type id equal to the array index has been removed from the * cache via the H5C__TAKE_OWNERSHIP_FLAG in the current epoch. * * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells @@ -4388,12 +4388,12 @@ typedef struct H5C_tag_info_t { * id equal to the array index has been moved in the current * epoch. * - * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. * The cells are used to record the number of times an entry * with type id equal to the array index has been moved * during its pre-serialize callback in the current epoch. * - * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. * The cells are used to record the number of times an entry * with type id equal to the array index has been moved * during a cache flush in the current epoch. @@ -4436,7 +4436,7 @@ typedef struct H5C_tag_info_t { * entry_flush_size_changes: Array of int64 of length * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record * the number of times an entry with type id equal to the - * array index has changed size while in its pre-serialize + * array index has changed size while in its pre-serialize * callback. * * cache_flush_size_changes: Array of int64 of length @@ -4500,7 +4500,7 @@ typedef struct H5C_tag_info_t { * enforcing the min_clean_fraction in H5C__make_space_in_cache(). * * total_dirty_pf_entries_skipped_in_msic: Number of dirty prefetched entries - * skipped in H5C__make_space_in_cache(). Note that this can + * skipped in H5C__make_space_in_cache(). Note that this can * only occur when a file is opened R/O with a cache image * containing dirty entries. * @@ -4512,7 +4512,7 @@ typedef struct H5C_tag_info_t { * * max_dirty_pf_entries_skipped_in_msic: Maximum number of dirty prefetched * entries skipped in any one call to H5C__make_space_in_cache(). - * Note that this can only occur when the file is opened + * Note that this can only occur when the file is opened * R/O with a cache image containing dirty entries. * * max_entries_scanned_in_msic: Maximum number of entries scanned over @@ -4522,24 +4522,24 @@ typedef struct H5C_tag_info_t { * for entries to evict in order to make space in cache. * * - * The following fields track statistics on cache images. + * The following fields track statistics on cache images. * * images_created: Integer field containing the number of cache images - * created since the last time statistics were reset. + * created since the last time statistics were reset. * * At present, this field must always be either 0 or 1. - * Further, since cache images are only created at file + * 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 + * 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 + * 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. * @@ -4547,25 +4547,25 @@ typedef struct H5C_tag_info_t { * loaded since the last time statistics were reset. * * At present, this field must always be either 0 or 1. - * Further, since cache images are only loaded at the + * Further, since cache images are only loaded at the * time of the first protect or on file close, this value * should only change on those events. * * last_image_size: Size of the most recently loaded metadata cache image * loaded into the cache, or zero if no image has been - * loaded. + * loaded. * - * At present, at most one cache image can be loaded into + * At present, at most one cache image can be loaded into * the metadata cache for any given file, and this image * will be loaded either on the first protect, or on file * close if no entry is protected before then. * * * Fields for tracking prefetched entries. Note that flushes and evictions - * of prefetched entries are tracked in the flushes and evictions arrays + * of prefetched entries are tracked in the flushes and evictions arrays * discused above. * - * prefetches: Number of prefetched entries that are loaded to the + * prefetches: Number of prefetched entries that are loaded to the * cache. * * dirty_prefetches: Number of dirty prefetched entries that are loaded @@ -4573,30 +4573,30 @@ typedef struct H5C_tag_info_t { * * prefetch_hits: Number of prefetched entries that are actually used. * - * - * As entries are now capable of moving, loading, dirtying, and deleting - * other entries in their pre_serialize and serialize callbacks, it has - * been necessary to insert code to restart scans of lists so as to avoid - * improper behavior if the next entry in the list is the target of one on + * + * As entries are now capable of moving, loading, dirtying, and deleting + * other entries in their pre_serialize and serialize callbacks, it has + * been necessary to insert code to restart scans of lists so as to avoid + * improper behavior if the next entry in the list is the target of one on * these operations. * - * The following fields are use to count such occurrences. They are used - * both in tests (to verify that the scan has been restarted), and to + * The following fields are use to count such occurrences. They are used + * both in tests (to verify that the scan has been restarted), and to * obtain estimates of how frequently these restarts occur. * * slist_scan_restarts: Number of times a scan of the slist (that contains - * calls to H5C__flush_single_entry()) has been restarted to - * avoid potential issues with change of status of the next + * calls to H5C__flush_single_entry()) has been restarted to + * avoid potential issues with change of status of the next * entry in the scan. * * LRU_scan_restarts: Number of times a scan of the LRU list (that contains - * calls to H5C__flush_single_entry()) has been restarted to - * avoid potential issues with change of status of the next + * calls to H5C__flush_single_entry()) has been restarted to + * avoid potential issues with change of status of the next * entry in the scan. * - * index_scan_restarts: Number of times a scan of the index has been + * index_scan_restarts: Number of times a scan of the index has been * restarted to avoid potential issues with load, insertion - * or change in flush dependency height of an entry other + * or change in flush dependency height of an entry other * than the target entry as the result of call(s) to the * pre_serialize or serialize callbacks. * @@ -4850,7 +4850,7 @@ struct H5C_t { int32_t max_dirty_pf_entries_skipped_in_msic; int32_t max_entries_scanned_in_msic; int64_t entries_scanned_to_make_space; - + /* Fields for tracking skip list scan restarts */ int64_t slist_scan_restarts; int64_t LRU_scan_restarts; diff --git a/src/H5Cprefetched.c b/src/H5Cprefetched.c index 0befdf9..954dd60 100644 --- a/src/H5Cprefetched.c +++ b/src/H5Cprefetched.c @@ -66,7 +66,7 @@ static herr_t H5C__prefetched_entry_pre_serialize(H5F_t *f, void *thing, unsigned *flags_ptr); static herr_t H5C__prefetched_entry_serialize(const H5F_t *f, void *image_ptr, size_t len, void *thing); -static herr_t H5C__prefetched_entry_notify(H5C_notify_action_t action, +static herr_t H5C__prefetched_entry_notify(H5C_notify_action_t action, void *thing); static herr_t H5C__prefetched_entry_free_icr(void *thing); static herr_t H5C__prefetched_entry_fsf_size(const void *thing, @@ -111,12 +111,12 @@ const H5AC_class_t H5AC_PREFETCHED_ENTRY[1] = {{ /*************************************************************************** - * With two exceptions, these functions should never be called, and thus + * With two exceptions, these functions should never be called, and thus * there is little point in documenting them separately as they all simply * throw an error. * * See header comments for the two exceptions (free_icr and notify). - * + * * JRM - 8/13/15 * ***************************************************************************/ @@ -157,8 +157,8 @@ H5C__prefetched_entry_verify_chksum(const void H5_ATTR_UNUSED *image_ptr, static void * -H5C__prefetched_entry_deserialize(const void H5_ATTR_UNUSED * image_ptr, - size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED * udata, +H5C__prefetched_entry_deserialize(const void H5_ATTR_UNUSED * image_ptr, + size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED * udata, hbool_t H5_ATTR_UNUSED * dirty_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ @@ -182,9 +182,9 @@ H5C__prefetched_entry_image_len(const void H5_ATTR_UNUSED *thing, static herr_t -H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *thing, +H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len, - haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr, + haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr, unsigned H5_ATTR_UNUSED *flags_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ @@ -196,7 +196,7 @@ H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED static herr_t -H5C__prefetched_entry_serialize(const H5F_t H5_ATTR_UNUSED *f, +H5C__prefetched_entry_serialize(const H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *image_ptr, size_t H5_ATTR_UNUSED len, void H5_ATTR_UNUSED *thing) { @@ -211,7 +211,7 @@ H5C__prefetched_entry_serialize(const H5F_t H5_ATTR_UNUSED *f, /*------------------------------------------------------------------------- * Function: H5C__prefetched_entry_notify * - * Purpose: On H5AC_NOTIFY_ACTION_BEFORE_EVICT, check to see if the + * Purpose: On H5AC_NOTIFY_ACTION_BEFORE_EVICT, check to see if the * target entry is a child in a flush dependency relationship. * If it is, destroy that flush dependency relationship. * @@ -243,18 +243,18 @@ H5C__prefetched_entry_notify(H5C_notify_action_t action, void *_thing) case H5C_NOTIFY_ACTION_AFTER_INSERT: case H5C_NOTIFY_ACTION_AFTER_LOAD: case H5C_NOTIFY_ACTION_AFTER_FLUSH: - case H5C_NOTIFY_ACTION_ENTRY_DIRTIED: - case H5C_NOTIFY_ACTION_ENTRY_CLEANED: - case H5C_NOTIFY_ACTION_CHILD_DIRTIED: - case H5C_NOTIFY_ACTION_CHILD_CLEANED: - case H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED: - case H5C_NOTIFY_ACTION_CHILD_SERIALIZED: + case H5C_NOTIFY_ACTION_ENTRY_DIRTIED: + case H5C_NOTIFY_ACTION_ENTRY_CLEANED: + case H5C_NOTIFY_ACTION_CHILD_DIRTIED: + case H5C_NOTIFY_ACTION_CHILD_CLEANED: + case H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED: + case H5C_NOTIFY_ACTION_CHILD_SERIALIZED: /* do nothing */ break; case H5C_NOTIFY_ACTION_BEFORE_EVICT: for(u = 0; u < entry_ptr->flush_dep_nparents; u++) { - H5C_cache_entry_t * parent_ptr; + H5C_cache_entry_t * parent_ptr; /* Sanity checks */ HDassert(entry_ptr->flush_dep_parent); @@ -268,9 +268,9 @@ H5C__prefetched_entry_notify(H5C_notify_action_t action, void *_thing) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "unable to destroy prefetched entry flush dependency") if(parent_ptr->prefetched) { - /* In prefetched entries, the fd_child_count field is - * used in sanity checks elsewhere. Thus update this - * field to reflect the destruction of the flush + /* In prefetched entries, the fd_child_count field is + * used in sanity checks elsewhere. Thus update this + * field to reflect the destruction of the flush * dependency relationship. */ HDassert(parent_ptr->fd_child_count > 0); @@ -335,8 +335,8 @@ done: } /* end H5C__prefetched_entry_free_icr() */ -static herr_t -H5C__prefetched_entry_fsf_size(const void H5_ATTR_UNUSED *thing, +static herr_t +H5C__prefetched_entry_fsf_size(const void H5_ATTR_UNUSED *thing, hsize_t H5_ATTR_UNUSED *fsf_size_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index bd200e0..0ba0234 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -150,7 +150,7 @@ * * These flags apply to H5C_protect() * H5C__READ_ONLY_FLAG - * H5C__FLUSH_LAST_FLAG ; super block only + * H5C__FLUSH_LAST_FLAG ; super block only * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only * * These flags apply to H5C_unprotect(): @@ -213,8 +213,8 @@ #define H5C_DO_TAGGING_SANITY_CHECKS 1 #define H5C_DO_EXTREME_SANITY_CHECKS 0 #else /* NDEBUG */ -/* With rare execptions, the following defines should be set - * to 0 if NDEBUG is defined +/* With rare execptions, the following defines should be set + * to 0 if NDEBUG is defined */ #define H5C_DO_SANITY_CHECKS 0 #define H5C_DO_SLIST_SANITY_CHECKS 0 @@ -292,50 +292,50 @@ typedef struct H5C_t H5C_t; * H5C__CLASS_NO_FLAGS_SET: No special processing. * * H5C__CLASS_SPECULATIVE_LOAD_FLAG: This flag is used only in - * H5C_load_entry(). When it is set, entries are - * permitted to change their sizes on the first attempt - * to load. + * H5C_load_entry(). When it is set, entries are + * permitted to change their sizes on the first attempt + * to load. * * If the new size is larger than the old, the read buffer - * is reallocated to the new size, loaded from file, and the - * deserialize routine is called a second time on the - * new buffer. The entry returned by the first call to + * is reallocated to the new size, loaded from file, and the + * deserialize routine is called a second time on the + * new buffer. The entry returned by the first call to * the deserialize routine is discarded (via the free_icr * call) after the new size is retrieved (via the image_len - * call). Note that the new size is used as the size of the + * call). Note that the new size is used as the size of the * entry in the cache. * - * If the new size is smaller than the old, no new loads + * If the new size is smaller than the old, no new loads * or deserializes are performed, but the new size becomes * the size of the entry in the cache. * - * When this flag is set, an attempt to read past the - * end of file could occur. In this case, if the size - * returned get_load_size callback would result in a - * read past the end of file, the size is truncated to + * When this flag is set, an attempt to read past the + * end of file could occur. In this case, if the size + * returned get_load_size callback would result in a + * read past the end of file, the size is truncated to * avoid this, and processing proceeds as normal. * * The following flags may only appear in test code. * * H5C__CLASS_SKIP_READS: This flags is intended only for use in test * code. When it is set, reads on load will be skipped, - * and an uninitialize buffer will be passed to the + * and an uninitialize buffer will be passed to the * deserialize function. * * H5C__CLASS_SKIP_WRITES: This flags is intended only for use in test - * code. When it is set, writes of buffers prepared by the + * code. When it is set, writes of buffers prepared by the * serialize callback will be skipped. * * GET_INITIAL_LOAD_SIZE: Pointer to the 'get initial load size' function. * - * This function determines the size based on the information in the + * This function determines the size based on the information in the * parameter "udata" or an initial speculative guess. The size is * returned in the parameter "image_len_ptr". * * For an entry with H5C__CLASS_NO_FLAGS_SET: * This function returns in "image_len_ptr" the on disk size of the * entry. - * + * * For an entry with H5C__CLASS_SPECULATIVE_LOAD_FLAG: * This function returns in "image_len_ptr" an initial guess of the * entry's on disk size. This many bytes will be loaded from @@ -359,7 +359,7 @@ typedef struct H5C_t H5C_t; * This value is used by the cache to determine the size of * the disk image for the metadata, in order to read the disk * image from the file. - * + * * Processing in the get_load_size function should proceed as follows: * * If successful, the function will place the length in the *image_len_ptr @@ -420,17 +420,17 @@ typedef struct H5C_t H5C_t; * the same as the checksum stored in the metadata. * * It computes the checksum based on the metadata stored in the - * parameter "image_ptr" and the actual length of the metadata in the + * parameter "image_ptr" and the actual length of the metadata in the * parameter "len" which is obtained from the "get_load_size" callback. * * The typedef for the verify_chksum callback is as follows: * - * typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, - * size_t len, + * typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, + * size_t len, * void *udata_ptr); * * The parameters of the verify_chksum callback are as follows: - * + * * image_ptr: Pointer to a buffer containing the metadata read in. * * len: The actual length of the metadata. @@ -539,23 +539,23 @@ typedef struct H5C_t H5C_t; * responsible for serializing the data structure, not moving it on disk * or resizing it. * - * In addition, the client may use the pre-serialize callback to - * ensure that the entry is ready to be flushed -- in particular, - * if the entry contains references to other entries that are in + * In addition, the client may use the pre-serialize callback to + * ensure that the entry is ready to be flushed -- in particular, + * if the entry contains references to other entries that are in * temporary file space, the pre-serialize callback must move those - * entries into real file space so that the serialzed entry will + * entries into real file space so that the serialzed entry will * contain no invalid data. * * One would think that the base address and length of - * the length of the entry's image on disk would be well known. + * the length of the entry's image on disk would be well known. * However, that need not be the case as free space section info - * entries will change size (and possibly location) depending on the - * number of blocks of free space being manages, and fractal heap - * direct blocks can change compressed size (and possibly location) + * entries will change size (and possibly location) depending on the + * number of blocks of free space being manages, and fractal heap + * direct blocks can change compressed size (and possibly location) * on serialization if compression is enabled. Similarly, it may * be necessary to move entries from temporary to real file space. * - * The pre-serialize callback must report any such changes to the + * The pre-serialize callback must report any such changes to the * cache, which must then update its internal structures as needed. * * The typedef for the pre-serialize callback is as follows: @@ -575,7 +575,7 @@ typedef struct H5C_t H5C_t; * target entry. * * thing: Pointer to void containing the address of the in core - * representation of the target metadata cache entry. + * representation of the target metadata cache entry. * This is the same pointer returned by a protect of the * addr and len given above. * @@ -587,8 +587,8 @@ typedef struct H5C_t H5C_t; * production mode. * * len: Length in bytes of the in file image of the entry to be - * serialized. Also the size the image passed to the - * serialize callback (discussed below) unless that + * serialized. Also the size the image passed to the + * serialize callback (discussed below) unless that * value is altered by this function. * * This parameter is supplied mainly for sanity checking. @@ -599,10 +599,10 @@ typedef struct H5C_t H5C_t; * new_addr_ptr: Pointer to haddr_t. If the entry is moved by * the serialize function, the new on disk base address must * be stored in *new_addr_ptr, and the appropriate flag set - * in *flags_ptr. + * in *flags_ptr. * - * If the entry is not moved by the serialize function, - * *new_addr_ptr is undefined on pre-serialize callback + * If the entry is not moved by the serialize function, + * *new_addr_ptr is undefined on pre-serialize callback * return. * * new_len_ptr: Pointer to size_t. If the entry is resized by the @@ -610,8 +610,8 @@ typedef struct H5C_t H5C_t; * must be stored in *new_len_ptr, and the appropriate flag set * in *flags_ptr. * - * If the entry is not resized by the pre-serialize function, - * *new_len_ptr is undefined on pre-serialize callback + * If the entry is not resized by the pre-serialize function, + * *new_len_ptr is undefined on pre-serialize callback * return. * * flags_ptr: Pointer to an unsigned integer used to return flags @@ -625,27 +625,27 @@ typedef struct H5C_t H5C_t; * must be stored in *new_len_ptr. * * If the H5C__SERIALIZE_MOVED_FLAG flag is set, the - * new image base address must be stored in *new_addr_ptr. + * new image base address must be stored in *new_addr_ptr. * * Processing in the pre-serialize function should proceed as follows: * * The pre-serialize function must examine the in core representation * indicated by the thing parameter, if the pre-serialize function does * not need to change the size or location of the on-disk image, it must - * set *flags_ptr to zero. + * set *flags_ptr to zero. * * If the size of the on-disk image must be changed, the pre-serialize * function must load the length of the new image into *new_len_ptr, and - * set the H5C__SERIALIZE_RESIZED_FLAG in *flags_ptr. + * set the H5C__SERIALIZE_RESIZED_FLAG in *flags_ptr. * * If the base address of the on disk image must be changed, the * pre-serialize function must set *new_addr_ptr to the new base address, * and set the H5C__SERIALIZE_MOVED_FLAG in *flags_ptr. * - * In addition, the pre-serialize callback may perform any other + * In addition, the pre-serialize callback may perform any other * processing required before the entry is written to disk * - * If it is successful, the function must return SUCCEED. + * If it is successful, the function must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API @@ -660,11 +660,11 @@ typedef struct H5C_t H5C_t; * * At this point, the base address and length of the entry's image on * disk must be well known and not change during the serialization - * process. + * process. * - * While any size and/or location changes must have been handled - * by a pre-serialize call, the client may elect to handle any other - * changes to the entry required to place it in correct form for + * While any size and/or location changes must have been handled + * by a pre-serialize call, the client may elect to handle any other + * changes to the entry required to place it in correct form for * writing to disk in this call. * * The typedef for the serialize callback is as follows: @@ -698,20 +698,20 @@ typedef struct H5C_t H5C_t; * production mode. * * thing: Pointer to void containing the address of the in core - * representation of the target metadata cache entry. + * representation of the target metadata cache entry. * This is the same pointer returned by a protect of the * addr and len given above. * * Processing in the serialize function should proceed as follows: * - * If there are any remaining changes to the entry required before + * If there are any remaining changes to the entry required before * write to disk, they must be dealt with first. * - * The serialize function must then examine the in core - * representation indicated by the thing parameter, and write a - * serialized image of its contents into the provided buffer. + * The serialize function must then examine the in core + * representation indicated by the thing parameter, and write a + * serialized image of its contents into the provided buffer. * - * If it is successful, the function must return SUCCEED. + * If it is successful, the function must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API @@ -737,25 +737,25 @@ typedef struct H5C_t H5C_t; * thing: Pointer to void containing the address of the in core * representation of the target metadata cache entry. This * is the same pointer that would be returned by a protect - * of the addr and len of the entry. + * of the addr and len of the entry. * * Processing in the notify function should proceed as follows: * * The notify function may perform any action it would like, including * metadata cache calls. * - * If the function is successful, it must return SUCCEED. + * If the function is successful, it must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API - * routines. + * routines. * * * FREE_ICR: Pointer to the free ICR callback. * * The free ICR callback is invoked by the metadata cache when it * wishes to evict an entry, and needs the client to free the memory - * allocated for the in core representation. + * allocated for the in core representation. * * The typedef for the free ICR callback is as follows: * @@ -766,18 +766,18 @@ typedef struct H5C_t H5C_t; * thing: Pointer to void containing the address of the in core * representation of the target metadata cache entry. This * is the same pointer that would be returned by a protect - * of the addr and len of the entry. + * of the addr and len of the entry. * * Processing in the free ICR function should proceed as follows: * * The free ICR function must free all memory allocated to the - * in core representation. + * in core representation. * - * If the function is successful, it must return SUCCEED. + * If the function is successful, it must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API - * routines. + * routines. * * At least when compiled with debug, it would be useful if the * free ICR call would fail if the in core representation has been @@ -787,30 +787,30 @@ typedef struct H5C_t H5C_t; * * In principle, there is no need for the get file space free size * callback. However, as an optimization, it is sometimes convenient - * to allocate and free file space for a number of cache entries + * to allocate and free file space for a number of cache entries * simultaneously in a single contiguous block of file space. * * File space allocation is done by the client, so the metadata cache * need not be involved. However, since the metadata cache typically - * handles file space release when an entry is destroyed, some + * handles file space release when an entry is destroyed, some * adjustment on the part of the metadata cache is required for this * operation. * - * The get file space free size callback exists to support this + * The get file space free size callback exists to support this * operation. * - * If a group of cache entries that were allocated as a group are to + * If a group of cache entries that were allocated as a group are to * be discarded and their file space released, the type of the first - * (i.e. lowest address) entry in the group must implement the - * get free file space size callback. + * (i.e. lowest address) entry in the group must implement the + * get free file space size callback. * - * To free the file space of all entries in the group in a single - * operation, first expunge all entries other than the first without - * the free file space flag. + * To free the file space of all entries in the group in a single + * operation, first expunge all entries other than the first without + * the free file space flag. * * Then, to complete the operation, unprotect or expunge the first - * entry in the block with the free file space flag set. Since - * the get free file space callback is implemented, the metadata + * entry in the block with the free file space flag set. Since + * the get free file space callback is implemented, the metadata * cache will use this callback to get the size of the block to be * freed, instead of using the size of the entry as is done otherwise. * @@ -830,12 +830,12 @@ typedef struct H5C_t H5C_t; * call of the associated addr and len. * * fs_size_ptr: Pointer to hsize_t in which the callback will return - * the size of the piece of file space to be freed. Note - * that the space to be freed is presumed to have the same + * the size of the piece of file space to be freed. Note + * that the space to be freed is presumed to have the same * base address as the cache entry. * * The function simply returns the size of the block of file space - * to be freed in *fsf_size_ptr. + * to be freed in *fsf_size_ptr. * * If the function is successful, it must return SUCCEED. * @@ -847,16 +847,16 @@ typedef struct H5C_t H5C_t; /* Actions that can be reported to 'notify' client callback */ typedef enum H5C_notify_action_t { - H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache + H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache * via the insert call */ - H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the + H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the * from file via the protect call */ H5C_NOTIFY_ACTION_AFTER_FLUSH, /* Entry has just been flushed to * file. */ - H5C_NOTIFY_ACTION_BEFORE_EVICT, /* Entry is about to be evicted + H5C_NOTIFY_ACTION_BEFORE_EVICT, /* Entry is about to be evicted * from cache. */ H5C_NOTIFY_ACTION_ENTRY_DIRTIED, /* Entry has been marked dirty. */ @@ -911,45 +911,45 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr, * * H5C_ring_t & associated #defines * - * The metadata cache uses the concept of rings to order the flushes of - * classes of entries. In this arrangement, each entry in the cache is - * assigned to a ring, and on flush, the members of the outermost ring + * The metadata cache uses the concept of rings to order the flushes of + * classes of entries. In this arrangement, each entry in the cache is + * assigned to a ring, and on flush, the members of the outermost ring * are flushed first, followed by the next outermost, and so on with the - * members of the innermost ring being flushed last. + * members of the innermost ring being flushed last. * - * Note that flush dependencies are used to order flushes within rings. + * Note that flush dependencies are used to order flushes within rings. * * Note also that at the conceptual level, rings are argueably superfluous, - * as a similar effect could be obtained via the flush dependency mechanism. - * However, this would require all entries in the cache to participate in a - * flush dependency -- with the implied setup and takedown overhead and - * added complexity. Further, the flush ordering between rings need only - * be enforced on flush operations, and thus the use of flush dependencies - * instead would apply unnecessary constraints on flushes under normal + * as a similar effect could be obtained via the flush dependency mechanism. + * However, this would require all entries in the cache to participate in a + * flush dependency -- with the implied setup and takedown overhead and + * added complexity. Further, the flush ordering between rings need only + * be enforced on flush operations, and thus the use of flush dependencies + * instead would apply unnecessary constraints on flushes under normal * operating circumstances. * - * As of this writing, all metadata entries pretaining to data sets and - * groups must be flushed first, and are thus assigned to the outermost - * ring. + * As of this writing, all metadata entries pretaining to data sets and + * groups must be flushed first, and are thus assigned to the outermost + * ring. * * Free space managers managing file space must be flushed next, * and are assigned to the second and third outermost rings. Two rings * are used here as the raw data free space manager must be flushed before * the metadata free space manager. * - * The object header and associated chunks used to implement superblock - * extension messages must be flushed next, and are thus assigned to + * The object header and associated chunks used to implement superblock + * extension messages must be flushed next, and are thus assigned to * the fourth outermost ring. * - * The superblock proper must be flushed last, and is thus assigned to + * The superblock proper must be flushed last, and is thus assigned to * the innermost ring. * * The H5C_ring_t and the associated #defines below are used to define - * the rings. Each entry must be assigned to the appropriate ring on + * the rings. Each entry must be assigned to the appropriate ring on * insertion or protect. * - * Note that H5C_ring_t was originally an enumerated type. It was - * converted to an integer and a set of #defines for convenience in + * Note that H5C_ring_t was originally an enumerated type. It was + * converted to an integer and a set of #defines for convenience in * debugging. */ @@ -1015,8 +1015,8 @@ typedef int H5C_ring_t; * dynamically allocated block of size bytes in which the * on disk image of the metadata cache entry is stored. * - * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is * written to disk * * image_up_to_date: Boolean flag that is set to TRUE when *image_ptr @@ -1038,14 +1038,14 @@ typedef int H5C_ring_t; * dirtied while protected. * * This field is set to FALSE in the protect call, and may - * be set to TRUE by the H5C_mark_entry_dirty() call at any + * be set to TRUE by the H5C_mark_entry_dirty() call at any * time prior to the unprotect call. * - * The H5C_mark_entry_dirty() call exists as a convenience - * function for the fractal heap code which may not know if - * an entry is protected or pinned, but knows that is either - * protected or pinned. The dirtied field was added as in - * the parallel case, it is necessary to know whether a + * The H5C_mark_entry_dirty() call exists as a convenience + * function for the fractal heap code which may not know if + * an entry is protected or pinned, but knows that is either + * protected or pinned. The dirtied field was added as in + * the parallel case, it is necessary to know whether a * protected entry is dirty prior to the protect call. * * is_protected: Boolean flag indicating whether this entry is protected @@ -1090,9 +1090,9 @@ typedef int H5C_ring_t; * policy code (LRU at present). * * 2) A pinned entry can be accessed or modified at any time. - * This places an extra burden on the pre-serialize and - * serialize callbacks, which must ensure that a pinned - * entry is consistent and ready to write to disk before + * This places an extra burden on the pre-serialize and + * serialize callbacks, which must ensure that a pinned + * entry is consistent and ready to write to disk before * generating an image. * * 3) A pinned entry can be marked as dirty (and possibly @@ -1121,9 +1121,9 @@ typedef int H5C_ring_t; * flushed from the cache until all other entries without * the flush_me_last flag set have been flushed. * - * Note: - * - * At this time, the flush_me_last + * Note: + * + * At this time, the flush_me_last * flag will only be applied to one entry, the superblock, * and the code utilizing these flags is protected with HDasserts * to enforce this. This restraint can certainly be relaxed in @@ -1149,11 +1149,11 @@ typedef int H5C_ring_t; * the unprotect, the entry's is_dirty flag is reset by flushing * it with the H5C__FLUSH_CLEAR_ONLY_FLAG. * - * flush_immediately: Boolean flag used only in Phdf5 -- and then only + * flush_immediately: Boolean flag used only in Phdf5 -- and then only * for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. * - * When a distributed metadata write is triggered at a - * sync point, this field is used to mark entries that + * When a distributed metadata write is triggered at a + * sync point, this field is used to mark entries that * must be flushed before leaving the sync point. At all * other times, this field should be set to FALSE. * @@ -1167,10 +1167,10 @@ typedef int H5C_ring_t; * * Fields supporting rings for flush ordering: * - * All entries in the metadata cache are assigned to a ring. On cache + * All entries in the metadata cache are assigned to a ring. On cache * flush, all entries in the outermost ring are flushed first, followed - * by all members of the next outermost ring, and so on until the - * innermost ring is flushed. Note that this ordering is ONLY applied + * by all members of the next outermost ring, and so on until the + * innermost ring is flushed. Note that this ordering is ONLY applied * in flush and serialize calls. Rings are ignored during normal operations * in which entries are flushed as directed by the replacement policy. * @@ -1211,7 +1211,7 @@ typedef int H5C_ring_t; * this field is nonzero, then this entry cannot be flushed. * * flush_dep_nunser_children: Number of flush dependency children - * that are either unserialized, or have a non-zero number of + * that are either unserialized, or have a non-zero number of * positive number of unserialized children. * * Note that since there is no requirement that a clean entry @@ -1219,7 +1219,7 @@ typedef int H5C_ring_t; * to be greater than flush_dep_ndirty_children. * * This field exist to facilitate correct ordering of entry - * serializations when it is necessary to serialize all the + * serializations when it is necessary to serialize all the * entries in the metadata cache. Thus in the cache * serialization, no entry can be serialized unless this * field contains 0. @@ -1232,7 +1232,7 @@ typedef int H5C_ring_t; * * Addendum: JRM -- 10/14/15 * - * We have come to scan all entries in the cache frequently enough that + * We have come to scan all entries in the cache frequently enough that * the cost of doing so by scanning the hash table has become unacceptable. * To reduce this cost, the index now also maintains a doubly linked list * of all entries in the index. This list is known as the index list. @@ -1251,12 +1251,12 @@ typedef int H5C_ring_t; * * il_next: Next pointer used by the index to maintain a doubly linked * list of all entries in the index (and thus in the cache). - * This field contains a pointer to the next entry in the + * This field contains a pointer to the next entry in the * index list, or NULL if there is no next entry. * * il_prev: Prev pointer used by the index to maintain a doubly linked * list of all entries in the index (and thus in the cache). - * This field contains a pointer to the previous entry in the + * This field contains a pointer to the previous entry in the * index list, or NULL if there is no previous entry. * * @@ -1294,71 +1294,71 @@ typedef int H5C_ring_t; * The use of the replacement policy fields under the Modified LRU policy * is discussed below: * - * next: Next pointer in either the LRU, the protected list, or - * the pinned list depending on the current values of - * is_protected and is_pinned. If there is no next entry + * next: Next pointer in either the LRU, the protected list, or + * the pinned list depending on the current values of + * is_protected and is_pinned. If there is no next entry * on the list, this field should be set to NULL. * * prev: Prev pointer in either the LRU, the protected list, - * or the pinned list depending on the current values of - * is_protected and is_pinned. If there is no previous + * or the pinned list depending on the current values of + * is_protected and is_pinned. If there is no previous * entry on the list, this field should be set to NULL. * * aux_next: Next pointer on either the clean or dirty LRU lists. - * This entry should be NULL when either is_protected or - * is_pinned is true. + * This entry should be NULL when either is_protected or + * is_pinned is true. * - * When is_protected and is_pinned are false, and is_dirty is - * true, it should point to the next item on the dirty LRU - * list. + * When is_protected and is_pinned are false, and is_dirty is + * true, it should point to the next item on the dirty LRU + * list. * - * When is_protected and is_pinned are false, and is_dirty is - * false, it should point to the next item on the clean LRU - * list. In either case, when there is no next item, it + * When is_protected and is_pinned are false, and is_dirty is + * false, it should point to the next item on the clean LRU + * list. In either case, when there is no next item, it * should be NULL. * * aux_prev: Previous pointer on either the clean or dirty LRU lists. - * This entry should be NULL when either is_protected or - * is_pinned is true. - * - * When is_protected and is_pinned are false, and is_dirty is - * true, it should point to the previous item on the dirty - * LRU list. - * - * When is_protected and is_pinned are false, and is_dirty - * is false, it should point to the previous item on the - * clean LRU list. - * - * In either case, when there is no previous item, it should + * This entry should be NULL when either is_protected or + * is_pinned is true. + * + * When is_protected and is_pinned are false, and is_dirty is + * true, it should point to the previous item on the dirty + * LRU list. + * + * When is_protected and is_pinned are false, and is_dirty + * is false, it should point to the previous item on the + * clean LRU list. + * + * In either case, when there is no previous item, it should * be NULL. * * Fields supporting the cache image feature: * - * The following fields are used to store data about the entry which must - * be stored in the cache image block, but which will typically be either - * lost or heavily altered in the process of serializing the cache and + * The following fields are used to store data about the entry which must + * be stored in the cache image block, but which will typically be either + * lost or heavily altered in the process of serializing the cache and * preparing its contents to be copied into the cache image block. * * Some fields are also used in loading the contents of the metadata cache - * image back into the cache, and in managing such entries until they are - * either protected by the library (at which point they become regular - * entries) or are evicted. See discussion of the prefetched field for + * image back into the cache, and in managing such entries until they are + * either protected by the library (at which point they become regular + * entries) or are evicted. See discussion of the prefetched field for * further details. * * include_in_image: Boolean flag indicating whether this entry should * be included in the metadata cache image. This field should * always be false prior to the H5C_prep_for_file_close() call. * During that call, it should be set to TRUE for all entries - * that are to be included in the metadata cache image. At - * present, only the superblock, the superblock extension - * object header and its chunks (if any) are omitted from + * that are to be included in the metadata cache image. At + * present, only the superblock, the superblock extension + * object header and its chunks (if any) are omitted from * the image. * * lru_rank: Rank of the entry in the LRU just prior to file close. * * Note that the first entry on the LRU has lru_rank 1, - * and that entries not on the LRU at that time will have - * either lru_rank -1 (if pinned) or 0 (if loaded during + * and that entries not on the LRU at that time will have + * either lru_rank -1 (if pinned) or 0 (if loaded during * the process of flushing the cache. * * image_dirty: Boolean flag indicating whether the entry should be marked @@ -1366,125 +1366,125 @@ typedef int H5C_ring_t; * TRUE iff the entry is dirty when H5C_prep_for_file_close() * is called. * - * fd_parent_count: If the entry is a child in one or more flush dependency - * relationships, this field contains the number of flush + * fd_parent_count: If the entry is a child in one or more flush dependency + * relationships, this field contains the number of flush * dependency parents. * * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the * cache image (i.e. include_in_image is TRUE), any parents * that are not in the image are removed from this count and * from the fd_parent_addrs array below. * - * Finally observe that if the entry is dirty and in the + * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. * - * fd_parent_addrs: If the entry is a child in one or more flush dependency - * relationship when H5C_prep_for_file_close() is called, this - * field must contain a pointer to an array of size - * fd_parent_count containing the on disk addresses of the + * fd_parent_addrs: If the entry is a child in one or more flush dependency + * relationship when H5C_prep_for_file_close() is called, this + * field must contain a pointer to an array of size + * fd_parent_count containing the on disk addresses of the * parent. * * In all other cases, the field is set to NULL. * - * Note that while this list of addresses is initially taken - * from the flush dependency fields above, if the entry is in the + * Note that while this list of addresses is initially taken + * from the flush dependency fields above, if the entry is in the * cache image (i.e. include_in_image is TRUE), any parents - * that are not in the image are removed from this list, and + * that are not in the image are removed from this list, and * and from the fd_parent_count above. * - * Finally observe that if the entry is dirty and in the + * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. * - * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush + * fd_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of flush * dependency children. * * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the * cache image (i.e. include_in_image is TRUE), any children * that are not in the image are removed from this count. * - * fd_dirty_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of dirty flush + * fd_dirty_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of dirty flush * dependency children. * * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any dirty - * children that are not in the image are removed from this + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any dirty + * children that are not in the image are removed from this * count. * * image_fd_height: Flush dependency height of the entry in the cache image. * - * The flush dependency height of any entry involved in a - * flush dependency relationship is defined to be the + * The flush dependency height of any entry involved in a + * flush dependency relationship is defined to be the * longest flush dependency path from that entry to an entry - * with no flush dependency children. + * with no flush dependency children. * - * Since the image_fd_height is used to order entries in the - * cache image so that fd parents preceed fd children, for + * Since the image_fd_height is used to order entries in the + * cache image so that fd parents preceed fd children, for * purposes of this field, and entry is at flush dependency * level 0 if it either has no children, or if all of its - * children are not in the cache image. + * children are not in the cache image. * - * Note that if a child in a flush dependency relationship is + * Note that if a child in a flush dependency relationship is * dirty and in the cache image, and its parent is dirty and - * not in the cache image, then the child must be excluded + * not in the cache image, then the child must be excluded * from the cache image to maintain flush ordering. * * prefetched: Boolean flag indicating that the on disk image of the entry - * has been loaded into the cache prior any request for the + * has been loaded into the cache prior any request for the * entry by the rest of the library. * - * As of this writing (8/10/15), this can only happen through - * the load of a cache image block, although other scenarios - * are contemplated for the use of this feature. Note that - * unlike the usual prefetch situation, this means that a - * prefetched entry can be dirty, and/or can be a party to - * flush dependency relationship(s). This complicates matters + * As of this writing (8/10/15), this can only happen through + * the load of a cache image block, although other scenarios + * are contemplated for the use of this feature. Note that + * unlike the usual prefetch situation, this means that a + * prefetched entry can be dirty, and/or can be a party to + * flush dependency relationship(s). This complicates matters * somewhat. * - * The essential feature of a prefetched entry is that it - * consists only of a buffer containing the on disk image of - * the entry. Thus it must be deserialized before it can - * be passed back to the library on a protect call. This + * The essential feature of a prefetched entry is that it + * consists only of a buffer containing the on disk image of + * the entry. Thus it must be deserialized before it can + * be passed back to the library on a protect call. This * task is handled by H5C_deserialized_prefetched_entry(). - * In essence, this routine calls the deserialize callback - * provided in the protect call with the on disk image, + * In essence, this routine calls the deserialize callback + * provided in the protect call with the on disk image, * deletes the prefetched entry from the cache, and replaces * it with the deserialized entry returned by the deserialize * callback. * - * Further, if the prefetched entry is a flush dependency parent, - * all its flush dependency children (which must also be - * prefetched entries), must be transferred to the new cache + * Further, if the prefetched entry is a flush dependency parent, + * all its flush dependency children (which must also be + * prefetched entries), must be transferred to the new cache * entry returned by the deserialization callback. * - * Finally, if the prefetched entry is a flush dependency child, - * this flush dependency must be destroyed prior to the + * Finally, if the prefetched entry is a flush dependency child, + * this flush dependency must be destroyed prior to the * deserialize call. * - * In addition to the above special processing on the first + * In addition to the above special processing on the first * protect call on a prefetched entry (after which is no longer - * a prefetched entry), prefetched entries also require special + * a prefetched entry), prefetched entries also require special * tretment on flush and evict. * - * On flush, a dirty prefetched entry must simply be written - * to disk and marked clean without any call to any client + * On flush, a dirty prefetched entry must simply be written + * to disk and marked clean without any call to any client * callback. * - * On eviction, if a prefetched entry is a flush dependency + * On eviction, if a prefetched entry is a flush dependency * child, that flush dependency relationship must be destroyed * just prior to the eviction. If the flush dependency code * is working properly, it should be impossible for any entry @@ -1496,35 +1496,35 @@ typedef int H5C_ring_t; * * The value of this field is undefined in prefetched is FALSE. * - * age: Number of times a prefetched entry has appeared in - * subsequent cache images. The field exists to allow - * imposition of a limit on how many times a prefetched + * age: Number of times a prefetched entry has appeared in + * subsequent cache images. The field exists to allow + * imposition of a limit on how many times a prefetched * entry can appear in subsequent cache images without being * converted to a regular entry. * - * This field must be zero if prefetched is FALSE. + * This field must be zero if prefetched is FALSE. * * prefetched_dirty: Boolean field that must be set to FALSE unless the * following conditions hold: * * 1) The file has been opened R/O. * - * 2) The entry is either a prefetched entry, or was + * 2) The entry is either a prefetched entry, or was * re-constructed from a prefetched entry. * * 3) The base prefetched entry was marked dirty. * - * This field exists to solve the following problem with + * This field exists to solve the following problem with * files containing cache images that are opened R/O. * * If the cache image contains a dirty entry, that entry * must be marked clean when it is inserted into the cache - * in the read-only case, as otherwise the metadata cache - * will attempt to flush it on file close -- which is poor + * in the read-only case, as otherwise the metadata cache + * will attempt to flush it on file close -- which is poor * form in the read-only case. * - * However, since the entry is marked clean, it is possible - * that the metadata cache will evict it if the size of the + * However, since the entry is marked clean, it is possible + * that the metadata cache will evict it if the size of the * metadata in the file exceeds the size of the metadata cache, * and the application visits much of this data. * @@ -1534,24 +1534,24 @@ typedef int H5C_ring_t; * the entry has ever been written to it assigned location in * the file. * - * With this background, the purpose of this field should be - * obvious -- when set, it allows the eviction candidate - * selection code to skip over the entry, thus avoiding the + * With this background, the purpose of this field should be + * obvious -- when set, it allows the eviction candidate + * selection code to skip over the entry, thus avoiding the * issue. * - * Since the issue only arises in the R/O case, there is - * no possible interaction with SWMR. There are also + * Since the issue only arises in the R/O case, there is + * no possible interaction with SWMR. There are also * potential interactions with Evict On Close -- at present, * we deal with this by disabling EOC in the R/O case. * - * serialization_count: Integer field used to maintain a count of the - * number of times each entry is serialized during cache + * serialization_count: Integer field used to maintain a count of the + * number of times each entry is serialized during cache * serialization. While no entry should be serialized more than - * once in any serialization call, throw an assertion if any - * flush depencency parent is serialized more than once during + * once in any serialization call, throw an assertion if any + * flush depencency parent is serialized more than once during * a single cache serialization. * - * This is a debugging field, and thus is maintained only if + * This is a debugging field, and thus is maintained only if * NDEBUG is undefined. * * Fields supporting tagged entries: @@ -1688,7 +1688,7 @@ typedef struct H5C_cache_entry_t { * structure H5C_image_entry_t * * Instances of the H5C_image_entry_t structure are used to store data on - * metadata cache entries used in the construction of the metadata cache + * metadata cache entries used in the construction of the metadata cache * image block. In essence this structure is a greatly simplified version * of H5C_cache_entry_t. * @@ -1705,17 +1705,17 @@ typedef struct H5C_cache_entry_t { * * size: Length of the cache entry on disk in bytes. * - * ring: Instance of H5C_ring_t indicating the flush ordering ring + * ring: Instance of H5C_ring_t indicating the flush ordering ring * to which this entry is assigned. * - * age: Number of times this prefetech entry has appeared in - * the current sequence of cache images. This field is + * age: Number of times this prefetech entry has appeared in + * the current sequence of cache images. This field is * initialized to 0 if the instance of H5C_image_entry_t - * is constructed from a regular entry. + * is constructed from a regular entry. * - * If the instance is constructed from a prefetched entry + * If the instance is constructed from a prefetched entry * currently residing in the metadata cache, the field is - * set to 1 + the age of the prefetched entry, or to + * set to 1 + the age of the prefetched entry, or to * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX if that sum exceeds * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX. * @@ -1724,8 +1724,8 @@ typedef struct H5C_cache_entry_t { * lru_rank: Rank of the entry in the LRU just prior to file close. * * Note that the first entry on the LRU has lru_rank 1, - * and that entries not on the LRU at that time will have - * either lru_rank -1 (if pinned) or 0 (if loaded during + * and that entries not on the LRU at that time will have + * either lru_rank -1 (if pinned) or 0 (if loaded during * the process of flushing the cache. * * is_dirty: Boolean flag indicating whether the contents of the cache @@ -1757,9 +1757,9 @@ typedef struct H5C_cache_entry_t { * In all other cases, the field is set to zero. * * Note that while this count is initially taken from the - * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are + * flush dependency fields in the associated instance of + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any parents that are * not in the image are removed from this count and * from the fd_parent_addrs array below. * @@ -1767,7 +1767,7 @@ typedef struct H5C_cache_entry_t { * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of + * This should have happened before the construction of * the instance of H5C_image_entry_t. * * fd_parent_addrs: If the entry is a child in one or more flush dependency @@ -1780,27 +1780,27 @@ typedef struct H5C_cache_entry_t { * * Note that while this list of addresses is initially taken * from the flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are not - * in the image are removed from this list, and from the + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any parents that are not + * in the image are removed from this list, and from the * fd_parent_count above. * * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of + * This should have happened before the construction of * the instance of H5C_image_entry_t. * - * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush + * fd_child_count: If the entry is a parent in a flush dependency + * relationship, this field contains the number of flush * dependency children. * * In all other cases, the field is set to zero. * * Note that while this count is initially taken from the * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image + * H5C_cache_entry_t, if the entry is in the cache image * (i.e. include_in_image is TRUE), any children * that are not in the image are removed from this count. * @@ -1812,16 +1812,16 @@ typedef struct H5C_cache_entry_t { * * Note that while this count is initially taken from the * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any dirty children + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any dirty children * that are not in the image are removed from this count. * * image_ptr: Pointer to void. When not NULL, this field points to a * dynamically allocated block of size bytes in which the * on disk image of the metadata cache entry is stored. * - * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is * written to disk * * @@ -2141,7 +2141,7 @@ typedef struct H5C_auto_size_ctl_t { * fields for generation of a metadata cache image on file close. * * At present control of construction of a cache image is via a FAPL - * property at file open / create. + * property at file open / create. * * The fields of the structure are discussed individually below: * @@ -2150,43 +2150,43 @@ typedef struct H5C_auto_size_ctl_t { * H5C_image_ctl_t passed to the cache must have a known * version number, or an error will be flagged. * - * generate_image: Boolean flag indicating whether a cache image should + * 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 + * 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 + * 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__NONE (-1) to * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). * - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit + * 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 + * A value of 0 prevents prefetched entries from being included * in cache images. * * 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 + * 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. * * flags: Unsigned integer containing flags controlling which aspects of the - * cache image functinality is actually executed. The primary impetus - * behind this field is to allow development of tests for partial - * implementations that will require little if any modification to run - * with the full implementation. In normal operation, all flags should + * cache image functinality is actually executed. The primary impetus + * behind this field is to allow development of tests for partial + * implementations that will require little if any modification to run + * with the full implementation. In normal operation, all flags should * be set. * ****************************************************************************/ @@ -2196,7 +2196,7 @@ typedef struct H5C_auto_size_ctl_t { #define H5C_CI__SUPRESS_ENTRY_WRITES ((unsigned)0x0004) #define H5C_CI__WRITE_CACHE_IMAGE ((unsigned)0x0008) -/* This #define must set all defined H5C_CI flags. It is +/* This #define must set all defined H5C_CI flags. It is * used in the default value for instances of H5C_cache_image_ctl_t. * This value will only be modified in test code. */ @@ -2242,7 +2242,7 @@ H5_DLL herr_t H5C_evict(H5F_t *f); H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags); H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags); -H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); +H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f); H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global); H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags); @@ -2270,7 +2270,7 @@ H5_DLL void * H5C_get_aux_ptr(const H5C_t *cache_ptr); H5_DLL herr_t H5C_image_stats(H5C_t * cache_ptr, hbool_t print_header); H5_DLL herr_t H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags); -H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, +H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw); H5_DLL herr_t H5C_mark_entry_dirty(void *thing); H5_DLL herr_t H5C_mark_entry_clean(void *thing); @@ -2309,7 +2309,7 @@ H5_DLL herr_t H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring) H5_DLL herr_t H5C_unsettle_entry_ring(void *thing); H5_DLL herr_t H5C_unsettle_ring(H5F_t * f, H5C_ring_t ring); H5_DLL herr_t H5C_remove_entry(void *thing); -H5_DLL herr_t H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, +H5_DLL herr_t H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr); H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr); H5_DLL herr_t H5C_get_mdc_image_info(H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); diff --git a/src/H5Cquery.c b/src/H5Cquery.c index a1267c5..9f1ec31 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -426,7 +426,7 @@ done: * Function: H5C_get_mdc_image_info * * Purpose: To retrieve the address and size of the cache image in the file. - * + * * Return: SUCCEED on success, and FAIL on failure. * * Programmer: Vailin Choi; March 2017 @@ -447,7 +447,7 @@ H5C_get_mdc_image_info(H5C_t * cache_ptr, haddr_t *image_addr, hsize_t *image_le *image_addr = cache_ptr->image_addr; if(image_len) *image_len = cache_ptr->image_len; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_get_mdc_image_info() */ diff --git a/src/H5Ctag.c b/src/H5Ctag.c index 807e68d..e92d0e4 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -56,16 +56,16 @@ /* Typedef for tagged entry iterator callback context - evict tagged entries */ typedef struct { H5F_t *f; /* File pointer for evicting entry */ - hbool_t evicted_entries_last_pass; /* Flag to indicate that an entry - * was evicted when iterating over - * cache + 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 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 + hbool_t skipped_pf_dirty_entries; /* Flag indicating that one or more * entries marked prefetched_dirty - * were encountered and not + * were encountered and not * evicted. */ } H5C_tag_iter_evict_ctx_t; @@ -113,10 +113,10 @@ H5FL_EXTERN(H5C_tag_info_t); * Function: H5C_ignore_tags * * Purpose: Override all assertion frameworks associated with making - * sure proper tags are applied to cache entries. + * sure proper tags are applied to cache entries. * - * NOTE: This should really only be used in tests that need - * to access internal functions without going through + * NOTE: This should really only be used in tests that need + * to access internal functions without going through * standard API paths. Since tags are set inside dxpl_id's * before coming into the cache, any external functions that * use the internal library functions (i.e., tests) should @@ -204,8 +204,8 @@ H5C_get_num_objs_corked(const H5C_t *cache_ptr) * Function: H5C__tag_entry * * Purpose: Tags an entry with the provided tag (contained in the API context). - * If sanity checking is enabled, this function will perform - * validation that a proper tag is contained within the provided + * If sanity checking is enabled, this function will perform + * validation that a proper tag is contained within the provided * data access property list id before application. * * Return: FAIL if error is detected, SUCCEED otherwise. @@ -234,10 +234,10 @@ H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry) if(cache->ignore_tags) { /* if we're ignoring tags, it's because we're running - tests on internal functions and may not have inserted a tag + tests on internal functions and may not have inserted a tag value into a given API context before creating some metadata. Thus, in this case only, if a tag value has not been set, we can - arbitrarily set it to something for the sake of passing the tests. + arbitrarily set it to something for the sake of passing the tests. If the tag value is set, then we'll just let it get assigned without additional checking for correctness. */ if(!H5F_addr_defined(tag)) @@ -399,7 +399,7 @@ H5C__iter_tagged_entries_real(H5C_t *cache, haddr_t tag, H5C_tag_iter_cb_t cb, /* Make callback for entry */ if((cb)(entry, cb_ctx) != H5_ITER_CONT) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "tagged entry iteration callback failed") - + /* Advance to next entry */ entry = next_entry; } /* end while */ @@ -441,11 +441,11 @@ H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "iteration of tagged entries failed") /* Check for iterating over global metadata */ - if(match_global) { + if(match_global) { /* Iterate over the entries for SOHM entries */ if(H5C__iter_tagged_entries_real(cache, H5AC__SOHM_TAG, cb, cb_ctx) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "iteration of tagged entries failed") - + /* Iterate over the entries for global heap entries */ if(H5C__iter_tagged_entries_real(cache, H5AC__GLOBALHEAP_TAG, cb, cb_ctx) < 0) HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "iteration of tagged entries failed") @@ -553,29 +553,29 @@ H5C_evict_tagged_entries(H5F_t * f, haddr_t tag, hbool_t match_global) /* Keep doing this until we have stopped evicted entries */ } while(TRUE == ctx.evicted_entries_last_pass); - /* In most cases, fail if we have finished evicting entries and pinned - * entries still 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. + * 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 + * 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 + * 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 + * 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 + * + * 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 + * 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)) @@ -631,7 +631,7 @@ H5C__mark_tagged_entries_cb(H5C_cache_entry_t *entry, void H5_ATTR_UNUSED *_ctx) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5C__mark_tagged_entries(H5C_t *cache, haddr_t tag) { herr_t ret_value = SUCCEED; /* Return value */ @@ -698,16 +698,16 @@ H5C_verify_tag(int id, haddr_t tag) if(tag == H5AC__SUPERBLOCK_TAG) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "H5AC__SUPERBLOCK_TAG applied to non-superblock entry") } /* end else */ - + /* Free Space Manager */ if(tag == H5AC__FREESPACE_TAG && ((id != H5AC_FSPACE_HDR_ID) && (id != H5AC_FSPACE_SINFO_ID))) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "H5AC__FREESPACE_TAG applied to non-freespace entry") - + /* SOHM */ if((id == H5AC_SOHM_TABLE_ID) || (id == H5AC_SOHM_LIST_ID)) if(tag != H5AC__SOHM_TAG) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "sohm entry not tagged with H5AC__SOHM_TAG") - + /* Global Heap */ if(id == H5AC_GHEAP_ID) { if(tag != H5AC__GLOBALHEAP_TAG) @@ -783,7 +783,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_retag_entries(H5C_t *cache, haddr_t src_tag, haddr_t dest_tag) +H5C_retag_entries(H5C_t *cache, haddr_t src_tag, haddr_t dest_tag) { H5C_tag_info_t *tag_info; /* Points to a tag info struct */ herr_t ret_value = SUCCEED; /* Return value */ @@ -860,7 +860,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags) { H5C_t *cache; /* Pointer to cache structure */ @@ -904,7 +904,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5C_get_tag(const void *thing, haddr_t *tag /*OUT*/) { const H5C_cache_entry_t *entry = (const H5C_cache_entry_t *)thing; /* Pointer to cache entry */ diff --git a/src/H5D.c b/src/H5D.c index 61a40df..37b3b39 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -332,7 +332,7 @@ H5Dclose(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset ID") /* Decrement the counter on the dataset. It will be freed if the count - * reaches zero. + * reaches zero. */ if(H5I_dec_app_ref_always_close(dset_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't decrement count on dataset ID") @@ -814,7 +814,7 @@ H5Dflush(hid_t dset_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); - + /* Check args */ if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dset_id parameter is not a valid dataset identifier") @@ -873,7 +873,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dformat_convert (Internal) * - * Purpose: For chunked: + * Purpose: For chunked: * Convert the chunk indexing type to version 1 B-tree if not * For compact/contiguous: * Downgrade layout version to 3 if greater than 3 @@ -892,7 +892,7 @@ H5Dformat_convert(hid_t dset_id) { H5VL_object_t *vol_obj; /* Dataset for this operation */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 56554f8..ae98654 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * * Purpose: v2 B-tree indexing for chunked datasets with > 1 unlimited dimensions. * Each dataset chunk in the b-tree is identified by its dimensional offset. @@ -106,7 +106,7 @@ static int H5D__bt2_idx_iterate_cb(const void *_record, void *_udata); /* Callback for H5B2_find() which is called in H5D__bt2_idx_get_addr() */ static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data); -/* +/* * Callback for H5B2_remove() and H5B2_delete() which is called * in H5D__bt2_idx_remove() and H5D__bt2_idx_delete(). */ @@ -252,7 +252,7 @@ H5D__bt2_crt_context(void *_udata) H5MM_memcpy(my_dim, udata->dim, H5O_LAYOUT_NDIMS * sizeof(uint32_t)); ctx->dim = my_dim; - /* + /* * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ @@ -292,7 +292,7 @@ H5D__bt2_dst_context(void *_ctx) /* Free array for chunk dimension sizes */ if(ctx->dim) - (void)H5FL_ARR_FREE(uint32_t, ctx->dim); + (void)H5FL_ARR_FREE(uint32_t, ctx->dim); /* Release callback context */ ctx = H5FL_FREE(H5D_bt2_ctx_t, ctx); @@ -569,7 +569,7 @@ H5D__bt2_filt_debug(FILE *stream, int indent, int fwidth, const H5D_chunk_rec_t *record = (const H5D_chunk_rec_t *)_record; /* The native record */ const H5D_bt2_ctx_t *ctx = (const H5D_bt2_ctx_t *)_ctx; /* Callback context */ unsigned u; /* Local index variable */ - + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ @@ -735,9 +735,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__bt2_idx_create + * Function: H5D__bt2_idx_create * - * Purpose: Create the v2 B-tree for tracking dataset chunks + * Purpose: Create the v2 B-tree for tracking dataset chunks * * Return: SUCCEED/FAIL * @@ -769,7 +769,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) if(idx_info->pline->nused > 0) { unsigned chunk_size_len; /* Size of encoded chunk size */ - /* + /* * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ @@ -837,7 +837,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) * Function: H5D__bt2_mod_cb * * Purpose: Modify record for dataset chunk when it is found in a v2 B-tree. - * This is the callback for H5B2_modify() which is called in + * This is the callback for H5B2_modify() which is called in * H5D__bt2_idx_insert(). * * Return: Success: non-negative @@ -879,7 +879,7 @@ H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed) * Function: H5D__bt2_idx_insert * * Purpose: Insert chunk address into the indexing structure. - * A non-filtered chunk: + * A non-filtered chunk: * Should not exist * Allocate the chunk and pass chunk address back up * A filtered chunk: @@ -954,7 +954,7 @@ done: * Function: H5D__bt2_found_cb * * Purpose: Retrieve record for dataset chunk when it is found in a v2 B-tree. - * This is the callback for H5B2_find() which is called in + * This is the callback for H5B2_find() which is called in * H5D__bt2_idx_get_addr() and H5D__bt2_idx_insert(). * * Return: Success: non-negative @@ -1073,7 +1073,7 @@ done: * Purpose: Translate the B-tree specific chunk record into a generic * form and make the callback to the generic chunk callback * routine. - * This is the callback for H5B2_iterate() which is called in + * This is the callback for H5B2_iterate() which is called in * H5D__bt2_idx_iterate(). * * Return: Success: Non-negative @@ -1163,7 +1163,7 @@ done: * * Purpose: Free space for 'dataset chunk' object as v2 B-tree * is being deleted or v2 B-tree node is removed. - * This is the callback for H5B2_remove() and H5B2_delete() which + * This is the callback for H5B2_remove() and H5B2_delete() which * which are called in H5D__bt2_idx_remove() and H5D__bt2_idx_delete(). * * Return: Success: non-negative diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index e48c3b3..655f660 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -843,7 +843,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, * the end of the data element, and don't read more than * the buffer size. */ - min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Read the new sieve buffer */ @@ -1038,7 +1038,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, max_data = store_contig->dset_size - dst_off; /* Compute the size of the sieve buffer */ - min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Check if there is any point in reading the data from the file */ @@ -1154,7 +1154,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, * the end of the data element, and don't read more than * the buffer size. */ - min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); + min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size); H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Check if there is any point in reading the data from the file */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index b23ac46..eaa8c46 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -615,7 +615,7 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, * Failure: NULL * * Programmer: Vailin Choi; July 2010 - * + * *------------------------------------------------------------------------- */ static void * @@ -933,7 +933,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) /* General parameters */ if(idx_info->pline->nused > 0) { unsigned chunk_size_len; /* Size of encoded chunk size */ - + /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ @@ -1349,7 +1349,7 @@ H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, } /* end if */ udata.cb = chunk_cb; udata.udata = chunk_udata; - + /* Iterate over the extensible array elements */ if((ret_value = H5EA_iterate(ea, H5D__earray_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 2d85e3b..cbaa52d 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -14,8 +14,8 @@ /* Programmer: Vailin Choi * Thursday, April 30, 2009 * - * Purpose: Fixed array indexed (chunked) I/O functions. - * The chunk coordinate is mapped as an index into an array of + * Purpose: Fixed array indexed (chunked) I/O functions. + * The chunk coordinate is mapped as an index into an array of * disk addresses for the chunks. * */ @@ -910,7 +910,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Set up the user data */ udata.f = idx_info->f; udata.chunk_size = idx_info->layout->size; - + /* Create the fixed array for the chunk index */ if(NULL == (idx_info->storage->u.farray.fa = H5FA_create(idx_info->f, &cparam, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array") @@ -961,7 +961,7 @@ H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi; 5 May 2014 - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1224,7 +1224,7 @@ H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, } /* end if */ udata.cb = chunk_cb; udata.udata = chunk_udata; - + /* Iterate over the fixed array elements */ if((ret_value = H5FA_iterate(fa, H5D__farray_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); diff --git a/src/H5Dfill.c b/src/H5Dfill.c index f5a5238..94c7b1c 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -565,7 +565,7 @@ done: */ herr_t H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) -{ +{ herr_t ret_value = SUCCEED; /* Return value */ void * buf = NULL; /* Temporary fill buffer */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 3d49df7..84b7e7a 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -321,7 +321,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dwrite_chunk * - * Purpose: Writes an entire chunk to the file directly. + * Purpose: Writes an entire chunk to the file directly. * * Return: Non-negative on success/Negative on failure * @@ -331,13 +331,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, +H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf) { H5VL_object_t *vol_obj = NULL; uint32_t data_size_32; /* Chunk data size (limited to 32-bits currently) */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiIu*hz*x", dset_id, dxpl_id, filters, offset, data_size, buf); diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 91557c3..492902b 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -364,13 +364,13 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, /* Check to see if the process is reading the entire dataset */ if(H5S_GET_SELECT_TYPE(file_space) != H5S_SEL_ALL) - local_cause[1] |= H5D_MPIO_RANK0_NOT_H5S_ALL; + local_cause[1] |= H5D_MPIO_RANK0_NOT_H5S_ALL; /* Only perform this optimization for contigous datasets, currently */ else if(H5D_CONTIGUOUS != io_info->dset->shared->layout.type) - /* Flag to do a MPI_Bcast of the data from one proc instead of + /* Flag to do a MPI_Bcast of the data from one proc instead of * having all the processes involved in the collective I/O. */ - local_cause[1] |= H5D_MPIO_RANK0_NOT_CONTIGUOUS; + local_cause[1] |= H5D_MPIO_RANK0_NOT_CONTIGUOUS; else if((is_vl_storage = H5T_is_vl_storage(type_info->dset_type)) < 0) local_cause[0] |= H5D_MPIO_ERROR_WHILE_CHECKING_COLLECTIVE_POSSIBLE; else if(is_vl_storage) @@ -394,7 +394,7 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, dset_size = ((hsize_t)snelmts) * type_size; /* If the size of the dataset is less than 2GB then do an MPI_Bcast - * of the data from one process instead of having all the processes + * of the data from one process instead of having all the processes * involved in the collective I/O. */ if(dset_size > ((hsize_t)(2.0F * H5_GB) - 1)) @@ -402,7 +402,7 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, } /* end else */ } /* end else */ } /* end else */ - + /* Check for independent I/O */ if(local_cause[0] & H5D_MPIO_SET_INDEPENDENT) global_cause[0] = local_cause[0]; @@ -812,7 +812,7 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf io_option = H5D_ONE_LINK_CHUNK_IO; /*no opt*/ /* direct request to multi-chunk-io */ else if(H5FD_MPIO_CHUNK_MULTI_IO == chunk_opt_mode) - io_option = H5D_MULTI_CHUNK_IO; + io_option = H5D_MULTI_CHUNK_IO; /* via default path. branch by num threshold */ else { unsigned one_link_chunk_io_threshold; /* Threshold to use single collective I/O for all chunks */ @@ -1123,9 +1123,9 @@ if(H5DEBUG(D)) /* Obtain MPI derived datatype from all individual chunks */ for(u = 0; u < num_chunk; u++) { - hsize_t *permute_map = NULL; /* array that holds the mapping from the old, - out-of-order displacements to the in-order - displacements of the MPI datatypes of the + hsize_t *permute_map = NULL; /* array that holds the mapping from the old, + out-of-order displacements to the in-order + displacements of the MPI datatypes of the point selection of the file space */ hbool_t is_permuted = FALSE; @@ -1135,8 +1135,8 @@ if(H5DEBUG(D)) * where it will be freed. */ if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.fspace, - type_info->src_type_size, - &chunk_ftype[u], /* OUT: datatype created */ + type_info->src_type_size, + &chunk_ftype[u], /* OUT: datatype created */ &chunk_mpi_file_counts[u], /* OUT */ &(chunk_mft_is_derived_array[u]), /* OUT */ TRUE, /* this is a file space, @@ -1154,9 +1154,9 @@ if(H5DEBUG(D)) if(is_permuted) HDassert(permute_map); if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.mspace, - type_info->dst_type_size, &chunk_mtype[u], - &chunk_mpi_mem_counts[u], - &(chunk_mbt_is_derived_array[u]), + type_info->dst_type_size, &chunk_mtype[u], + &chunk_mpi_mem_counts[u], + &(chunk_mbt_is_derived_array[u]), FALSE, /* this is a memory space, so if the file space is not @@ -2016,9 +2016,9 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf if((file_space != NULL) && (mem_space != NULL)) { int mpi_file_count; /* Number of file "objects" to transfer */ - hsize_t *permute_map = NULL; /* array that holds the mapping from the old, - out-of-order displacements to the in-order - displacements of the MPI datatypes of the + hsize_t *permute_map = NULL; /* array that holds the mapping from the old, + out-of-order displacements to the in-order + displacements of the MPI datatypes of the point selection of the file space */ hbool_t is_permuted = FALSE; @@ -2027,8 +2027,8 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf * and will be fed into the next call to H5S_mpio_space_type * where it will be freed. */ - if(H5S_mpio_space_type(file_space, type_info->src_type_size, - &mpi_file_type, &mpi_file_count, &mft_is_derived, /* OUT: datatype created */ + if(H5S_mpio_space_type(file_space, type_info->src_type_size, + &mpi_file_type, &mpi_file_count, &mft_is_derived, /* OUT: datatype created */ TRUE, /* this is a file space, so permute the datatype if the point selection is out of @@ -2037,13 +2037,13 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf the permutation of points selected in case they are out of - order */ + order */ &is_permuted /* OUT */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type") /* Sanity check */ if(is_permuted) HDassert(permute_map); - if(H5S_mpio_space_type(mem_space, type_info->src_type_size, + if(H5S_mpio_space_type(mem_space, type_info->src_type_size, &mpi_buf_type, &mpi_buf_count, &mbt_is_derived, /* OUT: datatype created */ FALSE, /* this is a memory space, so if the file space is not @@ -2055,7 +2055,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf generated by the file_space selection and applied to the - memory selection */, + memory selection */, &is_permuted /* IN */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buffer type") /* Sanity check */ @@ -2627,7 +2627,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ local_info_array[i].num_writers = 0; local_info_array[i].owners.original_owner = local_info_array[i].owners.new_owner = mpi_rank; local_info_array[i].buf = NULL; - + local_info_array[i].async_info.num_receive_requests = 0; local_info_array[i].async_info.receive_buffer_array = NULL; local_info_array[i].async_info.receive_requests_array = NULL; diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 2093512..5ba3f5b 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -14,7 +14,7 @@ /* Programmer: Vailin Choi * September 2010 * - * Purpose: Implicit (Non Index) chunked I/O functions. + * Purpose: Implicit (Non Index) chunked I/O functions. * This is used when the dataset is: * extendible but with fixed max. dims * with early allocation @@ -114,8 +114,8 @@ const H5D_chunk_ops_t H5D_COPS_NONE[1] = {{ * Function: H5D__none_idx_create * * Purpose: Allocate memory for the maximum # of chunks in the dataset. - * - * Return: Non-negative on success + * + * Return: Non-negative on success * Negative on failure. * * Programmer: Vailin Choi; September 2010 @@ -472,7 +472,7 @@ H5D__none_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /*------------------------------------------------------------------------- * Function: H5D__none_idx_dump * - * Purpose: Dump + * Purpose: Dump * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 281da81..b6ec06d 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -150,7 +150,7 @@ H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf/*out*/); H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf); -H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, +H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf); H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters, void *buf); @@ -193,7 +193,7 @@ H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type); #define H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME "direct_chunk_read_flag" #define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME "direct_chunk_read_offset" #define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME "direct_chunk_read_filters" - + /* Typedefs */ diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 8efa771..33274bb 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -14,7 +14,7 @@ /* Programmer: Vailin Choi * May 2011; updated 10/2015 * - * Purpose: Single Chunk I/O functions. + * Purpose: Single Chunk I/O functions. * This is used when the dataset has only 1 chunk (with or without filter): * cur_dims[] is equal to max_dims[] is equal to the chunk dims[] * non-filter chunk record: [address of the chunk] @@ -150,8 +150,8 @@ H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info, * Function: H5D__single_idx_create * * Purpose: Set up Single Chunk Index: filtered or non-filtered - * - * Return: Non-negative on success + * + * Return: Non-negative on success * Negative on failure. * * Programmer: Vailin Choi; July 2011 diff --git a/src/H5E.c b/src/H5E.c index 07eaf18..f204864 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -364,7 +364,7 @@ H5E__get_stack(void) /* No associated value with current thread - create one */ #ifdef H5_HAVE_WIN_THREADS /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ - estack = (H5E_t *)LocalAlloc(LPTR, sizeof(H5E_t)); + estack = (H5E_t *)LocalAlloc(LPTR, sizeof(H5E_t)); #else /* Use HDmalloc here since this has to match the HDfree in the * destructor and we want to avoid the codestack there. @@ -1045,7 +1045,7 @@ done: * * Programmer: Raymond Lu * Friday, July 15, 2003 - * + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 1d182a4..affa127 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -117,7 +117,7 @@ static herr_t H5EA__cache_dblk_page_get_initial_load_size(void *udata, size_t *i static htri_t H5EA__cache_dblk_page_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5EA__cache_dblk_page_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); -static herr_t H5EA__cache_dblk_page_image_len(const void *thing, +static herr_t H5EA__cache_dblk_page_image_len(const void *thing, size_t *image_len); static herr_t H5EA__cache_dblk_page_serialize(const H5F_t *f, void *image, size_t len, void *thing); @@ -1467,12 +1467,12 @@ H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len)) HDmemset(&dblock, 0, sizeof(dblock)); /* need to set: - * + * * dblock.hdr * dblock.npages * dblock.nelmts * - * before we invoke either H5EA_DBLOCK_PREFIX_SIZE() or + * before we invoke either H5EA_DBLOCK_PREFIX_SIZE() or * H5EA_DBLOCK_SIZE(). */ dblock.hdr = udata->hdr; @@ -1564,7 +1564,7 @@ H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED if(NULL == (dblock = H5EA__dblock_alloc(udata->hdr, udata->parent, udata->nelmts))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block") - HDassert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) || + HDassert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) || (len == H5EA_DBLOCK_PREFIX_SIZE(dblock))); /* Set the extensible array data block's information */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 0adcde2..bb3f39c 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -219,10 +219,10 @@ typedef struct H5EA_hdr_t { * of the extensible array header. * * The field is used to avoid duplicate - * setups of the flush dependency - * relationship, and to allow the + * setups of the flush dependency + * relationship, and to allow the * extensible array header to destroy - * the flush dependency on receipt of + * the flush dependency on receipt of * an eviction notification from the * metadata cache. */ @@ -448,7 +448,7 @@ H5_DLL herr_t H5EA__dblock_dest(H5EA_dblock_t *dblock); H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_alloc(H5EA_hdr_t *hdr, H5EA_sblock_t *parent); H5_DLL herr_t H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr); -H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, +H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_page_addr, unsigned flags); H5_DLL herr_t H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, unsigned cache_flags); diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 58e255a..8926d6a 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -346,10 +346,10 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */ * Function: H5EA__test_crt_dbg_context * * Purpose: Create context for debugging callback - * + * * Return: Success: non-NULL * Failure: NULL - * + * * Programmer: Vailin Choi; August 2010 * *------------------------------------------------------------------------- @@ -357,10 +357,10 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr)) - + /* Local variables */ H5EA__ctx_cb_t *ctx; /* Context for callbacks */ - + /* Allocate new context structure */ if(NULL == (ctx = H5FL_MALLOC(H5EA__ctx_cb_t))) H5E_THROW(H5E_CANTALLOC, "can't allocate extensible array client callback context") diff --git a/src/H5Eint.c b/src/H5Eint.c index 2aedc17..fe72449 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -994,7 +994,7 @@ H5E_dump_api_stack(hbool_t is_api) #ifdef H5_NO_DEPRECATED_SYMBOLS if(estack->auto_op.func2) (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ if(estack->auto_op.vers == 1) { if(estack->auto_op.func1) (void)((estack->auto_op.func1)(estack->auto_data)); diff --git a/src/H5Epkg.h b/src/H5Epkg.h index 86b5b73..83f3816 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -79,7 +79,7 @@ typedef struct { typedef struct { H5E_auto2_t func2; /* Only the new style callback function is available. */ } H5E_auto_op_t; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Some syntactic sugar to make the compiler happy with two different kinds of callbacks */ typedef struct { diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 922153c..8f5e696 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -669,7 +669,7 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block") - HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) + HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) || (len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock))); /* Set the fixed array data block's information */ @@ -954,21 +954,21 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */ * to free when a dblock entry is destroyed with the free * file space block set. * - * This function is needed when the data block is paged, as + * This function is needed when the data block is paged, as * the datablock header and all its pages are allocted as a - * single contiguous chunk of file space, and must be + * single contiguous chunk of file space, and must be * deallocated the same way. * * The size of the chunk of memory in which the dblock * header and all its pages is stored in the size field, * so we simply pass that value back to the cache. * - * If the datablock is not paged, then the size field of + * If the datablock is not paged, then the size field of * the cache_info contains the correct size. However this * value will be the same as the size field, so we return * the contents of the size field to the cache in this case * as well. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -1158,7 +1158,7 @@ H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len)) HDassert(image_len); /* Set the image length size */ - *image_len = dblk_page->size; + *image_len = dblk_page->size; END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */ diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 8f76fc9..2baee88 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -157,10 +157,10 @@ typedef struct H5FA_hdr_t { * of the fixed array header. * * The field is used to avoid duplicate - * setups of the flush dependency - * relationship, and to allow the + * setups of the flush dependency + * relationship, and to allow the * fixed array header to destroy - * the flush dependency on receipt of + * the flush dependency on receipt of * an eviction notification from the * metadata cache. */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 552b7ca..0551dd0 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -82,7 +82,7 @@ typedef struct H5FD_core_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ hbool_t dirty; /* changes not saved? */ @@ -405,7 +405,7 @@ done: * * Purpose: Initializes any interface-specific data or routines. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -757,9 +757,9 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr if((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) { if(HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW) >= 0) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file already exists") - + /* If backing store is requested, create and stat the file - * Note: We are forcing the O_CREAT flag here, even though this is + * Note: We are forcing the O_CREAT flag here, even though this is * technically an open. */ if(fa->backing_store) { @@ -856,14 +856,14 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* Read in existing data, being careful of interrupted system calls, * partial results, and the end of the file. */ - + uint8_t *mem = file->mem; /* memory pointer for writes */ HDoff_t offset = (HDoff_t)0; /* offset for reading */ - + while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ - + /* Trying to read more bytes than the return type can handle is * undefined behavior in POSIX. */ @@ -871,7 +871,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr bytes_in = H5_POSIX_MAX_IO_BYTES; else bytes_in = (h5_posix_io_t)size; - + do { #ifdef H5_HAVE_PREADWRITE bytes_read = HDpread(file->fd, mem, bytes_in, offset); @@ -881,7 +881,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr bytes_read = HDread(file->fd, mem, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); - + if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); @@ -890,10 +890,10 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ - + HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + mem += bytes_read; size -= (size_t)bytes_read; } /* end while */ @@ -1467,24 +1467,24 @@ done: * than the end-of-address. * * Addendum -- 12/2/11 - * For file images opened with the core file driver, it is + * For file images opened with the core file driver, it is * necessary that we avoid reallocating the core file driver's * buffer uneccessarily. * * To this end, I have made the following functional changes - * to this function. + * to this function. * - * If we are closing, and there is no backing store, this + * If we are closing, and there is no backing store, this * function becomes a no-op. * * If we are closing, and there is backing store, we set the - * eof to equal the eoa, and truncate the backing store to + * eof to equal the eoa, and truncate the backing store to * the new eof * - * If we are not closing, we realloc the buffer to size equal - * to the smallest multiple of the allocation increment that - * equals or exceeds the eoa and set the eof accordingly. - * Note that we no longer truncate the backing store to the + * If we are not closing, we realloc the buffer to size equal + * to the smallest multiple of the allocation increment that + * equals or exceeds the eoa and set the eof accordingly. + * Note that we no longer truncate the backing store to the * new eof if applicable. * -- JRM * diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index ce5e081..d045987 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -1344,7 +1344,7 @@ H5FD_direct_lock(H5FD_t *_file, hbool_t rw) /* Determine the type of lock */ int lock = rw ? LOCK_EX : LOCK_SH; - + /* Place the lock with non-blocking */ if(HDflock(file->fd, lock | LOCK_NB) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock file") diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index 3d4128d..37252f0 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -43,7 +43,7 @@ extern "C" { * * `version` (int32_t) * - * Version number of the `H5FD_hdfs_fapl_t` structure. Any instance passed + * Version number of the `H5FD_hdfs_fapl_t` structure. Any instance passed * to the above calls must have a recognized version number, or an error * will be flagged. * diff --git a/src/H5FDint.c b/src/H5FDint.c index ea8c4d8..8a2148a 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -241,7 +241,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void if(HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed") if((addr + file->base_addr + size) > eoa) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size=%llu, eoa=%llu", + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size=%llu, eoa=%llu", (unsigned long long)(addr+ file->base_addr), (unsigned long long)size, (unsigned long long)eoa) /* Dispatch to driver */ @@ -389,7 +389,7 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) /* Check for the driver to query and then query it */ if(driver->query) ret_value = (driver->query)(NULL, flags); - else + else *flags = 0; FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 60255e5..f649bc4 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -108,7 +108,7 @@ typedef struct H5FD_log_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ @@ -1255,7 +1255,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ - h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ + h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ /* Trying to read more bytes than the return type can handle is * undefined behavior in POSIX. @@ -1295,7 +1295,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + size -= (size_t)bytes_read; addr += (haddr_t)bytes_read; buf = (char *)buf + bytes_read; @@ -1472,7 +1472,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to write */ - h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ /* Trying to write more bytes than the return type can handle is * undefined behavior in POSIX. diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index bcbac08..ef035c1 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -1091,7 +1091,7 @@ H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit) { LOG_OP_CALL("H5FD_mirror_xmit_is_xmit"); HDassert(xmit); - if ( (H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || + if ( (H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version) ) { return FALSE; diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 11f0411..8c7e91a 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1283,7 +1283,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, #endif HMPI_GOTO_ERROR(FAIL, "MPI_Get_elements failed", mpi_code) } /* end if */ - + /* If the rank0-bcast feature was used, broadcast the # of bytes read to * other ranks, which didn't perform any I/O. */ @@ -1582,14 +1582,14 @@ done: * * Purpose: Make certain the file's size matches it's allocated size * - * This is a little sticky in the mpio case, as it is not + * This is a little sticky in the mpio case, as it is not * easy for us to track the current EOF by extracting it from - * write calls. + * write calls. * * Instead, we first check to see if the eoa has changed since - * the last call to this function. If it has, we call - * MPI_File_get_size() to determine the current EOF, and - * only call MPI_File_set_size() if this value disagrees + * the last call to this function. If it has, we call + * MPI_File_get_size() to determine the current EOF, and + * only call MPI_File_set_size() if this value disagrees * with the current eoa. * * Return: SUCCEED/FAIL @@ -1621,13 +1621,13 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR MPI_Offset size; MPI_Offset needed_eof; - /* In principle, it is possible for the size returned by the - * call to MPI_File_get_size() to depend on whether writes from + /* In principle, it is possible for the size returned by the + * call to MPI_File_get_size() to depend on whether writes from * all proceeses have completed at the time process 0 makes the - * call. + * call. * * In practice, most (all?) truncate calls will come after a barrier - * and with no interviening writes to the file (with the possible + * and with no interviening writes to the file (with the possible * exception of sueprblock / superblock extension message updates). * * Check the "MPI file closing" flag in the API context to determine @@ -1658,13 +1658,13 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, needed_eof))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) - /* In general, we must wait until all processes have finished - * the truncate before any process can continue, since it is - * possible that a process would write at the end of the + /* In general, we must wait until all processes have finished + * the truncate before any process can continue, since it is + * possible that a process would write at the end of the * file, and this write would be discarded by the truncate. * - * While this is an issue for a user initiated flush, it may - * not be an issue at file close. If so, we may be able to + * While this is an issue for a user initiated flush, it may + * not be an issue at file close. If so, we may be able to * optimize out the following barrier in that case. */ if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm))) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index d7fc88d..72f4da5 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -87,7 +87,7 @@ typedef struct H5FD_multi_t { haddr_t memb_next[H5FD_MEM_NTYPES]; /*addr of next member */ H5FD_t *memb[H5FD_MEM_NTYPES]; /*member pointers */ haddr_t memb_eoa[H5FD_MEM_NTYPES]; /*EOA for individual files, - *end of allocated addresses. v1.6 library + *end of allocated addresses. v1.6 library *have the EOA for the entire file. But it's *meaningless for MULTI file. We replaced it *with the EOAs for individual files */ @@ -831,9 +831,9 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) if (file->memb[mt]) if(H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt])<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1) - - /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ - file->memb_eoa[mt] = memb_eoa[mt]; + + /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ + file->memb_eoa[mt] = memb_eoa[mt]; } END_MEMBERS; return 0; @@ -1001,7 +1001,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* * Initialize the file from the file access properties, using default * values if necessary. Make sure to use CALLOC here because the code - * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa + * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa * in H5FD_multi_t. */ if(NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t)))) diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 124bac6..61bf212 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -207,7 +207,7 @@ typedef enum H5F_mem_t H5FD_mem_t; * the handle for the VFD (returned with the 'get_handle' callback) is * of type 'int' and is compatible with POSIX I/O calls. */ -#define H5FD_FEAT_POSIX_COMPAT_HANDLE 0x00000080 +#define H5FD_FEAT_POSIX_COMPAT_HANDLE 0x00000080 /* * Defining H5FD_FEAT_HAS_MPI for a VFL driver means that * the driver makes use of MPI communication and code may retrieve @@ -220,7 +220,7 @@ typedef enum H5F_mem_t H5FD_mem_t; * instead of the default H5D_ALLOC_TIME_LATE */ #define H5FD_FEAT_ALLOCATE_EARLY 0x00000200 - /* + /* * Defining H5FD_FEAT_ALLOW_FILE_IMAGE for a VFL driver means that * the driver is able to use a file image in the fapl as the initial * contents of a file. @@ -334,7 +334,7 @@ struct H5FD_t { /* Define enum for the source of file image callbacks */ typedef enum { H5FD_FILE_IMAGE_OP_NO_OP, - H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, @@ -345,13 +345,13 @@ typedef enum { /* Define structure to hold file image callbacks */ typedef struct { - void *(*image_malloc)(size_t size, H5FD_file_image_op_t file_image_op, + void *(*image_malloc)(size_t size, H5FD_file_image_op_t file_image_op, void *udata); void *(*image_memcpy)(void *dest, const void *src, size_t size, H5FD_file_image_op_t file_image_op, void *udata); - void *(*image_realloc)(void *ptr, size_t size, + void *(*image_realloc)(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *udata); - herr_t (*image_free)(void *ptr, H5FD_file_image_op_t file_image_op, + herr_t (*image_free)(void *ptr, H5FD_file_image_op_t file_image_op, void *udata); void *(*udata_copy)(void *udata); herr_t (*udata_free)(void *udata); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index d718a93..3551905 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -85,7 +85,7 @@ typedef struct H5FD_sec2_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ @@ -605,7 +605,7 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) * either the filesystem end-of-file or the HDF5 end-of-address * markers. * - * Return: End of file address, the first address past the end of the + * Return: End of file address, the first address past the end of the * "file", either the filesystem file or the HDF5 file. * * Programmer: Robb Matzke @@ -722,7 +722,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS bytes_read = HDread(file->fd, buf, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); - + if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); @@ -731,16 +731,16 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ - + if(0 == bytes_read) { /* end of file but not end of format address space */ HDmemset(buf, 0, size); break; } /* end if */ - + HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + size -= (size_t)bytes_read; addr += (haddr_t)bytes_read; buf = (char *)buf + bytes_read; @@ -808,7 +808,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to write */ - h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ /* Trying to write more bytes than the return type can handle is * undefined behavior in POSIX. @@ -827,7 +827,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU bytes_wrote = HDwrite(file->fd, buf, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_wrote && EINTR == errno); - + if(-1 == bytes_wrote) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); @@ -836,7 +836,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ - + HDassert(bytes_wrote > 0); HDassert((size_t)bytes_wrote <= size); diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 861c6a6..d29a1b4 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -110,7 +110,7 @@ typedef struct H5FD_stdio_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ } H5FD_stdio_t; @@ -824,13 +824,13 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1) } /* end if */ - + if(0 == bytes_read && feof(file->fp)) { /* end of file but not end of format address space */ memset((unsigned char *)buf, 0, size); break; } /* end if */ - + size -= bytes_read; addr += (haddr_t)bytes_read; buf = (char *)buf + bytes_read; @@ -914,7 +914,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) } /* end if */ - + assert(bytes_wrote > 0); assert((size_t)bytes_wrote <= size); @@ -1040,7 +1040,7 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, if(dwError != NO_ERROR ) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_FILEOPEN, "unable to set file pointer", -1) } - + bError = SetEndOfFile(file->hFile); if(0 == bError) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "unable to truncate/extend file properly", -1) diff --git a/src/H5FDtest.c b/src/H5FDtest.c index dec0818..2eb176d 100644 --- a/src/H5FDtest.c +++ b/src/H5FDtest.c @@ -110,6 +110,6 @@ H5FD__supports_swmr_test(const char *vfd_name) ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2"); FUNC_LEAVE_NOAPI(ret_value) - + } /* end H5FD__supports_swmr_test() */ diff --git a/src/H5FS.c b/src/H5FS.c index 1bd56b8..4fe0927 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -1171,7 +1171,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS__sinfo_dest() */ -herr_t +herr_t H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5FScache.c b/src/H5FScache.c index d5f2817..c3e3998 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -85,7 +85,7 @@ static void *H5FS__cache_hdr_deserialize(const void *image, size_t len, static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); -static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, +static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *thing); static herr_t H5FS__cache_hdr_free_icr(void *thing); @@ -241,7 +241,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, +H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5FS_t *fspace = NULL; /* Free space header info */ @@ -303,8 +303,8 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len /* Expand percent */ UINT16DECODE(image, fspace->expand_percent); - /* Size of address space free space sections are within - * (log2 of actual value) + /* Size of address space free space sections are within + * (log2 of actual value) */ UINT16DECODE(image, fspace->max_sect_addr); @@ -378,20 +378,20 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5FS__cache_hdr_pre_serialize * - * Purpose: The free space manager header contains the address, size, and + * Purpose: The free space manager header contains the address, size, and * allocation size of the free space manager section info. However, * since it is possible for the section info to either not be allocated * at all, or be allocated in temporary (AKA imaginary) files space, * it is possible for the above mentioned fields to contain giberish * when the free space manager header is serialized. * - * This function exists to prevent this problem. It does so by + * This function exists to prevent this problem. It does so by * forcing allocation of real file space for the section information. * * Note that in the Version 2 cache, this problem was dealt with by * simply flushing the section info before flushing the header. This - * was possible, since the clients handled file I/O directly. As - * this responsibility has moved to the cache in Version 3, this + * was possible, since the clients handled file I/O directly. As + * this responsibility has moved to the cache in Version 3, this * solution is no longer directly applicable. * * Return: Success: SUCCEED @@ -402,9 +402,9 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, - haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t H5_ATTR_NDEBUG_UNUSED *new_addr, + haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t H5_ATTR_NDEBUG_UNUSED *new_addr, size_t H5_ATTR_NDEBUG_UNUSED *new_len, unsigned *flags) { H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ @@ -433,23 +433,23 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, /* Set the ring type for the section info in the API context */ H5AC_set_ring(ring, &orig_ring); - /* This implies that the header "owns" the section info. + /* This implies that the header "owns" the section info. * - * Unfortunately, the comments in the code are not clear as to + * Unfortunately, the comments in the code are not clear as to * what this means, but from reviewing the code (most particularly - * H5FS_close(), H5FS_sinfo_lock, and H5FS_sinfo_unlock()), I - * gather that it means that the header is maintaining a pointer to - * an instance of H5FS_sinfo_t in which free space data is + * H5FS_close(), H5FS_sinfo_lock, and H5FS_sinfo_unlock()), I + * gather that it means that the header is maintaining a pointer to + * an instance of H5FS_sinfo_t in which free space data is * maintained, and either: * * 1) The instance of H5FS_sinfo_t is not in the metadata cache. * - * This will be TRUE iff H5F_addr_defined(fspace->sect_addr) + * This will be TRUE iff H5F_addr_defined(fspace->sect_addr) * is FALSE, and fspace->sinfo is not NULL. This is sometimes * referred to as "floating" section info in the comments. * - * If the section info structure contains free space data - * that must be placed on disk eventually, then + * If the section info structure contains free space data + * that must be placed on disk eventually, then * * fspace->serial_sect_count > 0 * @@ -458,57 +458,57 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, * H5F_addr_defined(fspace->addr) * * will both be TRUE. If this contition does not hold, then - * either the free space info is not persistent - * (!H5F_addr_defined(fspace->addr)???) or the section info - * contains no free space data that must be written to file + * either the free space info is not persistent + * (!H5F_addr_defined(fspace->addr)???) or the section info + * contains no free space data that must be written to file * ( fspace->serial_sect_count == 0 ). * * 2) The instance of H5FS_sinfo_t is in the metadata cache with * address in temporary file space (AKA imaginary file space). - * The entry may or may not be protected, and if protected, it - * may be protected either RW or RO (as indicated by + * The entry may or may not be protected, and if protected, it + * may be protected either RW or RO (as indicated by * fspace->sinfo_protected and fspace->sinfo_accmod). * * 3) The instance of H5FS_sinfo_t is in the metadata cache with * address in real file space. As in case 2) above, the entry - * may or may not be protected, and if protected, it - * may be protected either RW or RO (as indicated by + * may or may not be protected, and if protected, it + * may be protected either RW or RO (as indicated by * fspace->sinfo_protected and fspace->sinfo_accmod). * - * Observe that fspace->serial_sect_count > 0 must be TRUE in - * cases 2) and 3), as the section info should not be stored on + * Observe that fspace->serial_sect_count > 0 must be TRUE in + * cases 2) and 3), as the section info should not be stored on * disk if it doesn't exist. Similarly, since the section info - * will not be stored to disk unless the header is, + * will not be stored to disk unless the header is, * H5F_addr_defined(fspace->addr) must hold as well. * * As the objective is to touch up the free space manager header - * so that it contains sensical data on the size and location of + * so that it contains sensical data on the size and location of * the section information, we have to handle each of the above * cases differently. * - * Case 1) If either fspace->serial_sect_count == 0 or - * ! H5F_addr_defined(fspace->addr) do nothing as either - * the free space manager data is not persistent, or the + * Case 1) If either fspace->serial_sect_count == 0 or + * ! H5F_addr_defined(fspace->addr) do nothing as either + * the free space manager data is not persistent, or the * section info is empty. * * Otherwise, allocate space for the section info in real - * file space, insert the section info at this location, and - * set fspace->sect_addr, fspace->sect_size, and + * file space, insert the section info at this location, and + * set fspace->sect_addr, fspace->sect_size, and * fspace->alloc_sect_size to reflect the new location * of the section info. Note that it is not necessary to * force a write of the section info. * * Case 2) Allocate space for the section info in real file space, - * and tell the metadata cache to relocate the entry. - * Update fspace->sect_addr, fspace->sect_size, and + * and tell the metadata cache to relocate the entry. + * Update fspace->sect_addr, fspace->sect_size, and * fspace->alloc_sect_size to reflect the new location. * * Case 3) Nothing to be done in this case, although it is useful * to perform sanity checks. * - * Note that while we may alter the contents of the free space - * header in cases 1) and 2), there is no need to mark the header - * as dirty, as the metadata cache would not be attempting to + * Note that while we may alter the contents of the free space + * header in cases 1) and 2), there is no need to mark the header + * as dirty, as the metadata cache would not be attempting to * serialize the header if it thought it was clean. */ if(fspace->serial_sect_count > 0 && H5F_addr_defined(fspace->addr)) { @@ -558,7 +558,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); - /* the metadata cache is now managing the section info, + /* the metadata cache is now managing the section info, * so set fspace->sinfo to NULL. */ fspace->sinfo = NULL; @@ -607,11 +607,11 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, } /* end else */ } /* end if */ else if(H5F_addr_defined(fspace->sect_addr)) { - /* Here the metadata cache is managing the section info. + /* Here the metadata cache is managing the section info. * - * Do some sanity checks, and then test to see if the section - * info is in real file space. If it isn't relocate it into - * real file space lest the header be written to file with + * Do some sanity checks, and then test to see if the section + * info is in real file space. If it isn't relocate it into + * real file space lest the header be written to file with * a nonsense section info address. */ if(!H5F_POINT_OF_NO_RETURN(f)) { @@ -623,12 +623,12 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, unsigned sect_status = 0; haddr_t new_sect_addr; - /* we have work to do -- must relocate section info into + /* we have work to do -- must relocate section info into * real file space. * * Since the section info address is in temporary space (AKA - * imaginary space), it follows that the entry must be in - * cache. Further, since fspace->sinfo is NULL, it must be + * imaginary space), it follows that the entry must be in + * cache. Further, since fspace->sinfo is NULL, it must be * unprotected and un-pinned. Start by verifying this. */ if(H5AC_get_entry_status(f, fspace->sect_addr, §_status) < 0) @@ -654,7 +654,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, /* Update the internal address for the section info */ fspace->sect_addr = new_sect_addr; - /* No need to mark the header dirty, as we are about to + /* No need to mark the header dirty, as we are about to * serialize it. */ } /* end if */ @@ -682,7 +682,7 @@ done: * * Purpose: Given an instance of H5FS_t and a suitably sized buffer, * serialize the contents of the instance of H5FS_t and write - * its contents to the buffer. This buffer will be used to + * its contents to the buffer. This buffer will be used to * write the image of the instance to file. * * Return: Success: SUCCEED @@ -712,19 +712,19 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); HDassert(fspace->hdr_size == len); - /* The section information does not always exits, and if it does, - * it is not always in the cache. To make matters more interesting, + /* The section information does not always exits, and if it does, + * it is not always in the cache. To make matters more interesting, * even if it is in the cache, it may not be in real file space. * - * The pre-serialize function should have moved the section info + * The pre-serialize function should have moved the section info * into real file space if necessary before this function was called. * The following asserts are a cursory check on this. */ HDassert((! H5F_addr_defined(fspace->sect_addr)) || (! H5F_IS_TMP_ADDR(f, fspace->sect_addr))); if(!H5F_POINT_OF_NO_RETURN(f)) - HDassert((! H5F_addr_defined(fspace->sect_addr)) || - ((fspace->sect_size > 0) && + HDassert((! H5F_addr_defined(fspace->sect_addr)) || + ((fspace->sect_size > 0) && (fspace->alloc_sect_size == (size_t)fspace->sect_size))); /* Magic number */ @@ -758,8 +758,8 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN /* Expand percent */ UINT16ENCODE(image, fspace->expand_percent); - /* Size of address space free space sections are within (log2 of - * actual value) + /* Size of address space free space sections are within (log2 of + * actual value) */ UINT16ENCODE(image, fspace->max_sect_addr); @@ -808,7 +808,7 @@ H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(fspace); @@ -893,7 +893,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_get_initial_load_size() * - * Purpose: Compute the size of the on disk image of the free space + * Purpose: Compute the size of the on disk image of the free space * manager section info, and place this value in *image_len. * * Return: Success: SUCCEED @@ -904,7 +904,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_get_initial_load_size(void *_udata, size_t *image_len) { const H5FS_t *fspace; /* free space manager */ @@ -1108,7 +1108,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l UINT32DECODE(chksum_image, stored_chksum); /* Sanity check */ - HDassert((image == chksum_image) || + HDassert((image == chksum_image) || ((size_t)((image - (const uint8_t *)_image) + (chksum_image - image)) == old_sect_size)); /* Set return value */ @@ -1163,9 +1163,9 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_pre_serialize * - * Purpose: The objective of this function is to test to see if file space - * for the section info is located in temporary (AKA imaginary) file - * space. If it is, relocate file space for the section info to + * Purpose: The objective of this function is to test to see if file space + * for the section info is located in temporary (AKA imaginary) file + * space. If it is, relocate file space for the section info to * regular file space. * * Return: Success: SUCCEED @@ -1176,9 +1176,9 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, - size_t H5_ATTR_NDEBUG_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_NDEBUG_UNUSED *new_len, + size_t H5_ATTR_NDEBUG_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_NDEBUG_UNUSED *new_len, unsigned *flags) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ @@ -1249,8 +1249,8 @@ done: * Function: H5FS__cache_sinfo_serialize * * Purpose: Given an instance of H5FS_sinfo_t and a suitably sized buffer, - * serialize the contents of the instance of H5FS_sinfo_t and write - * its contents to the buffer. This buffer will be used to write + * serialize the contents of the instance of H5FS_sinfo_t and write + * its contents to the buffer. This buffer will be used to write * the image of the instance to file. * * Return: Success: SUCCEED @@ -1261,7 +1261,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, void *_thing) { @@ -1348,7 +1348,7 @@ H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *_thing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE - + /* Sanity check */ HDassert(sinfo); @@ -1396,7 +1396,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_free_icr * - * Purpose: Free the memory used for the in core representation of the + * Purpose: Free the memory used for the in core representation of the * free space manager section info. * * Note: The metadata cache sets the object's cache_info.magic to @@ -1411,7 +1411,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_free_icr(void *_thing) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ diff --git a/src/H5FSint.c b/src/H5FSint.c index 264950d..6ba5748 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -121,7 +121,7 @@ H5FS__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(parent_entry); HDassert(child_entry); @@ -153,7 +153,7 @@ H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(parent_entry); HDassert(child_entry); @@ -161,7 +161,7 @@ H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) /* Destroy a flush dependency between parent and child entry */ if(H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS__destroy_flush_depend() */ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index cf4a587..d783901 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -307,9 +307,9 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" * Purpose: Release the section info, either giving ownership back to * the cache or letting the free space header keep it. * - * Add the fix in this routine to resolve the potential infinite loop - * problem when allocating file space for the meta data of the - * self-referential free-space managers at file closing. + * Add the fix in this routine to resolve the potential infinite loop + * problem when allocating file space for the meta data of the + * self-referential free-space managers at file closing. * * On file close or flushing, when the section info is modified * and protected/unprotected, does not allow the section info size @@ -317,8 +317,8 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" * --if the current allocated section info size in fspace->sect_size is * larger than the previous section info size in fpsace->alloc_sect_size, * release the section info - * --Otherwise, set the fspace->sect_size to be the same as - * fpsace->alloc_sect_size. This means fspace->sect_size may be larger + * --Otherwise, set the fspace->sect_size to be the same as + * fpsace->alloc_sect_size. This means fspace->sect_size may be larger * than what is actually needed. * * Return: SUCCEED/FAIL @@ -439,7 +439,7 @@ HDfprintf(stderr, "%s: Relinquishing section info ownership\n", FUNC); /* Check if we need to release section info in the file */ if(H5F_addr_defined(fspace->sect_addr)) { /* Set flag to release section info space in file */ - /* On file close or flushing, only need to release section info with size + /* On file close or flushing, only need to release section info with size bigger than previous section */ if(closing_or_flushing) { if(fspace->sect_size > fspace->alloc_sect_size) @@ -1248,7 +1248,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) /* Retarget section pointer to 'less than' node that was merged into */ *sect = tmp_sect; - if(*sect == NULL) + if(*sect == NULL) HGOTO_DONE(ret_value); /* Indicate successful merge occurred */ @@ -1293,7 +1293,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't merge two sections") /* It's possible that the merge caused the section to be deleted (particularly in the paged allocation case) */ - if(*sect == NULL) + if(*sect == NULL) HGOTO_DONE(ret_value); /* Indicate successful merge occurred */ @@ -2457,22 +2457,22 @@ done: * The previous hack in this routine to avoid the potential infinite * loops by allocating file space directly from the end of the file * is removed. The allocation can now be done via the usual - * file space allocation call H5MF_alloc(). + * file space allocation call H5MF_alloc(). * - * The design flaw is addressed by not allowing the size - * of section info to shrink. This means, when trying to allocate - * section info size X via H5MF_alloc() and the section info size + * The design flaw is addressed by not allowing the size + * of section info to shrink. This means, when trying to allocate + * section info size X via H5MF_alloc() and the section info size * after H5MF_alloc() changes to Y: - * --if Y is larger than X, free the just allocated file space X + * --if Y is larger than X, free the just allocated file space X * via H5MF_xfree() and set fspace->sect_size to Y. - * This routine will be called again later from - * H5MF_settle_meta_data_fsm() to allocate section info with the + * This routine will be called again later from + * H5MF_settle_meta_data_fsm() to allocate section info with the * larger fpsace->sect_size Y. - * --if Y is smaller than X, no further allocation is needed and + * --if Y is smaller than X, no further allocation is needed and * fspace->sect_size and fspace->alloc_sect_size are set to X. * This means fspace->sect_size may be larger than what is * actually needed. - * + * * This routine also re-inserts the header and section info in the * metadata cache with this allocation. * @@ -2510,7 +2510,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, HDassert(f->shared->fs_persist); /* At present, all free space strategies enable the free space managers. - * This will probably change -- at which point this assertion should + * This will probably change -- at which point this assertion should * be revisited. */ /* Updated: Only the following two strategies enable the free-space managers */ diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 264a623..77d29f5 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -895,7 +895,7 @@ H5F__efc_try_close(H5F_t *f) HGOTO_DONE(SUCCEED) /* If the file EFC were locked, that should always mean that there exists - * a reference to this file that is not in an EFC (it may have just been + * a reference to this file that is not in an EFC (it may have just been * removed from an EFC), and should have been caught by the above check */ /* If we get here then we must be beginning a new run. Make sure that the * temporary variables in f->shared->efc are at the default value */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 0000512..e4c8229 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -3033,7 +3033,7 @@ H5F_set_retries(H5F_t *f) /* Initialize the # of bins for retries */ f->shared->retries_nbins = 0; if(f->shared->read_attempts > 1) { - /* Use HDceil to ensure that the log10 value is rounded up to the + /* Use HDceil to ensure that the log10 value is rounded up to the nearest integer before casting to unsigned */ tmp = HDceil(HDlog10((double)f->shared->read_attempts)); f->shared->retries_nbins = (unsigned)tmp; diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index b85305e..46185ff 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -80,17 +80,17 @@ + 1) /* superblock version */ /* The H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE is the minimal amount of super block - * variable length data guarnateed to load the sizeof offsets and the sizeof + * variable length data guarnateed to load the sizeof offsets and the sizeof * lengths fields in all versions of the superblock. * - * This is necessary in the V3 cache, as on the initial load, we need to + * This is necessary in the V3 cache, as on the initial load, we need to * get enough of the superblock to determine its version and size so that - * the metadata cache can load the correct amount of data from file to + * the metadata cache can load the correct amount of data from file to * allow the second deserialization attempt to succeed. * - * The value selected will have to be revisited for each new version + * The value selected will have to be revisited for each new version * of the super block. Note that the current value is one byte larger - * than it needs to be. + * than it needs to be. */ #define H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE 7 @@ -166,8 +166,8 @@ typedef struct H5F_superblock_cache_ud_t { unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */ haddr_t stored_eof; /* End-of-file in file */ hbool_t drvrinfo_removed; /* Indicate if the driver info was removed */ - unsigned super_vers; /* Superblock version obtained in get_load_size callback. - * It will be used later in verify_chksum callback + unsigned super_vers; /* Superblock version obtained in get_load_size callback. + * It will be used later in verify_chksum callback */ } H5F_superblock_cache_ud_t; @@ -242,16 +242,16 @@ typedef struct H5F_super_t { struct H5F_shared_t { H5FD_t *lf; /* Lower level file handle for I/O */ H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */ - H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info + H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info * cache entry. This field is only defined * for older versions of the super block, * and then only when a driver information * block is present. At all other times * it should be NULL. */ - hbool_t drvinfo_sb_msg_exists; /* Convenience field used to track - * whether the driver info superblock - * extension message has been created + hbool_t drvinfo_sb_msg_exists; /* Convenience field used to track + * whether the driver info superblock + * extension message has been created * yet. This field should be TRUE iff the * superblock extension exists and contains * a driver info message. Under all other @@ -278,7 +278,7 @@ struct H5F_shared_t { /* metadata cache. This structure is */ /* fixed at creation time and should */ /* not change thereafter. */ - H5AC_cache_image_config_t + H5AC_cache_image_config_t mdc_initCacheImageCfg; /* initial configuration for the */ /* generate metadata cache image on */ /* close option. This structure is */ @@ -318,7 +318,7 @@ struct H5F_shared_t { hsize_t fs_threshold; /* Free space section threshold */ hbool_t fs_persist; /* Free-space persist or not */ unsigned fs_version; /* Free-space version: */ - /* It is used to update fsinfo message in the superblock + /* It is used to update fsinfo message in the superblock extension when closing down the free-space managers */ hbool_t use_tmp_space; /* Whether temp. file space allocation is allowed */ haddr_t tmp_addr; /* Next address to use for temp. space in the file */ diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index f8a40b2..119548c 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -268,7 +268,7 @@ H5F__drvrinfo_prefix_decode(H5O_drvinfo_t *drvrinfo, char *drv_name, UINT32DECODE(image, drvrinfo->len); /* Driver name and/or version */ - if(drv_name) { + if(drv_name) { H5MM_memcpy(drv_name, (const char *)image, (size_t)8); drv_name[8] = '\0'; image += 8; /* advance past name/version */ @@ -369,7 +369,7 @@ H5F__cache_superblock_get_final_load_size(const void *_image, size_t H5_ATTR_NDE udata->super_vers = sblock.super_vers; /* Set the final size for the cache image */ - *actual_len = H5F_SUPERBLOCK_FIXED_SIZE + + *actual_len = H5F_SUPERBLOCK_FIXED_SIZE + (size_t)H5F_SUPERBLOCK_VARLEN_SIZE(sblock.super_vers, sblock.sizeof_addr, sblock.sizeof_size); done: @@ -380,7 +380,7 @@ done: /*------------------------------------------------------------------------- * Function: H5F__cache_superblock_verify_chksum * - * Purpose: Verify the computed checksum of the data structure is the + * Purpose: Verify the computed checksum of the data structure is the * same as the stored chksum. * * Return: Success: TRUE/FALSE @@ -584,14 +584,14 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS H5F_addr_decode(udata->f, (const uint8_t **)&image, &udata->stored_eof/*out*/); H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->root_addr/*out*/); - /* checksum verification already done in verify_chksum cb */ + /* checksum verification already done in verify_chksum cb */ /* Decode checksum */ UINT32DECODE(image, read_chksum); /* The Driver Information Block may not appear with the version - * 2 super block. Thus we set the driver_addr field of the in - * core representation of the super block HADDR_UNDEF to prevent + * 2 super block. Thus we set the driver_addr field of the in + * core representation of the super block HADDR_UNDEF to prevent * any attempt to load the Driver Information Block. */ sblock->driver_addr = HADDR_UNDEF; @@ -675,11 +675,11 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU HDassert(image); HDassert(sblock); - /* Assert that the superblock is marked as being flushed last (and + /* Assert that the superblock is marked as being flushed last (and collectively in parallel) */ /* (We'll rely on the cache to make sure it actually *is* flushed last (and collectively in parallel), but this check doesn't hurt) */ - HDassert(sblock->cache_info.flush_me_last); + HDassert(sblock->cache_info.flush_me_last); /* Encode the common portion of the file superblock for all versions */ H5MM_memcpy(image, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN); diff --git a/src/H5G.c b/src/H5G.c index a766e8a..bcc33bb 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -782,7 +782,7 @@ H5Gflush(hid_t group_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); - + /* Check args */ if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group ID") diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 0ffdc53..13a33a3 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -114,7 +114,7 @@ H5FL_SEQ_EXTERN(H5G_entry_t); /*------------------------------------------------------------------------- * Function: H5G__cache_node_get_initial_load_size() * - * Purpose: Determine the size of the on-disk image of the node, and + * Purpose: Determine the size of the on-disk image of the node, and * return this value in *image_len. * * Return: Success: SUCCEED @@ -150,10 +150,10 @@ H5G__cache_node_get_initial_load_size(void *_udata, size_t *image_len) * node, allocate an instance of H5G_node_t, load the contence of the * image into it, and return a pointer to the instance. * - * Note that deserializing the image requires access to the file - * pointer, which is not included in the parameter list for this - * callback. Finesse this issue by passing in the file pointer - * twice to the H5AC_protect() call -- once as the file pointer + * Note that deserializing the image requires access to the file + * pointer, which is not included in the parameter list for this + * callback. Finesse this issue by passing in the file pointer + * twice to the H5AC_protect() call -- once as the file pointer * proper, and again as the user data * * Return: Success: Pointer to in core representation diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 7e2b324..1a76012 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -60,7 +60,7 @@ typedef struct { /* PRIVATE PROTOTYPES */ static herr_t H5G__compact_build_table_cb(const void *_mesg, unsigned idx, void *_udata); -static herr_t H5G__compact_build_table(const H5O_loc_t *oloc, +static herr_t H5G__compact_build_table(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable); static herr_t H5G__compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata); diff --git a/src/H5Gint.c b/src/H5Gint.c index a3849a6..0f9f9cb 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -496,9 +496,9 @@ H5G_close(H5G_t *grp) /* Evict group metadata if evicting on close */ if(!file_closed && H5F_SHARED(grp->oloc.file) && H5F_EVICT_ON_CLOSE(grp->oloc.file)) { - if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr) < 0) + if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE) < 0) + if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") } /* end if */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 35b90f3..9faa0b5 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -538,7 +538,7 @@ H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, rt = sn->nsyms; while(lt < rt && cmp) { idx = (lt + rt) / 2; - + if((s = (const char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table name") cmp = HDstrcmp(udata->common.name, s); @@ -1449,7 +1449,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__node_iterate_size(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, +H5G__node_iterate_size(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t H5_ATTR_UNUSED addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *stab_size = (hsize_t *)_udata; /* User data */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 6dc025c..8ad03d0 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -372,7 +372,7 @@ H5_DLL ssize_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t hsize_t n, char* name, size_t size); H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, +H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk); @@ -434,7 +434,7 @@ H5_DLL ssize_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hsize_t idx, char *name, size_t size); H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, +H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 19b120c..501c883 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -216,7 +216,7 @@ H5_DLL herr_t H5G_iterate(H5G_loc_t *loc, const char *group_name, H5_DLL herr_t H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, void *op_data); -/* +/* * Functions that understand links in groups */ H5_DLL herr_t H5G_link_to_info(const struct H5O_loc_t *link_loc, const struct H5O_link_t *lnk, H5L_info2_t *linfo); diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 0f27880..5a4380d 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -843,9 +843,9 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver /* Set up invalid tag. This is a precautionary step only. Setting an invalid * tag here will ensure that no metadata accessed while doing the traversal - * is given an improper tag, unless another one is specifically set up - * first. This will ensure we're not accidentally tagging something we - * shouldn't be during the traversal. Note that for best tagging assertion + * is given an improper tag, unless another one is specifically set up + * first. This will ensure we're not accidentally tagging something we + * shouldn't be during the traversal. Note that for best tagging assertion * coverage, setting H5C_DO_TAGGING_SANITY_CHECKS is advised. */ H5_BEGIN_TAG(H5AC__INVALID_TAG); diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 5807c56..479c2bd 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -360,7 +360,7 @@ H5HF__huge_bt2_indir_compare(const void *_rec1, const void *_rec2, int *result) { FUNC_ENTER_STATIC_NOERR - *result = (int)(((const H5HF_huge_bt2_indir_rec_t *)_rec1)->id - + *result = (int)(((const H5HF_huge_bt2_indir_rec_t *)_rec1)->id - ((const H5HF_huge_bt2_indir_rec_t *)_rec2)->id); FUNC_LEAVE_NOAPI(SUCCEED) @@ -563,7 +563,7 @@ H5HF__huge_bt2_filt_indir_compare(const void *_rec1, const void *_rec2, int *res { FUNC_ENTER_STATIC_NOERR - *result = (int)(((const H5HF_huge_bt2_filt_indir_rec_t *)_rec1)->id - + *result = (int)(((const H5HF_huge_bt2_filt_indir_rec_t *)_rec1)->id - ((const H5HF_huge_bt2_filt_indir_rec_t *)_rec2)->id); FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 4a2ff91..8dbdf25 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -77,35 +77,35 @@ static herr_t H5HF__cache_hdr_get_final_load_size(const void *image_ptr, size_t image_len, void *udata, size_t *actual_len); static htri_t H5HF__cache_hdr_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5HF__cache_hdr_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HF__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, - size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_hdr_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HF__cache_hdr_free_icr(void *thing); static herr_t H5HF__cache_iblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5HF__cache_iblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5HF__cache_iblock_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HF__cache_iblock_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, void *thing, - haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); + haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_iblock_serialize(const H5F_t *f, void *image, - size_t len, void *thing); -static herr_t H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *thing); + size_t len, void *thing); +static herr_t H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5HF__cache_iblock_free_icr(void *thing); static herr_t H5HF__cache_dblock_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5HF__cache_dblock_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5HF__cache_dblock_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HF__cache_dblock_image_len(const void *thing, size_t *image_len); static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, void *thing, haddr_t addr, - size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_dblock_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5HF__cache_dblock_free_icr(void *thing); static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size); @@ -114,14 +114,14 @@ static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) #ifndef NDEBUG static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean); -static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, +static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, unsigned *iblock_status, hbool_t *fd_clean, hbool_t *clean); -static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, +static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_dblocks); -static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, +static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_iblocks); #endif /* NDEBUG */ @@ -212,7 +212,7 @@ H5FL_BLK_DEFINE(direct_block); * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref) { const uint8_t *image = *image_ref; /* Pointer into into supplied image */ @@ -351,8 +351,8 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) * Purpose: Determine the size of the fractal heap header on disk, * and set *image_len to this value. * - * Note also that the value returned by this function presumes that - * there is no I/O filtering data in the header. If there is, the + * Note also that the value returned by this function presumes that + * there is no I/O filtering data in the header. If there is, the * size reported will be too small, and H5C_load_entry() * will have to make two tries to load the fractal heap header. * @@ -364,7 +364,7 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) { H5HF_hdr_cache_ud_t *udata = (H5HF_hdr_cache_ud_t *)_udata; /* Pointer to user data */ @@ -402,7 +402,7 @@ H5HF__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { @@ -609,11 +609,11 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_hdr_image_len * - * Purpose: Return the actual size of the fractal heap header on - * disk image. + * Purpose: Return the actual size of the fractal heap header on + * disk image. * - * If the header contains filter information, this size will be - * larger than the value returned by H5HF__cache_hdr_get_initial_load_size(). + * If the header contains filter information, this size will be + * larger than the value returned by H5HF__cache_hdr_get_initial_load_size(). * * Return: Success: SUCCEED * Failure: FAIL @@ -623,7 +623,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) { const H5HF_hdr_t *hdr = (const H5HF_hdr_t *)_thing; /* Fractal heap info */ @@ -645,13 +645,13 @@ H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5HF__cache_hdr_pre_serialize * - * Purpose: As best I can tell, fractal heap header blocks are always + * Purpose: As best I can tell, fractal heap header blocks are always * allocated in real file space. Thus this routine simply verifies * this, verifies that the len parameter contains the expected * value, and returns an error if either of these checks fail. * * When compiled in debug mode, the function also verifies that all - * indirect and direct blocks that are children of the header are + * indirect and direct blocks that are children of the header are * either clean, or not in the metadata cache. * * Return: Success: SUCCEED @@ -662,7 +662,7 @@ H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, haddr_t H5_ATTR_UNUSED *new_addr, size_t H5_ATTR_UNUSED *new_len, unsigned *flags) @@ -706,8 +706,8 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, * is made during a cache serialization instead of an entry or cache * flush. * - * Note also that with the recent change in the definition of flush - * dependency, not all descendants need be clean -- only direct flush + * Note also that with the recent change in the definition of flush + * dependency, not all descendants need be clean -- only direct flush * dependency children. * * Finally, observe that the H5HF__cache_verify_hdr_descendants_clean() @@ -736,7 +736,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_hdr_serialize * - * Purpose: Construct the on disk image of the header, and place it in + * Purpose: Construct the on disk image of the header, and place it in * the buffer pointed to by image. Return SUCCEED on success, * and FAIL on failure. * @@ -748,7 +748,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { @@ -846,7 +846,7 @@ done: * * Purpose: Free the in core representation of the fractal heap header. * - * This routine frees just the header itself, not the + * This routine frees just the header itself, not the * associated version 2 B-Tree, the associated Free Space Manager, * nor the indirect/direct block tree that is rooted in the header. * @@ -865,7 +865,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_hdr_free_icr(void *_thing) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */ @@ -890,7 +890,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_get_initial_load_size() * - * Purpose: Compute the size of the on disk image of the indirect + * Purpose: Compute the size of the on disk image of the indirect * block, and place this value in *image_len. * * Return: Success: SUCCEED @@ -901,7 +901,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len) { H5HF_iblock_cache_ud_t *udata = (H5HF_iblock_cache_ud_t *)_udata; /* User data for callback */ @@ -913,7 +913,7 @@ H5HF__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len) HDassert(udata->par_info); HDassert(udata->par_info->hdr); HDassert(image_len); - + /* Set the image length size */ *image_len = (size_t)H5HF_MAN_INDIRECT_SIZE(udata->par_info->hdr, *udata->nrows); @@ -961,9 +961,9 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_deserialize * - * Purpose: Given a buffer containing the on disk image of the indirect - * block, allocate an instance of H5HF_indirect_t, load the data - * in the buffer into this new instance, and return a pointer to + * Purpose: Given a buffer containing the on disk image of the indirect + * block, allocate an instance of H5HF_indirect_t, load the data + * in the buffer into this new instance, and return a pointer to * it. * * As best I can tell, the size of the indirect block image is fully @@ -979,7 +979,7 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN *------------------------------------------------------------------------- */ static void * -H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, +H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ @@ -1164,7 +1164,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) { const H5HF_indirect_t *iblock = (const H5HF_indirect_t *)_thing; /* Indirect block info */ @@ -1188,11 +1188,11 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) * * Purpose: The primary objective of this function is to determine if the * indirect block is currently allocated in temporary file space, - * and if so, to move it to real file space before the entry is + * and if so, to move it to real file space before the entry is * serialized. * - * In debug compiles, this function also verifies that all - * immediate flush dependency children of this indirect block + * In debug compiles, this function also verifies that all + * immediate flush dependency children of this indirect block * are either clean or are not in cache. * * Return: Success: SUCCEED @@ -1203,7 +1203,7 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_UNUSED *new_len, unsigned *flags) @@ -1237,7 +1237,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, unsigned iblock_status = 0; /* verify that flush dependencies are working correctly. Do this - * by verifying that all immediate flush dependency children of this + * by verifying that all immediate flush dependency children of this * iblock are clean. */ if(H5AC_get_entry_status(f, iblock->addr, &iblock_status) < 0) @@ -1254,7 +1254,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, } #endif /* NDEBUG */ - /* Check to see if we must re-allocate the iblock from temporary to + /* Check to see if we must re-allocate the iblock from temporary to * normal (AKA real) file space. */ if(H5F_IS_TMP_ADDR(f, addr)) { @@ -1302,7 +1302,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, *new_addr = iblock_addr; *flags = H5AC__SERIALIZE_MOVED_FLAG; } /* end if */ - else + else *flags = 0; done: @@ -1313,8 +1313,8 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_serialize * - * Purpose: Given a pointer to an iblock, and a pointer to a buffer of - * the appropriate size, write the contents of the iblock to the + * Purpose: Given a pointer to an iblock, and a pointer to a buffer of + * the appropriate size, write the contents of the iblock to the * buffer in format appropriate for writing to disk. * * Return: Success: SUCCEED @@ -1325,7 +1325,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { @@ -1390,7 +1390,7 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG /* (either both the address & size are defined or both are * not defined) */ - HDassert((H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) + HDassert((H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) || (!H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); /* Size of filtered direct block */ @@ -1431,11 +1431,11 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_notify * - * Purpose: This function is used to create and destroy flush dependency + * Purpose: This function is used to create and destroy flush dependency * relationships between iblocks and their parents as indirect blocks * are loaded / inserted and evicted from the metadata cache. * - * In general, the parent will be another iblock, but it may be the + * In general, the parent will be another iblock, but it may be the * header if the iblock in question is the root iblock. * * Return: Success: SUCCEED @@ -1446,7 +1446,7 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) { H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; /* Indirect block info */ @@ -1528,7 +1528,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_iblock_free_icr * - * Purpose: Unlink the supplied instance of H5HF_indirect_t from the + * Purpose: Unlink the supplied instance of H5HF_indirect_t from the * fractal heap and free its memory. * * Note: The metadata cache sets the object's cache_info.magic to @@ -1543,7 +1543,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_iblock_free_icr(void *thing) { H5HF_indirect_t *iblock = (H5HF_indirect_t *)thing; /* Fractal heap indirect block to free */ @@ -1570,7 +1570,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_dblock_get_initial_load_size() * - * Purpose: Determine the size of the direct block on disk image, and + * Purpose: Determine the size of the direct block on disk image, and * return it in *image_len. * * Return: Success: SUCCEED @@ -1581,7 +1581,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) { const H5HF_dblock_cache_ud_t *udata = (const H5HF_dblock_cache_ud_t *)_udata; /* User data for callback */ @@ -1612,7 +1612,7 @@ H5HF__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) } /* end if */ else *image_len = udata->dblock_size; - + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5HF__cache_dblock_get_initial_load_size() */ @@ -1668,7 +1668,7 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) filter_cb.func = NULL; /* no callback function when failed */ /* Allocate buffer to perform I/O filtering on and copy image into - * it. Must do this as H5Z_pipeline() may re-size the buffer + * it. Must do this as H5Z_pipeline() may re-size the buffer * provided to it. */ if(NULL == (read_buf = H5MM_malloc(len))) @@ -1801,7 +1801,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { /* Direct block is already decompressed in verify_chksum callback */ - if(udata->decompressed) { + if(udata->decompressed) { /* Sanity check */ HDassert(udata->dblk); @@ -1822,7 +1822,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, filter_cb.func = NULL; /* no callback function when failed */ /* Allocate buffer to perform I/O filtering on and copy image into - * it. Must do this as H5Z_pipeline() may resize the buffer + * it. Must do this as H5Z_pipeline() may resize the buffer * provided to it. */ if (NULL == (read_buf = H5MM_malloc(len))) @@ -1926,7 +1926,7 @@ done: * Function: H5HF__cache_dblock_image_len * * Purpose: Report the actual size of the direct block image on disk. - * Note that this value will probably be incorrect if compression + * Note that this value will probably be incorrect if compression * is enabled and the entry is dirty. * * Return: Success: SUCCEED @@ -1937,7 +1937,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) { const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; /* Direct block info */ @@ -1958,32 +1958,32 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { - /* + /* * If the data is available, set to the compressed - * size of the direct block -- otherwise set it equal to the - * uncompressed size. + * size of the direct block -- otherwise set it equal to the + * uncompressed size. * * We have three possible scenarios here. * * First, the block may never have been flushed. In this - * case, both dblock->file_size and the size stored in the - * parent (either the header or the parent iblock) will all - * be zero. In this case, return the uncompressed size + * case, both dblock->file_size and the size stored in the + * parent (either the header or the parent iblock) will all + * be zero. In this case, return the uncompressed size * stored in dblock->size as the size. * * Second, the block may have just been serialized, in which - * case, dblock->file_size should be zero, and the correct + * case, dblock->file_size should be zero, and the correct * on disk size should be stored in the parent (again, either * the header or the parent iblock as case may be). - * - * Third, we may be in the process of discarding this + * + * Third, we may be in the process of discarding this * dblock without writing it. In this case, dblock->file_size - * should be non-zero and have the correct size. Note that + * should be non-zero and have the correct size. Note that * in this case, the direct block will have been detached, * and thus looking up the parent will likely return incorrect * data. */ - if(dblock->file_size != 0) + if(dblock->file_size != 0) size = dblock->file_size; else { const H5HF_indirect_t *par_iblock = dblock->parent; /* Parent iblock */ @@ -2012,54 +2012,54 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) * Function: H5HF__cache_dblock_pre_serialize * * Purpose: In principle, the purpose of this function is to determine - * the size and location of the disk image of the target direct + * the size and location of the disk image of the target direct * block. In this case, the uncompressed size of the block is - * fixed, but since the direct block could be compressed, + * fixed, but since the direct block could be compressed, * we may need to compute and report the compressed size. * - * This is a bit sticky in the case of a direct block when I/O + * This is a bit sticky in the case of a direct block when I/O * filters are enabled, as the size of the compressed version - * of the on disk image is not known until the direct block has - * been run through the filters. Further, the location of the - * on disk image may change if the compressed size of the image + * of the on disk image is not known until the direct block has + * been run through the filters. Further, the location of the + * on disk image may change if the compressed size of the image * changes as well. * - * To complicate matters further, the direct block may have been - * initially allocated in temporary (AKA imaginary) file space. - * In this case, we must relocate the direct block's on-disk - * image to "real" file space regardless of whether it has changed + * To complicate matters further, the direct block may have been + * initially allocated in temporary (AKA imaginary) file space. + * In this case, we must relocate the direct block's on-disk + * image to "real" file space regardless of whether it has changed * size. * - * One simplifying factor is the direct block's "blk" field, + * One simplifying factor is the direct block's "blk" field, * which contains a pointer to a buffer which (with the exception - * of a small header) contains the on disk image in uncompressed + * of a small header) contains the on disk image in uncompressed * form. * - * To square this particular circle, this function does - * everything the serialize function usually does, with the - * exception of copying the image into the image buffer provided - * to the serialize function by the metadata cache. The data to + * To square this particular circle, this function does + * everything the serialize function usually does, with the + * exception of copying the image into the image buffer provided + * to the serialize function by the metadata cache. The data to * copy is provided to the serialize function in a buffer pointed * to by the write_buf field. * - * If I/O filters are enabled, on exit, - * H5HF__cache_dblock_pre_serialize() sets the write_buf field to + * If I/O filters are enabled, on exit, + * H5HF__cache_dblock_pre_serialize() sets the write_buf field to * point to a buffer containing the filtered image of the direct * block. The serialize function should free this block, and set - * the write_buf field to NULL after copying it into the image + * the write_buf field to NULL after copying it into the image * buffer provided by the metadata cache. * - * If I/O filters are not enabled, this function prepares - * the buffer pointed to by the blk field for copying to the - * image buffer provided by the metadata cache, and sets the - * write_buf field equal to the blk field. In this case, the - * serialize function should simply set the write_buf field to - * NULL after copying the direct block image into the image + * If I/O filters are not enabled, this function prepares + * the buffer pointed to by the blk field for copying to the + * image buffer provided by the metadata cache, and sets the + * write_buf field equal to the blk field. In this case, the + * serialize function should simply set the write_buf field to + * NULL after copying the direct block image into the image * buffer. * - * In both of the above cases, the length of the buffer pointed - * to by write_buf is provided in the write_len field. This - * field must contain 0 on entry to this function, and should + * In both of the above cases, the length of the buffer pointed + * to by write_buf is provided in the write_len field. This + * field must contain 0 on entry to this function, and should * be set back to 0 at the end of the serialize function. * * Return: Success: SUCCEED @@ -2070,7 +2070,7 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { @@ -2114,10 +2114,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); if(dblock->parent) { - /* this is the common case, in which the direct block is the child + /* this is the common case, in which the direct block is the child * of an indirect block. Set up the convenience variables we will - * need if the address and/or compressed size of the on disk image - * of the direct block changes, and do some sanity checking in + * need if the address and/or compressed size of the on disk image + * of the direct block changes, and do some sanity checking in * passing. */ par_iblock = dblock->parent; @@ -2137,8 +2137,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, at_tmp_addr = H5F_IS_TMP_ADDR(f, addr); /* Begin by preping the direct block to be written to disk. Do - * this by writing the correct magic number, the dblock version, - * the address of the header, the offset of the block in the heap, + * this by writing the correct magic number, the dblock version, + * the address of the header, the offset of the block in the heap, * and the checksum at the beginning of the block. */ @@ -2172,7 +2172,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, UINT32ENCODE(image, metadata_chksum); } /* end if */ - /* at this point, dblock->blk should point to an uncompressed image of + /* at this point, dblock->blk should point to an uncompressed image of * the direct block. If I/O filters are not enabled, this image should * be ready to hand off to the metadata cache. */ @@ -2211,10 +2211,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Use the compressed number of bytes as the size to write */ write_size = nbytes; - /* If the size and/or location of the on disk image of the + /* If the size and/or location of the on disk image of the * direct block changes, we must touch up its parent to reflect * these changes. Do this differently depending on whether the - * direct block's parent is an indirect block or (rarely) the + * direct block's parent is an indirect block or (rarely) the * fractal heap header. In this case, the direct block is known * as a root direct block. */ @@ -2233,7 +2233,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, hdr_changed = TRUE; } /* end if */ - /* verify that the cache's last record of the compressed + /* verify that the cache's last record of the compressed * size matches the heap's last record. This value will * likely change shortly. */ @@ -2241,10 +2241,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Check if we need to re-size the block on disk */ if(hdr->pline_root_direct_size != write_size || at_tmp_addr) { - /* Check if the direct block is NOT currently allocated - * in temp. file space + /* Check if the direct block is NOT currently allocated + * in temp. file space * - * (temp. file space does not need to be freed) + * (temp. file space does not need to be freed) */ if(!at_tmp_addr) /* Release direct block's current disk space */ @@ -2255,8 +2255,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") - /* Update information about compressed direct block's - * location & size + /* Update information about compressed direct block's + * location & size */ HDassert(hdr->man_dtable.table_addr == addr); HDassert(hdr->pline_root_direct_size == len); @@ -2285,7 +2285,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, par_changed = TRUE; } /* end if */ - /* verify that the cache's last record of the compressed + /* verify that the cache's last record of the compressed * size matches the heap's last record. This value will * likely change shortly. */ @@ -2293,10 +2293,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Check if we need to re-size the block on disk */ if(par_iblock->filt_ents[par_entry].size != write_size || at_tmp_addr) { - /* Check if the direct block is NOT currently allocated - * in temp. file space + /* Check if the direct block is NOT currently allocated + * in temp. file space * - * (temp. file space does not need to be freed) + * (temp. file space does not need to be freed) */ if(!at_tmp_addr) /* Release direct block's current disk space */ @@ -2307,8 +2307,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") - /* Update information about compressed direct block's - * location & size + /* Update information about compressed direct block's + * location & size */ HDassert(par_iblock->ents[par_entry].addr == addr); HDassert(par_iblock->filt_ents[par_entry].size == len); @@ -2326,21 +2326,21 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, } /* end else */ } /* end if */ else { - /* I/O filters are not enabled -- thus all we need to do is check to - * see if the direct block is in temporary (AKA imaginary) file + /* I/O filters are not enabled -- thus all we need to do is check to + * see if the direct block is in temporary (AKA imaginary) file * space, and move it to real file space if it is. * - * As in the I/O filters case above, we will have to touch up the + * As in the I/O filters case above, we will have to touch up the * direct blocks parent if the direct block is relocated. * - * Recall that temporary file space need not be freed, which + * Recall that temporary file space need not be freed, which * simplifies matters slightly. */ write_buf = dblock->blk; write_size = dblock->size; - /* Check to see if we must re-allocate direct block from 'temp.' - * to 'normal' file space + /* Check to see if we must re-allocate direct block from 'temp.' + * to 'normal' file space */ if(at_tmp_addr) { /* Allocate 'normal' space for the direct block */ @@ -2377,9 +2377,9 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, } /* end if */ } /* end else */ - /* At this point, write_buf points to a buffer containing the image + /* At this point, write_buf points to a buffer containing the image * of the direct block that is ready to copy into the image buffer, - * and write_size contains the length of this buffer. + * and write_size contains the length of this buffer. * * Also, if image size or address has changed, the direct block's * parent has been modified to reflect the change. @@ -2419,14 +2419,14 @@ done: /*------------------------------------------------------------------------- * Function: H5HF__cache_dblock_serialize * - * Purpose: In principle, this function is supposed to construct the on - * disk image of the direct block, and place that image in the + * Purpose: In principle, this function is supposed to construct the on + * disk image of the direct block, and place that image in the * image buffer provided by the metadata cache. * - * However, since there are cases in which the pre_serialize - * function has to construct the on disk image to determine its size + * However, since there are cases in which the pre_serialize + * function has to construct the on disk image to determine its size * and address, this function simply copies the image prepared by - * the pre-serialize function into the supplied image buffer, and + * the pre-serialize function into the supplied image buffer, and * discards a buffer if necessary. * * Return: Success: SUCCEED @@ -2437,8 +2437,8 @@ done: * *------------------------------------------------------------------------- */ -static herr_t -H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, +static herr_t +H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Direct block info */ @@ -2462,8 +2462,8 @@ H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, /* Copy the image from *(dblock->write_buf) to *image */ H5MM_memcpy(image, dblock->write_buf, dblock->write_size); - /* Free *(dblock->write_buf) if it was allocated by the - * pre-serialize function + /* Free *(dblock->write_buf) if it was allocated by the + * pre-serialize function */ if(dblock->write_buf != dblock->blk) H5MM_xfree(dblock->write_buf); @@ -2490,7 +2490,7 @@ H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) { H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Fractal heap direct block */ @@ -2560,7 +2560,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_free_icr(void *_thing) { H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Fractal heap direct block */ @@ -2597,7 +2597,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) { const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; /* Fractal heap direct block */ @@ -2621,9 +2621,9 @@ H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) /*------------------------------------------------------------------------ * Function: H5HF__cache_verify_hdr_descendants_clean * - * Purpose: Sanity checking routine that verifies that all indirect - * and direct blocks that are descendants of the supplied - * instance of H5HF_hdr_t are clean. Set *clean to + * Purpose: Sanity checking routine that verifies that all indirect + * and direct blocks that are descendants of the supplied + * instance of H5HF_hdr_t are clean. Set *clean to * TRUE if this is the case, and to FALSE otherwise. * * Update -- 8/24/15 @@ -2636,41 +2636,41 @@ H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) * remain dirty. * * To address this, updated the sanity checks in this function - * to treat entries whose images are up to date as clean if + * to treat entries whose images are up to date as clean if * a cache serialization is in progress. * * Update -- 9/29/16 * * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be + * Prior to this change, a flush dependency parent could be * flushed if and only if all its flush dependency descendants - * were clean. In the new definition, a flush dependency + * were clean. In the new definition, a flush dependency * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * descendants. + * children are clean, regardless of any other dirty + * descendants. * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. * - * This means that the fractal heap is no longer ncessarily + * This means that the fractal heap is no longer ncessarily * flushed from the bottom up. * - * For example, it is now possible for a dirty fractal heap + * For example, it is now possible for a dirty fractal heap * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no + * there in an interviening iblock, and the header has no * dirty immediate flush dependency children. * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock * that points to it, and of the fractal heap header. * * As a result of these changes, the functionality of these * sanity checking routines has been modified significantly. * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, * they also walk the data structure, and verify it. * * @@ -2709,16 +2709,16 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* We have three basic scenarios we have to deal with: * - * The first, and most common case, is that there is a root iblock. - * In this case we need to verify that the root iblock and all its + * The first, and most common case, is that there is a root iblock. + * In this case we need to verify that the root iblock and all its * children are clean. * - * The second, and much less common case, is that in which the - * the fractal heap contains only one direct block, which is - * pointed to by hdr->man_dtable.table_addr. In this case, all we + * The second, and much less common case, is that in which the + * the fractal heap contains only one direct block, which is + * pointed to by hdr->man_dtable.table_addr. In this case, all we * need to do is verify that the root direct block is clean. * - * Finally, it is possible that the fractal heap is empty, and + * Finally, it is possible that the fractal heap is empty, and * has neither a root indirect block nor a root direct block. * In this case, we have nothing to do. */ @@ -2726,15 +2726,15 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* There are two ways in which we can arrive at the first scenario. * * By far the most common is when hdr->root_iblock contains a pointer - * to the root iblock -- in this case the root iblock is almost certainly + * to the root iblock -- in this case the root iblock is almost certainly * pinned, although we can't count on that. * - * However, it is also possible that there is a root iblock that - * is no longer pointed to by the header. In this case, the on + * However, it is also possible that there is a root iblock that + * is no longer pointed to by the header. In this case, the on * disk address of the iblock will be in hdr->man_dtable.table_addr * and hdr->man_dtable.curr_root_rows will contain a positive value. * - * Since the former case is far and away the most common, we don't + * Since the former case is far and away the most common, we don't * worry too much about efficiency in the second case. */ if(hdr->root_iblock || @@ -2748,7 +2748,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* make note of the on disk address of the root iblock */ if(root_iblock == NULL) /* hdr->man_dtable.table_addr must contain address of root - * iblock. Check to see if it is in cache. If it is, + * iblock. Check to see if it is in cache. If it is, * protect it and put its address in root_iblock. */ root_iblock_addr = hdr->man_dtable.table_addr; @@ -2786,18 +2786,18 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* At this point, the root iblock may be pinned, protected, * both, or neither, and we may or may not have a pointer - * to root iblock in memory. + * to root iblock in memory. * * Before we call H5HF__cache_verify_iblock_descendants_clean(), - * we must ensure that the root iblock is either pinned or - * protected or both, and that we have a pointer to it. + * we must ensure that the root iblock is either pinned or + * protected or both, and that we have a pointer to it. * Do this as follows: */ if(root_iblock == NULL) { /* we don't have ptr to root iblock */ if(0 == (root_iblock_status & H5AC_ES__IS_PROTECTED)) { /* just protect the root iblock -- this will give us - * the pointer we need to proceed, and ensure that - * it is locked into the metadata cache for the + * the pointer we need to proceed, and ensure that + * it is locked into the metadata cache for the * duration. * * Note that the udata is only used in the load callback. @@ -2808,9 +2808,9 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, * The tag specified in the API context we received * as a parameter (via API context) may not be correct. * Grab the (hopefully) correct tag from the header, - * and load it into the API context via the H5_BEGIN_TAG and + * and load it into the API context via the H5_BEGIN_TAG and * H5_END_TAG macros. Note that any error bracked by - * these macros must be reported with HGOTO_ERROR_TAG. + * these macros must be reported with HGOTO_ERROR_TAG. */ H5_BEGIN_TAG(hdr->heap_addr) @@ -2825,7 +2825,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, /* the root iblock is protected, and we have no * legitimate way of getting a pointer to it. * - * We square this circle by using the + * We square this circle by using the * H5AC_get_entry_ptr_from_addr() to get the needed * pointer. * @@ -2846,14 +2846,14 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, * be unpinned is if none of its children are in cache. * This unfortunately means that if it is protected and * not pinned, the fractal heap is in the process of loading - * or inserting one of its children. The obvious - * implication is that there is a significant chance that + * or inserting one of its children. The obvious + * implication is that there is a significant chance that * the root iblock is in an unstable state. * - * All this suggests that using - * H5AC_get_entry_ptr_from_addr() to obtain the pointer - * to the protected root iblock is questionable here. - * However, since this is test/debugging code, I expect + * All this suggests that using + * H5AC_get_entry_ptr_from_addr() to obtain the pointer + * to the protected root iblock is questionable here. + * However, since this is test/debugging code, I expect * that we will use this approach until it causes problems, * or we think of a better way. */ @@ -2863,8 +2863,8 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, } /* end else */ } /* end if */ else { /* root_iblock != NULL */ - /* we have the pointer to the root iblock. Protect it - * if it is neither pinned nor protected -- otherwise we + /* we have the pointer to the root iblock. Protect it + * if it is neither pinned nor protected -- otherwise we * are ready to go. */ H5HF_indirect_t * iblock = NULL; @@ -2882,9 +2882,9 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, * The tag associated specified in the API context we received * as a parameter (via API context) may not be correct. * Grab the (hopefully) correct tag from the header, - * and load it into the API context via the H5_BEGIN_TAG and + * and load it into the API context via the H5_BEGIN_TAG and * H5_END_TAG macros. Note that any error bracked by - * these macros must be reported with HGOTO_ERROR_TAG. + * these macros must be reported with HGOTO_ERROR_TAG. */ H5_BEGIN_TAG(hdr->heap_addr) @@ -2953,8 +2953,8 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock in cache and is a flush dep parent.") *clean = !((root_dblock_status & H5AC_ES__IS_DIRTY) && - (((root_dblock_status & - H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || + (((root_dblock_status & + H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || (!H5AC_get_serialization_in_progress(f)))); *fd_clean = *clean; @@ -2965,8 +2965,8 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, } /* end else */ } /* end else-if */ else { - /* this is scenario 3 -- the fractal heap is empty, and we - * have nothing to do. + /* this is scenario 3 -- the fractal heap is empty, and we + * have nothing to do. */ *fd_clean = TRUE; *clean = TRUE; @@ -2981,62 +2981,62 @@ done: /*------------------------------------------------------------------------ * Function: H5HF__cache_verify_iblock_descendants_clean * - * Purpose: Sanity checking routine that verifies that all indirect - * and direct blocks that are descendants of the supplied - * instance of H5HF_indirect_t are clean. Set *clean + * Purpose: Sanity checking routine that verifies that all indirect + * and direct blocks that are descendants of the supplied + * instance of H5HF_indirect_t are clean. Set *clean * to TRUE if this is the case, and to FALSE otherwise. * - * In passing, the function also does a cursory check to - * spot any obvious errors in the flush dependency setup. - * If any problems are found, the function returns failure. - * Note that these checks are not exhaustive, thus passing - * them does not mean that the flush dependencies are + * In passing, the function also does a cursory check to + * spot any obvious errors in the flush dependency setup. + * If any problems are found, the function returns failure. + * Note that these checks are not exhaustive, thus passing + * them does not mean that the flush dependencies are * correct -- only that there is nothing obviously wrong * with them. * - * WARNING: At its top level call, this function is - * intended to be called from H5HF_cache_iblock_flush(), - * and thus presumes that the supplied indirect block - * is in cache. Any other use of this function and - * its descendants must insure that this assumption is + * WARNING: At its top level call, this function is + * intended to be called from H5HF_cache_iblock_flush(), + * and thus presumes that the supplied indirect block + * is in cache. Any other use of this function and + * its descendants must insure that this assumption is * met. * - * Note that this function and - * H5HF__cache_verify_descendant_iblocks_clean() are + * Note that this function and + * H5HF__cache_verify_descendant_iblocks_clean() are * recursive co-routines. * * Update -- 9/29/16 * * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be + * Prior to this change, a flush dependency parent could be * flushed if and only if all its flush dependency descendants - * were clean. In the new definition, a flush dependency + * were clean. In the new definition, a flush dependency * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * descendants. + * children are clean, regardless of any other dirty + * descendants. * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. * - * This means that the fractal heap is no longer ncessarily + * This means that the fractal heap is no longer ncessarily * flushed from the bottom up. * - * For example, it is now possible for a dirty fractal heap + * For example, it is now possible for a dirty fractal heap * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no + * there in an interviening iblock, and the header has no * dirty immediate flush dependency children. * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock * that points to it, and of the fractal heap header. * * As a result of these changes, the functionality of these * sanity checking routines has been modified significantly. * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, * they also walk the data structure, and verify it. * * Return: Non-negative on success/Negative on failure @@ -3096,17 +3096,17 @@ done: * direct blocks pointed to by the supplied indirect block * are either clean, or not in the cache. * - * In passing, the function also does a cursory check to - * spot any obvious errors in the flush dependency setup. - * If any problems are found, the function returns failure. - * Note that these checks are not exhaustive, thus passing - * them does not mean that the flush dependencies are + * In passing, the function also does a cursory check to + * spot any obvious errors in the flush dependency setup. + * If any problems are found, the function returns failure. + * Note that these checks are not exhaustive, thus passing + * them does not mean that the flush dependencies are * correct -- only that there is nothing obviously wrong * with them. * - * WARNING: This function presumes that the supplied - * iblock is in the cache, and will not be removed - * during the call. Caller must ensure that this is + * WARNING: This function presumes that the supplied + * iblock is in the cache, and will not be removed + * during the call. Caller must ensure that this is * the case before the call. * * Update -- 8/24/15 @@ -3125,35 +3125,35 @@ done: * Update -- 9/29/16 * * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be + * Prior to this change, a flush dependency parent could be * flushed if and only if all its flush dependency descendants - * were clean. In the new definition, a flush dependency + * were clean. In the new definition, a flush dependency * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * descendants. + * children are clean, regardless of any other dirty + * descendants. * - * Further, metadata cache entries are now allowed to have - * multiple flush dependency parents. + * Further, metadata cache entries are now allowed to have + * multiple flush dependency parents. * - * This means that the fractal heap is no longer ncessarily + * This means that the fractal heap is no longer ncessarily * flushed from the bottom up. * - * For example, it is now possible for a dirty fractal heap + * For example, it is now possible for a dirty fractal heap * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no + * there in an interviening iblock, and the header has no * dirty immediate flush dependency children. * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock * that points to it, and of the fractal heap header. * * As a result of these changes, the functionality of these * sanity checking routines has been modified significantly. * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, * they also walk the data structure, and verify it. * * Return: Non-negative on success/Negative on failure @@ -3165,8 +3165,8 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, - H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, +H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, + H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_dblocks) { unsigned num_direct_rows; @@ -3224,16 +3224,16 @@ H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, (((dblock_status & H5AC_ES__IMAGE_IS_UP_TO_DATE) == 0) || (!H5AC_get_serialization_in_progress(f)))) { *clean = FALSE; - + if(H5AC_flush_dependency_exists(f, fd_parent_addr, dblock_addr, &fd_exists) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - if(fd_exists) + if(fd_exists) *fd_clean = FALSE; } /* end if */ - /* If a child dblock is in cache, it must have a flush - * dependency relationship with this iblock. Test this + /* If a child dblock is in cache, it must have a flush + * dependency relationship with this iblock. Test this * here. */ if(H5AC_flush_dependency_exists(f, iblock_addr, dblock_addr, &fd_exists) < 0) @@ -3246,7 +3246,7 @@ H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, i++; } /* end while */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5HF__cache_verify_iblocks_dblocks_clean() */ @@ -3260,17 +3260,17 @@ done: * direct blocks pointed to by the supplied indirect block * are either clean, or not in the cache. * - * In passing, the function also does a cursory check to - * spot any obvious errors in the flush dependency setup. - * If any problems are found, the function returns failure. - * Note that these checks are not exhaustive, thus passing - * them does not mean that the flush dependencies are + * In passing, the function also does a cursory check to + * spot any obvious errors in the flush dependency setup. + * If any problems are found, the function returns failure. + * Note that these checks are not exhaustive, thus passing + * them does not mean that the flush dependencies are * correct -- only that there is nothing obviously wrong * with them. * - * WARNING: This function presumes that the supplied - * iblock is in the cache, and will not be removed - * during the call. Caller must ensure that this is + * WARNING: This function presumes that the supplied + * iblock is in the cache, and will not be removed + * during the call. Caller must ensure that this is * the case before the call. * * Update -- 8/24/15 @@ -3289,35 +3289,35 @@ done: * Update -- 9/29/16 * * The implementation of flush dependencies has been changed. - * Prior to this change, a flush dependency parent could be + * Prior to this change, a flush dependency parent could be * flushed if and only if all its flush dependency descendants - * were clean. In the new definition, a flush dependency + * were clean. In the new definition, a flush dependency * parent can be flushed if all its immediate flush dependency - * children are clean, regardless of any other dirty - * descendants. + * children are clean, regardless of any other dirty + * descendants. * - * Further, metadata cache entries are now allowed to have + * Further, metadata cache entries are now allowed to have * multiple flush dependency parents. * - * This means that the fractal heap is no longer ncessarily + * This means that the fractal heap is no longer ncessarily * flushed from the bottom up. * - * For example, it is now possible for a dirty fractal heap + * For example, it is now possible for a dirty fractal heap * header to be flushed before a dirty dblock, as long as the - * there in an interviening iblock, and the header has no + * there in an interviening iblock, and the header has no * dirty immediate flush dependency children. * - * Also, I gather that under some circumstances, a dblock - * will be direct a flush dependency child both of the iblock + * Also, I gather that under some circumstances, a dblock + * will be direct a flush dependency child both of the iblock * that points to it, and of the fractal heap header. * * As a result of these changes, the functionality of these * sanity checking routines has been modified significantly. * Instead of scanning the fractal heap from a starting point - * down, and verifying that there were no dirty entries, the - * functions now scan downward from the starting point and - * verify that there are no dirty flush dependency children - * of the specified flush dependency parent. In passing, + * down, and verifying that there were no dirty entries, the + * functions now scan downward from the starting point and + * verify that there are no dirty flush dependency children + * of the specified flush dependency parent. In passing, * they also walk the data structure, and verify it. * * @@ -3388,54 +3388,54 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, *fd_clean = FALSE; } /* end if */ - /* if the child iblock is in cache and *fd_clean is TRUE, + /* if the child iblock is in cache and *fd_clean is TRUE, * we must continue to explore down the fractal heap tree - * structure to verify that all descendant blocks that are - * flush dependency children of the entry at parent_addr are - * either clean, or not in the metadata cache. We do this - * with a recursive call to + * structure to verify that all descendant blocks that are + * flush dependency children of the entry at parent_addr are + * either clean, or not in the metadata cache. We do this + * with a recursive call to * H5HF__cache_verify_iblock_descendants_clean(). * However, we can't make this call unless the child iblock - * is somehow locked into the cache -- typically via either + * is somehow locked into the cache -- typically via either * pinning or protecting. * * If the child iblock is pinned, we can look up its pointer - * on the current iblock's pinned child iblock list, and + * on the current iblock's pinned child iblock list, and * and use that pointer in the recursive call. * * If the entry is unprotected and unpinned, we simply * protect it. * - * If, however, the the child iblock is already protected, - * but not pinned, we have a bit of a problem, as we have + * If, however, the the child iblock is already protected, + * but not pinned, we have a bit of a problem, as we have * no legitimate way of looking up its pointer in memory. * * To solve this problem, I have added a new metadata cache - * call to obtain the pointer. + * call to obtain the pointer. * - * WARNING: This call should be used only in debugging - * routines, and it should be avoided there when - * possible. + * WARNING: This call should be used only in debugging + * routines, and it should be avoided there when + * possible. * - * Further, if we ever multi-thread the cache, - * this routine will have to be either discarded + * Further, if we ever multi-thread the cache, + * this routine will have to be either discarded * or heavily re-worked. * - * Finally, keep in mind that the entry whose - * pointer is obtained in this fashion may not - * be in a stable state. + * Finally, keep in mind that the entry whose + * pointer is obtained in this fashion may not + * be in a stable state. * - * Assuming that the flush dependency code is working - * as it should, the only reason for the child entry to + * Assuming that the flush dependency code is working + * as it should, the only reason for the child entry to * be unpinned is if none of its children are in cache. - * This unfortunately means that if it is protected and + * This unfortunately means that if it is protected and * not pinned, the fractal heap is in the process of loading * or inserting one of its children. The obvious implication - * is that there is a significant chance that the child + * is that there is a significant chance that the child * iblock is in an unstable state. * - * All this suggests that using the new call to obtain the - * pointer to the protected child iblock is questionable + * All this suggests that using the new call to obtain the + * pointer to the protected child iblock is questionable * here. However, since this is test/debugging code, I * expect that we will use this approach until it causes * problems, or we think of a better way. @@ -3491,8 +3491,8 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, child_iblock = iblock->child_iblocks[i - first_iblock_index]; } /* end else */ - /* At this point, one way or another we should have - * a pointer to the child iblock. Verify that we + /* At this point, one way or another we should have + * a pointer to the child iblock. Verify that we * that we have the correct one. */ HDassert(child_iblock); @@ -3504,8 +3504,8 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, if(H5HF__cache_verify_iblock_descendants_clean(f, fd_parent_addr, child_iblock, &child_iblock_status, fd_clean, clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify child iblock clean.") - /* if iblock_addr != fd_parent_addr, verify that a flush - * dependency relationship exists between iblock and + /* if iblock_addr != fd_parent_addr, verify that a flush + * dependency relationship exists between iblock and * the child iblock. */ if(fd_parent_addr != iblock_addr) { diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 20a62b7..07eb9cd 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -1805,7 +1805,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, /* Sanity check - first lookup must be an indirect block */ HDassert(row >= hdr->man_dtable.max_direct_rows); - /* Traverse down, until a direct block at the offset is found, then + /* Traverse down, until a direct block at the offset is found, then * use previous (i.e. parent's) offset, row, and column. */ prev_par_block_off = par_block_off = 0; diff --git a/src/H5HFman.c b/src/H5HFman.c index e5b5cb8..ea00546 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -238,7 +238,7 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) HDassert(hdr); HDassert(id); HDassert(obj_len_p); - + /* Skip over the flag byte */ id++; @@ -276,7 +276,7 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off HDassert(hdr); HDassert(id); HDassert(obj_off_p); - + /* Skip over the flag byte */ id++; @@ -307,8 +307,8 @@ H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, { H5HF_direct_t *dblock = NULL; /* Pointer to direct block to query */ unsigned dblock_access_flags; /* Access method for direct block */ - /* must equal either - * H5AC__NO_FLAGS_SET or + /* must equal either + * H5AC__NO_FLAGS_SET or * H5AC__READ_ONLY_FLAG */ haddr_t dblock_addr; /* Direct block address */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index b38a897..83e46fc 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -646,9 +646,9 @@ H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF__iblock_decr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size); H5_DLL herr_t H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node); @@ -779,13 +779,13 @@ H5_DLL herr_t H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, H5_DLL htri_t H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node); H5_DLL herr_t H5HF__space_revert_root(const H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF__space_create_root(const H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock); H5_DLL herr_t H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size); H5_DLL herr_t H5HF__space_remove(H5HF_hdr_t *hdr, H5HF_free_section_t *node); H5_DLL herr_t H5HF__space_close(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__space_delete(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class); /* Free space section routines */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index c11bc34..a0f984b 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -156,7 +156,7 @@ static hbool_t H5HF_sect_indirect_is_first(H5HF_free_section_t *sect); static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect); static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect); static H5HF_free_section_t * H5HF_sect_indirect_top(H5HF_free_section_t *sect); -static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, +static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect1, H5HF_free_section_t *sect2); static herr_t H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 0c27180..113124c 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -264,11 +264,11 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, HDassert(hdr); HDassert(id); HDassert(op); - + /* Get the object's encoded length */ /* H5HF_tiny_obj_len can't fail */ ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size); - + /* Advance past flag byte(s) */ if(!hdr->tiny_len_extended) id++; diff --git a/src/H5HG.c b/src/H5HG.c index 2d05a2c..f9d780c 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -785,14 +785,14 @@ H5HG_remove (H5F_t *f, H5HG_t *hobj) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); - + /* When the application selects the same location to rewrite the VL element by using H5Sselect_elements, * it can happen that the entry has been removed by first rewrite. Here we simply skip the removal of * the entry and let the second rewrite happen (see HDFFV-10635). In the future, it'd be nice to handle * this situation in H5T_conv_vlen in H5Tconv.c instead of this level (HDFFV-10648). */ if(heap->obj[hobj->idx].nrefs == 0 && heap->obj[hobj->idx].size == 0 && !heap->obj[hobj->idx].begin) HGOTO_DONE(ret_value) - + obj_start = heap->obj[hobj->idx].begin; /* Include object header size */ need = H5HG_ALIGN(heap->obj[hobj->idx].size) + H5HG_SIZEOF_OBJHDR(f); diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 18625cc..7485aad 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -64,10 +64,10 @@ static herr_t H5HG__cache_heap_get_initial_load_size(void *udata, size_t *image_ static herr_t H5HG__cache_heap_get_final_load_size(const void *_image, size_t image_len, void *udata, size_t *actual_len); static void *H5HG__cache_heap_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HG__cache_heap_image_len(const void *thing, size_t *image_len); static herr_t H5HG__cache_heap_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HG__cache_heap_free_icr(void *thing); /* Prefix deserialization */ @@ -158,10 +158,10 @@ done: /*------------------------------------------------------------------------- * Function: H5HG__cache_heap_get_initial_load_size() * - * Purpose: Return the initial speculative read size to the metadata - * cache. This size will be used in the initial attempt to read - * the global heap. If this read is too small, the cache will - * try again with the correct value obtained from + * Purpose: Return the initial speculative read size to the metadata + * cache. This size will be used in the initial attempt to read + * the global heap. If this read is too small, the cache will + * try again with the correct value obtained from * H5HG__cache_get_final_load_size(). * * Return: Success: SUCCEED @@ -232,7 +232,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HG__cache_heap_deserialize * - * Purpose: Given a buffer containing the on disk image of the global + * Purpose: Given a buffer containing the on disk image of the global * heap, deserialize it, load its contents into a newly allocated * instance of H5HG_heap_t, and return a pointer to the new instance. * @@ -334,11 +334,11 @@ H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, heap->obj[idx].begin = begin; /* - * The total storage size includes the size of the object - * header and is zero padded so the next object header is - * properly aligned. The entire obj array was calloc'ed, - * so no need to zero the space here. The last bit of space - * is the free space object whose size is never padded and + * The total storage size includes the size of the object + * header and is zero padded so the next object header is + * properly aligned. The entire obj array was calloc'ed, + * so no need to zero the space here. The last bit of space + * is the free space object whose size is never padded and * already includes the object header. */ if(idx > 0) { @@ -384,7 +384,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HG__cache_heap_image_len * - * Purpose: Return the on disk image size of the global heap to the + * Purpose: Return the on disk image size of the global heap to the * metadata cache via the image_len. * * Return: Success: SUCCEED @@ -418,7 +418,7 @@ H5HG__cache_heap_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5HG__cache_heap_serialize * - * Purpose: Given an appropriately sized buffer and an instance of + * Purpose: Given an appropriately sized buffer and an instance of * H5HG_heap_t, serialize the global heap for writing to file, * and copy the serialized version into the buffer. * diff --git a/src/H5HLcache.c b/src/H5HLcache.c index b0ac05f..cff3942 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -77,16 +77,16 @@ static void *H5HL__cache_prefix_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5HL__cache_prefix_image_len(const void *thing, size_t *image_len); static herr_t H5HL__cache_prefix_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HL__cache_prefix_free_icr(void *thing); /* Local heap data block */ static herr_t H5HL__cache_datablock_get_initial_load_size(void *udata, size_t *image_len); static void *H5HL__cache_datablock_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5HL__cache_datablock_image_len(const void *thing, size_t *image_len); static herr_t H5HL__cache_datablock_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing); static herr_t H5HL__cache_datablock_free_icr(void *thing); @@ -176,12 +176,12 @@ H5HL__hdr_deserialize( H5HL_t *heap, const uint8_t *image, HDassert(udata); /* Check magic number */ - if(HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if(HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad local heap signature") image += H5_SIZEOF_MAGIC; /* Version */ - if(H5HL_VERSION != *image++) + if(H5HL_VERSION != *image++) HGOTO_ERROR(H5E_HEAP, H5E_VERSION, FAIL, "wrong version number in local heap") /* Reserved */ @@ -323,7 +323,7 @@ H5HL__fl_serialize(const H5HL_t *heap) /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_get_initial_load_size() * - * Purpose: Return the initial size of the buffer the metadata cache should + * Purpose: Return the initial size of the buffer the metadata cache should * load from file and pass to the deserialize routine. * * Return: Success: SUCCEED @@ -352,7 +352,7 @@ H5HL__cache_prefix_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *im /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_get_final_load_size() * - * Purpose: Return the final size of the buffer the metadata cache should + * Purpose: Return the final size of the buffer the metadata cache should * load from file and pass to the deserialize routine. * * Return: Success: SUCCEED @@ -402,7 +402,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_deserialize * - * Purpose: Given a buffer containing the on disk image of the local + * Purpose: Given a buffer containing the on disk image of the local * heap prefix, deserialize it, load its contents into a newly allocated * instance of H5HL_prfx_t, and return a pointer to the new instance. * @@ -415,7 +415,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, +H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5HL_t *heap = NULL; /* Local heap */ @@ -472,8 +472,8 @@ H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") } /* end if */ else - /* Note that the heap should _NOT_ be a single - * object in the cache + /* Note that the heap should _NOT_ be a single + * object in the cache */ heap->single_cache_obj = FALSE; } /* end if */ @@ -501,7 +501,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_image_len * - * Purpose: Return the on disk image size of a local heap prefix to the + * Purpose: Return the on disk image size of a local heap prefix to the * metadata cache via the image_len. * * Return: Success: SUCCEED @@ -528,8 +528,8 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len) /* Set the prefix's size */ *image_len = prfx->heap->prfx_size; - /* If the heap is stored as a single object, add in the - * data block size also + /* If the heap is stored as a single object, add in the + * data block size also */ if(prfx->heap->single_cache_obj) *image_len += prfx->heap->dblk_size; @@ -541,9 +541,9 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_serialize * - * Purpose: Given a pointer to an instance of H5HL_prfx_t and an - * appropriately sized buffer, serialize the contents of the - * instance for writing to disk, and copy the serialized data + * Purpose: Given a pointer to an instance of H5HL_prfx_t and an + * appropriately sized buffer, serialize the contents of the + * instance for writing to disk, and copy the serialized data * into the buffer. * * Return: Success: SUCCEED @@ -603,9 +603,9 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, if((size_t)(image - (uint8_t *)_image) < heap->prfx_size) { size_t gap; /* Size of gap between prefix and data block */ - /* Set image to the start of the data block. This is necessary - * because there may be a gap between the used portion of - * the prefix and the data block due to alignment constraints. + /* Set image to the start of the data block. This is necessary + * because there may be a gap between the used portion of + * the prefix and the data block due to alignment constraints. */ gap = heap->prfx_size - (size_t)(image - (uint8_t *)_image); HDmemset(image, 0, gap); @@ -636,11 +636,11 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, /*------------------------------------------------------------------------- * Function: H5HL__cache_prefix_free_icr * - * Purpose: Free the supplied in core representation of a local heap + * Purpose: Free the supplied in core representation of a local heap * prefix. * - * Note that this function handles the partially initialize prefix - * from a failed speculative load attempt. See comments below for + * Note that this function handles the partially initialize prefix + * from a failed speculative load attempt. See comments below for * details. * * Note: The metadata cache sets the object's cache_info.magic to @@ -681,7 +681,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HL__cache_datablock_get_initial_load_size() * - * Purpose: Tell the metadata cache how large a buffer to read from + * Purpose: Tell the metadata cache how large a buffer to read from * file when loading a datablock. In this case, we simply lookup * the correct value in the user data, and return it in *image_len. * @@ -715,7 +715,7 @@ H5HL__cache_datablock_get_initial_load_size(void *_udata, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5HL__cache_datablock_deserialize * - * Purpose: Given a buffer containing the on disk image of a local + * Purpose: Given a buffer containing the on disk image of a local * heap data block, deserialize it, load its contents into a newly allocated * instance of H5HL_dblk_t, and return a pointer to the new instance. * @@ -826,7 +826,7 @@ H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, +H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HL_t *heap; /* Pointer to the local heap */ @@ -872,7 +872,7 @@ H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *imag * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing) { H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index 762a213..c3fcffe 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -242,7 +242,7 @@ H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size)) /* Insert data block into cache (pinned) */ if(FAIL == H5AC_insert_entry(f, H5AC_LHEAP_DBLK, new_addr, dblk, H5AC__PIN_ENTRY_FLAG)) H5E_THROW(H5E_CANTINIT, "unable to cache local heap data block"); - + dblk = NULL; /* Reset 'single cache object' flag */ diff --git a/src/H5HLint.c b/src/H5HLint.c index e625f3d..cc3e3ea 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -213,7 +213,7 @@ CATCH if(NULL != (fl = H5FL_FREE(H5HL_free_t, fl))) H5E_THROW(H5E_CANTFREE, "unable to free local heap free list"); } /* end while */ - + if(NULL != (heap = H5FL_FREE(H5HL_t, heap))) H5E_THROW(H5E_CANTFREE, "unable to free local heap"); diff --git a/src/H5I.c b/src/H5I.c index b233d23..2ef3601 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -820,7 +820,7 @@ done: * * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it. * This routine will check to ensure the supplied ID is not already - * in use, and ensure that it is a valid ID for the given type, + * in use, and ensure that it is a valid ID for the given type, * but will NOT check to ensure the OBJECT is not already * registered (thus, it is possible to register one object under * multiple IDs). @@ -1361,10 +1361,10 @@ H5I_dec_ref(hid_t id) * reference count without calling the free method. * * Beware: the free method may call other H5I functions. - * - * If an object is closing, we can remove the ID even though the free + * + * If an object is closing, we can remove the ID even though the free * method might fail. This can happen when a mandatory filter fails to - * write when a dataset is closed and the chunk cache is flushed to the + * write when a dataset is closed and the chunk cache is flushed to the * file. We have to close the dataset anyway. (SLU - 2010/9/7) */ if(1 == id_ptr->count) { @@ -1468,9 +1468,9 @@ H5I_dec_app_ref_always_close(hid_t id) /* Check for failure */ if (ret_value < 0) { /* - * If an object is closing, we can remove the ID even though the free + * If an object is closing, we can remove the ID even though the free * method might fail. This can happen when a mandatory filter fails to - * write when a dataset is closed and the chunk cache is flushed to the + * write when a dataset is closed and the chunk cache is flushed to the * file. We have to close the dataset anyway. (SLU - 2010/9/7) */ H5I_remove(id); @@ -1949,7 +1949,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) udata.app_key = key; udata.ret_obj = NULL; - /* Note that H5I_iterate returns an error code. We ignore it + /* Note that H5I_iterate returns an error code. We ignore it * here, as we can't do anything with it without revising the API. */ (void)H5I_iterate(type, H5I__search_cb, &udata, TRUE); @@ -2100,22 +2100,22 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) /*------------------------------------------------------------------------- * Function: H5I_iterate * - * Purpose: Apply function FUNC to each member of type TYPE (with - * non-zero application reference count if app_ref is TRUE). - * Stop if FUNC returns a non zero value (i.e. anything - * other than H5_ITER_CONT). + * Purpose: Apply function FUNC to each member of type TYPE (with + * non-zero application reference count if app_ref is TRUE). + * Stop if FUNC returns a non zero value (i.e. anything + * other than H5_ITER_CONT). * - * If FUNC returns a positive value (i.e. H5_ITER_STOP), + * If FUNC returns a positive value (i.e. H5_ITER_STOP), * return SUCCEED. * - * If FUNC returns a negative value (i.e. H5_ITER_ERROR), + * If FUNC returns a negative value (i.e. H5_ITER_ERROR), * return FAIL. - * - * The FUNC should take a pointer to the object and the - * udata as arguments and return non-zero to terminate + * + * The FUNC should take a pointer to the object and the + * udata as arguments and return non-zero to terminate * siteration, and zero to continue. * - * Limitation: Currently there is no way to start the iteration from + * Limitation: Currently there is no way to start the iteration from * where a previous iteration left off. * * Return: SUCCEED/FAIL diff --git a/src/H5L.c b/src/H5L.c index 47e29c0..15f2b7d 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -304,7 +304,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") @@ -394,7 +394,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5CX_set_lcpl(lcpl_id); /* Verify access property list and set up collective metadata if appropriate */ - if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") @@ -1325,7 +1325,7 @@ H5Literate2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, loc_params.obj_type = H5I_get_type(group_id); /* Iterate over the links */ - if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (unsigned)FALSE, (int)idx_type, (int)order, idx_p, + if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (unsigned)FALSE, (int)idx_type, (int)order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") diff --git a/src/H5M.c b/src/H5M.c index 4d76574..0866bb7 100644 --- a/src/H5M.c +++ b/src/H5M.c @@ -475,7 +475,7 @@ H5Mclose(hid_t map_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a map ID") /* Decrement the counter on the map. It will be freed if the count - * reaches zero. + * reaches zero. */ if(H5I_dec_app_ref_always_close(map_id) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTDEC, FAIL, "can't decrement count on map ID") @@ -848,7 +848,7 @@ done: * restart iteration at the same location on a subsequent * call to H5Miterate, IDX should be the same value as * returned by the previous call. - * + * * H5M_iterate_t is defined as: * herr_t (*H5M_iterate_t)(hid_t map_id, const void *key, * void *ctx) diff --git a/src/H5MF.c b/src/H5MF.c index df1c88a..5c31f19 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -100,7 +100,7 @@ static herr_t H5MF__close_shrink_eoa(H5F_t *f); static herr_t H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums); static hbool_t H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type); static hbool_t H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace); -static herr_t H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, +static herr_t H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, hbool_t *continue_alloc_fsm); /* Free-space type manager routines */ @@ -1307,7 +1307,7 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r end = addr + size; /* For paged aggregation: - * To extend a small block: can only extend if not crossing page boundary + * To extend a small block: can only extend if not crossing page boundary * To extend a large block at EOA: calculate in advance mis-aligned fragment so EOA will still end at page boundary */ if(H5F_PAGED_AGGR(f)) { @@ -1658,8 +1658,8 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); /* check args */ HDassert(f); - /* If there have been no file space allocations / deallocation so - * far, must call H5MF_tidy_self_referential_fsm_hack() to float + /* If there have been no file space allocations / deallocation so + * far, must call H5MF_tidy_self_referential_fsm_hack() to float * all self referential FSMs and release file space allocated to * them. Otherwise, the function will be called after the format * conversion, and will become very confused. @@ -1797,9 +1797,9 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); */ HDassert(H5F_addr_defined(f->shared->sblock->ext_addr)); - /* file space for all non-empty free space managers should be + /* file space for all non-empty free space managers should be * allocated at this point, and these free space managers should - * be written to file and thus their headers and section info + * be written to file and thus their headers and section info * entries in the metadata cache should be clean. */ @@ -1870,8 +1870,8 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); if(HADDR_UNDEF == (final_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)) ) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") - /* f->shared->eoa_post_fsm_fsalloc is undefined if there has - * been no file space allocation or deallocation since file + /* f->shared->eoa_post_fsm_fsalloc is undefined if there has + * been no file space allocation or deallocation since file * open. */ HDassert(H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc); @@ -2031,13 +2031,13 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); * been no file space allocation or deallocation since file * open. * - * If there is a cache image in the file at file open, - * f->shared->first_alloc_dealloc will always be FALSE unless + * If there is a cache image in the file at file open, + * f->shared->first_alloc_dealloc will always be FALSE unless * the file is opened R/O, as otherwise, the image will have been * read and discarded by this point. * - * If a cache image was created on file close, the actual EOA - * should be in f->shared->eoa_post_mdci_fsalloc. Note that in + * If a cache image was created on file close, the actual EOA + * should be in f->shared->eoa_post_mdci_fsalloc. Note that in * this case, it is conceivable that f->shared->first_alloc_dealloc * will still be TRUE, as the cache image is allocated directly from * the file driver layer. However, as this possibility seems remote, @@ -2049,8 +2049,8 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); (final_eoa == f->shared->eoa_post_mdci_fsalloc))); } /* end if */ else { - /* Iterate over all the free space types that have managers - * and get each free list's space + /* Iterate over all the free space types that have managers + * and get each free list's space */ for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; ptype++) if(H5MF__close_delete_fstype(f, ptype) < 0) @@ -2365,16 +2365,16 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t HDassert(f->shared); HDassert(f->shared->lf); - /* H5MF_tidy_self_referential_fsm_hack() will fail if any self + /* H5MF_tidy_self_referential_fsm_hack() will fail if any self * referential FSM is opened prior to the call to it. Thus call * it here if necessary and if it hasn't been called already. * * The situation is further complicated if a cache image exists * and had not yet been loaded into the metadata cache. In this - * case, call H5AC_force_cache_image_load() instead of + * case, call H5AC_force_cache_image_load() instead of * H5MF_tidy_self_referential_fsm_hack(). H5AC_force_cache_image_load() - * will load the cache image, and then call - * H5MF_tidy_self_referential_fsm_hack() to discard the cache image + * will load the cache image, and then call + * H5MF_tidy_self_referential_fsm_hack() to discard the cache image * block. */ @@ -2529,50 +2529,50 @@ done: /*------------------------------------------------------------------------- * Function: H5MF_settle_raw_data_fsm() * - * Purpose: Handle any tasks required before the metadata cache + * Purpose: Handle any tasks required before the metadata cache * can serialize or flush the raw data free space manager - * and any metadata free space managers that reside in the + * and any metadata free space managers that reside in the * raw data free space manager ring. * - * Specifically, this means any metadata managers that DON'T - * handle space allocation for free space manager header or - * section info will reside in the raw data free space manager + * Specifically, this means any metadata managers that DON'T + * handle space allocation for free space manager header or + * section info will reside in the raw data free space manager * ring. * - * In the absence of page allocation, there is at most one + * In the absence of page allocation, there is at most one * free space manager per memory type defined in H5F_mem_t. - * Of these, the one that allocates H5FD_MEM_DRAW will + * Of these, the one that allocates H5FD_MEM_DRAW will * always reside in the raw data free space manager ring. - * If there is more than one metadata free space manager, - * all that don't handle H5FD_MEM_FSPACE_HDR or - * H5FD_MEM_FSPACE_SINFO (which map to H5FD_MEM_OHDR and - * H5FD_MEM_LHEAP respectively) will reside in the raw + * If there is more than one metadata free space manager, + * all that don't handle H5FD_MEM_FSPACE_HDR or + * H5FD_MEM_FSPACE_SINFO (which map to H5FD_MEM_OHDR and + * H5FD_MEM_LHEAP respectively) will reside in the raw * data free space manager ring as well * - * With page allocation, the situation is conceptually + * With page allocation, the situation is conceptually * identical, but more complex in practice. * - * In the worst case (multi file driver) page allocation - * can result in two free space managers for each memory + * In the worst case (multi file driver) page allocation + * can result in two free space managers for each memory * type -- one for small (less than on equal to one page) * allocations, and one for large (greater than one page) * allocations. * * In the more common one file case, page allocation will - * result in a total of three free space managers -- one for - * small (<= one page) raw data allocations, one for small - * metadata allocations (i.e, all memory types other than - * H5FD_MEM_DRAW), and one for all large (> one page) + * result in a total of three free space managers -- one for + * small (<= one page) raw data allocations, one for small + * metadata allocations (i.e, all memory types other than + * H5FD_MEM_DRAW), and one for all large (> one page) * allocations. * * Despite these complications, the solution is the same in - * the page allocation case -- free space managers (be they - * small data or large) are assigned to the raw data free + * the page allocation case -- free space managers (be they + * small data or large) are assigned to the raw data free * space manager ring if they don't allocate file space for - * free space managers. Note that in the one file case, the + * free space managers. Note that in the one file case, the * large free space manager must be assigned to the metadata - * free space manager ring, as it both allocates pages for - * the metadata free space manager, and allocates space for + * free space manager ring, as it both allocates pages for + * the metadata free space manager, and allocates space for * large (> 1 page) metadata cache entries. * * At present, the task list for this routine is: @@ -2582,14 +2582,14 @@ done: * a) Free both aggregators. Space not at EOA will be * added to the appropriate free space manager. * - * The raw data aggregator should not be restarted + * The raw data aggregator should not be restarted * after this point. It is possible that the metadata * aggregator will be. * * b) Free all file space currently allocated to free * space managers. * - * c) Delete the free space manager superblock + * c) Delete the free space manager superblock * extension message if allocated. * * This done, reduce the EOA by moving it to just before @@ -2597,23 +2597,23 @@ done: * * 2) Ensure that space is allocated for the free space * manager superblock extension message. Must do this - * now, before reallocating file space for free space + * now, before reallocating file space for free space * managers, as it is possible that this allocation may * grab the last section in a FSM -- making it unnecessary * to re-allocate file space for it. * * 3) Scan all free space managers not involved in allocating * space for free space managers. For each such free space - * manager, test to see if it contains free space. If + * manager, test to see if it contains free space. If * it does, allocate file space for its header and section - * data. If it contains no free space, leave it without - * allocated file space as there is no need to save it to + * data. If it contains no free space, leave it without + * allocated file space as there is no need to save it to * file. * * Note that all free space managers in this class should - * see no further space allocations / deallocations as - * at this point, all raw data allocations should be - * finalized, as should all metadata allocations not + * see no further space allocations / deallocations as + * at this point, all raw data allocations should be + * finalized, as should all metadata allocations not * involving free space managers. * * We will allocate space for free space managers involved @@ -2648,7 +2648,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(f->shared); HDassert(fsm_settled); - /* + /* * Only need to settle things if we are persisting free space and * the private property in f->shared->null_fsm_addr is not enabled. */ @@ -2683,7 +2683,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * Note that while the raw data aggregator should not be restarted during * the close process, this need not be the case for the metadata aggregator. * - * Note also that the aggregators will not exist if page aggregation + * Note also that the aggregators will not exist if page aggregation * is enabled -- skip this if so. */ /* Vailin -- is this correct? */ @@ -2719,10 +2719,10 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * referential nature of the problem. These FSMs are dealt with in * H5MF_settle_meta_data_fsm(). * - * Since paged allocation may be enabled, there may be up to two + * Since paged allocation may be enabled, there may be up to two * free space managers per memory type -- one for small and one for * large allocation. Hence we must loop over the memory types twice - * setting the allocation size accordingly if paged allocation is + * setting the allocation size accordingly if paged allocation is * enabled. */ for(pass_count = 0; pass_count <= 1; pass_count++) { @@ -2783,7 +2783,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) /* Check if the free space manager has space in the file */ if(H5F_addr_defined(fs_stat.addr) || H5F_addr_defined(fs_stat.sect_addr)) { - /* Delete the free space manager in the file. Will + /* Delete the free space manager in the file. Will * reallocate later if the free space manager contains * any free space. */ @@ -2808,7 +2808,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) * extension messages will choke if the target message is * unexpectedly either absent or present. * - * Update: This is probably unnecessary, as I gather that the + * Update: This is probably unnecessary, as I gather that the * file space manager info message is guaranteed to exist. * Leave it in for now, but consider removing it. */ @@ -2911,9 +2911,9 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) fsm_visited[fsm_type] = TRUE; if(f->shared->fs_man[fsm_type]) { - /* Only allocate file space if the target free space manager - * doesn't allocate file space for free space managers. Note - * that this is also the deciding factor as to whether a FSM + /* Only allocate file space if the target free space manager + * doesn't allocate file space for free space managers. Note + * that this is also the deciding factor as to whether a FSM * in in the raw data FSM ring. */ if(!H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) { @@ -2995,15 +2995,15 @@ done: /*------------------------------------------------------------------------- * Function: H5MF_settle_meta_data_fsm() * - * Purpose: If the free space manager is persistent, handle any tasks - * required before the metadata cache can serialize or flush - * the metadata free space manager(s) that handle file space + * Purpose: If the free space manager is persistent, handle any tasks + * required before the metadata cache can serialize or flush + * the metadata free space manager(s) that handle file space * allocation for free space managers. * - * In most cases, there will be only one manager assigned + * In most cases, there will be only one manager assigned * to this role. However, since for reasons unknown, - * free space manager headers and section info blocks are - * different classes of memory, it is possible that two free + * free space manager headers and section info blocks are + * different classes of memory, it is possible that two free * space managers will be involved. * * On entry to this function, the raw data settle routine @@ -3020,23 +3020,23 @@ done: * 5) Re-created the free space manager superblock extension * message. * - * 6) Reallocated file space for all non-empty free space - * managers NOT involved in allocation of space for free + * 6) Reallocated file space for all non-empty free space + * managers NOT involved in allocation of space for free * space managers. * * Note that these free space managers (if not empty) should * have been written to file by this point, and that no - * further space allocations involving them should take + * further space allocations involving them should take * place during file close. * * On entry to this routine, the free space manager(s) involved * in allocation of file space for free space managers should - * still be floating. (i.e. should not have any file space + * still be floating. (i.e. should not have any file space * allocated to them.) * - * Similarly, the raw data aggregator should not have been - * restarted. Note that it is probable that reallocation of - * space in 5) and 6) above will have re-started the metadata + * Similarly, the raw data aggregator should not have been + * restarted. Note that it is probable that reallocation of + * space in 5) and 6) above will have re-started the metadata * aggregator. * * @@ -3048,35 +3048,35 @@ done: * 2) Free the aggregators. * * 3) Reduce the EOA to the extent possible, and make note - * of the resulting value. This value will be stored + * of the resulting value. This value will be stored * in the fsinfo superblock extension message and be used * in the subsequent file open. * * 4) Re-allocate space for any free space manager(s) that: * - * a) are involved in allocation of space for free space - * managers, and + * a) are involved in allocation of space for free space + * managers, and * * b) contain free space. * - * It is possible that we could allocate space for one - * of these free space manager(s) only to have the allocation - * result in the free space manager being empty and thus + * It is possible that we could allocate space for one + * of these free space manager(s) only to have the allocation + * result in the free space manager being empty and thus * obliging us to free the space again. Thus there is the * potential for an infinite loop if we want to avoid saving * empty free space managers. * - * Similarly, it is possible that we could allocate space - * for a section info block, only to discover that this - * allocation has changed the size of the section info -- + * Similarly, it is possible that we could allocate space + * for a section info block, only to discover that this + * allocation has changed the size of the section info -- * forcing us to deallocate and start the loop over again. * - * The solution is to modify the FSM code to + * The solution is to modify the FSM code to * save empty FSMs to file, and to allow section info blocks * to be oversized. That is, only allow section info to increase * in size, not shrink. The solution is now implemented. * - * 5) Make note of the EOA -- used for sanity checking on + * 5) Make note of the EOA -- used for sanity checking on * FSM shutdown. This is saved as eoa_pre_fsm_fsalloc in * the free-space info message for backward compatibility * with the 1.10 library that has the hack. @@ -3112,7 +3112,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(f->shared); HDassert(fsm_settled); - /* + /* * Only need to settle things if we are persisting free space and * the private property in f->shared->null_fsm_addr is not enabled. */ @@ -3197,8 +3197,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(fs_stat.alloc_sect_size == 0); } /* end if */ - /* Verify that lg_sinfo_fspace is floating if it - * exists and is distinct + /* Verify that lg_sinfo_fspace is floating if it + * exists and is distinct */ if((lg_sinfo_fspace) && (lg_hdr_fspace != lg_sinfo_fspace)) { /* Query free space manager info for this type */ @@ -3217,7 +3217,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) * H5MF_free_aggrs() call. Note that the raw data aggregator must * have already been freed. Sanity checks for this? * - * Note that the aggregators will not exist if paged aggregation + * Note that the aggregators will not exist if paged aggregation * is enabled -- don't attempt to free if this is the case. */ /* (for space not at EOF, it may be put into free space managers) */ @@ -3228,30 +3228,30 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") - /* WARNING: This approach settling the self referential free space - * managers and allocating space for them in the file will - * not work as currently implemented with the split and - * multi file drivers, as the self referential free space - * manager header and section info can be stored in up to - * two different files -- requiring that up to two EOA's - * be stored in the the free space managers super block - * extension message. + /* WARNING: This approach settling the self referential free space + * managers and allocating space for them in the file will + * not work as currently implemented with the split and + * multi file drivers, as the self referential free space + * manager header and section info can be stored in up to + * two different files -- requiring that up to two EOA's + * be stored in the the free space managers super block + * extension message. * - * As of this writing, we are solving this problem by - * simply not supporting persistent FSMs with the split + * As of this writing, we are solving this problem by + * simply not supporting persistent FSMs with the split * and multi file drivers. * - * Current plans are to do away with the multi file + * Current plans are to do away with the multi file * driver, so this should be a non-issue in this case. * - * We should be able to support the split file driver - * without a file format change. However, the code to + * We should be able to support the split file driver + * without a file format change. However, the code to * do so does not exist at present. * NOTE: not sure whether to remove or keep the above comments */ - /* - * Continue allocating file space for the header and section info until + /* + * Continue allocating file space for the header and section info until * they are all settled, */ do { @@ -3288,8 +3288,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) /* All free space managers should have file space allocated for them * now, and should see no further allocations / deallocations. - * For backward compatibility, store the eoa in f->shared->eoa_fsm_fsalloc - * which will be set to fsinfo.eoa_pre_fsm_fsalloc when we actually write + * For backward compatibility, store the eoa in f->shared->eoa_fsm_fsalloc + * which will be set to fsinfo.eoa_pre_fsm_fsalloc when we actually write * the free-space info message to the superblock extension. * This will allow the 1.10 library with the hack to open the file with * the new solution. @@ -3330,7 +3330,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, +H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, hbool_t *continue_alloc_fsm) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index d716ae2..0124555 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -189,11 +189,11 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); * The line in #ifdef REPLACE triggers the following problem: * test/objcopy.c: test_copy_group_deep() test fails with the family driver * - * When closing the destination file after H5Ocopy, the library flushes the fractal + * When closing the destination file after H5Ocopy, the library flushes the fractal * heap direct block via H5HF__cache_dblock_pre_serialize(). While doing so, * the cache eventually adjusts/evicts ageout entries and ends up flushing out the * same entry that is being serialized (flush_in_progress). - */ + */ if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE && (!f->shared->closing || !f->shared->fs_persist)) { #ifdef REPLACE if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE && !f->shared->closing) { @@ -405,7 +405,7 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); *------------------------------------------------------------------------- */ htri_t -H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, +H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) { htri_t ret_value = FALSE; /* Return value */ @@ -419,7 +419,7 @@ H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, /* Check if this aggregator is active */ if(f->shared->feature_flags & aggr->feature_flag) { - /* + /* * If the block being tested adjoins the beginning of the aggregator * block, check if the aggregator can accommodate the extension. */ @@ -443,7 +443,7 @@ H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, /* * If extra_requested is above percentage threshold: * 1) "bubble" up the aggregator by aggr->alloc_size or extra_requested - * 2) extend the block into the aggregator + * 2) extend the block into the aggregator */ else { hsize_t extra = (extra_requested < aggr->alloc_size) ? aggr->alloc_size : extra_requested; diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 7bb77e8..43e2305 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -115,8 +115,8 @@ H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) /* Print generic section information */ HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth, "Section type:", - (sect->sect_info.type == H5MF_FSPACE_SECT_SIMPLE ? "simple" : - (sect->sect_info.type == H5MF_FSPACE_SECT_SMALL ? "small" : + (sect->sect_info.type == H5MF_FSPACE_SECT_SIMPLE ? "simple" : + (sect->sect_info.type == H5MF_FSPACE_SECT_SMALL ? "small" : (sect->sect_info.type == H5MF_FSPACE_SECT_LARGE ? "large" : "unknown")))); HDfprintf(udata->stream, "%*s%-*s %a\n", udata->indent, "", udata->fwidth, "Section address:", diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index de1bdfb..acd773b 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -75,9 +75,9 @@ H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f); H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled); H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled); -/* This function has to be declared in H5MFprivate.h as it is needed - * in our test code to allow us to manually start a self referential - * free space manager prior to the first file space allocations / +/* This function has to be declared in H5MFprivate.h as it is needed + * in our test code to allow us to manually start a self referential + * free space manager prior to the first file space allocations / * deallocation without causing assertion failures on the first * file space allocation / deallocation. */ diff --git a/src/H5MFsection.c b/src/H5MFsection.c index f661ef9..715ece4 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -186,7 +186,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{ /* Declare a free list to manage the H5MF_free_section_t struct */ H5FL_DEFINE(H5MF_free_section_t); -/* +/* * "simple/small/large" section callbacks */ @@ -371,7 +371,7 @@ done: FUNC_LEAVE_NOAPI((H5FS_section_info_t *)ret_value) } /* end H5MF__sect_split() */ -/* +/* * "simple" section callbacks */ @@ -615,7 +615,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5MF__sect_simple_shrink() */ -/* +/* * "small" section callbacks */ @@ -625,7 +625,7 @@ done: * * Purpose: Perform actions on a small "meta" action before adding it to the free space manager: * 1) Drop the section if it is at page end and its size <= page end threshold - * 2) Adjust section size to include page end threshold if + * 2) Adjust section size to include page end threshold if * (section size + threshold) is at page end * * Return: Success: non-negative @@ -792,7 +792,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5MF__sect_small_merge() */ -/* +/* * "Large" section callbacks */ diff --git a/src/H5MM.c b/src/H5MM.c index 0add640..cceac4f 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -254,7 +254,7 @@ H5MM_final_sanity_check(void) * difficult to check as a return value. This is still * considered an error condition since allocations of zero * bytes usually indicate problems. - * + * * Return: Success: Pointer to new memory * Failure: NULL * diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 573bb7a..aeaebea 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -36,7 +36,7 @@ static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_ty void *native_src, H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); static herr_t H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx); diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index a4a746e..d498be5 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -830,7 +830,7 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk") /* Because the attribute structure is shared now. The only situation that requires - * copying the data is when the metadata cache evicts and reloads this attribute. + * copying the data is when the metadata cache evicts and reloads this attribute. * The shared attribute structure will be different in that situation. SLU-2010/7/29 */ if(((H5A_t *)mesg->native)->shared != udata->attr->shared) { /* Sanity check */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 8bad181..45c55fd 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -66,17 +66,17 @@ static herr_t H5O__cache_get_final_load_size(const void *image_ptr, size_t image void *udata, size_t *actual_len); static htri_t H5O__cache_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5O__cache_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5O__cache_image_len(const void *thing, size_t *image_len); static herr_t H5O__cache_serialize(const H5F_t *f, void *image, size_t len, - void *thing); + void *thing); static herr_t H5O__cache_notify(H5AC_notify_action_t action, void *_thing); static herr_t H5O__cache_free_icr(void *thing); static herr_t H5O__cache_chk_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5O__cache_chk_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5O__cache_chk_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5O__cache_chk_image_len(const void *thing, size_t *image_len); static herr_t H5O__cache_chk_serialize(const H5F_t *f, void *image, size_t len, void *thing); @@ -161,7 +161,7 @@ H5FL_SEQ_DEFINE(H5O_cont_t); /*------------------------------------------------------------------------- * Function: H5O__cache_get_initial_load_size() * - * Purpose: Tell the metadata cache how much data to read from file in + * Purpose: Tell the metadata cache how much data to read from file in * the first speculative read for the object header. * * Return: Success: SUCCEED @@ -288,12 +288,12 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) /*------------------------------------------------------------------------- * Function: H5O__cache_deserialize * - * Purpose: Attempt to deserialize the object header contained in the - * supplied buffer, load the data into an instance of H5O_t, and + * Purpose: Attempt to deserialize the object header contained in the + * supplied buffer, load the data into an instance of H5O_t, and * return a pointer to the new instance. * - * Note that the object header is read with with a speculative read. - * If the initial read is too small, make note of this fact and return + * Note that the object header is read with with a speculative read. + * If the initial read is too small, make note of this fact and return * without error. H5C_load_entry() will note the size discrepency * and retry the deserialize operation with the correct size read. * @@ -317,7 +317,7 @@ H5O__cache_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void /* Check arguments */ HDassert(image); - HDassert(len > 0); + HDassert(len > 0); HDassert(udata); HDassert(udata->common.f); HDassert(udata->common.cont_msg_info); @@ -441,15 +441,15 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) H5O__assert(oh); #endif /* H5O_DEBUG */ - /* Point to raw data 'image' for first chunk, which - * has room for the prefix + /* Point to raw data 'image' for first chunk, which + * has room for the prefix */ chunk_image = oh->chunk[0].image; /* Later versions of object header prefix have different format and * also require that chunk 0 always be updated, since the checksum * on the entire block of memory needs to be updated if anything is - * modified + * modified */ if(oh->version > H5O_VERSION_1) { uint64_t chunk0_size; /* Size of chunk 0's data */ @@ -536,11 +536,11 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) HDassert((size_t)(chunk_image - oh->chunk[0].image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); /* Serialize messages for this chunk */ - if(H5O__chunk_serialize(f, oh, (unsigned)0) < 0) + if(H5O__chunk_serialize(f, oh, (unsigned)0) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize first object header chunk") - /* copy the chunk into the image -- this is potentially expensive. - * Can we rework things so that the object header and the cache + /* copy the chunk into the image -- this is potentially expensive. + * Can we rework things so that the object header and the cache * share a buffer? */ H5MM_memcpy(image, oh->chunk[0].image, len); @@ -651,7 +651,7 @@ done: */ static herr_t H5O__cache_free_icr(void *_thing) -{ +{ H5O_t *oh = (H5O_t *)_thing; /* Object header to destroy */ herr_t ret_value = SUCCEED; /* Return value */ @@ -674,8 +674,8 @@ done: /*------------------------------------------------------------------------- * Function: H5O__cache_chk_get_initial_load_size() * - * Purpose: Tell the metadata cache how large the on disk image of the - * chunk proxy is, so it can load the image into a buffer for the + * Purpose: Tell the metadata cache how large the on disk image of the + * chunk proxy is, so it can load the image into a buffer for the * deserialize call. * * Return: Success: SUCCEED @@ -751,7 +751,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata) * Function: H5O__cache_chk_deserialize * * Purpose: Attempt to deserialize the object header continuation chunk - * contained in the supplied buffer, load the data into an instance + * contained in the supplied buffer, load the data into an instance * of H5O_chunk_proxy_t, and return a pointer to the new instance. * * Return: Success: Pointer to in core representation @@ -780,7 +780,7 @@ H5O__cache_chk_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, HDassert(dirty); /* Allocate space for the object header data structure */ - if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) + if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Check if we are still decoding the object header */ @@ -804,7 +804,7 @@ H5O__cache_chk_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, /* Set the chunk number for the chunk proxy */ chk_proxy->chunkno = udata->chunkno; - /* Sanity check that the chunk representation we have in memory is + /* Sanity check that the chunk representation we have in memory is * the same as the one being brought in from disk. */ HDassert(0 == HDmemcmp(image, udata->oh->chunk[chk_proxy->chunkno].image, udata->oh->chunk[chk_proxy->chunkno].size)); @@ -830,7 +830,7 @@ done: /*------------------------------------------------------------------------- * Function: H5O__cache_chk_image_len * - * Purpose: Return the on disk image size of a object header chunk to the + * Purpose: Return the on disk image size of a object header chunk to the * metadata cache via the image_len. * * Return: Success: SUCCEED @@ -864,9 +864,9 @@ H5O__cache_chk_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5O__cache_chk_serialize * - * Purpose: Given a pointer to an instance of an object header chunk and an - * appropriately sized buffer, serialize the contents of the - * instance for writing to disk, and copy the serialized data + * Purpose: Given a pointer to an instance of an object header chunk and an + * appropriately sized buffer, serialize the contents of the + * instance for writing to disk, and copy the serialized data * into the buffer. * * Return: Success: SUCCEED @@ -1263,19 +1263,19 @@ H5O__prefix_deserialize(const uint8_t *_image, H5O_cache_ud_t *udata) /* Verify object header prefix length */ HDassert((size_t)(image - _image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); - /* If udata->oh is to be freed (see H5O__cache_verify_chksum), + /* If udata->oh is to be freed (see H5O__cache_verify_chksum), save the pointer to udata->oh and free it later after setting udata->oh with the new object header */ if(udata->free_oh) { H5O_t *saved_oh = udata->oh; - HDassert(udata->oh); + HDassert(udata->oh); /* Save the object header for later use in 'deserialize' callback */ udata->oh = oh; if(H5O__free(saved_oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header") udata->free_oh = FALSE; - } else + } else /* Save the object header for later use in 'deserialize' callback */ udata->oh = oh; @@ -1491,7 +1491,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image mesg->type = H5O_msg_class_g[H5O_UNKNOWN_ID]; /* Check for "fail if unknown" message flags */ - if(((udata->file_intent & H5F_ACC_RDWR) && + if(((udata->file_intent & H5F_ACC_RDWR) && (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_AND_OPEN_FOR_WRITE)) || (flags & H5O_MSG_FLAG_FAIL_IF_UNKNOWN_ALWAYS)) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "unknown message with 'fail if unknown' flag found") diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index 70d9ef5..6ac04c8 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -40,10 +40,10 @@ /* Callbacks for message class */ static void *H5O__mdci_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, +static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O__mdci_copy(const void *_mesg, void *_dest); -static size_t H5O__mdci_size(const H5F_t *f, hbool_t disable_shared, +static size_t H5O__mdci_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__mdci_free(void *mesg); static herr_t H5O__mdci_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); @@ -143,7 +143,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__mdci_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__mdci_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_mdci_t *mesg = (const H5O_mdci_t *)_mesg; @@ -220,7 +220,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O__mdci_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__mdci_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ @@ -228,7 +228,7 @@ H5O__mdci_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, FUNC_ENTER_STATIC_NOERR /* Set return value */ - ret_value = (size_t)( 1 + /* Version number */ + ret_value = (size_t)( 1 + /* Version number */ H5F_SIZEOF_ADDR(f) + /* addr of metadata cache */ /* image block */ H5F_SIZEOF_SIZE(f) ); /* length of metadata cache */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c27ece0..6eaaae9 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -43,7 +43,7 @@ static void *H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_t void *native_src, H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata); static herr_t H5O__dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); diff --git a/src/H5Oflush.c b/src/H5Oflush.c index b441840..898184b 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -270,11 +270,11 @@ done: * Purpose: Refreshes all buffers associated with an object. * * Note: This is based on the original H5O_refresh_metadata() but - * is split into 2 routines. + * is split into 2 routines. * This is done so that H5Fstart_swmr_write() can use these - * 2 routines to refresh opened objects. This may be + * 2 routines to refresh opened objects. This may be * restored back to the original code when H5Fstart_swmr_write() - * uses a different approach to handle issues with opened objects. + * uses a different approach to handle issues with opened objects. * H5Fstart_swmr_write() no longer calls the 1st routine. (12/24/15) * * Return: Non-negative on success, negative on failure @@ -383,7 +383,7 @@ H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - + /* Make deep local copy of object's location information */ if(obj_loc) { H5G_loc_t tmp_loc; diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 2a2a07b..8e6e204 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -373,7 +373,7 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Check version */ if(mesg->version < H5O_LAYOUT_VERSION_4) HGOTO_ERROR(H5E_OHDR, H5E_VERSION, NULL, "invalid layout version with virtual layout") - + /* Heap information */ H5F_addr_decode(f, &p, &(mesg->storage.u.virt.serial_list_hobjid.addr)); UINT32DECODE(p, mesg->storage.u.virt.serial_list_hobjid.idx); diff --git a/src/H5Opkg.h b/src/H5Opkg.h index fb08f7d..16ea8e5 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -391,15 +391,15 @@ typedef struct H5O_chunk_proxy_t { H5O_t *oh; /* Object header for this chunk */ unsigned chunkno; /* Chunk number for this chunk */ - /* Flush depencency parent information (not stored) + /* Flush depencency parent information (not stored) * - * The following field is used to store a pointer + * The following field is used to store a pointer * to the in-core representation of a new chunk proxy's flush dependency * parent -- if it exists. If it does not exist, this field will * contain NULL. * - * If the file is opened in SWMR write mode, the flush dependency - * parent of the chunk proxy will be either its object header + * If the file is opened in SWMR write mode, the flush dependency + * parent of the chunk proxy will be either its object header * or the chunk with the continuation message that references this chunk. */ void *fd_parent; /* Pointer to flush dependency parent */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index ceaa96d..0be6d89 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -223,7 +223,7 @@ typedef struct H5O_copy_t { #define H5O_MDCI_MSG_ID 0x0018 /* Metadata Cache Image Message */ #define H5O_UNKNOWN_ID 0x0019 /* Placeholder message ID for unknown message. */ /* (this should never exist in a file) */ -/* +/* * Note: Must increment H5O_MSG_TYPES in H5Opkg.h and update H5O_msg_class_g * in H5O.c when creating a new message type. Also bump the value of * H5O_BOGUS_INVALID_ID, below, to be one greater than the value of @@ -482,7 +482,7 @@ typedef struct H5O_storage_chunk_t { const struct H5D_chunk_ops_t *ops; /* Pointer to chunked storage operations */ union { H5O_storage_chunk_btree_t btree; /* Information for v1 B-tree index */ - H5O_storage_chunk_bt2_t btree2; /* Information for v2 B-tree index */ + H5O_storage_chunk_bt2_t btree2; /* Information for v2 B-tree index */ H5O_storage_chunk_earray_t earray; /* Information for extensible array index */ H5O_storage_chunk_farray_t farray; /* Information for fixed array index */ H5O_storage_chunk_single_filt_t single; /* Information for single chunk w/ filters index */ @@ -583,8 +583,8 @@ typedef struct H5O_storage_t { typedef struct H5O_layout_chunk_farray_t { /* Creation parameters for fixed array data structure */ struct { - uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in a data block page) - - i.e. # of bits needed to store max. # of elements + uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in a data block page) - + i.e. # of bits needed to store max. # of elements in a data block page */ } cparam; } H5O_layout_chunk_farray_t; diff --git a/src/H5P.c b/src/H5P.c index 09ff7f0..9bc293b 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -820,7 +820,7 @@ done: H5Pencode2 PURPOSE Routine to convert the property values in a property list into a binary buffer. - The encoding of property values will be done according to the file format + The encoding of property values will be done according to the file format setting in fapl_id. USAGE herr_t H5Pencode(plist_id, buf, nalloc, fapl_id) @@ -878,7 +878,7 @@ done: Failure: H5I_INVALID_HID (negative) DESCRIPTION Decodes a property list from a binary buffer. The contents of the buffer - contain the values for the correponding properties of the plist. The decode + contain the values for the correponding properties of the plist. The decode callback of a certain property decodes its value from the buffer and sets it in the property list. GLOBAL VARIABLES diff --git a/src/H5PB.c b/src/H5PB.c index 6c83217..45f24e3 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -166,7 +166,7 @@ H5FL_DEFINE_STATIC(H5PB_entry_t); * *------------------------------------------------------------------------- */ -herr_t +herr_t H5PB_reset_stats(H5PB_t *page_buf) { FUNC_ENTER_NOAPI_NOERR @@ -208,7 +208,7 @@ H5PB_reset_stats(H5PB_t *page_buf) * *------------------------------------------------------------------------- */ -herr_t +herr_t H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2], unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]) { @@ -517,9 +517,9 @@ done: /*------------------------------------------------------------------------- * Function: H5PB_add_new_page * - * Purpose: Add a new page to the new page skip list. This is called - * from the MF layer when a new page is allocated to - * indicate to the page buffer layer that a read of the page + * Purpose: Add a new page to the new page skip list. This is called + * from the MF layer when a new page is allocated to + * indicate to the page buffer layer that a read of the page * from the file is not necessary since it's an empty page. * * Return: Non-negative on success/Negative on failure @@ -577,9 +577,9 @@ done: /*------------------------------------------------------------------------- * Function: H5PB_update_entry * - * Purpose: In PHDF5, entries that are written by other processes and just - * marked clean by this process have to have their corresponding - * pages updated if they exist in the page buffer. + * Purpose: In PHDF5, entries that are written by other processes and just + * marked clean by this process have to have their corresponding + * pages updated if they exist in the page buffer. * This routine checks and update the pages. * * Return: Non-negative on success/Negative on failure @@ -588,7 +588,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf) { H5PB_entry_t *page_entry; /* Pointer to the corresponding page entry */ @@ -743,7 +743,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * page_buf->bypasses[0] ++; } /* end if */ - /* If page buffering is disabled, or if this is a large metadata access, + /* If page buffering is disabled, or if this is a large metadata access, * or if this is parallel raw data access, we are done here */ if(NULL == page_buf || (size >= page_buf->page_size && H5FD_MEM_DRAW != type) || @@ -769,7 +769,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * last_page_addr = ((addr + size - 1) / page_buf->page_size) * page_buf->page_size; /* How many pages does this write span */ - num_touched_pages = (last_page_addr / page_buf->page_size + 1) - + num_touched_pages = (last_page_addr / page_buf->page_size + 1) - (first_page_addr / page_buf->page_size); if(first_page_addr == last_page_addr) { HDassert(1 == num_touched_pages); @@ -822,7 +822,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * offset = addr - first_page_addr; HDassert(page_buf->page_size > offset); - H5MM_memcpy(buf, (uint8_t *)page_entry->page_buf_ptr + offset, + H5MM_memcpy(buf, (uint8_t *)page_entry->page_buf_ptr + offset, page_buf->page_size - (size_t)offset); /* move to top of LRU list */ @@ -830,7 +830,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * } /* end if */ /* special handling for the last page if it is not a full page access */ else if(num_touched_pages > 1 && i == num_touched_pages-1 && search_addr < addr+size) { - offset = (num_touched_pages-2)*page_buf->page_size + + offset = (num_touched_pages-2)*page_buf->page_size + (page_buf->page_size - (addr - first_page_addr)); H5MM_memcpy((uint8_t *)buf + offset, page_entry->page_buf_ptr, @@ -843,7 +843,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * else { offset = i*page_buf->page_size; - H5MM_memcpy((uint8_t *)buf+(i*page_buf->page_size) , page_entry->page_buf_ptr, + H5MM_memcpy((uint8_t *)buf+(i*page_buf->page_size) , page_entry->page_buf_ptr, page_buf->page_size); } /* end else */ } /* end if */ @@ -1039,7 +1039,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, page_buf->bypasses[0]++; } /* end if */ - /* If page buffering is disabled, or if this is a large metadata access, + /* If page buffering is disabled, or if this is a large metadata access, * or if this is a parallel raw data access, we are done here */ if(NULL == page_buf || (size >= page_buf->page_size && H5FD_MEM_DRAW != type) || @@ -1073,7 +1073,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, last_page_addr = (addr + size - 1) / page_buf->page_size * page_buf->page_size; /* how many pages does this write span */ - num_touched_pages = (last_page_addr/page_buf->page_size + 1) - + num_touched_pages = (last_page_addr/page_buf->page_size + 1) - (first_page_addr / page_buf->page_size); if(first_page_addr == last_page_addr) { HDassert(1 == num_touched_pages); @@ -1114,18 +1114,18 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, } /* end if */ } /* end if */ /* Special handling for the last page if it is not a full page update */ - else if(num_touched_pages > 1 && i == (num_touched_pages - 1) && + else if(num_touched_pages > 1 && i == (num_touched_pages - 1) && (search_addr + page_buf->page_size) != (addr + size)) { HDassert(search_addr+page_buf->page_size > addr+size); /* Lookup the page in the skip list */ page_entry = (H5PB_entry_t *)H5SL_search(page_buf->slist_ptr, (void *)(&search_addr)); if(page_entry) { - offset = (num_touched_pages - 2) * page_buf->page_size + + offset = (num_touched_pages - 2) * page_buf->page_size + (page_buf->page_size - (addr - first_page_addr)); /* Update page's data */ - H5MM_memcpy(page_entry->page_buf_ptr, (const uint8_t *)buf + offset, + H5MM_memcpy(page_entry->page_buf_ptr, (const uint8_t *)buf + offset, (size_t)((addr + size) - last_page_addr)); /* Mark page dirty and push to top of LRU */ @@ -1313,7 +1313,7 @@ done: /*------------------------------------------------------------------------- * Function: H5PB__insert_entry() * - * Purpose: ??? + * Purpose: ??? * * This function was created without documentation. * What follows is my best understanding of Mohamad's intent. @@ -1334,7 +1334,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5PB__insert_entry(H5PB_t *page_buf, H5PB_entry_t *page_entry) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1399,7 +1399,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) /* check the metadata threshold before evicting metadata items */ while(1) { - if(page_entry->prev && H5F_MEM_PAGE_META == page_entry->type && + if(page_entry->prev && H5F_MEM_PAGE_META == page_entry->type && page_buf->min_meta_count >= page_buf->meta_count) page_entry = page_entry->prev; else @@ -1416,7 +1416,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) /* check the raw data threshold before evicting raw data items */ while(1) { - if(page_entry->prev && (H5F_MEM_PAGE_DRAW == page_entry->type || H5F_MEM_PAGE_GHEAP == page_entry->type) && + if(page_entry->prev && (H5F_MEM_PAGE_DRAW == page_entry->type || H5F_MEM_PAGE_GHEAP == page_entry->type) && page_buf->min_raw_count >= page_buf->raw_count) page_entry = page_entry->prev; else @@ -1461,7 +1461,7 @@ done: /*------------------------------------------------------------------------- * Function: H5PB__write_entry() * - * Purpose: ??? + * Purpose: ??? * * This function was created without documentation. * What follows is my best understanding of Mohamad's intent. diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 09ba2ee..7e49c4b 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -251,25 +251,25 @@ H5P__dcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the storage layout property */ - if(H5P__register_real(pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &H5D_def_layout_g, + if(H5P__register_real(pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &H5D_def_layout_g, NULL, H5D_CRT_LAYOUT_SET, H5D_CRT_LAYOUT_GET, H5D_CRT_LAYOUT_ENC, H5D_CRT_LAYOUT_DEC, H5D_CRT_LAYOUT_DEL, H5D_CRT_LAYOUT_COPY, H5D_CRT_LAYOUT_CMP, H5D_CRT_LAYOUT_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the fill value property */ - if(H5P__register_real(pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &H5D_def_fill_g, + if(H5P__register_real(pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &H5D_def_fill_g, NULL, H5D_CRT_FILL_VALUE_SET, H5D_CRT_FILL_VALUE_GET, H5D_CRT_FILL_VALUE_ENC, H5D_CRT_FILL_VALUE_DEC, H5D_CRT_FILL_VALUE_DEL, H5D_CRT_FILL_VALUE_COPY, H5D_CRT_FILL_VALUE_CMP, H5D_CRT_FILL_VALUE_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the space allocation time state property */ - if(H5P__register_real(pclass, H5D_CRT_ALLOC_TIME_STATE_NAME, H5D_CRT_ALLOC_TIME_STATE_SIZE, &H5D_def_alloc_time_state_g, + if(H5P__register_real(pclass, H5D_CRT_ALLOC_TIME_STATE_NAME, H5D_CRT_ALLOC_TIME_STATE_SIZE, &H5D_def_alloc_time_state_g, NULL, NULL, NULL, H5D_CRT_ALLOC_TIME_STATE_ENC, H5D_CRT_ALLOC_TIME_STATE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the external file list property */ - if(H5P__register_real(pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &H5D_def_efl_g, + if(H5P__register_real(pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &H5D_def_efl_g, NULL, H5D_CRT_EXT_FILE_LIST_SET, H5D_CRT_EXT_FILE_LIST_GET, H5D_CRT_EXT_FILE_LIST_ENC, H5D_CRT_EXT_FILE_LIST_DEC, H5D_CRT_EXT_FILE_LIST_DEL, H5D_CRT_EXT_FILE_LIST_COPY, H5D_CRT_EXT_FILE_LIST_CMP, H5D_CRT_EXT_FILE_LIST_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -1512,7 +1512,7 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value) size_t len; if(efl->nused >= efl->nalloc) { size_t na = efl->nalloc + H5O_EFL_ALLOC; - H5O_efl_entry_t *x = (H5O_efl_entry_t *)H5MM_realloc(efl->slot, + H5O_efl_entry_t *x = (H5O_efl_entry_t *)H5MM_realloc(efl->slot, na * sizeof(H5O_efl_entry_t)); if(!x) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed") @@ -2222,7 +2222,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, if((ent->psfn_nsubs == 0) && (ent->psdn_nsubs == 0)) { if(ent->parsed_source_file_name) ent->source_dset.file_name = ent->parsed_source_file_name->name_segment; - else + else ent->source_dset.file_name = ent->source_file_name; if(ent->parsed_source_dset_name) ent->source_dset.dset_name = ent->parsed_source_dset_name->name_segment; @@ -2342,7 +2342,7 @@ done: * Purpose: Takes the dataset creation property list for the virtual * dataset, dcpl_id, and the mapping index, index, and * returns a dataspace identifier for the selection within - * the virtual dataset used in the mapping. + * the virtual dataset used in the mapping. * * Return: Returns a dataspace identifier if successful; otherwise * returns a negative value. @@ -2400,7 +2400,7 @@ done: * Purpose: Takes the dataset creation property list for the virtual * dataset, dcpl_id, and the mapping index, index, and * returns a dataspace identifier for the selection within - * the source dataset used in the mapping. + * the source dataset used in the mapping. * * Return: Returns a dataspace identifier if successful; otherwise * returns a negative value. @@ -2504,7 +2504,7 @@ done: * be the size in bytes of the filename. That value, plus 1 * for a NULL terminator, is then assigned to size for a * second H5Pget_virtual_filename call, which will retrieve - * the actual filename. + * the actual filename. * * Return: Returns the length of the name if successful, otherwise * returns a negative value. @@ -2567,7 +2567,7 @@ done: * be the size in bytes of the dataset name. That value, plus 1 * for a NULL terminator, is then assigned to size for a * second H5Pget_virtual_dsetname call, which will retrieve - * the actual dataset name. + * the actual dataset name. * * Return: Returns the length of the name if successful, otherwise * returns a negative value. diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index 1b5f581..b9efaee 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -563,9 +563,9 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid strategy") /* * For 1.10.0 H5Pset_file_space: - * If strategy is zero, the property is not changed; + * If strategy is zero, the property is not changed; * the existing strategy is retained. - * If threshold is zero, the property is not changed; + * If threshold is zero, the property is not changed; * the existing threshold is retained. */ if(!in_strategy) @@ -579,7 +579,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh new_persist = TRUE; new_threshold = in_threshold; break; - + case H5F_FILE_SPACE_ALL: new_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; new_threshold = in_threshold; @@ -592,7 +592,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh case H5F_FILE_SPACE_VFD: new_strategy = H5F_FSPACE_STRATEGY_NONE; break; - + case H5F_FILE_SPACE_NTYPES: case H5F_FILE_SPACE_DEFAULT: default: diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 9baa201..3f5754e 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -128,7 +128,7 @@ #define H5D_MPIO_ACTUAL_IO_MODE_DEF H5D_MPIO_NO_COLLECTIVE /* Definitions for cause of broken collective io property */ #define H5D_MPIO_NO_COLLECTIVE_CAUSE_SIZE sizeof(uint32_t) -#define H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF H5D_MPIO_COLLECTIVE +#define H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF H5D_MPIO_COLLECTIVE /* Definitions for EDC property */ #define H5D_XFER_EDC_SIZE sizeof(H5Z_EDC_t) @@ -245,7 +245,7 @@ static const unsigned H5D_def_mpio_chunk_opt_num_g = H5D_XFER_MPIO_CHUNK_OPT_NUM static const unsigned H5D_def_mpio_chunk_opt_ratio_g = H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEF; static const H5D_mpio_actual_chunk_opt_mode_t H5D_def_mpio_actual_chunk_opt_mode_g = H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF; static const H5D_mpio_actual_io_mode_t H5D_def_mpio_actual_io_mode_g = H5D_MPIO_ACTUAL_IO_MODE_DEF; -static const H5D_mpio_no_collective_cause_t H5D_def_mpio_no_collective_cause_g = H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF; +static const H5D_mpio_no_collective_cause_t H5D_def_mpio_no_collective_cause_g = H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF; static const H5Z_EDC_t H5D_def_enable_edc_g = H5D_XFER_EDC_DEF; /* Default value for EDC property */ static const H5Z_cb_t H5D_def_filter_cb_g = H5D_XFER_FILTER_CB_DEF; /* Default value for filter callback */ static const H5T_conv_cb_t H5D_def_conv_cb_g = H5D_XFER_CONV_CB_DEF; /* Default value for datatype conversion callback */ @@ -271,96 +271,96 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register the max. temp buffer size property */ - if(H5P__register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &H5D_def_max_temp_buf_g, + if(H5P__register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &H5D_def_max_temp_buf_g, NULL, NULL, NULL, H5D_XFER_MAX_TEMP_BUF_ENC, H5D_XFER_MAX_TEMP_BUF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the type conversion buffer property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_TCONV_BUF_NAME, H5D_XFER_TCONV_BUF_SIZE, &H5D_def_tconv_buf_g, + if(H5P__register_real(pclass, H5D_XFER_TCONV_BUF_NAME, H5D_XFER_TCONV_BUF_SIZE, &H5D_def_tconv_buf_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the background buffer property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_NAME, H5D_XFER_BKGR_BUF_SIZE, &H5D_def_bkgr_buf_g, + if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_NAME, H5D_XFER_BKGR_BUF_SIZE, &H5D_def_bkgr_buf_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the background buffer type property */ - if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_TYPE_NAME, H5D_XFER_BKGR_BUF_TYPE_SIZE, &H5D_def_bkgr_buf_type_g, + if(H5P__register_real(pclass, H5D_XFER_BKGR_BUF_TYPE_NAME, H5D_XFER_BKGR_BUF_TYPE_SIZE, &H5D_def_bkgr_buf_type_g, NULL, NULL, NULL, H5D_XFER_BKGR_BUF_TYPE_ENC, H5D_XFER_BKGR_BUF_TYPE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the B-Tree node splitting ratios property */ - if(H5P__register_real(pclass, H5D_XFER_BTREE_SPLIT_RATIO_NAME, H5D_XFER_BTREE_SPLIT_RATIO_SIZE, H5D_def_btree_split_ratio_g, + if(H5P__register_real(pclass, H5D_XFER_BTREE_SPLIT_RATIO_NAME, H5D_XFER_BTREE_SPLIT_RATIO_SIZE, H5D_def_btree_split_ratio_g, NULL, NULL, NULL, H5D_XFER_BTREE_SPLIT_RATIO_ENC, H5D_XFER_BTREE_SPLIT_RATIO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen allocation function property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_NAME, H5D_XFER_VLEN_ALLOC_SIZE, &H5D_def_vlen_alloc_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_NAME, H5D_XFER_VLEN_ALLOC_SIZE, &H5D_def_vlen_alloc_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen allocation information property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_INFO_NAME, H5D_XFER_VLEN_ALLOC_INFO_SIZE, &H5D_def_vlen_alloc_info_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_ALLOC_INFO_NAME, H5D_XFER_VLEN_ALLOC_INFO_SIZE, &H5D_def_vlen_alloc_info_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen free function property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_NAME, H5D_XFER_VLEN_FREE_SIZE, &H5D_def_vlen_free_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_NAME, H5D_XFER_VLEN_FREE_SIZE, &H5D_def_vlen_free_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vlen free information property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_INFO_NAME, H5D_XFER_VLEN_FREE_INFO_SIZE, &H5D_def_vlen_free_info_g, + if(H5P__register_real(pclass, H5D_XFER_VLEN_FREE_INFO_NAME, H5D_XFER_VLEN_FREE_INFO_SIZE, &H5D_def_vlen_free_info_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the vector size property */ - if(H5P__register_real(pclass, H5D_XFER_HYPER_VECTOR_SIZE_NAME, H5D_XFER_HYPER_VECTOR_SIZE_SIZE, &H5D_def_hyp_vec_size_g, + if(H5P__register_real(pclass, H5D_XFER_HYPER_VECTOR_SIZE_NAME, H5D_XFER_HYPER_VECTOR_SIZE_SIZE, &H5D_def_hyp_vec_size_g, NULL, NULL, NULL, H5D_XFER_HYPER_VECTOR_SIZE_ENC, H5D_XFER_HYPER_VECTOR_SIZE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the I/O transfer mode properties */ - if(H5P__register_real(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &H5D_def_io_xfer_mode_g, + if(H5P__register_real(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &H5D_def_io_xfer_mode_g, NULL, NULL, NULL, H5D_XFER_IO_XFER_MODE_ENC, H5D_XFER_IO_XFER_MODE_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P__register_real(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &H5D_def_mpio_collective_opt_mode_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &H5D_def_mpio_collective_opt_mode_g, NULL, NULL, NULL, H5D_XFER_MPIO_COLLECTIVE_OPT_ENC, H5D_XFER_MPIO_COLLECTIVE_OPT_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, H5D_XFER_MPIO_CHUNK_OPT_HARD_SIZE, &H5D_def_mpio_chunk_opt_mode_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, H5D_XFER_MPIO_CHUNK_OPT_HARD_SIZE, &H5D_def_mpio_chunk_opt_mode_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_HARD_ENC, H5D_XFER_MPIO_CHUNK_OPT_HARD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, H5D_XFER_MPIO_CHUNK_OPT_NUM_SIZE, &H5D_def_mpio_chunk_opt_num_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, H5D_XFER_MPIO_CHUNK_OPT_NUM_SIZE, &H5D_def_mpio_chunk_opt_num_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_NUM_ENC, H5D_XFER_MPIO_CHUNK_OPT_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE, &H5D_def_mpio_chunk_opt_ratio_g, + if(H5P__register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE, &H5D_def_mpio_chunk_opt_ratio_g, NULL, NULL, NULL, H5D_XFER_MPIO_CHUNK_OPT_RATIO_ENC, H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the chunk optimization mode property. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &H5D_def_mpio_actual_chunk_opt_mode_g, + if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &H5D_def_mpio_actual_chunk_opt_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the actual I/O mode property. */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &H5D_def_mpio_actual_io_mode_g, + if(H5P__register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &H5D_def_mpio_actual_io_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -396,7 +396,7 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) /* Register the data transform property */ if(H5P__register_real(pclass, H5D_XFER_XFORM_NAME, H5D_XFER_XFORM_SIZE, &H5D_def_xfer_xform_g, - NULL, H5D_XFER_XFORM_SET, H5D_XFER_XFORM_GET, H5D_XFER_XFORM_ENC, H5D_XFER_XFORM_DEC, + NULL, H5D_XFER_XFORM_SET, H5D_XFER_XFORM_GET, H5D_XFER_XFORM_ENC, H5D_XFER_XFORM_DEC, H5D_XFER_XFORM_DEL, H5D_XFER_XFORM_COPY, H5D_XFER_XFORM_CMP, H5D_XFER_XFORM_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -860,7 +860,7 @@ H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t H5_ATTR_UNU if(*xform1) { HDassert(*xform2); - + /* Get the transform expressions */ pexp1 = H5Z_xform_extract_xform_str(*xform1); pexp2 = H5Z_xform_extract_xform_str(*xform2); @@ -1964,7 +1964,7 @@ H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Do", plist_id, actual_chunk_opt_mode); @@ -2000,7 +2000,7 @@ H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_ { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Di", plist_id, actual_io_mode); @@ -2034,7 +2034,7 @@ H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_ca { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*Iu*Iu", plist_id, local_no_collective_cause, global_no_collective_cause); diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 2a07a67..d4b6b5f 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -687,7 +687,7 @@ done: on failure. DESCRIPTION Decodes a property list from a binary buffer. The contents of the buffer - contain the values for the correponding properties of the plist. The decode + contain the values for the correponding properties of the plist. The decode callback of a certain property decodes its value from the buffer and sets it in the property list. GLOBAL VARIABLES diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7866464..30b590f 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -5780,7 +5780,7 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED /* Set return value */ ret_value = cmp_value; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_vol_cmp() */ diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 56af8b1..3b0ce66 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -212,38 +212,38 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI_NOINIT /* Register the user block size */ - if(H5P__register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &H5F_def_userblock_size_g, - NULL, NULL, NULL, H5F_CRT_USER_BLOCK_ENC, H5F_CRT_USER_BLOCK_DEC, + if(H5P__register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &H5F_def_userblock_size_g, + NULL, NULL, NULL, H5F_CRT_USER_BLOCK_ENC, H5F_CRT_USER_BLOCK_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for symbol table leaf nodes */ - if(H5P__register_real(pclass, H5F_CRT_SYM_LEAF_NAME, H5F_CRT_SYM_LEAF_SIZE, &H5F_def_sym_leaf_k_g, - NULL, NULL, NULL, H5F_CRT_SYM_LEAF_ENC, H5F_CRT_SYM_LEAF_DEC, + if(H5P__register_real(pclass, H5F_CRT_SYM_LEAF_NAME, H5F_CRT_SYM_LEAF_SIZE, &H5F_def_sym_leaf_k_g, + NULL, NULL, NULL, H5F_CRT_SYM_LEAF_ENC, H5F_CRT_SYM_LEAF_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for btree internal nodes */ - if(H5P__register_real(pclass, H5F_CRT_BTREE_RANK_NAME, H5F_CRT_BTREE_RANK_SIZE, H5F_def_btree_k_g, - NULL, NULL, NULL, H5F_CRT_BTREE_RANK_ENC, H5F_CRT_BTREE_RANK_DEC, + if(H5P__register_real(pclass, H5F_CRT_BTREE_RANK_NAME, H5F_CRT_BTREE_RANK_SIZE, H5F_def_btree_k_g, + NULL, NULL, NULL, H5F_CRT_BTREE_RANK_ENC, H5F_CRT_BTREE_RANK_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for an address */ - if(H5P__register_real(pclass, H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &H5F_def_sizeof_addr_g, - NULL, NULL, NULL, H5F_CRT_ADDR_BYTE_NUM_ENC, H5F_CRT_ADDR_BYTE_NUM_DEC, + if(H5P__register_real(pclass, H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &H5F_def_sizeof_addr_g, + NULL, NULL, NULL, H5F_CRT_ADDR_BYTE_NUM_ENC, H5F_CRT_ADDR_BYTE_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for object size */ - if(H5P__register_real(pclass, H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE, &H5F_def_sizeof_size_g, - NULL, NULL, NULL, H5F_CRT_OBJ_BYTE_NUM_ENC, H5F_CRT_OBJ_BYTE_NUM_DEC, + if(H5P__register_real(pclass, H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE, &H5F_def_sizeof_size_g, + NULL, NULL, NULL, H5F_CRT_OBJ_BYTE_NUM_ENC, H5F_CRT_OBJ_BYTE_NUM_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the superblock version number */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5F_CRT_SUPER_VERS_NAME, H5F_CRT_SUPER_VERS_SIZE, &H5F_def_superblock_ver_g, + if(H5P__register_real(pclass, H5F_CRT_SUPER_VERS_NAME, H5F_CRT_SUPER_VERS_SIZE, &H5F_def_superblock_ver_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -272,8 +272,8 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file space handling strategy */ - if(H5P__register_real(pclass, H5F_CRT_FILE_SPACE_STRATEGY_NAME, H5F_CRT_FILE_SPACE_STRATEGY_SIZE, &H5F_def_file_space_strategy_g, - NULL, NULL, NULL, H5F_CRT_FILE_SPACE_STRATEGY_ENC, H5F_CRT_FILE_SPACE_STRATEGY_DEC, + if(H5P__register_real(pclass, H5F_CRT_FILE_SPACE_STRATEGY_NAME, H5F_CRT_FILE_SPACE_STRATEGY_SIZE, &H5F_def_file_space_strategy_g, + NULL, NULL, NULL, H5F_CRT_FILE_SPACE_STRATEGY_ENC, H5F_CRT_FILE_SPACE_STRATEGY_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -284,8 +284,8 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the free space section threshold */ - if(H5P__register_real(pclass, H5F_CRT_FREE_SPACE_THRESHOLD_NAME, H5F_CRT_FREE_SPACE_THRESHOLD_SIZE, &H5F_def_free_space_threshold_g, - NULL, NULL, NULL, H5F_CRT_FREE_SPACE_THRESHOLD_ENC, H5F_CRT_FREE_SPACE_THRESHOLD_DEC, + if(H5P__register_real(pclass, H5F_CRT_FREE_SPACE_THRESHOLD_NAME, H5F_CRT_FREE_SPACE_THRESHOLD_SIZE, &H5F_def_free_space_threshold_g, + NULL, NULL, NULL, H5F_CRT_FREE_SPACE_THRESHOLD_ENC, H5F_CRT_FREE_SPACE_THRESHOLD_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -1333,7 +1333,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_space_strategy * - * Purpose: Retrieves the strategy, persist, and threshold that the library + * Purpose: Retrieves the strategy, persist, and threshold that the library * uses in managing file space. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index 1e39749..41ad078 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -124,7 +124,7 @@ H5P_fmnt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI_NOINIT /* Register property of whether symlinks is local to file */ - if(H5P__register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, + if(H5P__register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index e2fdcea..03874c8 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -133,13 +133,13 @@ H5P__gcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register group info property */ - if(H5P__register_real(pclass, H5G_CRT_GROUP_INFO_NAME, H5G_CRT_GROUP_INFO_SIZE, &H5G_def_ginfo_g, + if(H5P__register_real(pclass, H5G_CRT_GROUP_INFO_NAME, H5G_CRT_GROUP_INFO_SIZE, &H5G_def_ginfo_g, NULL, NULL, NULL, H5G_CRT_GROUP_INFO_ENC, H5G_CRT_GROUP_INFO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register link info property */ - if(H5P__register_real(pclass, H5G_CRT_LINK_INFO_NAME, H5G_CRT_LINK_INFO_SIZE, &H5G_def_linfo_g, + if(H5P__register_real(pclass, H5G_CRT_LINK_INFO_NAME, H5G_CRT_LINK_INFO_SIZE, &H5G_def_linfo_g, NULL, NULL, NULL, H5G_CRT_LINK_INFO_ENC, H5G_CRT_LINK_INFO_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -545,7 +545,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)value; /* Create local aliases for values */ @@ -558,7 +558,7 @@ H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size) UINT16ENCODE(*pp, ginfo->max_compact) UINT16ENCODE(*pp, ginfo->min_dense) UINT16ENCODE(*pp, ginfo->est_num_entries) - UINT16ENCODE(*pp, ginfo->est_name_len) + UINT16ENCODE(*pp, ginfo->est_name_len) } /* end if */ *size += sizeof(uint16_t) * 4 + sizeof(uint32_t); @@ -582,7 +582,7 @@ H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__gcrt_group_info_dec(const void **_pp, void *_value) { H5O_ginfo_t *ginfo = (H5O_ginfo_t *)_value; /* Group info settings */ @@ -599,16 +599,16 @@ H5P__gcrt_group_info_dec(const void **_pp, void *_value) UINT16DECODE(*pp, ginfo->max_compact) UINT16DECODE(*pp, ginfo->min_dense) UINT16DECODE(*pp, ginfo->est_num_entries) - UINT16DECODE(*pp, ginfo->est_name_len) + UINT16DECODE(*pp, ginfo->est_name_len) /* Update fields */ - if(ginfo->max_compact != H5G_CRT_GINFO_MAX_COMPACT || + if(ginfo->max_compact != H5G_CRT_GINFO_MAX_COMPACT || ginfo->min_dense != H5G_CRT_GINFO_MIN_DENSE) ginfo->store_link_phase_change = TRUE; else ginfo->store_link_phase_change = FALSE; - if(ginfo->est_num_entries != H5G_CRT_GINFO_EST_NUM_ENTRIES || + if(ginfo->est_num_entries != H5G_CRT_GINFO_EST_NUM_ENTRIES || ginfo->est_name_len != H5G_CRT_GINFO_EST_NAME_LEN) ginfo->store_est_entry_info = TRUE; else @@ -633,7 +633,7 @@ H5P__gcrt_group_info_dec(const void **_pp, void *_value) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)value; /* Create local aliases for values */ @@ -675,7 +675,7 @@ H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__gcrt_link_info_dec(const void **_pp, void *_value) { H5O_linfo_t *linfo = (H5O_linfo_t *)_value; /* Link info settings */ diff --git a/src/H5Pint.c b/src/H5Pint.c index 0810427..3cefb64 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -111,7 +111,7 @@ static H5P_genprop_t *H5P__create_prop(const char *name, size_t size, H5P_prop_w static H5P_genprop_t *H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type); static herr_t H5P__free_prop(H5P_genprop_t *prop); static int H5P__cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2); -static herr_t H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, +static herr_t H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, H5P_do_pclass_op_t pclass_op, void *udata); static int H5P__open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key); static H5P_genprop_t *H5P__find_prop_pclass(H5P_genclass_t *pclass, const char *name); @@ -1947,7 +1947,7 @@ done: PURPOSE Internal routine to register a new property in a property list class. USAGE - herr_t H5P__register_real(class, name, size, default, prp_create, prp_set, + herr_t H5P__register_real(class, name, size, default, prp_create, prp_set, prp_get, prp_close, prp_encode, prp_decode) H5P_genclass_t *class; IN: Property list class to modify const char *name; IN: Name of property to register @@ -2081,7 +2081,7 @@ done: The 'encode' callback is called when a property list with this property is being encoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to encode. @@ -2090,12 +2090,12 @@ done: void *plist; IN: The property list structure. uint8_t **buf; OUT: The buffer that holds the encoded property; The 'encode' routine returns the size needed to encode the property value - if the buffer passed in is NULL or the size is zero. Otherwise it encodes + if the buffer passed in is NULL or the size is zero. Otherwise it encodes the property value into binary in buf. The 'decode' callback is called when a property list with this property is being decoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. @@ -2150,7 +2150,7 @@ H5P__register_real(H5P_genclass_t *pclass, const char *name, size_t size, HGOTO_ERROR(H5E_PLIST, H5E_EXISTS, FAIL, "property already exists") /* Create property object from parameters */ - if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_CLASS, + if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_CLASS, def_value, prp_create, prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL,"Can't create property") @@ -2259,7 +2259,7 @@ done: The 'encode' callback is called when a property list with this property is being encoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to encode. @@ -2268,12 +2268,12 @@ done: void *plist; IN: The property list structure. uint8_t **buf; OUT: The buffer that holds the encoded property; The 'encode' routine returns the size needed to encode the property value - if the buffer passed in is NULL or the size is zero. Otherwise it encodes + if the buffer passed in is NULL or the size is zero. Otherwise it encodes the property value into binary in buf. The 'decode' callback is called when a property list with this property is being decoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. @@ -2416,7 +2416,7 @@ H5P__register(H5P_genclass_t **ppclass, const char *name, size_t size, } /* end if */ /* Really register the property in the class */ - if(H5P__register_real(pclass, name, size, def_value, prp_create, prp_set, prp_get, + if(H5P__register_real(pclass, name, size, def_value, prp_create, prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "can't register property") @@ -2439,7 +2439,7 @@ done: PURPOSE Internal routine to insert a new property in a property list. USAGE - herr_t H5P_insert(plist, name, size, value, prp_set, prp_get, prp_close, + herr_t H5P_insert(plist, name, size, value, prp_set, prp_get, prp_close, prp_encode, prp_decode) H5P_genplist_t *plist; IN: Property list to add property to const char *name; IN: Name of property to add @@ -2500,7 +2500,7 @@ done: The 'encode' callback is called when a property list with this property is being encoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to encode. @@ -2509,12 +2509,12 @@ done: void *plist; IN: The property list structure. uint8_t **buf; OUT: The buffer that holds the encoded property; The 'encode' routine returns the size needed to encode the property value - if the buffer passed in is NULL or the size is zero. Otherwise it encodes + if the buffer passed in is NULL or the size is zero. Otherwise it encodes the property value into binary in buf. The 'decode' callback is called when a property list with this property is being decoded. H5P_prp_encode_func_t is defined as: - typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, + typedef herr_t (*H5P_prp_encode_func_t)(void *f, size_t *size, void *value, void *plist, uint8_t **buf); where the parameters to the callback function are: void *f; IN: A fake file structure used to decode. @@ -2653,8 +2653,8 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, /* Ok to add to property list */ /* Create property object from parameters */ - if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_LIST, value, NULL, - prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, + if(NULL == (new_prop = H5P__create_prop(name, size, H5P_PROP_WITHIN_LIST, value, NULL, + prp_set, prp_get, prp_encode, prp_decode, prp_delete, prp_copy, prp_cmp, prp_close))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "Can't create property") @@ -2698,7 +2698,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, +H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op, H5P_do_pclass_op_t pclass_op, void *udata) { H5P_genclass_t *tclass; /* Temporary class pointer */ @@ -2780,7 +2780,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__poke_plist_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, +H5P__poke_plist_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, H5P_genprop_t *prop, void *_udata) { H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */ @@ -3149,7 +3149,7 @@ done: COMMENTS, BUGS, ASSUMPTIONS The 'get' callback routine registered for this property will _NOT_ be called, this routine is designed for internal library use only! - + This routine may not be called for zero-sized properties and will return an error in that case. EXAMPLES @@ -3203,7 +3203,7 @@ done: COMMENTS, BUGS, ASSUMPTIONS The 'set' callback routine registered for this property will _NOT_ be called, this routine is designed for internal library use only! - + This routine may not be called for zero-sized properties and will return an error in that case. @@ -4396,7 +4396,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__peek_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, +H5P__peek_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, H5P_genprop_t *prop, void *_udata) { H5P_prop_get_ud_t *udata = (H5P_prop_get_ud_t *)_udata; /* User data for callback */ diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 6e582fb..3d00c12 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -194,39 +194,39 @@ H5P__lacc_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register property for number of links traversed */ - if(H5P__register_real(pclass, H5L_ACS_NLINKS_NAME, H5L_ACS_NLINKS_SIZE, &H5L_def_nlinks_g, + if(H5P__register_real(pclass, H5L_ACS_NLINKS_NAME, H5L_ACS_NLINKS_SIZE, &H5L_def_nlinks_g, NULL, NULL, NULL, H5L_ACS_NLINKS_ENC, H5L_ACS_NLINKS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link prefix */ - if(H5P__register_real(pclass, H5L_ACS_ELINK_PREFIX_NAME, H5L_ACS_ELINK_PREFIX_SIZE, &H5L_def_elink_prefix_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_PREFIX_NAME, H5L_ACS_ELINK_PREFIX_SIZE, &H5L_def_elink_prefix_g, NULL, H5L_ACS_ELINK_PREFIX_SET, H5L_ACS_ELINK_PREFIX_GET, H5L_ACS_ELINK_PREFIX_ENC, H5L_ACS_ELINK_PREFIX_DEC, H5L_ACS_ELINK_PREFIX_DEL, H5L_ACS_ELINK_PREFIX_COPY, H5L_ACS_ELINK_PREFIX_CMP, H5L_ACS_ELINK_PREFIX_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register fapl for link access */ - if(H5P__register_real(pclass, H5L_ACS_ELINK_FAPL_NAME, H5L_ACS_ELINK_FAPL_SIZE, &H5L_def_fapl_id_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_FAPL_NAME, H5L_ACS_ELINK_FAPL_SIZE, &H5L_def_fapl_id_g, NULL, H5L_ACS_ELINK_FAPL_SET, H5L_ACS_ELINK_FAPL_GET, H5L_ACS_ELINK_FAPL_ENC, H5L_ACS_ELINK_FAPL_DEC, H5L_ACS_ELINK_FAPL_DEL, H5L_ACS_ELINK_FAPL_COPY, H5L_ACS_ELINK_FAPL_CMP, H5L_ACS_ELINK_FAPL_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link file access flags */ - if(H5P__register_real(pclass, H5L_ACS_ELINK_FLAGS_NAME, H5L_ACS_ELINK_FLAGS_SIZE, &H5L_def_elink_flags_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_FLAGS_NAME, H5L_ACS_ELINK_FLAGS_SIZE, &H5L_def_elink_flags_g, NULL, NULL, NULL, H5L_ACS_ELINK_FLAGS_ENC, H5L_ACS_ELINK_FLAGS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for external link file traversal callback */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5L_ACS_ELINK_CB_NAME, H5L_ACS_ELINK_CB_SIZE, &H5L_def_elink_cb_g, + if(H5P__register_real(pclass, H5L_ACS_ELINK_CB_NAME, H5L_ACS_ELINK_CB_SIZE, &H5L_def_elink_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL /* Register the metadata collective read flag */ - if(H5P__register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5L_ACS_COLL_MD_READ_SIZE, &H5L_def_coll_md_read_g, - NULL, NULL, NULL, H5L_ACS_COLL_MD_READ_ENC, H5L_ACS_COLL_MD_READ_DEC, + if(H5P__register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5L_ACS_COLL_MD_READ_SIZE, &H5L_def_coll_md_read_g, + NULL, NULL, NULL, H5L_ACS_COLL_MD_READ_ENC, H5L_ACS_COLL_MD_READ_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index ace853a..fc1a3b9 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -124,7 +124,7 @@ H5P_lcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI(FAIL) /* Register create intermediate groups property */ - if(H5P__register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &H5L_def_intmd_group_g, + if(H5P__register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &H5L_def_intmd_group_g, NULL, NULL, NULL, H5L_CRT_INTERMEDIATE_GROUP_ENC, H5L_CRT_INTERMEDIATE_GROUP_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 2dc92f9..7390cae 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -64,7 +64,7 @@ #define H5O_CPY_MERGE_COMM_DT_LIST_CLOSE H5P__ocpy_merge_comm_dt_list_close /* Definitions for callback function when completing the search for a matching committed datatype from the committed dtype list */ #define H5O_CPY_MCDT_SEARCH_CB_SIZE sizeof(H5O_mcdt_cb_info_t) -#define H5O_CPY_MCDT_SEARCH_CB_DEF {NULL,NULL} +#define H5O_CPY_MCDT_SEARCH_CB_DEF {NULL,NULL} /******************/ @@ -161,20 +161,20 @@ H5P__ocpy_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register copy options property */ - if(H5P__register_real(pclass, H5O_CPY_OPTION_NAME, H5O_CPY_OPTION_SIZE, &H5O_def_ocpy_option_g, + if(H5P__register_real(pclass, H5O_CPY_OPTION_NAME, H5O_CPY_OPTION_SIZE, &H5O_def_ocpy_option_g, NULL, NULL, NULL, H5O_CPY_OPTION_ENC, H5O_CPY_OPTION_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register merge named dtype list property */ - if(H5P__register_real(pclass, H5O_CPY_MERGE_COMM_DT_LIST_NAME, H5O_CPY_MERGE_COMM_DT_LIST_SIZE, &H5O_def_merge_comm_dtype_list_g, + if(H5P__register_real(pclass, H5O_CPY_MERGE_COMM_DT_LIST_NAME, H5O_CPY_MERGE_COMM_DT_LIST_SIZE, &H5O_def_merge_comm_dtype_list_g, NULL, H5O_CPY_MERGE_COMM_DT_LIST_SET, H5O_CPY_MERGE_COMM_DT_LIST_GET, H5O_CPY_MERGE_COMM_DT_LIST_ENC, H5O_CPY_MERGE_COMM_DT_LIST_DEC, H5O_CPY_MERGE_COMM_DT_LIST_DEL, H5O_CPY_MERGE_COMM_DT_LIST_COPY, H5O_CPY_MERGE_COMM_DT_LIST_CMP, H5O_CPY_MERGE_COMM_DT_LIST_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register property for callback when completing the search for a matching named datatype from the named dtype list */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P__register_real(pclass, H5O_CPY_MCDT_SEARCH_CB_NAME, H5O_CPY_MCDT_SEARCH_CB_SIZE, &H5O_def_mcdt_cb_g, + if(H5P__register_real(pclass, H5O_CPY_MCDT_SEARCH_CB_NAME, H5O_CPY_MCDT_SEARCH_CB_SIZE, &H5O_def_mcdt_cb_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -421,7 +421,7 @@ H5P__ocpy_merge_comm_dt_list_enc(const void *value, void **_pp, size_t *size) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) { H5O_copy_dtype_merge_list_t **dt_list = (H5O_copy_dtype_merge_list_t **)_value; /* Pointer to merge named datatype list */ @@ -439,7 +439,7 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) /* Start off with NULL (default value) */ *dt_list = NULL; - + /* Decode the string sequence */ len = HDstrlen(*(const char **)pp); while(len > 0) { @@ -469,7 +469,7 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) /* Advance past terminator for string sequence */ *pp += 1; -done: +done: if(ret_value < 0) { *dt_list = H5P__free_merge_comm_dtype_list(*dt_list); if(tmp_dt_list) { @@ -874,7 +874,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_mcdt_search_cb * - * Purpose: Retrieves the callback function and user data from the specified + * Purpose: Retrieves the callback function and user data from the specified * object copy property list. * * Usage: H5Pget_mcdt_search_cb(plist_id, H5O_mcdt_search_cb_t *func, void **op_data) @@ -905,7 +905,7 @@ H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data /* Get callback info */ if(H5P_get(plist, H5O_CPY_MCDT_SEARCH_CB_NAME, &cb_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get callback info") - + if(func) *func = cb_info.func; diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 45343c6..97d6119 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -130,7 +130,7 @@ H5P__strcrt_reg_prop(H5P_genclass_t *pclass) FUNC_ENTER_STATIC /* Register character encoding */ - if(H5P__register_real(pclass, H5P_STRCRT_CHAR_ENCODING_NAME, H5P_STRCRT_CHAR_ENCODING_SIZE, &H5P_def_char_encoding_g, + if(H5P__register_real(pclass, H5P_STRCRT_CHAR_ENCODING_NAME, H5P_STRCRT_CHAR_ENCODING_SIZE, &H5P_def_char_encoding_g, NULL, NULL, NULL, H5P_STRCRT_CHAR_ENCODING_ENC, H5P_STRCRT_CHAR_ENCODING_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") diff --git a/src/H5SM.c b/src/H5SM.c index 290e575..6eea80d 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -57,7 +57,7 @@ static herr_t H5SM__create_index(H5F_t *f, H5SM_index_header_t *header); static herr_t H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap); static haddr_t H5SM__create_list(H5F_t *f, H5SM_index_header_t *header); -static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, +static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *empty_pos, size_t *list_pos); static herr_t H5SM__convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header, H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh); diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 6d0f2b0..7f243a6 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -59,16 +59,16 @@ static herr_t H5SM__cache_table_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5SM__cache_table_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5SM__cache_table_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5SM__cache_table_image_len(const void *thing, size_t *image_len); static herr_t H5SM__cache_table_serialize(const H5F_t *f, void *image, - size_t len, void *thing); + size_t len, void *thing); static herr_t H5SM__cache_table_free_icr(void *thing); static herr_t H5SM__cache_list_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5SM__cache_list_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); static void *H5SM__cache_list_deserialize(const void *image, size_t len, - void *udata, hbool_t *dirty); + void *udata, hbool_t *dirty); static herr_t H5SM__cache_list_image_len(const void *thing, size_t *image_len); static herr_t H5SM__cache_list_serialize(const H5F_t *f, void *image, size_t len, void *thing); @@ -129,7 +129,7 @@ const H5AC_class_t H5AC_SOHM_LIST[1] = {{ /*------------------------------------------------------------------------- * Function: H5SM__cache_table_get_initial_load_size() * - * Purpose: Return the size of the master table of Shared Object Header + * Purpose: Return the size of the master table of Shared Object Header * Message indexes on disk. * * Return: Success: SUCCEED @@ -198,9 +198,9 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU /*------------------------------------------------------------------------- * Function: H5SM__cache_table_deserialize * - * Purpose: Given a buffer containing the on disk representation of the + * Purpose: Given a buffer containing the on disk representation of the * master table of Shared Object Header Message indexes, deserialize - * the table, copy the contents into a newly allocated instance of + * the table, copy the contents into a newly allocated instance of * H5SM_master_table_t, and return a pointer to the new instance. * * Return: Success: Pointer to in core representation @@ -212,7 +212,7 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU *------------------------------------------------------------------------- */ static void * -H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, +H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5F_t *f; /* File pointer -- from user data */ @@ -264,7 +264,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l /* Read in the index headers */ for(u = 0; u < table->num_indexes; ++u) { /* Verify correct version of index list */ - if(H5SM_LIST_VERSION != *image++) + if(H5SM_LIST_VERSION != *image++) HGOTO_ERROR(H5E_SOHM, H5E_VERSION, NULL, "bad shared message list version number") /* Type of the index (list or B-tree) */ @@ -555,8 +555,8 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo /*------------------------------------------------------------------------- * Function: H5SM__cache_list_deserialize * - * Purpose: Given a buffer containing the on disk image of a list of - * SOHM message, deserialize the list, load it into a newly allocated + * Purpose: Given a buffer containing the on disk image of a list of + * SOHM message, deserialize the list, load it into a newly allocated * instance of H5SM_list_t, and return a pointer to same. * * Return: Success: Pointer to in core representation @@ -568,7 +568,7 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo *------------------------------------------------------------------------- */ static void * -H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, +H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5SM_list_t *list = NULL; /* The SOHM list being read in */ diff --git a/src/H5Sall.c b/src/H5Sall.c index 77fb582..8290ae2 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -675,7 +675,7 @@ H5S__all_deserialize(H5S_t **space, const uint8_t **p) HDassert(*p); /* As part of the efforts to push all selection-type specific coding - to the callbacks, the coding for the allocation of a null dataspace + to the callbacks, the coding for the allocation of a null dataspace is moved from H5S_select_deserialize() in H5Sselect.c. This is needed for decoding virtual layout in H5O__layout_decode() */ diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 6397f4b..33dd492 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -899,7 +899,7 @@ if(H5DEBUG(S)) /* Calculate start and extent values of this dimension */ /* Check if value overflow to cast to type MPI_Aint */ - if(d[i].start > LONG_MAX || offset[i] > LONG_MAX || elmt_size > LONG_MAX) + if(d[i].start > LONG_MAX || offset[i] > LONG_MAX || elmt_size > LONG_MAX) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "result overflow") start_disp = (MPI_Aint)d[i].start * (MPI_Aint)offset[i] * (MPI_Aint)elmt_size; diff --git a/src/H5Spublic.h b/src/H5Spublic.h index f7c5ae7..1ca79ea 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -47,7 +47,7 @@ #define H5S_SEL_ITER_SHARE_WITH_DATASPACE 0x0002 /* Don't copy the dataspace * selection when creating the * selection iterator. - * + * * This can improve performance * of creating the iterator, but * the dataspace _MUST_NOT_ be diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 13233ce..56f14ba 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -3044,7 +3044,7 @@ done: Retrieve a list of offset / length pairs (a list of "sequences") matching the selected elements for an iterator, according to the iteration order for the iterator. The lengths returned are in _bytes_, not elements. - + Note that the iteration order for "all" and "hyperslab" selections is row-major (i.e. "C-ordered"), but the iteration order for "point" selections is "in order selected", unless the H5S_SEL_ITER_GET_SEQ_LIST_SORTED diff --git a/src/H5TS.c b/src/H5TS.c index 98eba41..3643ed5 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -179,7 +179,7 @@ H5TS_thread_id(void) /* An ID is *not* already assigned: reuse an ID that's on the * free list, or else generate a new ID. - * + * * Allocating memory while holding a mutex is bad form, so * point `tid` at `proto_tid` if we need to allocate some * memory. @@ -292,7 +292,7 @@ herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex) { #ifdef H5_HAVE_WIN_THREADS - EnterCriticalSection( &mutex->CriticalSection); + EnterCriticalSection( &mutex->CriticalSection); return 0; #else /* H5_HAVE_WIN_THREADS */ herr_t ret_value = pthread_mutex_lock(&mutex->atomic_lock); @@ -313,7 +313,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) mutex->lock_count = 1; } - return pthread_mutex_unlock(&mutex->atomic_lock); + return pthread_mutex_unlock(&mutex->atomic_lock); #endif /* H5_HAVE_WIN_THREADS */ } @@ -344,7 +344,7 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) #ifdef H5_HAVE_WIN_THREADS /* Releases ownership of the specified critical section object. */ LeaveCriticalSection(&mutex->CriticalSection); - return 0; + return 0; #else /* H5_HAVE_WIN_THREADS */ herr_t ret_value = pthread_mutex_lock(&mutex->atomic_lock); @@ -363,7 +363,7 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) ret_value = err; } /* end if */ - return ret_value; + return ret_value; #endif /* H5_HAVE_WIN_THREADS */ } /* H5TS_mutex_unlock */ @@ -400,15 +400,15 @@ H5TS_cancel_count_inc(void) return SUCCEED; #else /* H5_HAVE_WIN_THREADS */ H5TS_cancel_t *cancel_counter; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; - cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); + cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); if (!cancel_counter) { /* * First time thread calls library - create new counter and associate * with key. - * + * * Don't use H5MM calls here since the destructor has to use HDfree in * order to avoid codestack calls. */ @@ -429,7 +429,7 @@ H5TS_cancel_count_inc(void) ++cancel_counter->cancel_count; - return ret_value; + return ret_value; #endif /* H5_HAVE_WIN_THREADS */ } @@ -459,19 +459,19 @@ H5TS_cancel_count_inc(void) herr_t H5TS_cancel_count_dec(void) { -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS /* unsupported; will just return 0 */ return SUCCEED; #else /* H5_HAVE_WIN_THREADS */ - register H5TS_cancel_t *cancel_counter; + register H5TS_cancel_t *cancel_counter; herr_t ret_value = SUCCEED; - cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); + cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); if (cancel_counter->cancel_count == 1) ret_value = pthread_setcancelstate(cancel_counter->previous_state, NULL); - --cancel_counter->cancel_count; + --cancel_counter->cancel_count; return ret_value; #endif /* H5_HAVE_WIN_THREADS */ @@ -491,7 +491,7 @@ H5TS_cancel_count_dec(void) * *-------------------------------------------------------------------------- */ -H5_DLL BOOL CALLBACK +H5_DLL BOOL CALLBACK H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) { BOOL ret_value = TRUE; @@ -653,7 +653,7 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) { H5TS_thread_t ret_value; -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS /* When calling C runtime functions, you should use _beginthread or * _beginthreadex instead of CreateThread. Threads created with diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 7d26af3..bb660c2 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -1084,7 +1084,7 @@ H5T_update_shared(H5T_t *dt) /*------------------------------------------------------------------------- * Function: H5T_construct_datatype * - * Purpose: Create a Library datatype with a connector specific datatype object + * Purpose: Create a Library datatype with a connector specific datatype object * * Return: Success: A type structure * Failure: NULL @@ -1156,7 +1156,7 @@ H5T_get_named_type(const H5T_t *dt) * Function: H5T_get_actual_type * * Purpose: Returns underlying native datatype created by native connector - * if datatype is committed, otherwise return the datatype + * if datatype is committed, otherwise return the datatype * object associate with the ID. * * Return: Success: Pointer to the VOL-managed data for this datatype diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 2b1283e..06eb44e 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -2157,7 +2157,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_COMPOUND != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") - if(H5T_COMPOUND != dst->shared->type) + if(H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") if(H5T_conv_struct_init(src, dst, cdata) < 0) @@ -2385,7 +2385,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_COMPOUND != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") - if(H5T_COMPOUND != dst->shared->type) + if(H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") /* Initialize data which is relatively constant */ @@ -2648,14 +2648,14 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * that array are the index numbers in the destination type or negative * if the entry is unused. * - * (This optimized algorithm doesn't work when the byte orders are different. + * (This optimized algorithm doesn't work when the byte orders are different. * The code such as "n = *((int*)(src->shared->u.enumer.value+i*src->shared->size));" * can change the value significantly. i.g. if the source value is big-endian 0x0000000f, * executing the casting on little-endian machine will get a big number 0x0f000000. - * Then it can't meet the condition + * Then it can't meet the condition * "if(src->shared->u.enumer.nmembs<2 || (double)length/src->shared->u.enumer.nmembs<1.2)" - * Because this is the optimized code, we won't fix it. It should still work in some - * situations. SLU - 2011/5/24) + * Because this is the optimized code, we won't fix it. It should still work in some + * situations. SLU - 2011/5/24) */ if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) { for(i = 0; i < src->shared->u.enumer.nmembs; i++) { @@ -2763,7 +2763,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_ENUM != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") - if(H5T_ENUM != dst->shared->type) + if(H5T_ENUM != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") if(H5T_conv_enum_init(src, dst, cdata) < 0) @@ -2790,7 +2790,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_ENUM != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") - if(H5T_ENUM != dst->shared->type) + if(H5T_ENUM != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") /* priv->src2dst map was computed for certain sort keys. Make sure those same @@ -2830,10 +2830,10 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Use O(1) lookup */ /* (The casting won't work when the byte orders are different. i.g. if the source value * is big-endian 0x0000000f, the direct casting "n = *((int*)s);" will make it a big - * number 0x0f000000 on little-endian machine. But we won't fix it because it's an + * number 0x0f000000 on little-endian machine. But we won't fix it because it's an * optimization code. Please also see the comment in the H5T_conv_enum_init() function. * SLU - 2011/5/24) - */ + */ if(1 == src->shared->size) n = *((signed char*)s); else if(sizeof(short) == src->shared->size) @@ -2912,9 +2912,9 @@ done: /*------------------------------------------------------------------------- * Function: H5T__conv_enum_numeric * - * Purpose: Converts enumerated data to a numeric type (integer or - * floating-point number). This function is registered into - * the conversion table twice in H5T_init_interface in H5T.c. + * Purpose: Converts enumerated data to a numeric type (integer or + * floating-point number). This function is registered into + * the conversion table twice in H5T_init_interface in H5T.c. * Once for enum-integer conversion. Once for enum-float conversion. * * Return: Success: Non-negative @@ -2966,7 +2966,7 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne if(NULL == (tpath = H5T_path_find(src_parent, dst))) { HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") } else if(!H5T_path_noop(tpath)) { - if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0) + if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") /* Convert the data */ @@ -3059,7 +3059,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_VLEN != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype") if(H5T_VLEN_STRING == src->shared->u.vlen.type && H5T_VLEN_STRING == dst->shared->u.vlen.type) { - if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset) + if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset) || (H5T_CSET_ASCII == dst->shared->u.vlen.cset && H5T_CSET_UTF8 == src->shared->u.vlen.cset)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") } /* end if */ @@ -4701,7 +4701,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad source character set") if(H5T_CSET_ASCII != dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 != dst->shared->u.atomic.u.s.cset) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad destination character set") - if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) + if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) || (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR || diff --git a/src/H5Torder.c b/src/H5Torder.c index 62662d6..b4babfa 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -86,7 +86,7 @@ static herr_t H5T_set_order(H5T_t *dtype, H5T_order_t order); * * Programmer: Robb Matzke * Wednesday, January 7, 1998 - * + * *------------------------------------------------------------------------- */ H5T_order_t @@ -159,7 +159,7 @@ H5T_get_order(const H5T_t *dtype) if(memb_order != H5T_ORDER_NONE && ret_value == H5T_ORDER_NONE) ret_value = memb_order; - /* If the orders are mixed, stop the loop and report it. + /* If the orders are mixed, stop the loop and report it. * (H5T_ORDER_NONE is ignored) */ if(memb_order != H5T_ORDER_NONE && ret_value != H5T_ORDER_NONE @@ -186,7 +186,7 @@ done: * 2. H5T_ORDER_NONE only works for reference and fixed-length * string. * 3. For opaque type, the order will be ignored. - * 4. For compound type, all restrictions above apply to the + * 4. For compound type, all restrictions above apply to the * members. * * Return: Non-negative on success/Negative on failure @@ -246,12 +246,12 @@ H5T_set_order(H5T_t *dtype, H5T_order_t order) if(H5T_ENUM == dtype->shared->type && dtype->shared->u.enumer.nmembs > 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after enum members are defined") - /* For derived data type, defer to parent */ + /* For derived data type, defer to parent */ while(dtype->shared->parent) dtype = dtype->shared->parent; /* Check for setting order on inappropriate datatype */ - if(order == H5T_ORDER_NONE && !(H5T_REFERENCE == dtype->shared->type || + if(order == H5T_ORDER_NONE && !(H5T_REFERENCE == dtype->shared->type || H5T_OPAQUE == dtype->shared->type || H5T_IS_FIXED_STRING(dtype->shared))) HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "illegal byte order for type") diff --git a/src/H5UC.c b/src/H5UC.c index 2277818..dd61539 100644 --- a/src/H5UC.c +++ b/src/H5UC.c @@ -16,7 +16,7 @@ * * These are used for various internal buffers which are shared. * - * The module used to be H5RC, but changed to H5UC because of + * The module used to be H5RC, but changed to H5UC because of * conflicting requirement for the use of H5RC. * */ diff --git a/src/H5UCprivate.h b/src/H5UCprivate.h index c451f31..e4916df 100644 --- a/src/H5UCprivate.h +++ b/src/H5UCprivate.h @@ -13,7 +13,7 @@ /* * This file contains private information about the H5UC module - * The module used to be H5RC, but changed to H5UC because of + * The module used to be H5RC, but changed to H5UC because of * conflicting requirement for the use of H5RC. */ diff --git a/src/H5VLnative_attr.c b/src/H5VLnative_attr.c index 8072cd5..1798a0e 100644 --- a/src/H5VLnative_attr.c +++ b/src/H5VLnative_attr.c @@ -49,7 +49,7 @@ H5VL__native_attr_create(void *obj, const H5VL_loc_params_t *loc_params, const c { H5G_loc_t loc; /* Object location */ H5G_loc_t obj_loc; /* Location used to open group */ - hbool_t loc_found = FALSE; + hbool_t loc_found = FALSE; H5T_t *type, *dt; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ H5A_t *attr = NULL; @@ -89,7 +89,7 @@ H5VL__native_attr_create(void *obj, const H5VL_loc_params_t *loc_params, const c done: /* Release resources */ if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't free location") + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't free location") FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_attr_create() */ @@ -106,7 +106,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const char *attr_name, +H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const char *attr_name, hid_t H5_ATTR_UNUSED aapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; /* Object location */ @@ -134,9 +134,9 @@ H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const cha else if(loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Aopen_by_idx */ /* Open the attribute in the object header */ - if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, - loc_params->loc_data.loc_by_idx.idx_type, - loc_params->loc_data.loc_by_idx.order, + if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, + loc_params->loc_data.loc_by_idx.idx_type, + loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open attribute") } /* end else-if */ @@ -279,15 +279,15 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, } else if(H5VL_OBJECT_BY_IDX == loc_params->type) { H5G_loc_t loc; - + /* check arguments */ if(H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Open the attribute on the object header */ - if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, - loc_params->loc_data.loc_by_idx.idx_type, - loc_params->loc_data.loc_by_idx.order, + if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, + loc_params->loc_data.loc_by_idx.idx_type, + loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") @@ -326,7 +326,7 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, else if(H5VL_OBJECT_BY_NAME == loc_params->type) { char *attr_name = HDva_arg(arguments, char *); H5G_loc_t loc; - + /* check arguments */ if(H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") @@ -345,15 +345,15 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, } else if(H5VL_OBJECT_BY_IDX == loc_params->type) { H5G_loc_t loc; - + /* check arguments */ if(H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Open the attribute on the object header */ - if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, - loc_params->loc_data.loc_by_idx.idx_type, - loc_params->loc_data.loc_by_idx.order, + if(NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, + loc_params->loc_data.loc_by_idx.idx_type, + loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") @@ -400,7 +400,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_t specific_type, +H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c index 8660e80..3f62e00 100644 --- a/src/H5VLnative_dataset.c +++ b/src/H5VLnative_dataset.c @@ -108,7 +108,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VL__native_dataset_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, +H5VL__native_dataset_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t dapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5D_t *dset = NULL; @@ -316,7 +316,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, +H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5D_t *dset = (H5D_t *)obj; @@ -328,7 +328,7 @@ H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, /* H5Dspecific_space */ case H5VL_DATASET_SET_EXTENT: { /* H5Dset_extent (H5Dextend - deprecated) */ - const hsize_t *size = HDva_arg(arguments, const hsize_t *); + const hsize_t *size = HDva_arg(arguments, const hsize_t *); if(H5D__set_extent(dset, size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extent of dataset") diff --git a/src/H5VLnative_datatype.c b/src/H5VLnative_datatype.c index 3c9463d..1e9d739 100644 --- a/src/H5VLnative_datatype.c +++ b/src/H5VLnative_datatype.c @@ -112,7 +112,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VL__native_datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, +H5VL__native_datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t H5_ATTR_UNUSED tapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5T_t *type = NULL; /* Datatype opened in file */ @@ -147,7 +147,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_datatype_get(void *obj, H5VL_datatype_get_t get_type, +H5VL__native_datatype_get(void *obj, H5VL_datatype_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5T_t *dt = (H5T_t *)obj; @@ -199,7 +199,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, +H5VL__native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5T_t *dt = (H5T_t *)obj; diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c index 1f213dd..5275898 100644 --- a/src/H5VLnative_file.c +++ b/src/H5VLnative_file.c @@ -44,7 +44,7 @@ *------------------------------------------------------------------------- */ void * -H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, +H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5F_t *new_file = NULL; @@ -60,7 +60,7 @@ H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t flags |= H5F_ACC_EXCL; /* default */ flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; - /* Create the file */ + /* Create the file */ if(NULL == (new_file = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file") new_file->id_exists = TRUE; @@ -68,7 +68,7 @@ H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t ret_value = (void *)new_file; done: - if(NULL == ret_value && new_file) + if(NULL == ret_value && new_file) if(H5F__close(new_file) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") @@ -95,7 +95,7 @@ H5VL__native_file_open(const char *name, unsigned flags, hid_t fapl_id, FUNC_ENTER_PACKAGE - /* Open the file */ + /* Open the file */ if(NULL == (new_file = H5F_open(name, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") new_file->id_exists = TRUE; @@ -561,7 +561,7 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, uint32_t cur_num_entries; /* Go get the size data */ - if(H5AC_get_cache_size(f->shared->cache, max_size_ptr, min_clean_size_ptr, + if(H5AC_get_cache_size(f->shared->cache, max_size_ptr, min_clean_size_ptr, cur_size_ptr, &cur_num_entries) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_size() failed.") diff --git a/src/H5VLnative_group.c b/src/H5VLnative_group.c index 236ee9d..cca5c55 100644 --- a/src/H5VLnative_group.c +++ b/src/H5VLnative_group.c @@ -65,7 +65,7 @@ H5VL__native_group_create(void *obj, const H5VL_loc_params_t *loc_params, const /* Create the new group & get its ID */ if(NULL == (grp = H5G__create(loc.oloc->file, &gcrt_info))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") } /* end if */ /* otherwise it's from H5Gcreate */ else { @@ -107,7 +107,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VL__native_group_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, +H5VL__native_group_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t H5_ATTR_UNUSED gapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; /* Location to open group */ @@ -216,7 +216,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_group_specific(void *obj, H5VL_group_specific_t specific_type, +H5VL__native_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_t *grp = (H5G_t *)obj; diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c index 051de19..ceb8d61 100644 --- a/src/H5VLnative_link.c +++ b/src/H5VLnative_link.c @@ -75,7 +75,7 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") /* Create the link */ - if((ret_value = H5L_create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, + if((ret_value = H5L_create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, link_loc_p, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") } /* end if */ @@ -136,7 +136,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, +H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj, const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) @@ -161,8 +161,8 @@ H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, dst_loc_p = src_loc_p; /* Copy the link */ - if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, - dst_loc_p, loc_params2->loc_data.loc_by_name.name, + if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, + dst_loc_p, loc_params2->loc_data.loc_by_name.name, TRUE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link") @@ -181,7 +181,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, +H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj, const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) @@ -206,8 +206,8 @@ H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, dst_loc_p = src_loc_p; /* Move the link */ - if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, - dst_loc_p, loc_params2->loc_data.loc_by_name.name, + if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, + dst_loc_p, loc_params2->loc_data.loc_by_name.name, FALSE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") @@ -226,7 +226,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type, +H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; @@ -289,7 +289,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ if(H5L_get_val_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, buf, size) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") } else HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") @@ -316,7 +316,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_t specific_type, +H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c index 3a29b6c..8f60ac4 100644 --- a/src/H5VLnative_object.c +++ b/src/H5VLnative_object.c @@ -41,7 +41,7 @@ *------------------------------------------------------------------------- */ void * -H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_type_t *opened_type, +H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_type_t *opened_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; @@ -104,15 +104,15 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name, - void *dst_obj, const H5VL_loc_params_t *loc_params2, const char *dst_name, +herr_t +H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name, + void *dst_obj, const H5VL_loc_params_t *loc_params2, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t src_loc; /* Source object group location */ H5G_loc_t dst_loc; /* Destination group location */ herr_t ret_value = FAIL; - + FUNC_ENTER_PACKAGE /* get location for objects */ @@ -123,7 +123,7 @@ H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, co /* Copy the object */ if((ret_value = H5O_copy(&src_loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object") + HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object") done: FUNC_LEAVE_NOAPI(ret_value) @@ -140,7 +140,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type, +H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ @@ -300,7 +300,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_t specific_type, +H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; @@ -579,7 +579,7 @@ H5VL__native_object_optional(void *obj, H5VL_object_optional_t optional_type, } default: - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't perform this operation on object"); + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't perform this operation on object"); } /* end switch */ done: diff --git a/src/H5VM.c b/src/H5VM.c index f78da96..d12bea6 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -1227,7 +1227,7 @@ H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, /* Defer to H5VM_chunk_index_scaled */ chunk_idx = H5VM_chunk_index_scaled(ndims, coord, chunk, down_nchunks, scaled_coord); - + FUNC_LEAVE_NOAPI(chunk_idx) } /* end H5VM_chunk_index() */ diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 34fdfec..6d7b87e 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -26,7 +26,7 @@ #ifdef H5_HAVE_FILTER_DEFLATE -#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) +#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER) # define H5_ZLIB_HEADER "zlib.h" #endif #if defined(H5_ZLIB_HEADER) diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 2f79725..8c0e876 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -751,7 +751,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, H5_CHECK_OVERFLOW(dtype_member_offset, size_t, unsigned); H5_CHECK_OVERFLOW(dtype_next_member_offset, size_t, unsigned); cd_values[(*cd_values_index)++] = (unsigned)dtype_next_member_offset - (unsigned)dtype_member_offset; - } + } break; case H5T_TIME: diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 6d07513..dfc984a 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -105,10 +105,10 @@ static void H5Z_XFORM_DEBUG(H5Z_node *tree); static void H5Z_print(H5Z_node *tree, FILE *stream); #endif /* H5Z_XFORM_DEBUG */ -/* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before +/* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before * doing the operation. So I break down the command into two lines: * *p = *p OP tree_val; p++; - * Actually, the behavior of *p++ = *p OP tree_val is undefined. (SLU - 2012/3/19) + * Actually, the behavior of *p++ = *p OP tree_val is undefined. (SLU - 2012/3/19) */ #define H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \ { \ @@ -328,9 +328,9 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); H5VM_array_fill(array, &val, sizeof(TYPE), (SIZE)); \ } -/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. - * The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, - * these two macros are called in different ways. (SLU 2012/3/20) +/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. + * The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, + * these two macros are called in different ways. (SLU 2012/3/20) */ #define H5Z_XFORM_DO_OP6(OP) \ { \ @@ -1229,15 +1229,15 @@ H5Z_xform_find_type(const H5T_t* type) HDassert(type); /* Check for SHORT type */ - if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) + if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_SHORT) /* Check for INT type */ - else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_INT) /* Check for LONG type */ - else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_LONG) /* Check for LONGLONG type */ @@ -1370,7 +1370,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_op_is_numbs - * Purpose: Internal function to facilitate the condition check in + * Purpose: Internal function to facilitate the condition check in * H5Z_xform_reduce_tree to reduce the bulkiness of the code. * Return: TRUE or FALSE * Programmer: Raymond Lu @@ -1397,7 +1397,7 @@ H5Z_op_is_numbs(H5Z_node* _tree) /*------------------------------------------------------------------------- * Function: H5Z_op_is_numbs2 - * Purpose: Internal function to facilitate the condition check in + * Purpose: Internal function to facilitate the condition check in * H5Z_xform_reduce_tree to reduce the bulkiness of the code. * The difference from H5Z_op_is_numbs is that the left child * can be empty, like -x or +x. diff --git a/src/H5mpi.c b/src/H5mpi.c index 4e1bc95..9c72fb0 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -124,7 +124,7 @@ H5_mpi_comm_dup(MPI_Comm comm, MPI_Comm *comm_new) */ if (MPI_SUCCESS != (mpi_code = MPI_Comm_set_errhandler(comm_dup, MPI_ERRORS_RETURN))) HMPI_GOTO_ERROR(FAIL, "MPI_Errhandler_set failed", mpi_code) - + } /* Copy the new communicator to the return argument */ @@ -138,7 +138,7 @@ done: } FUNC_LEAVE_NOAPI(ret_value) -} /* end H5_mpi_comm_dup() */ +} /* end H5_mpi_comm_dup() */ /*------------------------------------------------------------------------- @@ -191,7 +191,7 @@ done: } FUNC_LEAVE_NOAPI(ret_value) -} /* end H5_mpi_info_dup() */ +} /* end H5_mpi_info_dup() */ /*------------------------------------------------------------------------- diff --git a/src/H5public.h b/src/H5public.h index f592ab9..0fd9f3b 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -415,5 +415,5 @@ H5_DLL void *H5resize_memory(void *mem, size_t size); } #endif #endif /* _H5public_H */ - + diff --git a/src/H5system.c b/src/H5system.c index dd1f10d..ca0c6bf 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -422,7 +422,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) H5O_token_t token = HDva_arg(ap, H5O_token_t); /* Print the raw token. */ - n = fprintf(stream, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", + n = fprintf(stream, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", (unsigned char)token.__data[15], (unsigned char)token.__data[14], (unsigned char)token.__data[13], diff --git a/test/SWMR_UseCase_UG.txt b/test/SWMR_UseCase_UG.txt index e29944a..18d4927 100644 --- a/test/SWMR_UseCase_UG.txt +++ b/test/SWMR_UseCase_UG.txt @@ -11,7 +11,7 @@ %%%%Use Case 1.7%%%% - + 3. Use Case [1.7]: Appending a single chunk diff --git a/test/accum.c b/test/accum.c index f7d02fd..548a04d 100644 --- a/test/accum.c +++ b/test/accum.c @@ -77,12 +77,12 @@ void accum_printf(const H5F_t *f); /*------------------------------------------------------------------------- * Function: main - * + * * Purpose: Test the metadata accumulator code - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 7, 2010 * @@ -157,7 +157,7 @@ main(void) return 0; -error: +error: if(api_ctx_pushed) H5CX_pop(); HDputs("*** TESTS FAILED ***"); @@ -171,12 +171,12 @@ error: /*------------------------------------------------------------------------- * Function: test_write_read - * + * * Purpose: Simple test to write to then read from metadata accumulator. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 7, 2010 * @@ -222,17 +222,17 @@ error: HDfree(read_buf); return 1; -} /* test_write_read */ +} /* test_write_read */ /*------------------------------------------------------------------------- * Function: test_write_read_nonacc_front - * + * * Purpose: Simple test to write to then read from before metadata accumulator. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Allen Byrne * October 8, 2010 * @@ -281,17 +281,17 @@ error: HDfree(read_buf); return 1; -} /* test_write_read */ +} /* test_write_read */ /*------------------------------------------------------------------------- * Function: test_write_read_nonacc_end - * + * * Purpose: Simple test to write to then read from after metadata accumulator. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Allen Byrne * October 8, 2010 * @@ -340,17 +340,17 @@ error: HDfree(read_buf); return 1; -} /* test_write_read */ +} /* test_write_read */ /*------------------------------------------------------------------------- * Function: test_free * * Purpose: Simple test to free metadata accumulator. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Raymond Lu * October 8, 2010 * @@ -366,7 +366,7 @@ test_free(H5F_t *f) TESTING("simple freeing metadata accumulator"); - /* Write and free the whole accumulator. */ + /* Write and free the whole accumulator. */ wbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t)); HDassert(wbuf); rbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t)); @@ -388,12 +388,12 @@ test_free(H5F_t *f) /* Write second quarter of the accumulator */ if(accum_write(64 * sizeof(int32_t), 64 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; - /* Free the second quarter of the accumulator, the requested area + /* Free the second quarter of the accumulator, the requested area * is bigger than the data region on the right side. */ if(accum_free(f, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; - /* Write half of the accumulator. */ + /* Write half of the accumulator. */ if(accum_write(0, 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; /* Free the first block of 4B */ @@ -525,19 +525,19 @@ error: HDfree(expect); return 1; -} /* test_free */ +} /* test_free */ /*------------------------------------------------------------------------- * Function: test_accum_overlap - * + * * Purpose: This test will write a series of pieces of data * to the accumulator with the goal of overlapping * the writes in various different ways. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 7, 2010 * @@ -629,9 +629,9 @@ test_accum_overlap(H5F_t *f) if(accum_write(96, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; if(accum_read(96, 3 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0) TEST_ERROR; - + /* Set up expected data buffer and verify contents of - accumulator as constructed by cases 1-8, above */ + accumulator as constructed by cases 1-8, above */ for(i = 0; i < 5; i++) wbuf[i] = 4; for(i = 5; i < 6; i++) @@ -881,14 +881,14 @@ error: /*------------------------------------------------------------------------- * Function: test_accum_non_overlap_size - * + * * Purpose: This test will write a series of pieces of data * to the accumulator with the goal of not overlapping * the writes with a data size larger then the accum size. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Allen Byrne * October 8, 2010 * @@ -950,7 +950,7 @@ error: * * Purpose: This test will write a series of pieces of data * to the accumulator with the goal of overlapping - * the writes with a data size completely overlapping + * the writes with a data size completely overlapping * the accumulator at both ends. * * Return: Success: SUCCEED @@ -1015,25 +1015,25 @@ error: /*------------------------------------------------------------------------- * Function: test_accum_adjust - * + * * Purpose: This test examines the various ways the accumulator might * adjust itself as a result of data appending or prepending * to it. * - * This test program covers all the code in H5F_accum_adjust, + * This test program covers all the code in H5F_accum_adjust, * but NOT all possible paths through said code. It only covers * six potential paths through the function. (Again, though, each * piece of code within an if/else statement in H5F_accum_adjust is - * covered by one of the paths in this test function). Since there - * are a ridiculous number of total possible paths through this + * covered by one of the paths in this test function). Since there + * are a ridiculous number of total possible paths through this * function due to its large number of embedded if/else statements, - * that's certainly a lot of different test cases to write by hand. - * (Though if someone comes across this code and has some free + * that's certainly a lot of different test cases to write by hand. + * (Though if someone comes across this code and has some free * time, go for it). - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 11, 2010 * @@ -1068,7 +1068,7 @@ test_accum_adjust(H5F_t *f) * an increase in size because it's already at it's maximum size */ if(accum_write((1024 * 1024), (1024 * 1024) - 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Write a small (1KB) block that prepends to the front of the accumulator. */ + /* Write a small (1KB) block that prepends to the front of the accumulator. */ /* ==> Accumulator will need more buffer space */ /* ==> Accumulator will try to resize, but see that it's getting too big */ /* ==> Size of new block is less than half maximum size of accumulator */ @@ -1084,7 +1084,7 @@ test_accum_adjust(H5F_t *f) /* Read back and verify second write */ if(accum_read((1024 * 1024) - 1024, 1024, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; - + /* Reset accumulator for next case */ if(accum_reset(f) < 0) FAIL_STACK_ERROR; @@ -1144,7 +1144,7 @@ test_accum_adjust(H5F_t *f) to disk */ if(accum_write(0, 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read((1024 * 1024) - 1, 1024, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; @@ -1175,7 +1175,7 @@ test_accum_adjust(H5F_t *f) /* ==> Size of new block is less than than half maximum size of accumulator */ /* ==> New block being appended to accumulator */ /* ==> We can slide the dirty region down, to accomodate the request */ - /* ==> Max Buffer Size - (dirty offset + adjust size) >= 2 * size) */ + /* ==> Max Buffer Size - (dirty offset + adjust size) >= 2 * size) */ /* ==> Need to adjust location of accumulator while appending */ /* ==> Accumulator will need to be reallocated */ if(accum_write(1048571, 349523, wbuf) < 0) FAIL_STACK_ERROR; @@ -1184,7 +1184,7 @@ test_accum_adjust(H5F_t *f) to disk */ if(accum_write(1398900, 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; @@ -1213,7 +1213,7 @@ test_accum_adjust(H5F_t *f) /* ==> Size of new block is less than than half maximum size of accumulator */ /* ==> New block being appended to accumulator */ /* ==> We can slide the dirty region down, to accomodate the request */ - /* ==> Max Buffer Size - (dirty offset + adjust size) < 2 * size) */ + /* ==> Max Buffer Size - (dirty offset + adjust size) < 2 * size) */ /* ==> Need to adjust location of accumulator while appending */ if(accum_write((1024 * 1024) - 5, 10, wbuf) < 0) FAIL_STACK_ERROR; @@ -1221,7 +1221,7 @@ test_accum_adjust(H5F_t *f) to disk */ if(accum_write(0, 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read((1024 * 1024) - 5, 10, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)10) != 0) TEST_ERROR; @@ -1253,7 +1253,7 @@ test_accum_adjust(H5F_t *f) to disk */ if(accum_write(1398900, 1, wbuf) < 0) FAIL_STACK_ERROR; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; @@ -1279,23 +1279,23 @@ error: /*------------------------------------------------------------------------- * Function: test_read_after - * - * Purpose: This test will verify the case when metadata is read partly - * from the accumulator and partly from disk. The test will + * + * Purpose: This test will verify the case when metadata is read partly + * from the accumulator and partly from disk. The test will * write a block of data at address 512, force the data to be - * written to disk, write new data partially overlapping the - * original block from below, then read data at address 512. - * The data read should be partly new and partly original. - * + * written to disk, write new data partially overlapping the + * original block from below, then read data at address 512. + * The data read should be partly new and partly original. + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Larry Knox * October 8, 2010 * *------------------------------------------------------------------------- */ -unsigned +unsigned test_read_after(H5F_t *f) { int i = 0; @@ -1329,14 +1329,14 @@ test_read_after(H5F_t *f) of the original block */ if(accum_write(256, 512, wbuf) < 0) FAIL_STACK_ERROR; - /* Read 128 bytes at the original address, and then */ + /* Read 128 bytes at the original address, and then */ if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR; - /* Set the second half of wbuf back to 1s */ + /* Set the second half of wbuf back to 1s */ for(i = 64; i < s; i++) wbuf[i] = 1; - /* Read in the piece we wrote to disk above, and then verify that + /* Read in the piece we wrote to disk above, and then verify that the data is as expected */ if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)128) != 0) TEST_ERROR; @@ -1362,19 +1362,19 @@ error: /*------------------------------------------------------------------------- * Function: test_big - * + * * Purpose: This test exercises writing large pieces of metadata to the * file. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Quincey Koziol * October 12, 2010 * *------------------------------------------------------------------------- */ -unsigned +unsigned test_big(H5F_t *f) { uint8_t *wbuf, *wbuf2, *rbuf, *zbuf; /* Buffers for reading & writing, etc */ @@ -1670,19 +1670,19 @@ error: /*------------------------------------------------------------------------- * Function: test_random_write - * + * * Purpose: This test writes random pieces of data to the file and * then reads it all back. - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Quincey Koziol * October 11, 2010 * *------------------------------------------------------------------------- */ -unsigned +unsigned test_random_write(H5F_t *f) { uint8_t *wbuf, *rbuf; /* Buffers for reading & writing */ @@ -1808,23 +1808,23 @@ error: /*------------------------------------------------------------------------- * Function: test_swmr_write_big - * + * * Purpose: A SWMR test: verifies that writing "large" metadata to a file - * opened with SWMR_WRITE will flush the existing metadata in the + * opened with SWMR_WRITE will flush the existing metadata in the * accumulator to disk first before writing the "large" metadata - * to disk. + * to disk. * This test will fork and exec a reader "accum_swmr_reader" which * opens the same file with SWMR_READ and verifies that the correct * metadata is read from disk. - * + * * Return: Success: 0 * Failure: 1 - * + * * Programmer: Vailin Choi; April 2013 * *------------------------------------------------------------------------- */ -unsigned +unsigned test_swmr_write_big(hbool_t newest_format) { hid_t fid = -1; /* File ID */ @@ -1991,11 +1991,11 @@ test_swmr_write_big(hbool_t newest_format) FAIL_STACK_ERROR; /* Close and remove the file */ - if(H5Fclose(fid) < 0) + if(H5Fclose(fid) < 0) FAIL_STACK_ERROR; /* Close the property list */ - if(H5Pclose(fapl) < 0) + if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; /* Pop API context */ @@ -2034,12 +2034,12 @@ error: /*------------------------------------------------------------------------- * Function: accum_printf - * + * * Purpose: Debug function to print some stats about the accumulator - * + * * Return: Success: SUCCEED * Failure: FAIL - * + * * Programmer: Mike McGreevy * October 7, 2010 * diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index ac48a13..c3be09a 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -33,15 +33,15 @@ const char *FILENAME[] = { /*------------------------------------------------------------------------- * Function: main - * - * Purpose: This is the reader forked/execved by "test_swmr_write_big()" + * + * Purpose: This is the reader forked/execved by "test_swmr_write_big()" * test in accum.c. The reader reads at address 1024 from the file * and verifies that the metadata in the accumulator at address * 1024 does get written to disk. - * + * * Return: Success: EXIT_SUCCESS * Failure: EXIT_FAILURE - * + * * Programmer: Vailin Choi; June 2013 * *------------------------------------------------------------------------- @@ -85,7 +85,7 @@ main(void) api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ - if(NULL == (f = (H5F_t *)H5VL_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR /* Should read in [1024, 2024] with buf data */ @@ -93,7 +93,7 @@ main(void) FAIL_STACK_ERROR; /* Verify the data read is correct */ - if(HDmemcmp(buf, rbuf, (size_t)1024) != 0) + if(HDmemcmp(buf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* CLose the file */ diff --git a/test/big.c b/test/big.c index 481da58..a2f07af 100644 --- a/test/big.c +++ b/test/big.c @@ -69,7 +69,7 @@ # define GB8LL 0 /*cannot do the test*/ #endif -/* Define Small, Large, Extra Large, Huge File which +/* Define Small, Large, Extra Large, Huge File which * corrspond to less than 2GB, 2GB, 4GB, and tens of GB file size. * NO_FILE stands for "no file" to be tested. */ @@ -633,7 +633,7 @@ error: return 1; } /* end test_sec2() */ -static int +static int test_stdio(hid_t fapl) { char filename[1024]; diff --git a/test/cache_common.c b/test/cache_common.c index 038a0ed..1dc13a1 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -724,7 +724,7 @@ variable_get_final_load_size(const void *image, size_t image_len, */ static htri_t -verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, +verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { test_entry_t *entry; diff --git a/test/cross_read.c b/test/cross_read.c index 5444aae..c16ddbc 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -213,7 +213,7 @@ error: * Purpose: Handle each dataset from the data file. * * Return: Success: 0 - * Failure: Number of failures + * Failure: Number of failures * * Programmer: Raymond Lu * 21 January 2011 @@ -242,46 +242,46 @@ check_file(char *filename) TESTING("dataset of LE FLOAT with scale-offset filter"); nerrors += check_data_f(DATASETNAME2, fid); - + TESTING("dataset of BE FLOAT with scale-offset filter"); nerrors += check_data_f(DATASETNAME3, fid); TESTING("dataset of LE DOUBLE with scale-offset filter"); nerrors += check_data_f(DATASETNAME4, fid); - + TESTING("dataset of BE DOUBLE with scale-offset filter"); nerrors += check_data_f(DATASETNAME5, fid); - + TESTING("dataset of LE CHAR with scale-offset filter"); nerrors += check_data_i(DATASETNAME6, fid); - + TESTING("dataset of BE CHAR with scale-offset filter"); nerrors += check_data_i(DATASETNAME7, fid); - + TESTING("dataset of LE SHORT with scale-offset filter"); nerrors += check_data_i(DATASETNAME8, fid); - + TESTING("dataset of BE SHORT with scale-offset filter"); nerrors += check_data_i(DATASETNAME9, fid); TESTING("dataset of LE INT with scale-offset filter"); nerrors += check_data_i(DATASETNAME10, fid); - + TESTING("dataset of BE INT with scale-offset filter"); nerrors += check_data_i(DATASETNAME11, fid); TESTING("dataset of LE LONG LONG with scale-offset filter"); nerrors += check_data_i(DATASETNAME12, fid); - + TESTING("dataset of BE LONG LONG with scale-offset filter"); nerrors += check_data_i(DATASETNAME13, fid); TESTING("dataset of LE FLOAT with Fletcher32 filter"); nerrors += check_data_f(DATASETNAME14, fid); - + TESTING("dataset of BE FLOAT with Fletcher32 filter"); nerrors += check_data_f(DATASETNAME15, fid); - + TESTING("dataset of LE FLOAT with Deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE nerrors += check_data_f(DATASETNAME16, fid); diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c index ada7a6f..4c1efae 100644 --- a/test/del_many_dense_attrs.c +++ b/test/del_many_dense_attrs.c @@ -13,7 +13,7 @@ /* * Purpose: Test to verify that the infinite loop closing library/abort failure - * is fixed when the application creates and removes dense attributes + * is fixed when the application creates and removes dense attributes * (See HDFFV-10659). */ @@ -22,7 +22,7 @@ /* The test file name */ const char *FILENAME[] = { - "del_many_dense_attrs", + "del_many_dense_attrs", NULL }; @@ -49,7 +49,7 @@ static void catch_signal(int H5_ATTR_UNUSED signo) * Function: main * * Purpose: Test to verify that the infinite loop closing library/abort failure - * is fixed when the application creates and removes dense attributes + * is fixed when the application creates and removes dense attributes * (See HDFFV-10659). * * Return: Success: exit(EXIT_SUCCESS) @@ -137,7 +137,7 @@ main(void) if(H5Aclose(aid) < 0) TEST_ERROR } - + /* Close the datatype */ if(H5Tclose(tid) < 0) TEST_ERROR diff --git a/test/dsets.c b/test/dsets.c index 2201d89..34108d6 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5364,7 +5364,7 @@ test_types(hid_t file) (space=H5Screate_simple(1, &nelmts, NULL)) < 0 || (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - for(i=0; ishared->cache->index_len; + during = file_ptr->shared->cache->index_len; #ifdef EOC_MANUAL_INSPECTION HDprintf("\nCACHE AFTER DATA READ (WHILE OPEN):\n"); diff --git a/test/external.c b/test/external.c index 4d9fef0..d29fb6b 100644 --- a/test/external.c +++ b/test/external.c @@ -1418,7 +1418,7 @@ main(void) nerrors += test_path_absolute(current_fapl_id); nerrors += test_path_relative(current_fapl_id); nerrors += test_path_relative_cwd(current_fapl_id); - + /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(EXT_FNAME, current_fapl_id) < 0 ? 1 : 0); diff --git a/test/external_common.c b/test/external_common.c index c9b6584..a9e600b 100644 --- a/test/external_common.c +++ b/test/external_common.c @@ -65,7 +65,7 @@ reset_raw_data_files(hbool_t is_env) HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1); if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) goto error; - + /* Write garbage data to the file. This allows us to test the * the ability to set an offset in the raw data file. */ @@ -102,7 +102,7 @@ reset_raw_data_files(hbool_t is_env) HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1); if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) goto error; - + /* Write garbage data to the file. This allows us to test the * the ability to set an offset in the raw data file. */ diff --git a/test/farray.c b/test/farray.c index 355ecbb..b647b51 100644 --- a/test/farray.c +++ b/test/farray.c @@ -143,7 +143,7 @@ init_cparam(H5FA_create_t *cparam, farray_test_param_t *tparam) * Purpose: Create file and retrieve pointer to internal file object * * Return: SUCCEED/FAIL - * + * *------------------------------------------------------------------------- */ static herr_t @@ -262,7 +262,7 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state) *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *fid, H5F_t **f, hid_t fapl_id, +reopen_file(hid_t *fid, H5F_t **f, hid_t fapl_id, H5FA_t **fa, haddr_t fa_addr, const farray_test_param_t *tparam) { /* Check for closing & re-opening the array */ diff --git a/test/fheap.c b/test/fheap.c index 899c41f..b1a0db0 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -82,7 +82,7 @@ /* 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 +#define PAGE_BUFFER_PAGE_SIZE 4096 const char *FILENAME[] = { "fheap", @@ -7665,7 +7665,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ FAIL_STACK_ERROR /* - * Test incremental insert and removal + * Test incremental insert and removal */ TESTING("incremental object insertion and removal") @@ -7691,7 +7691,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ if(H5HF_insert(fh, (sizeof(obj1)), &obj1, heap_id[i]) < 0) FAIL_STACK_ERROR } /* end for */ - + /* Close the fractal heap */ if(H5HF_close(fh) < 0) TEST_ERROR @@ -16350,7 +16350,7 @@ main(void) 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 @@ -16400,12 +16400,12 @@ main(void) for(v = 0; v < num_pb_fs; v++) { /* Skip test when: a) multi/split drivers and - b) persisting free-space or using paged aggregation strategy + b) persisting free-space or using paged aggregation strategy because the library will fail file creation (temporary) for the above conditions */ if(!contig_addr_vfd && v) break; - if((fcpl = H5Pcopy(def_fcpl)) < 0) + if((fcpl = H5Pcopy(def_fcpl)) < 0) TEST_ERROR switch(v) { @@ -16419,14 +16419,14 @@ main(void) TEST_ERROR fapl = def_fapl; /* This is a fix for the daily test failure from the checkin for libver bounds. */ - /* + /* * Many tests failed the file size check when comparing (a) and (b) as below: * --Create a file and close the file. Got the initial file size (a). * --Reopen the file, perform fractal heap operations, and close the file. * Got the file size (b). * The cause for the file size differences: - * When the file is initially created with persisting free-space and with - * (earliest, latest) libver bounds, the file will have version 2 superblock + * When the file is initially created with persisting free-space and with + * (earliest, latest) libver bounds, the file will have version 2 superblock * due to non-default free-space handling. As the low bound is earliest, * the library uses version 1 object header when creating the superblock * extension message. @@ -16440,7 +16440,7 @@ main(void) * The fix: * Set libver bounds in fapl to (v18, latest) so that the file created in the * test routines will have low bound set to v18. This will cause the - * library to use version 2 object header for the superblock extension + * library to use version 2 object header for the superblock extension * message. */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) diff --git a/test/file_image.c b/test/file_image.c index dfb3ae8..0d4873a 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -88,16 +88,16 @@ test_properties(void) hid_t fapl_1 = -1; hid_t fapl_2 = -1; char *buffer = 0; - int count = 10; + int count = 10; void *temp = 0; char *temp2 = 0; - int i; + int i; size_t size; size_t temp_size; int retval = 1; TESTING("File image property list functions"); - + /* Initialize file image buffer * * Note: this image will not contain a valid HDF5 file, as it complicates testing @@ -122,7 +122,7 @@ test_properties(void) /* Set file image stuff */ if(H5Pset_file_image(fapl_1, (void *)buffer, size) < 0) FAIL_STACK_ERROR - + /* Get the same */ if(H5Pget_file_image(fapl_1, (void **)&temp, &temp_size) < 0) FAIL_STACK_ERROR @@ -137,9 +137,9 @@ test_properties(void) /* Get values from the new fapl */ if(H5Pget_file_image(fapl_2, (void **)&temp2, &temp_size) < 0) FAIL_STACK_ERROR - + /* Check that sizes are the same, and that the buffers are identical but separate */ - VERIFY(temp_size == size,"Sizes of buffers don't match"); + VERIFY(temp_size == size,"Sizes of buffers don't match"); VERIFY(temp2 != NULL,"Recieved buffer not set"); VERIFY(temp2 != buffer, "Retrieved buffer is the same as original"); VERIFY(temp2 != temp, "Retrieved buffer is the same as previously retrieved buffer"); @@ -334,7 +334,7 @@ reset_udata(udata_t *u) static int test_callbacks(void) { - H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, + H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; H5FD_file_image_callbacks_t null_callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL}; H5FD_file_image_callbacks_t callbacks; @@ -388,9 +388,9 @@ test_callbacks(void) /* Get file image callbacks */ callbacks = null_callbacks; if(H5Pget_file_image_callbacks(fapl_1, &callbacks) < 0) FAIL_STACK_ERROR - + /* Verify values */ - VERIFY(callbacks.image_malloc == &malloc_cb, "malloc callback was not set or retrieved properly"); + VERIFY(callbacks.image_malloc == &malloc_cb, "malloc callback was not set or retrieved properly"); VERIFY(callbacks.image_memcpy == &memcpy_cb, "memcpy callback was not set or retrieved properly"); VERIFY(callbacks.image_realloc == &realloc_cb, "realloc callback was not set or retrieved properly"); VERIFY(callbacks.image_free == &free_cb, "free callback was not set or retrieved properly"); @@ -398,7 +398,7 @@ test_callbacks(void) VERIFY(callbacks.udata_free == &udata_free_cb, "udata free callback was not set or retrieved properly"); VERIFY(callbacks.udata == udata, "udata was not set or retrieved properly"); - + /* * Check callbacks in internal function without a previously set file image */ @@ -406,7 +406,7 @@ test_callbacks(void) /* Copy fapl */ reset_udata(udata); if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR - + /* Verify that the property's copy callback used the correct image callbacks */ VERIFY(udata->used_callbacks == (UDATA_COPY), "Copying a fapl with no image used incorrect callbacks"); @@ -419,14 +419,14 @@ test_callbacks(void) /* Copy again */ if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR - + /* Remove property from fapl */ reset_udata(udata); if(H5Premove(fapl_2, H5F_ACS_FILE_IMAGE_INFO_NAME) < 0) FAIL_STACK_ERROR /* Verify that the property's delete callback was called using the correct image callbacks */ VERIFY(udata->used_callbacks == (UDATA_FREE), "Removing a property from a fapl with no image used incorrect callbacks"); - + /* Close it again */ if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR @@ -442,15 +442,15 @@ test_callbacks(void) if(H5Pset_file_image(fapl_1, (void *)file_image, size) < 0) FAIL_STACK_ERROR VERIFY(udata->used_callbacks == (MALLOC | MEMCPY), "Setting a file image (first time) used incorrect callbacks"); - + /* * Check callbacks in internal functions with a previously set file image */ - + /* Copy fapl */ reset_udata(udata); if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR - + /* Verify that the property's copy callback used the correct image callbacks */ VERIFY(udata->used_callbacks == (MALLOC | MEMCPY | UDATA_COPY), "Copying a fapl with an image used incorrect callbacks"); VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, "malloc callback has wrong source"); @@ -466,7 +466,7 @@ test_callbacks(void) /* Copy again */ if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR - + /* Remove property from fapl */ reset_udata(udata); if(H5Premove(fapl_2, H5F_ACS_FILE_IMAGE_INFO_NAME) < 0) FAIL_STACK_ERROR @@ -474,11 +474,11 @@ test_callbacks(void) /* Verify that the property's delete callback was called using the correct image callbacks */ VERIFY(udata->used_callbacks == (FREE | UDATA_FREE), "Removing a property from a fapl with an image used incorrect callbacks"); VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, "free callback has wrong source"); - + /* Close it again */ if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR - /* Get file image */ + /* Get file image */ reset_udata(udata); if(H5Pget_file_image(fapl_1, (void **)&temp_file_image, &temp_size) < 0) FAIL_STACK_ERROR @@ -538,11 +538,11 @@ test_core(void) int fd; h5_stat_t sb; herr_t ret; - H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, + H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; TESTING("Initial file image and callbacks in Core VFD"); - + /* Create fapl */ fapl = h5_fileaccess(); VERIFY(fapl >= 0, "fapl creation failed"); @@ -579,7 +579,7 @@ test_core(void) reset_udata(udata); file = H5Fopen(copied_filename, H5F_ACC_RDONLY, fapl); VERIFY(file >= 0, "H5Fopen failed"); - VERIFY((udata->used_callbacks == MALLOC) || + VERIFY((udata->used_callbacks == MALLOC) || (udata->used_callbacks == (MALLOC | UDATA_COPY | UDATA_FREE)), "opening a core file used the wrong callbacks"); VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_FILE_OPEN, "Malloc callback came from wrong sourc in core open"); @@ -599,24 +599,24 @@ test_core(void) dims[1] = DIM1; space = H5Screate_simple(RANK, dims, dims); VERIFY(space >= 0, "H5Screate failed"); - + /* Create new dset, invoking H5FD_core_write */ reset_udata(udata); dset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset >=0, "H5Dcreate failed"); - + /* Flush the write and check the realloc callback */ ret = H5Fflush(file, H5F_SCOPE_LOCAL); VERIFY(ret >= 0, "H5Fflush failed"); VERIFY(udata->used_callbacks == (REALLOC), "core write used the wrong callbacks"); VERIFY(udata->realloc_src == H5FD_FILE_IMAGE_OP_FILE_RESIZE, "Realloc callback came from wrong source in core write"); - + /* Close dset and space */ ret = H5Dclose(dset); VERIFY(ret >= 0, "H5Dclose failed"); ret = H5Sclose(space); VERIFY(ret >= 0, "H5Sclose failed"); - + /* Test file close */ reset_udata(udata); ret = H5Fclose(file); @@ -644,11 +644,11 @@ test_core(void) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Release resources */ - h5_clean_files(FILENAME, fapl); + h5_clean_files(FILENAME, fapl); HDfree(udata); HDfree(file_image); HDremove(copied_filename); - + PASSED(); return 0; @@ -718,7 +718,7 @@ test_get_file_image(const char * test_banner, if(driver == H5FD_FAMILY) is_family_file = TRUE; - + /* setup the file name */ h5_fixname(FILENAME2[file_name_num], fapl, file_name, sizeof(file_name)); VERIFY(HDstrlen(file_name)>0, "h5_fixname failed"); @@ -741,7 +741,7 @@ test_get_file_image(const char * test_banner, VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); @@ -750,7 +750,7 @@ test_get_file_image(const char * test_banner, data[i] = i; err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -768,7 +768,7 @@ test_get_file_image(const char * test_banner, VERIFY(bytes_read == image_size, "H5Fget_file_image(2) failed."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -860,8 +860,8 @@ test_get_file_image(const char * test_banner, file_size -= USERBLOCK_SIZE; } - /* with latest mods to truncate call in core file drive, - * file size should match image size + /* with latest mods to truncate call in core file drive, + * file size should match image size */ VERIFY(file_size == image_size, "file size != image size."); @@ -931,13 +931,13 @@ test_get_file_image(const char * test_banner, h5_clean_files(FILENAME2, fapl); /* discard the image buffer if it exists */ - if(image_ptr != NULL) + if(image_ptr != NULL) HDfree(image_ptr); /* discard the image buffer if it exists */ - if(file_image_ptr != NULL) + if(file_image_ptr != NULL) HDfree(file_image_ptr); - + PASSED(); return 0; @@ -986,10 +986,10 @@ test_get_file_image_error_rejection(void) TESTING("H5Fget_file_image() error rejection"); /************************ Sub-Test #1 ********************************/ - /* set up a test file, and try to get its image with a buffer that is + /* set up a test file, and try to get its image with a buffer that is * too small. Call to H5Fget_file_image() should fail. * - * Since we have already done the necessary setup, verify that + * Since we have already done the necessary setup, verify that * H5Fget_file_image() will fail with: * * bad file id, or @@ -1020,17 +1020,17 @@ test_get_file_image_error_rejection(void) VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); /* write some data to the data set */ for (i = 0; i < 100; i++) data[i] = i; - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -1066,7 +1066,7 @@ test_get_file_image_error_rejection(void) VERIFY(bytes_read < 0, "H5Fget_file_image(4 -- test 1) succeeded."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -1079,11 +1079,11 @@ test_get_file_image_error_rejection(void) h5_clean_files(FILENAME2, fapl_id); /* discard the image buffer if it exists */ - if(image_ptr != NULL) + if(image_ptr != NULL) HDfree(image_ptr); /************************** Test #2 **********************************/ - /* set up a multi file driver test file, and try to get its image + /* set up a multi file driver test file, and try to get its image * with H5Fget_file_image(). Attempt should fail. */ @@ -1130,7 +1130,7 @@ test_get_file_image_error_rejection(void) VERIFY(fapl_id >= 0, "H5Pcreate(2) failed"); /* setup the fapl for the multi file driver */ - err = H5Pset_fapl_multi(fapl_id, memb_map, memb_fapl, memb_name, + err = H5Pset_fapl_multi(fapl_id, memb_map, memb_fapl, memb_name, memb_addr, FALSE); VERIFY(err >= 0, "H5Pset_fapl_multi failed"); @@ -1149,17 +1149,17 @@ test_get_file_image_error_rejection(void) VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); /* write some data to the data set */ for (i = 0; i < 100; i++) data[i] = i; - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -1171,7 +1171,7 @@ test_get_file_image_error_rejection(void) VERIFY(image_size == -1, "H5Fget_file_image(5) succeeded."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -1184,11 +1184,11 @@ test_get_file_image_error_rejection(void) h5_clean_files(FILENAME2, fapl_id); /************************** Test #3 **********************************/ - /* set up a split file driver test file, and try to get its image + /* set up a split file driver test file, and try to get its image * with H5Fget_file_image(). Attempt should fail. */ - /* create fapl */ + /* create fapl */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); VERIFY(fapl_id >= 0, "H5Pcreate(3) failed"); @@ -1211,17 +1211,17 @@ test_get_file_image_error_rejection(void) VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); /* write some data to the data set */ for (i = 0; i < 100; i++) data[i] = i; - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -1233,7 +1233,7 @@ test_get_file_image_error_rejection(void) VERIFY(image_size == -1, "H5Fget_file_image(6) succeeded."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -1246,11 +1246,11 @@ test_get_file_image_error_rejection(void) h5_clean_files(FILENAME2, fapl_id); /************************** Test #4 **********************************/ - /* set up a family file driver test file, and try to get its image + /* set up a family file driver test file, and try to get its image * with H5Fget_file_image(). Attempt should fail. */ - /* create fapl */ + /* create fapl */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); VERIFY(fapl_id >= 0, "H5Pcreate(3) failed"); @@ -1271,17 +1271,17 @@ test_get_file_image_error_rejection(void) VERIFY(space_id >= 0, "H5Screate() failed"); /* Create a dataset */ - dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VERIFY(dset_id >=0, "H5Dcreate() failed"); /* write some data to the data set */ for (i = 0; i < 100; i++) data[i] = i; - err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); VERIFY(err >= 0, "H5Dwrite() failed."); - + /* Flush the file */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VERIFY(err >= 0, "H5Fflush failed"); @@ -1293,7 +1293,7 @@ test_get_file_image_error_rejection(void) VERIFY(image_size == -1, "H5Fget_file_image(7) succeeded."); /* Close dset and space */ - err = H5Dclose(dset_id); + err = H5Dclose(dset_id); VERIFY(err >= 0, "H5Dclose failed"); err = H5Sclose(space_id); VERIFY(err >= 0, "H5Sclose failed"); @@ -1304,7 +1304,7 @@ test_get_file_image_error_rejection(void) /* tidy up */ h5_clean_files(FILENAME2, fapl_id); - + PASSED(); return 0; @@ -1362,14 +1362,14 @@ main(void) } /* end for */ #if 0 - /* at present, H5Fget_file_image() rejects files opened with the + /* at present, H5Fget_file_image() rejects files opened with the * family file driver, due to the addition of a driver info message * in the super block. This message prevents the image being opened - * with any driver other than the family file driver, which sort of + * with any driver other than the family file driver, which sort of * defeats the purpose of the get file image operation. * * While this issues is quite fixable, we don't have time or resources - * for this right now. Once we do, the following code should be + * for this right now. Once we do, the following code should be * suitable for testing the fix. */ /* test H5Fget_file_image() with family file driver */ @@ -1386,10 +1386,10 @@ main(void) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - if(errors) { - HDprintf("***** %d File Image TEST%s FAILED! *****\n", - errors, errors > 1 ? "S" : ""); - return 1; + if(errors) { + HDprintf("***** %d File Image TEST%s FAILED! *****\n", + errors, errors > 1 ? "S" : ""); + return 1; } HDprintf("All File Image tests passed.\n"); diff --git a/test/filter_fail.c b/test/filter_fail.c index 4be2547..e5187be 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -50,8 +50,8 @@ const H5Z_class2_t H5Z_FAIL_TEST[1] = {{ /*------------------------------------------------------------------------- * Function: filter_fail * - * Purpose: For testing library's behavior when a mandatory filter - * fails to write a chunk. + * Purpose: For testing library's behavior when a mandatory filter + * fails to write a chunk. * * Return: Success: Data chunk size * Failure: 0 @@ -74,7 +74,7 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, ret_value = nbytes; } /* end if */ else { /* Write data */ - /* If it's the last chunk, pretend to fail. Otherwise, do nothing. */ + /* If it's the last chunk, pretend to fail. Otherwise, do nothing. */ if(*dst == 8 || *dst == 9) { ret_value = 0; } else { @@ -90,14 +90,14 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, /*------------------------------------------------------------------------- * Function: test_filter_write_failure * - * Purpose: Tests the library's behavior when a mandate filter returns + * Purpose: Tests the library's behavior when a mandate filter returns * failure. There're only 5 chunks with each of them having - * 2 integers. The filter will fail in the last chunk. The - * dataset should release all resources even though the last + * 2 integers. The filter will fail in the last chunk. The + * dataset should release all resources even though the last * chunk can't be flushed to file. The file should close * successfully. * - * Return: + * Return: * Success: 0 * Failure: -1 * @@ -107,7 +107,7 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, * Modifications: * Raymond Lu * 5 Oct 2010 - * Test when the chunk cache is enable and disabled to make + * Test when the chunk cache is enable and disabled to make * sure the library behaves properly. *------------------------------------------------------------------------- */ @@ -151,7 +151,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) TEST_ERROR /* create a dataset */ - if((dataset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR /* Initialize the write buffer */ for(i = 0; i < DIM; i++) @@ -160,7 +160,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) /* Write data. If the chunk cache is enabled, H5Dwrite should succeed. If it is * diabled, H5Dwrite should fail. */ if(cache_enabled) { - if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0) + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0) TEST_ERROR } else { /* Data writing should fail */ @@ -194,7 +194,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) TEST_ERROR } - /* Even though H5Dclose or H5Dwrite fails, it should release all resources. + /* Even though H5Dclose or H5Dwrite fails, it should release all resources. * So the file should close successfully. */ if(H5Fclose (file) < 0) TEST_ERROR @@ -215,11 +215,11 @@ error: /*------------------------------------------------------------------------- * Function: test_filter_read * - * Purpose: Tests the library's behavior when a mandate filter returns - * failure. The first 4 chunks should be in the file. The + * Purpose: Tests the library's behavior when a mandate filter returns + * failure. The first 4 chunks should be in the file. The * last chunk should not. * - * Return: + * Return: * Success: 0 * Failure: -1 * @@ -305,7 +305,7 @@ test_filter_read(char *file_name, hid_t my_fapl) if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR - /* Check that the values read are the same as the values written. + /* Check that the values read are the same as the values written. * The last chunk should not be in the file. */ for(i = 0; i < DIM; i+=2) { if(i < DIM-2 && rbuf[i] != i) { @@ -344,11 +344,11 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Tests the library's behavior when a mandate filter returns + * Purpose: Tests the library's behavior when a mandate filter returns * failure. * * Return: EXIT_SUCCESS/EXIT_FAILURE - * + * * Programmer: Raymond Lu * 25 August 2010 * diff --git a/test/filter_plugin1_dsets.c b/test/filter_plugin1_dsets.c index b74e086..a9a53ae 100644 --- a/test/filter_plugin1_dsets.c +++ b/test/filter_plugin1_dsets.c @@ -69,7 +69,7 @@ add_sub_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_value /* Check that permanent parameters are set correctly */ if (cd_values[0] > 9) return 0; - + value = (int)cd_values[0]; if (flags & H5Z_FLAG_REVERSE) { diff --git a/test/flush1.c b/test/flush1.c index ac5f9ef..04f24f7 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -99,7 +99,7 @@ create_file(const char *filename, hid_t fapl_id, hbool_t swmr) if(H5Gclose(top_gid) < 0) STACK_ERROR - + return fid; error: @@ -185,7 +185,7 @@ error: * a variety of situations. * * Part 1 of a two-part H5Fflush() test. - * + * * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke diff --git a/test/flush2.c b/test/flush2.c index a6acb41..5fc716b 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -354,7 +354,7 @@ main(void) /* TEST 6 */ /* Check the case where the file was flushed, but more data was - * added afterward and then flushed (w/SWMR) + * added afterward and then flushed (w/SWMR) */ TESTING("H5Fflush (part2 with flush and later addition and another flush + SWMR)"); if(vfd_supports_swmr) { diff --git a/test/flushrefresh.c b/test/flushrefresh.c index 20a4ba4..2db1d6b 100644 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -15,10 +15,10 @@ * Programmer: Mike McGreevy * June 30, 2010 * - * Purpose: This test file contains routines used to test flushing and - * refreshing individual objects' metadata from the cache. - * - * Note: This file should NOT be run manually. Instead, invoke it + * Purpose: This test file contains routines used to test flushing and + * refreshing individual objects' metadata from the cache. + * + * Note: This file should NOT be run manually. Instead, invoke it * via its associated test script, testflushrefresh.sh * */ @@ -119,12 +119,12 @@ herr_t end_verification(void); * Function: main * * Purpose: This function coordinates the test of flush/refresh - * functionality verification. It accepts either one, two or + * functionality verification. It accepts either one, two or * no command line parameters. The main test routine runs * with no command line parameters specified, while verification * routines run with one or two command line parameters. - * - * Note: This program should not be run manually, as the + * + * Note: This program should not be run manually, as the * test is controlled by the testflushrefresh.sh script. Running * the flushrefresh program manually will result in failure, as * it will time out waiting for a signal from the test script @@ -137,7 +137,7 @@ herr_t end_verification(void); * *------------------------------------------------------------------------- */ -int main(int argc, const char *argv[]) +int main(int argc, const char *argv[]) { /* Variables */ const char *envval = NULL; @@ -148,8 +148,8 @@ int main(int argc, const char *argv[]) /* Parse command line options */ if(argc == 1) { - /* No arguments supplied. Run main test routines if - * using sec2 or stdio driver, otherwise don't run + /* No arguments supplied. Run main test routines if + * using sec2 or stdio driver, otherwise don't run * anything. */ /* Determine driver being used */ @@ -161,7 +161,7 @@ int main(int argc, const char *argv[]) } /* end if */ else { HDfprintf(stdout, "Skipping all flush/refresh tests (only run with SWMR-enabled file drivers).\n"); - + /* Test script is expecting some signals, so send them out to end it. */ if(end_verification() < 0) TEST_ERROR; if(end_verification() < 0) TEST_ERROR; @@ -202,29 +202,29 @@ error: * *------------------------------------------------------------------------- */ -herr_t test_flush(void) +herr_t test_flush(void) { /************************************************************************** * * Test Description: * - * This test will build an HDF5 file with several objects in a varying + * This test will build an HDF5 file with several objects in a varying * hierarchical layout. It will then attempt to flush the objects * in the file one by one, individually, using the four H5*flush - * routines (D,G,T, and O). After each call to either create or flush an + * routines (D,G,T, and O). After each call to either create or flush an * object, a series of verifications will occur on each object in the file. * * Each verification consists of spawning off a new process and determining - * if the object can be opened and its information retreived in said - * alternate process. It reports the results, which are compared to an + * if the object can be opened and its information retreived in said + * alternate process. It reports the results, which are compared to an * expected value (either that the object can be found on disk, or that it * cannot). * * Note that to spawn a verification, this program sends a signal (by creating - * a file on disk) to the test script controlling it, indicating how to + * a file on disk) to the test script controlling it, indicating how to * run the verification. - * - * Implementation is funky, but basically, an example: + * + * Implementation is funky, but basically, an example: * * Step 1. Dataset is created. * Step 2. Verify that dataset can't be opened by separate process, as @@ -233,14 +233,14 @@ herr_t test_flush(void) * Step 4. Verify that group can't be opened by separate process. * Step 5. H5Gflush is called on the group. * Step 6. Verify that group CAN be opened, but dataset still has - * yet to hit disk, and CANNOT be opened. Success! Only the group + * yet to hit disk, and CANNOT be opened. Success! Only the group * was flushed. * **************************************************************************/ /************************************************************************** * Generated Test File will look like this: - * + * * GROUP "/" * DATASET "Dataset1" * GROUP "Group1" { @@ -265,14 +265,14 @@ herr_t test_flush(void) /* Cleanup any old error or signal files */ CLEANUP_FILES; - + /* ================ */ /* CREATE TEST FILE */ /* ================ */ /* Create file, open root group - have to use latest file format for SWMR */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR; + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR; if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; if((rid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) TEST_ERROR; @@ -341,7 +341,7 @@ herr_t test_flush(void) if(run_flush_verification_process(T2, NOT_FLUSHED) != 0) TEST_ERROR; if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR; - /* Flush Group1 and Verify it is recently flushed, and nothing + /* Flush Group1 and Verify it is recently flushed, and nothing * else has changed. */ if((status = H5Gflush(gid)) < 0) TEST_ERROR; if(run_flush_verification_process(RG, FLUSHED) != 0) TEST_ERROR; @@ -355,7 +355,7 @@ herr_t test_flush(void) if(run_flush_verification_process(T2, NOT_FLUSHED) != 0) TEST_ERROR; if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR; - /* Flush Group2 and Verify it is recently flushed, and nothing + /* Flush Group2 and Verify it is recently flushed, and nothing * else has changed. */ if((status = H5Gflush(gid2)) < 0) TEST_ERROR; if(run_flush_verification_process(RG, FLUSHED) != 0) TEST_ERROR; @@ -440,7 +440,7 @@ herr_t test_flush(void) if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR; PASSED(); - + /* ============= */ /* FLUSH OBJECTS */ /* ============= */ @@ -490,7 +490,7 @@ herr_t test_flush(void) PASSED(); /* ================== */ - /* Cleanup and Return */ + /* Cleanup and Return */ /* ================== */ if(H5Pclose(fapl) < 0) TEST_ERROR; if(H5Gclose(gid) < 0) TEST_ERROR; @@ -515,7 +515,7 @@ error: /*------------------------------------------------------------------------- * Function: test_refresh * - * Purpose: This function tests refresh (evict/reload) of individual + * Purpose: This function tests refresh (evict/reload) of individual * objects' metadata from the metadata cache. * * Return: 0 on Success, 1 on Failure @@ -525,27 +525,27 @@ error: * *------------------------------------------------------------------------- */ -herr_t test_refresh(void) +herr_t test_refresh(void) { /************************************************************************** * * Test Description: * - * This test will build an HDF5 file with several objects in a varying + * This test will build an HDF5 file with several objects in a varying * hierarchical layout. It will then flush the entire file to disk. Then, * an attribute will be added to each object in the file. - * + * * One by one, this process will flush each object to disk, individually. * It will also be coordinating with another process, which will open * the object before it is flushed by this process, and then refresh the * object after it's been flushed, comparing the before and after object * information to ensure that they are as expected. (i.e., most notably, - * that an attribute has been added, and is only visible after a + * that an attribute has been added, and is only visible after a * successful call to a H5*refresh function). - * - * As with the flush case, the implemention is a bit tricky as it's + * + * As with the flush case, the implemention is a bit tricky as it's * dealing with signals going back and forth between the two processes - * to ensure the timing is correct, but basically, an example: + * to ensure the timing is correct, but basically, an example: * * Step 1. Dataset is created. * Step 2. Dataset is flushed. @@ -555,7 +555,7 @@ herr_t test_refresh(void) * Step 5. This process flushes the dataset again (with Attribute attached). * Step 6. The other process calls H5Drefresh, which should evict/reload * the object's metadata, and thus pick up the attribute that's - * attached to it. Most other before/after object information is + * attached to it. Most other before/after object information is * compared for sanity as well. * Step 7. Rinse and Repeat for each object in the file. * @@ -563,7 +563,7 @@ herr_t test_refresh(void) /************************************************************************** * Generated Test File will look like this: - * + * * GROUP "/" * DATASET "Dataset1" * GROUP "Group1" { @@ -755,7 +755,7 @@ herr_t test_refresh(void) PASSED(); /* ================== */ - /* Cleanup and Return */ + /* Cleanup and Return */ /* ================== */ /* Close Stuff */ @@ -791,8 +791,8 @@ error: * * Purpose: This function is used to communicate with the test script * in order to spawn off a process to verify that a flush - * of an individual object was successful. - * + * of an individual object was successful. + * * Return: 0 on Success, 1 on Failure * * Programmer: Mike McGreevy @@ -800,7 +800,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t run_flush_verification_process(const char * obj_pathname, const char * expected) +herr_t run_flush_verification_process(const char * obj_pathname, const char * expected) { HDremove(SIGNAL_FROM_SCRIPT); @@ -825,10 +825,10 @@ error: * Function: flush_verification * * Purpose: This function tries to open target object in the test file. - * It compares the success of the open function to the expected + * It compares the success of the open function to the expected * value, and succeeds if they are equal and fails if they differ. * - * Note that full path to the object must be provided as the + * Note that full path to the object must be provided as the * obj_pathname argument. * * Return: 0 on Success, 1 on Failure @@ -838,7 +838,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t flush_verification(const char * obj_pathname, const char * expected) +herr_t flush_verification(const char * obj_pathname, const char * expected) { /* Variables */ hid_t oid = -1, fid = -1; @@ -887,7 +887,7 @@ error: * Purpose: This function is used to communicate with the test script * in order to spawn off a process which will test the * H5*refresh routine. - * + * * Return: 0 on Success, 1 on Failure * * Programmer: Mike McGreevy @@ -895,14 +895,14 @@ error: * *------------------------------------------------------------------------- */ -herr_t start_refresh_verification_process(const char * obj_pathname) +herr_t start_refresh_verification_process(const char * obj_pathname) { HDremove(SIGNAL_BETWEEN_PROCESSES_1); - /* Send Signal to SCRIPT indicating that it should kick off a refresh + /* Send Signal to SCRIPT indicating that it should kick off a refresh verification process */ h5_send_message(SIGNAL_TO_SCRIPT, obj_pathname, NULL); - + /* Wait for Signal from VERIFICATION PROCESS indicating that it's opened the target object and ready for MAIN PROCESS to modify it */ if(h5_wait_message(SIGNAL_BETWEEN_PROCESSES_1) < 0) TEST_ERROR; @@ -922,10 +922,10 @@ error: * Function: end_refresh_verification_process * * Purpose: This function is used to communicate with the verification - * process spawned by the start_refresh_verification_process + * process spawned by the start_refresh_verification_process * function. It gives it the go-ahead to call H5*refresh * on an object and conlcude the refresh verification. - * + * * Return: 0 on Success, 1 on Failure * * Programmer: Mike McGreevy @@ -933,8 +933,8 @@ error: * *------------------------------------------------------------------------- */ -herr_t end_refresh_verification_process(void) -{ +herr_t end_refresh_verification_process(void) +{ HDremove(SIGNAL_FROM_SCRIPT); /* Send Signal to REFRESH VERIFICATION PROCESS indicating that the object @@ -974,7 +974,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t refresh_verification(const char * obj_pathname) +herr_t refresh_verification(const char * obj_pathname) { /* Variables */ hid_t oid,fid,status = 0; @@ -985,7 +985,7 @@ herr_t refresh_verification(const char * obj_pathname) int tries = 800, sleep_tries = 400; int token_cmp; hbool_t ok = FALSE; - + HDremove(SIGNAL_BETWEEN_PROCESSES_2); /* Open Object */ @@ -1002,16 +1002,16 @@ herr_t refresh_verification(const char * obj_pathname) if(flushed_oinfo.num_attrs != 0) PROCESS_ERROR; - /* Send Signal to MAIN PROCESS indicating that it can go ahead and modify the + /* Send Signal to MAIN PROCESS indicating that it can go ahead and modify the object. */ h5_send_message(SIGNAL_BETWEEN_PROCESSES_1, obj_pathname, NULL); - /* Wait for Signal from MAIN PROCESS indicating that it's modified the + /* Wait for Signal from MAIN PROCESS indicating that it's modified the object and we can run verification now. */ if(h5_wait_message(SIGNAL_BETWEEN_PROCESSES_2) < 0) PROCESS_ERROR; - /* Get object info again. This will NOT reflect what's on disk, only what's - in the cache. Thus, all values will be unchanged from above, despite + /* Get object info again. This will NOT reflect what's on disk, only what's + in the cache. Thus, all values will be unchanged from above, despite newer information being on disk. */ if((status = H5Oget_info3(oid, &refreshed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS)) < 0) PROCESS_ERROR; if((status = H5Oget_native_info(oid, &refreshed_ninfo, H5O_NATIVE_INFO_HDR)) < 0) PROCESS_ERROR; @@ -1105,7 +1105,7 @@ error: * processes to see if they've succeeded. It checks for the * existance of flushrefresh_ERROR file. If present, that indicates * an external verification process has failed, and this function - * thus fails as well. If not present, then nothing else has + * thus fails as well. If not present, then nothing else has * failed, and this function succeeds. * * Return: 0 on Success, 1 on Failure @@ -1115,7 +1115,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t check_for_errors(void) +herr_t check_for_errors(void) { FILE * file; @@ -1131,24 +1131,24 @@ herr_t check_for_errors(void) /*------------------------------------------------------------------------- * Function: end_verification - * - * Purpose: Tells test script that verification routines are completed and - * that the test can wrap up. + * + * Purpose: Tells test script that verification routines are completed and + * that the test can wrap up. * * Return: void * * Programmer: Mike McGreevy * July 16, 2010 - * + * *------------------------------------------------------------------------- */ -herr_t end_verification(void) +herr_t end_verification(void) { HDremove(SIGNAL_FROM_SCRIPT); /* Send Signal to SCRIPT to indicate that we're done with verification. */ h5_send_message(SIGNAL_TO_SCRIPT, "VERIFICATION_DONE", "VERIFICATION_DONE"); - + /* Wait for Signal from SCRIPT indicating that we can continue. */ if(h5_wait_message(SIGNAL_FROM_SCRIPT) < 0) TEST_ERROR; diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c index c52eb95..292659c 100644 --- a/test/gen_bad_compound.c +++ b/test/gen_bad_compound.c @@ -61,7 +61,7 @@ int main() aid = H5Acreate(gid, "attr", cmpd_dt, sid, H5P_DEFAULT); assert(aid > 0); - /* Commit the datatype */ + /* Commit the datatype */ ret = H5Tcommit(file, "cmpnd", cmpd_dt); assert(ret >= 0); diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c index 82e94cd..b485e36 100644 --- a/test/gen_bad_offset.c +++ b/test/gen_bad_offset.c @@ -28,8 +28,8 @@ /*------------------------------------------------------------------------- * Function: main * - * Generate an HDF5 file with groups, datasets and symbolic links. - * After the file is generated, write bad offset values to + * Generate an HDF5 file with groups, datasets and symbolic links. + * After the file is generated, write bad offset values to * the heap at 3 locations in the file: * (A) Open the file: * fd = HDopen(TESTFILE, O_RDWR, 0663); @@ -37,7 +37,7 @@ * (1) HDlseek(fd, (HDoff_t)880, SEEK_SET); * "/group1/group2": replace heap offset "8" by bad offset * (2) HDlseek(fd, (HDoff_t)1512, SEEK_SET); - * "/dsetA": replace name offset into private heap "72" by bad offset + * "/dsetA": replace name offset into private heap "72" by bad offset * (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET); * /soft_one: replace link value offset in the scratch pad "32" by bad offset * (C) Write the bad offset value to the file for (1), (2) and (3): @@ -98,7 +98,7 @@ main(void) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR - /* + /* * Write bad offset values at 3 locations in the file */ diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 237b024..1ab18a4 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -37,12 +37,12 @@ #ifdef H5O_ENABLE_BOGUS /* - * Create datasets in the location (in "/" or "/group") with + * Create datasets in the location (in "/" or "/group") with * message id: (a) H5O_BOGUS_VALID_ID or (b)H5O_BOGUS_INVALID_ID * and various unknown message flags */ static int -generate_datasets(hid_t loc_id, unsigned bogus_id) +generate_datasets(hid_t loc_id, unsigned bogus_id) { hid_t sid = -1; /* Dataspace ID */ hid_t dcpl = -1; /* Dataset creation property list ID */ diff --git a/test/gen_bounds.c b/test/gen_bounds.c index fe05a1e..2f696e6 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -27,8 +27,8 @@ * that they can or cannot read particular file format. */ -/* - * Add two routines gen_ref_files() and gen_sel_files() to generate the +/* + * Add two routines gen_ref_files() and gen_sel_files() to generate the * following test files: * * (1) gen_ref_files(): @@ -42,7 +42,7 @@ * bounds_sel_v112_v112.h5 * bounds_sel_v110_v110.h5 * - * These test files will be copied to 1.12, 1.10 and 1.8 libraries for + * These test files will be copied to 1.12, 1.10 and 1.8 libraries for * compatibility testing. */ #include "h5test.h" @@ -649,25 +649,25 @@ error: /*********************************************************************** * gen_sel_files() is used to create the following test files: - * bounds_sel_earliest_latest.h5 - * bounds_sel_latest_latest.h5 - * bounds_sel_v112_v112.h5 - * bounds_sel_v110_v110.h5 + * bounds_sel_earliest_latest.h5 + * bounds_sel_latest_latest.h5 + * bounds_sel_v112_v112.h5 + * bounds_sel_v110_v110.h5 * * File contents for: * --bounds_sel_earliest_latest.h5 * --bounds_sel_latest_latest.h5 * --bounds_sel_v112_v112.h5 - * --each file contains 3 datasets with old region reference type - * (1) Sel_ex32_reg_dset: + * --each file contains 3 datasets with old region reference type + * (1) Sel_ex32_reg_dset: * --regular hyperslab selection exceeding 32 bits integer limit * (2) Sel_ex32_irr_dset: * --irregular hyperslab selection exceeding 32 bits integer limit - * (3) Sel_ex32_pt_dset: + * (3) Sel_ex32_pt_dset: * --point selection exceeding 32 bits integer limit * * File contents for: - * --bounds_ref_v110_v110.h5 + * --bounds_ref_v110_v110.h5 * (1) Sel_ex32_reg_dset: a dataset with old region reference type * --regular hyperslab selection exceeding 32 bits integer limit * (2) Sel_ex32_irr_dset: does not exist, cannot be created @@ -696,7 +696,7 @@ static herr_t gen_sel_files(const char *filename, H5F_libver_t low_bound, H5F_l hdset_reg_ref_t ref_wbuf[1]; /* Buffer for dataset region reference */ /* - * Create test file, attribute, group and dataset + * Create test file, attribute, group and dataset */ /* Create the test file */ @@ -720,7 +720,7 @@ static herr_t gen_sel_files(const char *filename, H5F_libver_t low_bound, H5F_l TEST_ERROR; /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; /* Set to use the low/high bounds in fapl */ @@ -770,7 +770,7 @@ static herr_t gen_sel_files(const char *filename, H5F_libver_t low_bound, H5F_l if(H5Dclose(ref_did) < 0) TEST_ERROR; - } + } /* Generate irregular hyperslab exceeding 32 */ ref_start = 8; @@ -825,7 +825,7 @@ static herr_t gen_sel_files(const char *filename, H5F_libver_t low_bound, H5F_l if(H5Dclose(ref_did) < 0) TEST_ERROR; - } + } /* Closing */ if(H5Sclose(ref_sid) < 0) @@ -858,30 +858,30 @@ error: /*********************************************************************** * gen_ref_files() is used to create the following test files: - * bounds_ref_earliest_latest.h5 - * bounds_ref_latest_latest.h5 - * bounds_ref_v110_v110.h5 - * bounds_ref_v18_v18.h5 + * bounds_ref_earliest_latest.h5 + * bounds_ref_latest_latest.h5 + * bounds_ref_v110_v110.h5 + * bounds_ref_v18_v18.h5 * * File contents for: * --bounds_ref_earliest_latest.h5 * --bounds_ref_latest_latest.h5 * --bounds_ref_v112_v112.h5 * (1) Revised_refs_dset: a dataset created with the revised reference type - * --attribute reference + * --attribute reference * --object reference * --dataset region reference - * (2) Old_ref_object_dset: + * (2) Old_ref_object_dset: * --a dataset created with the old object reference type - * (3) Old_ref_region_dset: + * (3) Old_ref_region_dset: * --a dataset created with the old dataset region reference type * * File contents for: - * --bounds_ref_v110_v110.h5 - * --bounds_ref_v18_v18.h5 - * (1) Old_ref_object_dset: + * --bounds_ref_v110_v110.h5 + * --bounds_ref_v18_v18.h5 + * (1) Old_ref_object_dset: * --a dataset created with the old object reference type - * (2) Old_ref_region_dset: + * (2) Old_ref_region_dset: * --a dataset created with the old dataset region reference type * * Return: SUCCEED/FAIL @@ -912,7 +912,7 @@ static herr_t gen_ref_files(const char *filename, H5F_libver_t low_bound, H5F_l unsigned i; /* Local index variable */ /* - * Create test file, attribute, group and dataset + * Create test file, attribute, group and dataset */ if((dwbuf = HDcalloc(sizeof(unsigned), 100)) == NULL) @@ -968,7 +968,7 @@ static herr_t gen_ref_files(const char *filename, H5F_libver_t low_bound, H5F_l HDfree(dwbuf); dwbuf = NULL; } - + /* Create file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; @@ -980,7 +980,7 @@ static herr_t gen_ref_files(const char *filename, H5F_libver_t low_bound, H5F_l if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) <0) TEST_ERROR; - /* + /* * Create the revised and old references in the file */ @@ -1080,7 +1080,7 @@ static herr_t gen_ref_files(const char *filename, H5F_libver_t low_bound, H5F_l TEST_ERROR; if(H5Sclose(sid) < 0) TEST_ERROR; - if(H5Pclose(fapl) < 0) + if(H5Pclose(fapl) < 0) TEST_ERROR; if(H5Fclose(fid) < 0) TEST_ERROR; @@ -1120,7 +1120,7 @@ int main(void) if (gen_v18_v18() < 0) TEST_ERROR; - /* + /* * Files generated via gen_ref_files() */ @@ -1144,7 +1144,7 @@ int main(void) if(gen_ref_files(FILENAME_REF_V18_V18, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0) TEST_ERROR; - /* + /* * Files generated via gen_sel_files() */ diff --git a/test/gen_filespace.c b/test/gen_filespace.c index f4a4f3f..bf49b7b 100644 --- a/test/gen_filespace.c +++ b/test/gen_filespace.c @@ -40,7 +40,7 @@ const char *FILENAMES[] = { * Move these files to 1.8 branch for compatibility testing: * test_filespace_compatible() in test/tfile.c will use these files. * - * Copy these files from the 1.8 branch back to the trunk for + * Copy these files from the 1.8 branch back to the trunk for * compatibility testing via test_filespace_round_compatible() in test/tfile.c. * */ diff --git a/test/gen_filters.c b/test/gen_filters.c index fa66078..9764830 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -29,9 +29,9 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, * Function: create_file_with_bogus_filter * * Purpose: Create a dataset with the fletcher filter. - * This function is used to create the test file `test_filters.h5' - * which has a dataset with the "fletcher" I/O filter. This dataset - * will be used to verify the correct behavior of the library in + * This function is used to create the test file `test_filters.h5' + * which has a dataset with the "fletcher" I/O filter. This dataset + * will be used to verify the correct behavior of the library in * the test "dsets" * * Return: Success: 0 @@ -168,7 +168,7 @@ create_file_with_bogus_filter(void) /* create dcpl */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - /* create chunking */ + /* create chunking */ if(H5Pset_chunk(dcpl, rank, chunk_dims) < 0) goto error; /* register bogus filter */ diff --git a/test/gen_plist.c b/test/gen_plist.c index 8fc8a05..b6f5597 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -37,7 +37,7 @@ main(void) hid_t acpl1; /* attribute create prop. list */ herr_t ret = 0; - hsize_t chunk_size = 16384; /* chunk size */ + hsize_t chunk_size = 16384; /* chunk size */ int fill = 2; /* Fill value */ hsize_t max_size[1]; /* data space maximum size */ size_t nslots = 521 * 2; @@ -129,22 +129,22 @@ main(void) assert(ret > 0); max_size[0] = 100; - if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0, + if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) assert(ret > 0); - if((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0, + if((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) assert(ret > 0); - if((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0, + if((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) assert(ret > 0); - if((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0, + if((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4))) < 0) assert(ret > 0); if((ret = encode_plist(dcpl1, little_endian, word_length, "testfiles/plist_files/dcpl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(dcpl1)) < 0) assert(ret > 0); @@ -156,13 +156,13 @@ main(void) if((ret = encode_plist(dapl1, little_endian, word_length, "testfiles/plist_files/def_dapl_")) < 0) assert(ret > 0); - + if((ret = H5Pset_chunk_cache(dapl1, nslots, nbytes, w0)) < 0) assert(ret > 0); if((ret = encode_plist(dapl1, little_endian, word_length, "testfiles/plist_files/dapl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(dapl1)) < 0) assert(ret > 0); @@ -197,7 +197,7 @@ main(void) if((ret = encode_plist(dxpl1, little_endian, word_length, "testfiles/plist_files/dxpl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(dxpl1)) < 0) assert(ret > 0); @@ -228,7 +228,7 @@ main(void) if((ret = encode_plist(gcpl1, little_endian, word_length, "testfiles/plist_files/gcpl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(gcpl1)) < 0) assert(ret > 0); @@ -245,7 +245,7 @@ main(void) if((ret = encode_plist(lcpl1, little_endian, word_length, "testfiles/plist_files/lcpl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(lcpl1)) < 0) assert(ret > 0); @@ -268,7 +268,7 @@ main(void) if((ret = encode_plist(ocpypl1, little_endian, word_length, "testfiles/plist_files/ocpypl_")) < 0) assert(ret > 0); - + /* release resource */ if((ret = H5Pclose(ocpypl1)) < 0) assert(ret > 0); @@ -482,7 +482,7 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil HDassert(write_size == (ssize_t)temp_size); HDclose(fd); - + HDfree(temp_buf); return 1; diff --git a/test/genall5.h b/test/genall5.h index 1dce195..20141de 100644 --- a/test/genall5.h +++ b/test/genall5.h @@ -34,7 +34,7 @@ void os_grp_0(hid_t fid, const char *group_name); void vrfy_os_grp_0(hid_t fid, const char *group_name); void os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks); -void vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, +void vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks); void ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data); diff --git a/test/getname.c b/test/getname.c index c542ec5..a6f2f5a 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2375,7 +2375,7 @@ test_main(hid_t file_id, hid_t fapl) } H5E_END_TRY; if(H5Tcommit_anon(file2_id, dtype, H5P_DEFAULT, H5P_DEFAULT)) TEST_ERROR - + /* Test H5Iget_name with anonymously created datatype, should pass because committed */ if((size = H5Iget_name(dtype, NULL, 0)) != 0) TEST_ERROR @@ -2585,7 +2585,7 @@ test_obj_ref(hid_t fapl) /* Make sure size parameter is ignored */ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 200); if(namelen != 9) TEST_ERROR - + namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(namelen == 9))) TEST_ERROR PASSED(); diff --git a/test/h5test.c b/test/h5test.c index e7d91b6..9cca100 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2146,7 +2146,7 @@ const char *H5_get_srcdir_filename(const char *filename) /*------------------------------------------------------------------------- * Function: H5_get_srcdir * - * Purpose: Just return the srcdir path + * Purpose: Just return the srcdir path * * Return: The string * diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 112d67a..4da742f 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -107,7 +107,7 @@ static void mybzero(void *dest, size_t size); /* ---------------------------------------------------------------------------- * Function: mybzero * - * Purpose: Have bzero simplicity and abstraction in (possible) absence of + * Purpose: Have bzero simplicity and abstraction in (possible) absence of * it being available. * * Programmer: Jacob Smith diff --git a/test/ohdr.c b/test/ohdr.c index 31a54d2..ad76576 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -1053,7 +1053,7 @@ test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id) dcpl_default = H5Pcreate(H5P_DATASET_CREATE); if(dcpl_default < 0) TEST_ERROR - + dcpl_minimize = H5Pcreate(H5P_DATASET_CREATE); if(dcpl_minimize < 0) TEST_ERROR ret = H5Pset_dset_no_attrs_hint(dcpl_minimize, TRUE); diff --git a/test/page_buffer.c b/test/page_buffer.c index a6b3561..a508dc9 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -41,7 +41,7 @@ /* test routines */ #ifdef H5_HAVE_PARALLEL -static unsigned verify_page_buffering_disabled(hid_t orig_fapl, +static unsigned verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr); #else #define NUM_DSETS 5 @@ -72,9 +72,9 @@ const char *FILENAME[] = { * Purpose: The purpose of this function appears to be a smoke check * intended to exercise the page buffer. * - * Specifically, the function creates a file, and then goes - * through a loop in which it creates four data sets, write - * data to one of them, verifies the data written, and then + * Specifically, the function creates a file, and then goes + * through a loop in which it creates four data sets, write + * data to one of them, verifies the data written, and then * deletes the three that it didn't write to. * * Any data mis-matches or failures reported by the HDF5 @@ -158,7 +158,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl) HDmemset(data, 0, (size_t)num_elements * sizeof(int)); if((dset_id = H5Dopen2(grp_id, dset_name, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + FAIL_STACK_ERROR; if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR; if(H5Dclose(dset_id) < 0) @@ -213,7 +213,7 @@ error: * Purpose: The purpose of this function appears to be a smoke check * intended to exercise the page buffer. * - * Specifically, the function opens a file (created by + * Specifically, the function opens a file (created by * create_file()?), and verify the contents of its datasets. * * Any data mis-matches or failures reported by the HDF5 @@ -228,7 +228,7 @@ error: *------------------------------------------------------------------------- */ static unsigned -open_file(char *filename, hid_t fapl, hsize_t page_size, +open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size) { hid_t file_id = -1; @@ -370,7 +370,7 @@ error: * * 1) verifying that API errors are caught. * - * 2) verifying that the page buffer behaves more or less + * 2) verifying that the page buffer behaves more or less * as advertized. * * Any data mis-matches or unexpected failures or successes @@ -404,8 +404,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; - /* Test setting a page buffer without Paged Aggregation enabled - - * should fail + /* Test setting a page buffer without Paged Aggregation enabled - + * should fail */ if(H5Pset_page_buffer_size(fapl, 512, 0, 0) < 0) TEST_ERROR; @@ -418,8 +418,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; - /* Test setting a page buffer with a size smaller than a single - * page size - should fail + /* Test setting a page buffer with a size smaller than a single + * page size - should fail */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) TEST_ERROR; @@ -438,8 +438,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; - /* Test setting a page buffer with sum of min meta and raw - * data percentage > 100 - should fail + /* Test setting a page buffer with sum of min meta and raw + * data percentage > 100 - should fail */ H5E_BEGIN_TRY { ret = H5Pset_page_buffer_size(fapl, 512, 50, 51); @@ -468,8 +468,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; - /* Test setting a page buffer with a size slightly larger than a - * single page size + /* Test setting a page buffer with a size slightly larger than a + * single page size */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) TEST_ERROR; @@ -555,14 +555,14 @@ error: * * Programmer: unknown * ?? / ?? / ?? - * + * * Changes: Added base_page_cnt field as supporting code. This allows * the test to adjust to the number of page buffer pages * accessed during file open / create. * - * The test for the value of base_page_cnt just after file + * The test for the value of base_page_cnt just after file * open exists detect changes in library behavior. Assuming - * any such change is not indicative of other issues, these + * any such change is not indicative of other issues, these * tests can be modified to reflect the change. * * JRM -- 2/23/17 @@ -615,7 +615,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; /* opening the file inserts one or more pages into the page buffer. - * Get the number of pages inserted, and verify that it is the + * Get the number of pages inserted, and verify that it is the * the expected value. */ base_page_cnt = H5SL_count(f->shared->page_buf->slist_ptr); @@ -695,8 +695,8 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) FAIL_STACK_ERROR; - /* read elements 1200 - 1201, this should read -1 and bring in an - * entire page of addr 1200 + /* read elements 1200 - 1201, this should read -1 and bring in an + * entire page of addr 1200 */ if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, data) < 0) FAIL_STACK_ERROR; @@ -746,7 +746,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) } /* read elements 0 - 800 using the PB.. this should result in all - * what we have written so far and should get the updates from the PB + * what we have written so far and should get the updates from the PB */ if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0) FAIL_STACK_ERROR; @@ -761,7 +761,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* update elements 400 - 1400 to value 0, this will go to disk but * also evict existing pages from the PB (page 400 & 1200 that are - * existing). + * existing). */ for(i=0 ; i<1000 ; i++) data[i] = 0; @@ -832,14 +832,14 @@ error: * * Programmer: unknown * ?? / ?? / ?? - * + * * Changes: Added base_page_cnt field as supporting code. This allows * the test to adjust to the number of page buffer pages * accessed during file open / create. * - * The test for the value of base_page_cnt just after file + * The test for the value of base_page_cnt just after file * open exists detect changes in library behavior. Assuming - * any such change is not indicative of other issues, these + * any such change is not indicative of other issues, these * tests can be modified to reflect the change. * * JRM -- 2/23/17 @@ -898,7 +898,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; /* opening the file inserts one or more pages into the page buffer. - * Get the number of pages inserted, and verify that it is the + * Get the number of pages inserted, and verify that it is the * the expected value. */ base_page_cnt = H5SL_count(f->shared->page_buf->slist_ptr); @@ -918,7 +918,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) /* update the first 100 elements to have values 0-99 - this will be * a page buffer update with 1 page resulting in the page - * buffer. + * buffer. */ for(i=0 ; i<100 ; i++) data[i] = i; @@ -932,7 +932,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* update elements 300 - 450, with values 300 - 449 - this will - * bring two pages into the page buffer and evict 0. + * bring two pages into the page buffer and evict 0. */ for(i=0 ; i<150 ; i++) data[i] = i+300; @@ -1074,7 +1074,7 @@ error: /*------------------------------------------------------------------------- * Function: test_min_threshold() * - * Purpose: Tests verifying observation of minimum and maximum + * Purpose: Tests verifying observation of minimum and maximum * raw and metadata page counts in the page buffer. * * Any data mis-matches or failures reported by the HDF5 @@ -1085,16 +1085,16 @@ error: * * Programmer: unknown * ?? / ?? / ?? - * + * * Changes: Added the base_raw_cnt and base_meta_cnt fields and - * supporting code. This allows the test to adjust to the - * number of page buffer pages accessed during file open / + * supporting code. This allows the test to adjust to the + * number of page buffer pages accessed during file open / * create. * * The tests for the values of base_raw_cnt and base_meta_cnt - * just after file open exist detect changes in library - * behavior. Assuming any such change is not indicative of - * other issues, these tests can be modified to reflect the + * just after file open exist detect changes in library + * behavior. Assuming any such change is not indicative of + * other issues, these tests can be modified to reflect the * change. * * JRM -- 2/23/17 @@ -1186,7 +1186,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - /* write all raw data, this would end up in page buffer since there + /* write all raw data, this would end up in page buffer since there * is no metadata yet * * Not necessarily -- opening the file may may load a metadata page. @@ -1244,7 +1244,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* write and read more raw data and make sure that they don't end up in * page buffer since the minimum metadata is actually the entire - * page buffer + * page buffer */ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1320,7 +1320,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) TEST_ERROR; - /* write all meta data, this would end up in page buffer since there + /* write all meta data, this would end up in page buffer since there * is no raw data yet */ for(i=0 ; i<100 ; i++) @@ -1375,7 +1375,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* write and read more meta data and make sure that they don't end up in * page buffer since the minimum metadata is actually the entire - * page buffer + * page buffer */ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; @@ -1407,8 +1407,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) HDprintf("\tMinimum metadata threshold = 40%%, Minimum rawdata threshold = 40%%\n"); page_count = 0; - /* keep 5 pages at max in the page buffer 2 meta pages, 2 raw pages - * minimum + /* keep 5 pages at max in the page buffer 2 meta pages, 2 raw pages + * minimum */ if(H5Pset_page_buffer_size(fapl, sizeof(int)*1000, 40, 40) < 0) TEST_ERROR; @@ -1423,8 +1423,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* opening the file inserts one or more pages into the page buffer. * - * However, with the current 1 metadata page inserted into the - * the page buffer, it is not necessary to track the base raw and + * However, with the current 1 metadata page inserted into the + * the page buffer, it is not necessary to track the base raw and * metadata entry counts. */ @@ -1503,8 +1503,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(f->shared->page_buf->raw_count != 2) TEST_ERROR; - /* adding more meta entires should replace meta entries since raw data - * is at its minimum + /* adding more meta entires should replace meta entries since raw data + * is at its minimum */ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1522,8 +1522,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - /* adding 2 raw entries (even with 1 call) should only evict 1 meta - * entry and another raw entry + /* adding 2 raw entries (even with 1 call) should only evict 1 meta + * entry and another raw entry */ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1647,8 +1647,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(f->shared->page_buf->raw_count != 4) TEST_ERROR; - /* write one more raw entry which should replace another raw entry - * keeping min threshold of meta entries + /* write one more raw entry which should replace another raw entry + * keeping min threshold of meta entries */ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1662,8 +1662,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(f->shared->page_buf->raw_count != 4) TEST_ERROR; - /* write a metadata entry that should replace the metadata entry - * at the bottom of the LRU + /* write a metadata entry that should replace the metadata entry + * at the bottom of the LRU */ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; @@ -1721,16 +1721,16 @@ error: * * Programmer: unknown * ?? / ?? / ?? - * + * * Changes: Added the base_raw_cnt and base_meta_cnt fields and - * supporting code. This allows the test to adjust to the - * number of page buffer pages accessed during file open / + * supporting code. This allows the test to adjust to the + * number of page buffer pages accessed during file open / * create. * * The tests for the values of base_raw_cnt and base_meta_cnt - * just after file open exist detect changes in library - * behavior. Assuming any such change is not indicative of - * other issues, these tests can be modified to reflect the + * just after file open exist detect changes in library + * behavior. Assuming any such change is not indicative of + * other issues, these tests can be modified to reflect the * change. * * JRM -- 2/23/17 @@ -1787,7 +1787,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; /* opening the file inserts one or more pages into the page buffer. - * Get the raw and meta counts now, so we can adjust the expected + * Get the raw and meta counts now, so we can adjust the expected * statistics accordingly. */ HDassert(f); @@ -2014,7 +2014,7 @@ error: /*------------------------------------------------------------------------- * Function: verify_page_buffering_disabled() * - * Purpose: This function should only be called in parallel + * Purpose: This function should only be called in parallel * builds. * * At present, page buffering should be disabled in parallel @@ -2025,7 +2025,7 @@ error: * * Programmer: John Mainzer * 03/21/17 - * + * * Changes: None. * *------------------------------------------------------------------------- @@ -2072,7 +2072,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) if(file_id >= 0) TEST_ERROR; - /* now, create a file, close it, and then try to open it with page + /* now, create a file, close it, and then try to open it with page * buffering enabled. */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -2092,7 +2092,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR; - /* try to open the file using the fapl prepared above which enables + /* try to open the file using the fapl prepared above which enables * page buffering. Should fail. */ H5E_BEGIN_TRY { @@ -2158,7 +2158,7 @@ main(void) * Page buffering depends on paged aggregation which is * currently disabled for multi/split drivers. */ - if((0 == HDstrcmp(env_h5_drvr, "multi")) || + if((0 == HDstrcmp(env_h5_drvr, "multi")) || (0 == HDstrcmp(env_h5_drvr, "split"))) { SKIPPED() @@ -2175,7 +2175,7 @@ main(void) if(H5CX_push() < 0) FAIL_STACK_ERROR api_ctx_pushed = TRUE; -#ifdef H5_HAVE_PARALLEL +#ifdef H5_HAVE_PARALLEL HDputs("Page Buffering is disabled for parallel."); nerrors += verify_page_buffering_disabled(fapl, env_h5_drvr); diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index df984b1..71e4929 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -337,7 +337,7 @@ int main(int argc, const char *argv[]) verbose = 0; u++; break; - + /* Random # seed */ case 'r': use_seed = 1; diff --git a/test/swmr_check_compat_vfd.c b/test/swmr_check_compat_vfd.c index e249e09..9b4fbb5 100644 --- a/test/swmr_check_compat_vfd.c +++ b/test/swmr_check_compat_vfd.c @@ -13,7 +13,7 @@ /* Purpose: This is a small program that checks if the HDF5_DRIVER * environment variable is set to a value that supports SWMR. - * + * * It is intended for use in shell scripts. */ diff --git a/test/swmr_common.c b/test/swmr_common.c index 925dc33..7ae1fad 100644 --- a/test/swmr_common.c +++ b/test/swmr_common.c @@ -27,7 +27,7 @@ #include "h5test.h" #include "swmr_common.h" #include "vds_swmr.h" - + /*******************/ /* Local Variables */ /*******************/ diff --git a/test/swmr_common.h b/test/swmr_common.h index 99d1cb2..a0bc581 100644 --- a/test/swmr_common.h +++ b/test/swmr_common.h @@ -26,7 +26,7 @@ #define NLEVELS 5 /* # of datasets in the SWMR test file */ -#define NMAPPING 9 +#define NMAPPING 9 #define FILENAME "swmr_data.h5" /* SWMR test file name */ #define DTYPE_SIZE 150 /* Data size in opaque type */ diff --git a/test/swmr_generator.c b/test/swmr_generator.c index 54a9900..f6a4fe2 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -358,7 +358,7 @@ int main(int argc, const char *argv[]) HDfprintf(stderr, "\tcompression level = %d\n", comp_level); HDfprintf(stderr, "\tindex type = %s\n", index_type); } /* end if */ - + /* Set the random seed */ if(!use_seed) { struct timeval t; diff --git a/test/swmr_reader.c b/test/swmr_reader.c index cb354a7..ee263e3 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -329,7 +329,7 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, /* Emit informational message */ if(verbose) HDfprintf(verbose_file, "Closing file\n"); - + /* Close the file */ if(H5Fclose(fid) < 0) return -1; diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 9ca6045..b02d16f 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -371,7 +371,7 @@ usage(void) HDprintf("and will generate a random seed (no -r given).\n"); HDprintf("\n"); HDexit(EXIT_FAILURE); -} +} int main(int argc, const char *argv[]) { diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index e6d23de..2bebab9 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -272,7 +272,7 @@ int main(int argc, const char *argv[]) verbose = 0; u++; break; - + /* Random # seed */ case 'r': use_seed = 1; diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index 6adc6c5..6d5d257 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -162,7 +162,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t * The amount of time to sleep (s). * * unsigned reopen_count - * + * * * Return: Success: 0 * Failure: -1 @@ -185,7 +185,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, HDassert(filename); HDassert(poll_time != 0); - + /* Create file access property list */ if((fapl = h5_fileaccess()) < 0) return -1; diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index c4222ad..fc7e7a5 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -53,11 +53,11 @@ static void usage(void); * Purpose: Creates the HDF5 file (without SWMR access) which * which will be used for testing H5Fstart_swmr_write(). * - * Parameters: + * Parameters: * filename: The SWMR test file's name. * verbose: whether verbose console output is desired. * verbose_file: file pointer for verbose output - * random_seed: The random seed to store in the file. + * random_seed: The random seed to store in the file. * The sparse tests use this value. * * Return: Success: the file ID @@ -134,10 +134,10 @@ create_file(const char *filename, hbool_t verbose, FILE *verbose_file, /*------------------------------------------------------------------------- * Function: create_datasets * - * Purpose: Create datasets (and keep them opened) which will be used for testing + * Purpose: Create datasets (and keep them opened) which will be used for testing * H5Fstart_swmr_write(). * - * Parameters: + * Parameters: * fid: file ID for the SWMR test file * comp_level: the compresssion level * index_type: The chunk index type (b1 | b2 | ea | fa) @@ -212,7 +212,7 @@ create_datasets(hid_t fid, int comp_level, hbool_t verbose, FILE *verbose_file, * Purpose: Writes a specified number of records to random datasets in * the SWMR test file. * - * Parameters: + * Parameters: * fid: The file ID of the SWMR HDF5 file * verbose: Whether or not to emit verbose console messages * verbose_file: file pointer for verbose output @@ -419,7 +419,7 @@ int main(int argc, const char *argv[]) verbose = FALSE; u++; break; - + /* Random # seed */ case 'r': use_seed = TRUE; diff --git a/test/swmr_writer.c b/test/swmr_writer.c index 4c3e64a..d4387aa 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -328,7 +328,7 @@ int main(int argc, const char *argv[]) verbose = FALSE; u++; break; - + /* Random # seed */ case 'r': use_seed = TRUE; diff --git a/test/test_filter_plugin.sh.in b/test/test_filter_plugin.sh.in index 0a45c0f..e8c53e4 100644 --- a/test/test_filter_plugin.sh.in +++ b/test/test_filter_plugin.sh.in @@ -1,10 +1,10 @@ #! /bin/sh # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in +# Copyright by The HDF Group. +# 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 COPYING file, which can be found at the root of the source code # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from diff --git a/test/test_vol_plugin.sh.in b/test/test_vol_plugin.sh.in index 38220ef..32d1c12 100644 --- a/test/test_vol_plugin.sh.in +++ b/test/test_vol_plugin.sh.in @@ -1,10 +1,10 @@ #! /bin/sh # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in +# Copyright by The HDF Group. +# 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 COPYING file, which can be found at the root of the source code # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from diff --git a/test/testabort_fail.sh.in b/test/testabort_fail.sh.in index 925d8a4..c86bf8a 100644 --- a/test/testabort_fail.sh.in +++ b/test/testabort_fail.sh.in @@ -14,7 +14,7 @@ # Test to verify that the assertion/abort failure is fixed when the application # does not close the file. (See HDFFV-10160) # -# Test to verify that the infinite loop closing library/abort failure is fixed +# Test to verify that the infinite loop closing library/abort failure is fixed # when the application creates and removes dense attributes (See HDFFV-10659) srcdir=@srcdir@ @@ -33,7 +33,7 @@ TEST_NAME=filenotclosed # The test name TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary # # Run the test -$RUNSERIAL $TEST_BIN >/dev/null 2>&1 +$RUNSERIAL $TEST_BIN >/dev/null 2>&1 exitcode=$? if [ $exitcode -eq 0 ]; then echo "Test PASSED" @@ -47,7 +47,7 @@ echo "Testing infinite loop closing library/abort failure" TEST_NAME=del_many_dense_attrs # The test name TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary # Run the test -$RUNSERIAL $TEST_BIN >/dev/null 2>&1 +$RUNSERIAL $TEST_BIN >/dev/null 2>&1 exitcode=$? if [ $exitcode -eq 0 ]; then echo "Test PASSED" diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in index a5641f5..836170d 100644 --- a/test/testcheck_version.sh.in +++ b/test/testcheck_version.sh.in @@ -71,7 +71,7 @@ WarnMesg(){ test -n "$H5_HAVE_EMBEDDED_LIBINFO" && cat $h5libsettings echo "Bye..." } - + # Print warning message2 of version mismatch. WarnMesg2(){ @@ -88,13 +88,13 @@ WarnMesg2(){ echo "Headers are $xxh5versmajor.$xxh5versminor.$xxh5versrelease, library is $h5versmajor.$h5versminor.$h5versrelease" test -n "$H5_HAVE_EMBEDDED_LIBINFO" && cat $h5libsettings } - + # Run a test and print PASS or *FAIL*. If a test fails then increment # the `nerrors' global variable and (if $verbose is set) display the # difference between the actual output and the expected output. The # expected output generated according to the parameter values and compared -# against actual output. +# against actual output. # The expected and actual output files are removed unless $HDF5_NOCLEANUP # has a non-zero value. # $1: the set value of $HDF5_DISABLE_VERSION_CHECK. (unset means not to set @@ -175,7 +175,7 @@ TESTING() { ) >$actual 2>$actual_err ret_code=$? cat $actual_err >> $actual - + if [ $h5haveexitcode = 'yes' -a \( $expect_code -ne $ret_code \) ]; then echo "*FAILED*" echo " Expected exit code ($expect_code) differs from actual code ($ret_code)" @@ -189,7 +189,7 @@ TESTING() { test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi - # Clean up output file. + # Clean up output file. # Also clean the core file generated by H5check_version's abort. if test -z "$HDF5_NOCLEANUP"; then $RM $expect $actual $actual_err @@ -211,14 +211,14 @@ nerrors=0 verbose=yes # default on debugmode= # default off H5_HAVE_EMBEDDED_LIBINFO=`grep '#define H5_HAVE_EMBEDDED_LIBINFO ' ../src/H5pubconf.h` -h5libsettings=../src/libhdf5.settings +h5libsettings=../src/libhdf5.settings PURPOSE # Figure out library version numbers from the header file. -h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | cut -f2` -h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | cut -f2` -h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | cut -f2` +h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | cut -f2` +h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | cut -f2` +h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | cut -f2` DEBUGPRINT $h5versmajor.$h5versminor.$h5versrelease case "$h5versmajor$h5versminor$h5versrelease" in [0-9]*) # good. noop. diff --git a/test/testerror.sh.in b/test/testerror.sh.in index ac2a109..b5ec853 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -11,7 +11,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# Tests for test_error and err_compat +# Tests for test_error and err_compat srcdir=@srcdir@ @@ -62,7 +62,7 @@ TEST() { TESTING $TEST_ERR ( # Skip the plugin for testing missing filter. - $ENVCMD $RUNSERIAL $TEST_ERR_BIN + $ENVCMD $RUNSERIAL $TEST_ERR_BIN ) >$actual 2>$actual_err # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ @@ -73,7 +73,7 @@ TEST() { -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ $actual_err > $actual_ext cat $actual_ext >> $actual - + if $CMP $expect1 $actual; then echo " PASSED" elif $CMP $expect2 $actual; then @@ -96,7 +96,7 @@ SKIP() { TESTING $@ echo " -SKIP-" } - + ############################################################################## ############################################################################## ### T H E T E S T S ### diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in index 1dd744b..b2e8a12 100644 --- a/test/testlibinfo.sh.in +++ b/test/testlibinfo.sh.in @@ -47,7 +47,7 @@ SKIP() { LINEMSG $* echo " -SKIP-" } - + # Function definitions CHECK_LIBINFO(){ LINEMSG $1 @@ -80,9 +80,9 @@ if [ -n $Shared_Lib ]; then shlib=$(grep dlname ../src/libhdf5.la | sed -e "s/dlname='//" -e "s/'//") else h5libdir=../src -fi +fi -h5libsettings=../src/libhdf5.settings +h5libsettings=../src/libhdf5.settings # Part 1: # Verify the HDF5 library does contains an exact copy of the content of the diff --git a/test/th5s.c b/test/th5s.c index c60b1ff..bb84353 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1210,7 +1210,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) * Test encoding and decoding of simple dataspace and hyperslab selection. *------------------------------------------------------------------------- */ - + /* Create the file access property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); @@ -1569,7 +1569,7 @@ test_h5s_encode1(void) /**************************************************************** ** -** test_h5s_check_encoding(): +** test_h5s_check_encoding(): ** This is the helper routine to verify that H5Sencode2() ** works as specified in the RFC for the library format setting ** in the file access property list. @@ -1582,7 +1582,7 @@ test_h5s_encode1(void) ** ****************************************************************/ static herr_t -test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, +test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, uint8_t expected_enc_size, hbool_t expected_to_fail) { char *buf = NULL; /* Pointer to the encoded buffer */ @@ -1633,7 +1633,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, VERIFY(in_low_bounds[0], d_low_bounds[0], "Compare selection low bounds"); VERIFY(in_high_bounds[0], d_high_bounds[0], "Compare selection high bounds"); - /* + /* * See "RFC: H5Sencode/H5Sdeocde Format Change" for the verification of: * H5S_SEL_POINTS: * --the expected version for point selection info @@ -1644,7 +1644,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, */ if(H5Sget_select_type(in_sid) == H5S_SEL_POINTS) { - + /* Verify the version */ VERIFY((uint32_t)buf[35], expected_version, "Version for point selection"); @@ -1666,7 +1666,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, ret = H5Sclose(d_sid); CHECK(ret, FAIL, "H5Sclose"); - if(buf) + if(buf) HDfree(buf); } @@ -1723,15 +1723,15 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) start = 0; count = unlim? H5S_UNLIMITED : 2; - if((high <= H5F_LIBVER_V18) && + if((high <= H5F_LIBVER_V18) && (unlim || config == CONFIG_32)) expected_to_fail = TRUE; - if(low >= H5F_LIBVER_V112) + if(low >= H5F_LIBVER_V112) expected_version = 3; else if(config == CONFIG_16 && !unlim) expected_version = 1; - else + else expected_version = 2; /* test 1 */ @@ -1745,7 +1745,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) stride = POWER32 - 1; block = 4; expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8); - + break; default: HDassert(0); @@ -1873,7 +1873,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) /**************************************************************** ** -** test_h5s_encode_irregular_hyper(): +** test_h5s_encode_irregular_hyper(): ** This test verifies that H5Sencode2() works as specified in ** the RFC for irregular hyperslabs. ** See "RFC: H5Sencode/H5Sdeocde Format Change". @@ -1961,7 +1961,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) break; case CONFIG_16: - stride = POWER16; + stride = POWER16; expected_enc_size = 4; break; @@ -2092,11 +2092,11 @@ test_h5s_encode_points(H5F_libver_t low, H5F_libver_t high) /**************************************************************** ** -** test_h5s_encode_length(): +** test_h5s_encode_length(): ** Test to verify HDFFV-10271 is fixed. ** Verify that version 2 hyperslab encoding length is correct. ** -** See "RFC: H5Sencode/H5Sdecode Format Change" for the +** See "RFC: H5Sencode/H5Sdecode Format Change" for the ** description of the encoding format. ** ****************************************************************/ diff --git a/test/thread_id.c b/test/thread_id.c index 818ab4a..24aef80 100644 --- a/test/thread_id.c +++ b/test/thread_id.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Check that a thread ID returned by H5TS_thread_id() possesses the - * following properties: + * following properties: * * 1 ID >= 1. * 2 The ID is constant over the thread's lifetime. diff --git a/test/trefer.c b/test/trefer.c index d399fef..15f9d64 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -542,7 +542,7 @@ test_reference_obj(void) ** Tests references to various kinds of objects ** ** Note: The libver_low/libver_high parameters are added to create the file -** with the low and high bounds setting in fapl. +** with the low and high bounds setting in fapl. ** Please see the RFC for "H5Sencode/H5Sdecode Format Change". ** ****************************************************************/ @@ -634,7 +634,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) H5E_BEGIN_TRY { dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - + if(dset1 < 0) { VERIFY(libver_high <= H5F_LIBVER_V110, TRUE, "H5Dcreate2"); @@ -840,7 +840,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 1, "H5Sget_select_hyper_nblocks"); /* allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); @@ -871,7 +871,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, SPACE2_DIM2, "H5Sget_select_elem_npoints"); /* allocate space for the element points */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); @@ -1196,7 +1196,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 15, "H5Sget_select_hyper_nblocks"); /* allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); @@ -1251,7 +1251,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 10, "H5Sget_select_elem_npoints"); /* allocate space for the element points */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c index a830314..db91b8e 100644 --- a/test/trefer_deprec.c +++ b/test/trefer_deprec.c @@ -491,7 +491,7 @@ test_reference_obj(void) ** Tests references to various kinds of objects ** ** Note: The libver_low/libver_high parameters are added to create the file -** with the low and high bounds setting in fapl. +** with the low and high bounds setting in fapl. ** Please see the RFC for "H5Sencode/H5Sdecode Format Change". ** ****************************************************************/ diff --git a/test/trefer_shutdown.c b/test/trefer_shutdown.c index 89a44b3..b1c43e0 100644 --- a/test/trefer_shutdown.c +++ b/test/trefer_shutdown.c @@ -50,7 +50,7 @@ main(int argc, char **argv) /* * "Forget" to call H5Rdestroy on reference objects. If H5Rdestroy * is called at least once on either reference object, or both - * objects, the infinite loop goes away. If H5Rdestroy is never + * objects, the infinite loop goes away. If H5Rdestroy is never * called, the infinite loop will appear. */ #if 0 diff --git a/test/trefstr.c b/test/trefstr.c index 83e2951..c33b5eb 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -299,7 +299,7 @@ test_refstr_own(void) /* Initialize buffer */ s = (char *)H5FL_BLK_MALLOC(str_buf,HDstrlen("foo") + 1); - CHECK_PTR(s, "H5FL_BLK_MALLOC"); + CHECK_PTR(s, "H5FL_BLK_MALLOC"); HDstrcpy(s, "foo"); /* Transfer ownership of dynamically allocated string to ref-counted string */ diff --git a/test/tselect.c b/test/tselect.c index 390f61f..492a917 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -15325,7 +15325,7 @@ test_select_intersect_block(void) /**************************************************************** ** -** test_hyper_io_1d(): +** test_hyper_io_1d(): ** Test to verify all the selected 10th element in the 1-d file ** dataspace is read correctly into the 1-d contiguous memory space. ** This is modeled after the test scenario described in HDFFV-10585 diff --git a/test/ttsafe.c b/test/ttsafe.c index 89c87a3..e6edd9a 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) #ifdef H5_HAVE_THREADSAFE AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); -#ifdef H5_HAVE_PTHREAD_H +#ifdef H5_HAVE_PTHREAD_H /* Thread cancellability only supported with pthreads ... */ AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL); #endif /* H5_HAVE_PTHREAD_H */ diff --git a/test/twriteorder.c b/test/twriteorder.c index b104b72..04f3bc5 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -187,7 +187,7 @@ parse_option(int argc, char * const argv[]) /* verify partition size must be >= blocksize */ if (part_size_g < blocksize_g ){ HDfprintf(stderr, "Blocksize %d should not be bigger than partition size %d\n", blocksize_g, part_size_g); - Hgoto_error(-1); + Hgoto_error(-1); } done: @@ -228,7 +228,7 @@ int setup_parameters(int argc, char * const argv[]) int create_wo_file(void) { int blkaddr = 0; /* blkaddress of next linked block */ - h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ /* Create the data file */ if ((write_fd_g = HDopen(DATAFILE, O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) { @@ -252,8 +252,8 @@ int write_wo_file(void) int blkaddr_old=0; int i; char buffer[BLOCKSIZE_DFT]; - h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ - + h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + /* write block 1, 2, ... */ for (i = 1; i < nlinkedblock_g; i++) { @@ -345,7 +345,7 @@ int read_wo_file(void) } -/* Overall Algorithm: +/* Overall Algorithm: * Parse options from user; * Generate/pre-created the test file needed and close it; * fork: child processes become the reader processes; @@ -447,7 +447,7 @@ main(int argc, char *argv[]) Hgoto_error(2); } } - + done: /* Print result and exit */ if (ret_value != 0){ diff --git a/test/unregister.c b/test/unregister.c index db37f3e..a2a507d 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -55,7 +55,7 @@ const H5Z_class2_t H5Z_DUMMY[1] = {{ * Function: do_nothing * * Purpose: A dummy compression method that doesn't do anything. This - * filter is only for test_unregister_filters. Please don't + * filter is only for test_unregister_filters. Please don't * use it for other tests because it may mess up this test. * * Return: Data chunk size @@ -124,12 +124,12 @@ test_unregister_filters(hid_t fapl_id) goto error; if (H5Zfilter_avail(H5Z_FILTER_DUMMY) != TRUE) goto error; - + /******************* * PART 1 - GROUPS * *******************/ - /* Use DUMMY filter for creating groups */ + /* Use DUMMY filter for creating groups */ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; if(H5Pset_filter(gcpl_id, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) @@ -145,7 +145,7 @@ test_unregister_filters(hid_t fapl_id) if((gid_loop = H5Gcreate2(gid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Gclose(gid_loop) < 0) - goto error; + goto error; } /* Flush the file containing the groups */ @@ -174,7 +174,7 @@ test_unregister_filters(hid_t fapl_id) * PART 2 - DATASETS * *********************/ - /* Use DUMMY filter for creating datasets */ + /* Use DUMMY filter for creating datasets */ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk(dcpl_id, 2, chunk_dims) < 0) @@ -227,7 +227,7 @@ test_unregister_filters(hid_t fapl_id) if(H5Dclose(did) < 0) goto error; - /* Unregister the filter after closing all objects but before closing files. + /* Unregister the filter after closing all objects but before closing files. * It should flush all files. */ if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 35594cf..8fcf0d3 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -148,7 +148,7 @@ main(int argc, char *argv[]) if ((UC_opts.fapl_id = h5_fileaccess()) < 0) { HDfprintf(stderr, "can't create creation FAPL\n"); Hgoto_error(1); - } + } if (H5Pset_libver_bounds(UC_opts.fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { HDfprintf(stderr, "can't set creation FAPL libver bounds\n"); Hgoto_error(1); @@ -159,7 +159,7 @@ main(int argc, char *argv[]) } else { HDprintf("File created.\n"); } - /* Close FAPL to prevent issues with forking later */ + /* Close FAPL to prevent issues with forking later */ if (H5Pclose(UC_opts.fapl_id) < 0) { HDfprintf(stderr, "can't close creation FAPL\n"); Hgoto_error(1); diff --git a/test/use_common.c b/test/use_common.c index bf29936..b537741 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -157,9 +157,9 @@ void show_parameters(options_t * opts) { HDprintf("===Parameters used:===\n"); - HDprintf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)opts->chunkdims[0], + HDprintf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)opts->chunkdims[0], (unsigned long long)opts->chunkdims[1], (unsigned long long)opts->chunkdims[2]); - HDprintf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)opts->max_dims[0], + HDprintf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)opts->max_dims[0], (unsigned long long)opts->max_dims[1], (unsigned long long)opts->max_dims[2]); HDprintf("number of planes to write=%llu\n", (unsigned long long)opts->nplanes); HDprintf("using SWMR mode=%s\n", opts->use_swmr ? "yes(1)" : "no(0)"); @@ -301,7 +301,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts) /* verify chunk_dims against set paramenters */ if (chunk_dims[0]!=opts->chunkdims[0] || chunk_dims[1] != cz || chunk_dims[2] != cz) { HDfprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n", - (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1], + (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1], (unsigned long long)chunk_dims[2]); return -1; } @@ -329,12 +329,12 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts) return -1; } HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n", - rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]), + rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]), (unsigned long long)(dims[2])); /* verify that file space dims are as expected and are consistent with memory space dims */ if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]) { HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n", - (unsigned long long)dims[0], (unsigned long long)dims[1], + (unsigned long long)dims[0], (unsigned long long)dims[1], (unsigned long long)dims[2]); return -1; } @@ -529,7 +529,7 @@ read_uc_file(hbool_t towait, options_t * opts) HDprintf("\n"); loops_waiting_for_plane=0; } - HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplanes_seen, + HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplanes_seen, (unsigned long long)dims[0]); } else { @@ -579,7 +579,7 @@ read_uc_file(hbool_t towait, options_t * opts) if (++nerrs < ErrorReportMax) { HDfprintf(stderr, "found error %llu plane(%llu,%llu), expected %llu, got %d\n", - (unsigned long long)nplane, (unsigned long long)j, + (unsigned long long)nplane, (unsigned long long)j, (unsigned long long)k, (unsigned long long)nplane, (int)*(bufptr-1)); } /* end if should print error */ } /* end if value mismatch */ @@ -587,7 +587,7 @@ read_uc_file(hbool_t towait, options_t * opts) } /* end for plane first dimension */ if (nerrs) { nreadererr++; - HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs, + HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs, (unsigned long long)nplane); } } /* end for each plane added since last read */ diff --git a/test/vds.c b/test/vds.c index c6b88eb..c4d1391 100644 --- a/test/vds.c +++ b/test/vds.c @@ -618,7 +618,7 @@ test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low) TEST_ERROR /* Get examination DCPL */ - if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, + if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (low >= H5F_LIBVER_V112)?(hsize_t)99:(low >= H5F_LIBVER_V110?174:213)) < 0) TEST_ERROR @@ -1026,7 +1026,7 @@ test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low) } /* Get examination DCPL */ - if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, + if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (low >= H5F_LIBVER_V112)?(hsize_t)607:(hsize_t)697) < 0) TEST_ERROR @@ -12221,9 +12221,9 @@ test_dapl_values(hid_t fapl_id) * * Purpose: Tests datasets with virtual layout * - * Note: + * Note: * Tests are modified to test with the low/high bounds combination - * set in fapl. + * set in fapl. * Please see RFC for "H5Sencode/H5Sdecode Format Change". * * Return: EXIT_SUCCESS/EXIT_FAILURE @@ -12273,7 +12273,7 @@ main(void) high_string = h5_get_version_string(high); HDsprintf(msg, "Testing virtual dataset with file version bounds: (%s, %s):", low_string, high_string); HDputs(msg); - + for(test_api_config = (int)TEST_API_BASIC; test_api_config < (int)TEST_API_NTESTS; test_api_config++) nerrors += test_api((test_api_config_t)test_api_config, my_fapl, low); for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) { diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c index d62ecaf..d70352d 100644 --- a/test/vds_swmr_writer.c +++ b/test/vds_swmr_writer.c @@ -43,7 +43,7 @@ main(int argc, char *argv[]) ******************************/ /* The file number is passed on the command line. - * This is an integer index into the FILE_NAMES array. + * This is an integer index into the FILE_NAMES array. */ if(argc != 2) { HDfprintf(stderr, "ERROR: Must pass the source file number on the command line.\n"); diff --git a/test/vol.c b/test/vol.c index 88354e1..0f8af4f 100644 --- a/test/vol.c +++ b/test/vol.c @@ -919,11 +919,11 @@ test_basic_object_operation(void) TEST_ERROR; /* H5Oexists_by_name */ - if (H5Oexists_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT) != TRUE) + if (H5Oexists_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT) != TRUE) TEST_ERROR; /* H5Oopen/close */ - if ((oid = H5Oopen(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT)) < 0) + if ((oid = H5Oopen(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; if (H5Oclose(oid) < 0) TEST_ERROR; diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 0cdba24..4509945 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -24,7 +24,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test # Test scripts-- # testpflush.sh: TEST_SCRIPT_PARA = testpflush.sh -SCRIPT_DEPEND = t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) +SCRIPT_DEPEND = t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) check_SCRIPTS = $(TEST_SCRIPT_PARA) diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index e5ab280..54ea546 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -533,17 +533,17 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] * with 2 MPI ranks and with $HDF5TestExpress == 0 * i.e. Exhaustive test run is allowed. Otherwise * the test is skipped. - * + * * Thanks to l.ferraro@cineca.it for the following test:: * - * This is a simple test case to reproduce a problem - * occurring on LUSTRE filesystem with the creation - * of a 4GB dataset using chunking with parallel HDF5. - * The test works correctly if disabling chunking or - * when the bytes assigned to each process is less - * that 4GB. if equal or more, either hangs or results - * in a PMPI_Waitall error. - * + * This is a simple test case to reproduce a problem + * occurring on LUSTRE filesystem with the creation + * of a 4GB dataset using chunking with parallel HDF5. + * The test works correctly if disabling chunking or + * when the bytes assigned to each process is less + * that 4GB. if equal or more, either hangs or results + * in a PMPI_Waitall error. + * * $> mpirun -genv I_MPI_EXTRA_FILESYSTEM on * -genv I_MPI_EXTRA_FILESYSTEM_LIST gpfs * -n 1 ./h5_mpi_big_dataset.x 1024 1024 1024 @@ -602,7 +602,7 @@ static int MpioTest2G( MPI_Comm comm ) */ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); VRFY((file_id >= 0), "H5Fcreate succeeded"); - + H5Pclose(plist_id); /* @@ -4961,7 +4961,7 @@ main(int argc, char **argv) /* Display testing information */ if (MAINPROCESS) TestInfo(argv[0]); - + /* setup file access property list */ fapl = H5Pcreate (H5P_FILE_ACCESS); H5Pset_fapl_mpio(fapl, test_comm, MPI_INFO_NULL); diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index e950015..740f78e 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -16,7 +16,7 @@ #define HYPER 1 #define POINT 2 -#define ALL 3 +#define ALL 3 /* some commonly used routines for collective chunk IO tests*/ diff --git a/testpar/t_coll_md_read.c b/testpar/t_coll_md_read.c index d4b2106..d4aaa2e 100644 --- a/testpar/t_coll_md_read.c +++ b/testpar/t_coll_md_read.c @@ -48,7 +48,7 @@ * in strictly non-decreasing order of chunk address. For version 1 and 2 B-trees, * this caused the non-participating ranks to issue a collective MPI_Bcast() call * which the other ranks did not issue, thus causing a hang. - * + * * However, since these ranks are not actually reading/writing anything, this call * can simply be removed and the address used for the read/write can be set to an * arbitrary number (0 was chosen). diff --git a/testpar/t_file.c b/testpar/t_file.c index 6183b8d..19a75c8 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -736,7 +736,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, } /* - * NOTE: See HDFFV-10894 and add tests later to verify MPI-specific properties in the + * NOTE: See HDFFV-10894 and add tests later to verify MPI-specific properties in the * incoming fapl that could conflict with the existing values in H5F_shared_t on * multiple opens of the same file. */ diff --git a/testpar/t_file_image.c b/testpar/t_file_image.c index 62db11a..81bb7c2 100644 --- a/testpar/t_file_image.c +++ b/testpar/t_file_image.c @@ -21,11 +21,11 @@ * * Process zero: * - * 1) Creates a core file with an integer vector data set of - * length n (= mpi_size), + * 1) Creates a core file with an integer vector data set of + * length n (= mpi_size), * - * 2) Initializes the vector to zero in * location 0, and to -1 - * everywhere else. + * 2) Initializes the vector to zero in * location 0, and to -1 + * everywhere else. * * 3) Flushes the core file, and gets an image of it. Closes * the core file. @@ -35,7 +35,7 @@ * 5) Awaits receipt on a file image from process n-1. * * 6) opens the image received from process n-1, verifies that - * it contains a vector of length equal to mpi_size, and + * it contains a vector of length equal to mpi_size, and * that the vector contains (0, 1, 2, ... n-1) * * 7) closes the core file and exits. @@ -45,7 +45,7 @@ * 1) Await receipt of file image from process (i - 1). * * 2) Open the image with the core file driver, verify that i - * contains a vector v of length, and that v[j] = j for + * contains a vector v of length, and that v[j] = j for * 0 <= j < i, and that v[j] == -1 for i <= j < n * * 3) Set v[i] = i in the core file. @@ -87,13 +87,13 @@ file_image_daisy_chain_test(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* setup file name */ - HDsnprintf(file_name, 1024, "file_image_daisy_chain_test_%05d.h5", + HDsnprintf(file_name, 1024, "file_image_daisy_chain_test_%05d.h5", (int)mpi_rank); if(mpi_rank == 0) { - - /* 1) Creates a core file with an integer vector data set - * of length mpi_size, + + /* 1) Creates a core file with an integer vector data set + * of length mpi_size, */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); VRFY((fapl_id >= 0), "creating fapl"); @@ -111,10 +111,10 @@ file_image_daisy_chain_test(void) dset_id = H5Dcreate2(file_id, "v", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((dset_id >= 0), "created data set"); - - /* 2) Initialize the vector to zero in location 0, and - * to -1 everywhere else. + + /* 2) Initialize the vector to zero in location 0, and + * to -1 everywhere else. */ vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); @@ -131,7 +131,7 @@ file_image_daisy_chain_test(void) HDfree(vector_ptr); vector_ptr = NULL; - + /* 3) Flush the core file, and get an image of it. Close * the core file. */ @@ -159,14 +159,14 @@ file_image_daisy_chain_test(void) err = H5Pclose(fapl_id); VRFY((err >= 0), "closed fapl(1)."); - + /* 4) Send the image to process 1. */ - mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), + mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), MPI_BYTE, 1, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), "sent image size to process 1"); - mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, + mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, MPI_BYTE, 1, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), "sent image to process 1"); @@ -190,9 +190,9 @@ file_image_daisy_chain_test(void) &rcvstat); VRFY((mpi_result == MPI_SUCCESS), \ "received file image from process n-1"); - + /* 6) open the image received from process n-1, verify that - * it contains a vector of length equal to mpi_size, and + * it contains a vector of length equal to mpi_size, and * that the vector contains (0, 1, 2, ... n-1). */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); @@ -229,7 +229,7 @@ file_image_daisy_chain_test(void) vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); - err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); VRFY((err >= 0), "read received vector."); @@ -238,7 +238,7 @@ file_image_daisy_chain_test(void) if(vector_ptr[i] != i) vector_ok = FALSE; VRFY((vector_ok), "verified received vector."); - + HDfree(vector_ptr); vector_ptr = NULL; @@ -276,9 +276,9 @@ file_image_daisy_chain_test(void) &rcvstat); VRFY((mpi_result == MPI_SUCCESS), \ "received file image from process mpi_rank-1"); - + /* 2) Open the image with the core file driver, verify that it - * contains a vector v of length, and that v[j] = j for + * contains a vector v of length, and that v[j] = j for * 0 <= j < i, and that v[j] == -1 for i <= j < n */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); @@ -316,7 +316,7 @@ file_image_daisy_chain_test(void) vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); - err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); VRFY((err >= 0), "read received vector."); @@ -331,7 +331,7 @@ file_image_daisy_chain_test(void) } } VRFY((vector_ok), "verified received vector."); - + /* 3) Set v[i] = i in the core file. */ @@ -344,7 +344,7 @@ file_image_daisy_chain_test(void) HDfree(vector_ptr); vector_ptr = NULL; - + /* 4) Flush the core file and send it to process (mpi_rank + 1) % n. */ err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); @@ -359,14 +359,14 @@ file_image_daisy_chain_test(void) bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_len); VRFY(bytes_read == image_len, "wrote file into image buffer"); - mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), - MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, + mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), + MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), \ "sent image size to process (mpi_rank + 1) % mpi_size"); - mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, - MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, + mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, + MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), \ "sent image to process (mpi_rank + 1) % mpi_size"); @@ -374,7 +374,7 @@ file_image_daisy_chain_test(void) HDfree(image_ptr); image_ptr = NULL; image_len = 0; - + /* 5) close the core file and exit. */ err = H5Sclose(space_id); diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c index 6176bb5..0e40fe4 100644 --- a/testpar/t_init_term.c +++ b/testpar/t_init_term.c @@ -37,7 +37,7 @@ main (int argc, char **argv) /* Initialize and finalize MPI */ MPI_Init(&argc, &argv); MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_rank(comm, &mpi_rank); if(MAINPROCESS) TESTING("Usage of Serial HDF5 after MPI_Finalize() is called"); diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 9e5d839..0719ca6 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -302,7 +302,7 @@ static int test_mpio_gb_file(char *filename) { "proc %d: write to mpi_off=%016llx, %lld\n", mpi_rank, mpi_off, mpi_off); /* set data to some trivial pattern for easy verification */ - for (j = 0; j < MB; j++) + for (j = 0; j < MB; j++) *(buf + j) = (int8_t)(i * mpi_size + mpi_rank); if (VERBOSE_MED) HDfprintf(stdout, diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 74feeb6..ba4165e 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -281,7 +281,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) /* create a chunked dataset */ chunk[0] = COUNT/8; - + if ( pass ) { if ( (dcpl_id = H5Pcreate (H5P_DATASET_CREATE)) < 0 ) { pass = false; @@ -295,9 +295,9 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) failure_mssg = "H5Pset_chunk() failed.\n"; } } - + if ( pass ) { - + if ( (dset_id_ch = H5Dcreate2(file_id, "dataset0_chunked", H5T_NATIVE_FLOAT, filespace, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0 ) { @@ -319,7 +319,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) failure_mssg = "H5Pclose(dcpl_id) failed.\n"; } } - + if ( pass || (dset_id_ch != -1)) { if ( H5Dclose(dset_id_ch) < 0 ) { pass = false; @@ -698,8 +698,8 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) data_slice = NULL; } - /* - * Test reading proc0-read-and-bcast with sub-communicators + /* + * Test reading proc0-read-and-bcast with sub-communicators */ /* Don't test with more than LIMIT_NPROC processes to avoid memory issues */ @@ -798,7 +798,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) nextValue = 0; else /* test 2 group 1 */ nextValue = (float)((hsize_t)( mpi_size / 2 )*count); - + i = 0; while ( ( pass ) && ( i < (hsize_t)dset_size ) ) { /* what we really want is data_slice[i] != nextValue -- @@ -863,7 +863,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) nextValue = 0; else /* test 2 group 1 */ nextValue = (float)((hsize_t)( mpi_size / 2 )*count); - + i = 0; while ( ( pass ) && ( i < (hsize_t)dset_size ) ) { /* what we really want is data_slice[i] != nextValue -- @@ -893,8 +893,8 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) data_slice = NULL; } - /* - * Read an H5S_ALL filespace into a hyperslab defined memory space + /* + * Read an H5S_ALL filespace into a hyperslab defined memory space */ if ( (data_slice = (float *)HDmalloc((size_t)(dset_size*2)*filetype_size)) == NULL ) { @@ -979,14 +979,14 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) i++; } } - + if ( pass || (memspace != -1) ) { if ( H5Sclose(memspace) < 0 ) { pass = false; failure_mssg = "H5Sclose(memspace) failed.\n"; } } - + /* free data_slice if it has been allocated */ if ( data_slice != NULL ) { HDfree(data_slice); diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c index 71a8277..da6bbe0 100644 --- a/testpar/t_prestart.c +++ b/testpar/t_prestart.c @@ -48,11 +48,11 @@ main (int argc, char **argv) MPI_Init(&argc, &argv); MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_rank(comm, &mpi_rank); if(MAINPROCESS) TESTING("proper shutdown of HDF5 library"); - + /* Set up file access property list with parallel I/O access */ fapl = H5Pcreate(H5P_FILE_ACCESS); VRFY((fapl >= 0), "H5Pcreate succeeded"); @@ -121,7 +121,7 @@ main (int argc, char **argv) HDremove(filename); /* release data buffers */ - if(data_array) + if(data_array) HDfree(data_array); nerrors += GetTestNumErrs(); diff --git a/testpar/t_prop.c b/testpar/t_prop.c index 62e4dde..dde322d 100644 --- a/testpar/t_prop.c +++ b/testpar/t_prop.c @@ -97,7 +97,7 @@ test_plist_ed(void) int mpi_size, mpi_rank, recv_proc; - hsize_t chunk_size = 16384; /* chunk size */ + hsize_t chunk_size = 16384; /* chunk size */ double fill = 2.7f; /* Fill value */ size_t nslots = 521*2; size_t nbytes = 1048576 * 10; @@ -165,16 +165,16 @@ test_plist_ed(void) VRFY((ret>=0), "set fill-value succeeded"); max_size[0] = 100; - ret = H5Pset_external(dcpl, "ext1.data", (off_t)0, + ret = H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4)); VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext2.data", (off_t)0, + ret = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4)); VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext3.data", (off_t)0, + ret = H5Pset_external(dcpl, "ext3.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4)); VRFY((ret>=0), "set external succeeded"); - ret = H5Pset_external(dcpl, "ext4.data", (off_t)0, + ret = H5Pset_external(dcpl, "ext4.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int)/4)); VRFY((ret>=0), "set external succeeded"); diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c index 55073c8..6a35fb2 100644 --- a/testpar/t_pshutdown.c +++ b/testpar/t_pshutdown.c @@ -51,11 +51,11 @@ main (int argc, char **argv) MPI_Init(&argc, &argv); MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_rank(comm, &mpi_rank); if(MAINPROCESS) TESTING("proper shutdown of HDF5 library"); - + /* Set up file access property list with parallel I/O access */ fapl = H5Pcreate(H5P_FILE_ACCESS); VRFY((fapl >= 0), "H5Pcreate succeeded"); @@ -107,7 +107,7 @@ main (int argc, char **argv) VRFY((ret >= 0), "H5Dwrite succeeded"); /* release data buffers */ - if(data_array) + if(data_array) HDfree(data_array); MPI_Finalize(); diff --git a/testpar/testpar.h b/testpar/testpar.h index 2c1bce2..f76de51 100644 --- a/testpar/testpar.h +++ b/testpar/testpar.h @@ -34,7 +34,7 @@ if (VERBOSE_MED && *mesg != '\0') \ HDprintf("%s\n", mesg) -/* +/* * VRFY: Verify if the condition val is true. * If it is true, then call MESG to print mesg, depending on the verbose * level. diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index 88473ad..affdf99 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -133,8 +133,8 @@ extern "C" { *------------------------------------------------------------------------- */ H5TOOLS_DLL void h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order); -H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, - hbool_t visit_start, hbool_t recurse, h5trav_obj_func_t visit_obj, +H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, + hbool_t visit_start, hbool_t recurse, h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk, void *udata, unsigned fields); H5TOOLS_DLL herr_t symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path); H5TOOLS_DLL hbool_t symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path); diff --git a/tools/src/Makefile.am b/tools/src/Makefile.am index beceee5..93fcc1e 100644 --- a/tools/src/Makefile.am +++ b/tools/src/Makefile.am @@ -23,6 +23,6 @@ CONFIG=ordered # All subdirectories SUBDIRS=h5diff h5ls h5dump misc h5import h5repack h5jam h5copy \ - h5format_convert h5stat + h5format_convert h5stat include $(top_srcdir)/config/conclude.am diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index ae72ea9..2c4cf41 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -18,7 +18,7 @@ /* * We include the private header file so we can get to the uniform - * programming environment it declares. + * programming environment it declares. * HDF5 API functions (except for H5G_basename()) */ #include "H5private.h" @@ -74,7 +74,7 @@ static struct long_options l_opts[] = { * *------------------------------------------------------------------------- */ -static void usage(const char *prog) +static void usage(const char *prog) { HDfprintf(stdout, "usage: %s [OPTIONS] file_name\n", prog); HDfprintf(stdout, " OPTIONS\n"); @@ -114,7 +114,7 @@ static void usage(const char *prog) *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char **argv) +parse_command_line(int argc, const char **argv) { int opt; @@ -332,7 +332,7 @@ done: } else if(verbose_g) HDfprintf(stdout, "Close the dataset\n"); - + /* Close the dataset creation property list */ if(H5Pclose(dcpl) < 0) { error_msg("unable to close dataset creation property list\n"); @@ -475,7 +475,7 @@ done: HDfree(fname_g); if(dname_g) HDfree(dname_g); - + H5Eset_auto2(H5E_DEFAULT, func, edata); leave(h5tools_getstatus()); diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index ae93b30..b1d6ab4 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -794,7 +794,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, else if (H5Pget_vol_id(options->fout_fapl, &out_vol_id) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pget_vol_id failed"); - + if (in_vol_id != out_vol_id) use_h5ocopy = FALSE; diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 550b182..54b390f 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -3780,9 +3780,9 @@ void gent_multi(void) char *sv_data = NULL; haddr_t memb_addr[H5FD_MEM_NTYPES]; - sv_data = (char *)HDcalloc(H5FD_MEM_NTYPES * 1024, sizeof(char)); - sv = (char **)HDcalloc(H5FD_MEM_NTYPES, sizeof(sv_data)); - for (i = 0; i < H5FD_MEM_NTYPES; i++) + sv_data = (char *)HDcalloc(H5FD_MEM_NTYPES * 1024, sizeof(char)); + sv = (char **)HDcalloc(H5FD_MEM_NTYPES, sizeof(sv_data)); + for (i = 0; i < H5FD_MEM_NTYPES; i++) sv[i] = sv_data + (i * 1024); fapl = H5Pcreate(H5P_FILE_ACCESS); diff --git a/tools/test/h5format_convert/h5fc_chk_idx.c b/tools/test/h5format_convert/h5fc_chk_idx.c index 02cc25f..2fbbec4 100644 --- a/tools/test/h5format_convert/h5fc_chk_idx.c +++ b/tools/test/h5format_convert/h5fc_chk_idx.c @@ -13,7 +13,7 @@ /* * A program to verify that the chunk indexing type of a dataset in a file - * is version 1 B-tree. + * is version 1 B-tree. * This is to support the testing of the tool "h5format_convert". */ @@ -32,7 +32,7 @@ usage(void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: To check that the chunk indexing type for the dataset in + * Purpose: To check that the chunk indexing type for the dataset in * the file is version 1 B-tree. * * Return: 0 -- the indexing type is version 1 B-tree @@ -90,7 +90,7 @@ main(int argc, char *argv[]) } /* end if */ /* Return success when the chunk indexing type is version 1 B-tree */ - if(idx_type == H5D_CHUNK_IDX_BTREE) + if(idx_type == H5D_CHUNK_IDX_BTREE) HDexit(EXIT_SUCCESS); else { HDfprintf(stderr, "Error: chunk indexing type is %d\n", idx_type); diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index 38f7b2f..29906a1 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -42,7 +42,7 @@ LDADD=../../src/h5repack/libh5repack.la $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) testh5repack_detect_szip_SOURCES=testh5repack_detect_szip.c -h5repacktst_SOURCES=h5repacktst.c +h5repacktst_SOURCES=h5repacktst.c if HAVE_SHARED_CONDITIONAL diff --git a/tools/test/misc/vds/UC_1.h b/tools/test/misc/vds/UC_1.h index 9d1f758..d922d22 100644 --- a/tools/test/misc/vds/UC_1.h +++ b/tools/test/misc/vds/UC_1.h @@ -49,7 +49,7 @@ | | +-------M-------+ - + dim[0] / diff --git a/tools/test/misc/vds/UC_1_one_dim_gen.c b/tools/test/misc/vds/UC_1_one_dim_gen.c index b5ddae3..7c4201e 100644 --- a/tools/test/misc/vds/UC_1_one_dim_gen.c +++ b/tools/test/misc/vds/UC_1_one_dim_gen.c @@ -44,7 +44,7 @@ static char UC_1_VDS_FILE_NAME[NAME_LEN] = "1_vds.h5"; /* Dataset names */ static char UC_1_SOURCE_DSET_NAME[NAME_LEN] = "source_dset"; static char UC_1_VDS_DSET_NAME[NAME_LEN] = "vds_dset"; - + /* Fill values */ static int UC_1_FILL_VALUES[UC_1_N_SOURCES] = { -1, @@ -162,7 +162,7 @@ main(void) value = ((i + 1) * 10) + j; for(k = 0; k < count; k++) - buffer[k] = value; + buffer[k] = value; start[0] = (hsize_t)j; start[1] = 0; diff --git a/tools/test/misc/vds/UC_2.h b/tools/test/misc/vds/UC_2.h index a3ee0f7..07f9b9a 100644 --- a/tools/test/misc/vds/UC_2.h +++ b/tools/test/misc/vds/UC_2.h @@ -45,7 +45,7 @@ | | dim[1] - + */ #define UC_2_N_SOURCES 5 @@ -98,7 +98,7 @@ static char UC_2_FILE_NAMES[UC_2_N_SOURCES][NAME_LEN] = { /* VDS file name */ #define UC_2_VDS_FILE_NAME "2_vds.h5" - + /* Dataset names */ #define UC_2_SOURCE_DSET_NAME "source_dset" #define UC_2_SOURCE_DSET_PATH "/source_dset" diff --git a/tools/test/misc/vds/UC_2_two_dims_gen.c b/tools/test/misc/vds/UC_2_two_dims_gen.c index 8e1554b..b9799d6 100644 --- a/tools/test/misc/vds/UC_2_two_dims_gen.c +++ b/tools/test/misc/vds/UC_2_two_dims_gen.c @@ -168,7 +168,7 @@ main(void) value = ((i + 1) * 10) + j; for(k = 0; k < count; k++) - buffer[k] = value; + buffer[k] = value; start[0] = (hsize_t)j; start[1] = 0; diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index 5557558..e594e34 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -112,51 +112,51 @@ static int create_dset1(hid_t file) hsize_t chunk_dims[RANK] = {CHUNK1_DIM1, CHUNK1_DIM2}; int data[DSET1_DIM1][DSET1_DIM2]; /* data for writing */ int i, j; - + /* Create the data space. */ if((dataspace = H5Screate_simple (RANK, dims, NULL)) < 0) goto error; - + /* Modify dataset creation properties, i.e. enable chunking */ if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dcpl, RANK, chunk_dims) < 0) goto error; - + /* Set the dummy filter simply for counting the number of bytes being read into the memory */ if(H5Zregister(H5Z_COUNTER) < 0) goto error; - + if(H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL) < 0) goto error; - + /* Create a new dataset within the file using chunk creation properties. */ if((dataset = H5Dcreate2 (file, DSET1_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - + for (i = 0; i < DSET1_DIM1; i++) for (j = 0; j < DSET1_DIM2; j++) data[i][j] = i+j; - + /* Write data to dataset */ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) goto error; - + /* Close resources */ H5Dclose (dataset); H5Pclose (dcpl); H5Sclose (dataspace); return 0; - + error: H5E_BEGIN_TRY { H5Dclose (dataset); H5Pclose (dcpl); H5Sclose (dataspace); } H5E_END_TRY; - + return 1; } @@ -173,51 +173,51 @@ static int create_dset2(hid_t file) hsize_t chunk_dims[RANK] = {CHUNK2_DIM1, CHUNK2_DIM2}; int data[DSET2_DIM1][DSET2_DIM2]; /* data for writing */ int i, j; - + /* Create the data space. */ if((dataspace = H5Screate_simple (RANK, dims, NULL)) < 0) goto error; - + /* Modify dataset creation properties, i.e. enable chunking */ if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dcpl, RANK, chunk_dims) < 0) goto error; - + /* Set the dummy filter simply for counting the number of bytes being read into the memory */ if(H5Zregister(H5Z_COUNTER) < 0) goto error; if(H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL) < 0) goto error; - + /* Create a new dataset within the file using chunk creation properties. */ if((dataset = H5Dcreate2 (file, DSET2_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - + for (i = 0; i < DSET2_DIM1; i++) for (j = 0; j < DSET2_DIM2; j++) data[i][j] = i+j; - + /* Write data to dataset */ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) goto error; - + /* Close resources */ H5Dclose (dataset); H5Pclose (dcpl); H5Sclose (dataspace); - + return 0; - + error: H5E_BEGIN_TRY { H5Dclose (dataset); H5Pclose (dcpl); H5Sclose (dataspace); } H5E_END_TRY; - + return 1; } /*--------------------------------------------------------------------------- @@ -230,56 +230,56 @@ static int check_partial_chunks_perf(hid_t file) hid_t filespace = H5I_INVALID_HID; hid_t memspace = H5I_INVALID_HID; hid_t dapl = H5I_INVALID_HID; - + int rdata[DSET1_DIM2]; /* data for reading */ int i; - + hsize_t row_rank = 1; hsize_t row_dim[1] = {DSET1_DIM2}; hsize_t start[RANK] = {0, 0}; hsize_t count[RANK] = {1, DSET1_DIM2}; double start_t, end_t; - + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) goto error; if(H5Pset_chunk_cache (dapl, RDCC_NSLOTS, RDCC_NBYTES, RDCC_W0) < 0) goto error; dataset = H5Dopen2 (file, DSET1_NAME, dapl); - + H5_CHECK_OVERFLOW(row_rank, hsize_t, int); memspace = H5Screate_simple((int)row_rank, row_dim, NULL); filespace = H5Dget_space(dataset); - + nbytes_global = 0; - + start_t = retrieve_time(); - + /* Read the data row by row */ for(i = 0; i < DSET1_DIM1; i++) { start[0] = (hsize_t)i; if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL) < 0) goto error; - + if(H5Dread (dataset, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, rdata) < 0) goto error; } - + end_t = retrieve_time(); - + #ifdef H5_HAVE_GETTIMEOFDAY printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); #else printf("1. Partial chunks: no total read time because gettimeofday() is not available; number of bytes being read from file is %lu\n", nbytes_global); #endif - + H5Dclose (dataset); H5Sclose (filespace); H5Sclose (memspace); H5Pclose (dapl); - + return 0; error: H5E_BEGIN_TRY { @@ -302,21 +302,21 @@ static int check_hash_value_perf(hid_t file) hid_t filespace = H5I_INVALID_HID; hid_t memspace = H5I_INVALID_HID; hid_t dapl = H5I_INVALID_HID; - + int rdata[DSET2_DIM1]; /* data for reading */ int i; - + hsize_t column_rank = 1; hsize_t column_dim[1] = {DSET2_DIM1}; hsize_t start[RANK] = {0, 0}; hsize_t count[RANK] = {DSET2_DIM1, 1}; double start_t, end_t; - + if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) goto error; if(H5Pset_chunk_cache (dapl, RDCC_NSLOTS, RDCC_NBYTES, RDCC_W0) < 0) goto error; - + if((dataset = H5Dopen2 (file, DSET2_NAME, dapl)) < 0) goto error; @@ -325,37 +325,37 @@ static int check_hash_value_perf(hid_t file) goto error; if((filespace = H5Dget_space(dataset)) < 0) goto error; - + nbytes_global = 0; - + start_t = retrieve_time(); - + /* Read the data column by column */ for(i = 0; i < DSET2_DIM2; i++) { start[1] = (hsize_t)i; if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL) < 0) goto error; - + if(H5Dread (dataset, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, rdata) < 0) goto error; } - + end_t = retrieve_time(); - + #ifdef H5_HAVE_GETTIMEOFDAY printf("2. Hash value: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); #else printf("2. Hash value: no total read time because gettimeofday() is not available; number of bytes being read from file is %lu\n", nbytes_global); #endif - + H5Dclose (dataset); H5Sclose (filespace); H5Sclose (memspace); H5Pclose (dapl); return 0; - + error: H5E_BEGIN_TRY { H5Dclose (dataset); @@ -377,14 +377,14 @@ main (void) { hid_t file; /* handles */ int nerrors = 0; - + /* Create a new file. If file exists its contents will be overwritten. */ if((file = H5Fcreate (FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; nerrors += create_dset1(file); nerrors += create_dset2(file); - + if(H5Fclose (file) < 0) goto error; @@ -394,14 +394,14 @@ main (void) nerrors += check_partial_chunks_perf(file); nerrors += check_hash_value_perf(file); - + if(H5Fclose (file) < 0) goto error; - + if (nerrors>0) goto error; cleanup(); return 0; - + error: fprintf(stderr, "*** ERRORS DETECTED ***\n"); return 1; diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c index f13cd24..20b7237 100644 --- a/tools/test/perform/direct_write_perf.c +++ b/tools/test/perform/direct_write_perf.c @@ -75,7 +75,7 @@ const char *FILENAME[] = { #define NX 100 #define NY 1000 #define NZ 250 -#define CHUNK_NX 1 +#define CHUNK_NX 1 #define CHUNK_NY 1000 #define CHUNK_NZ 250 @@ -108,7 +108,7 @@ void reportTime(struct timeval start, double mbytes) } /* end if */ /*printf("mbytes=%lf, sec=%lf, usec=%lf\n", mbytes, (double)timeval_diff.tv_sec, (double)timeval_diff.tv_usec);*/ - printf("MBytes/second: %lf\n", (double)mbytes/((double)timeval_diff.tv_sec+((double)timeval_diff.tv_usec/(double)1000000.0))); + printf("MBytes/second: %lf\n", (double)mbytes/((double)timeval_diff.tv_sec+((double)timeval_diff.tv_usec/(double)1000000.0))); } /*-------------------------------------------------- @@ -121,7 +121,7 @@ int create_file(hid_t fapl_id) hid_t fapl; hid_t cparms; hid_t dataspace, dataset; - hsize_t dims[RANK] = {NX, NY, NZ}; + hsize_t dims[RANK] = {NX, NY, NZ}; hsize_t chunk_dims[RANK] ={CHUNK_NX, CHUNK_NY, CHUNK_NZ}; unsigned int aggression = 9; /* Compression aggression setting */ int ret; @@ -198,7 +198,7 @@ int create_file(hid_t fapl_id) if(H5Dclose(dataset) < 0) TEST_ERROR; - if(H5Fclose(file) < 0) + if(H5Fclose(file) < 0) TEST_ERROR; if(H5Sclose(dataspace) < 0) @@ -223,7 +223,7 @@ int create_file(hid_t fapl_id) /* Initialize data for chunks */ for(i = 0; i < NX; i++) { p = direct_buf[i] = (unsigned int*)malloc(CHUNK_NY*CHUNK_NZ*sizeof(unsigned int)); - + for(j=0; j < CHUNK_NY*CHUNK_NZ; j++, p++) *p = rand() % 65000; @@ -267,7 +267,7 @@ error: } /*-------------------------------------------------- - * Benchmark the performance of the new function + * Benchmark the performance of the new function * with precompressed data. *-------------------------------------------------- */ @@ -283,8 +283,8 @@ test_direct_write_uncompressed_data(hid_t fapl_id) unsigned filter_mask = 0; hsize_t offset[RANK] = {0, 0, 0}; - struct timeval timeval_start; - + struct timeval timeval_start; + TESTING("H5Dwrite_chunk for uncompressed data"); if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) @@ -301,8 +301,8 @@ test_direct_write_uncompressed_data(hid_t fapl_id) TEST_ERROR; - /* Write the compressed chunk data repeatedly to cover all the chunks in the - * dataset, using the direct writing function. */ + /* Write the compressed chunk data repeatedly to cover all the chunks in the + * dataset, using the direct writing function. */ for(i=0; i Date: Mon, 20 Apr 2020 17:38:45 -0700 Subject: Separated VFD and VOL parameters in tools. --- tools/lib/h5tools.c | 335 ++++++++++++++++++------------------- tools/lib/h5tools.h | 33 ++-- tools/libtest/h5tools_test_utils.c | 9 +- tools/src/h5dump/h5dump.c | 16 +- tools/src/h5ls/h5ls.c | 14 +- tools/src/h5repack/h5repack_main.c | 12 +- tools/src/h5stat/h5stat.c | 14 +- 7 files changed, 215 insertions(+), 218 deletions(-) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 2f641d0..cc51e2c 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -434,138 +434,126 @@ h5tools_set_error_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_vfd_fapl + * Function: h5tools_set_fapl_vfd * * Purpose: Given a VFL driver name, sets the appropriate driver on the * specified FAPL. * - * TODO: Add handling for Windows VFD. - * * Return: positive - succeeded * negative - failed *------------------------------------------------------------------------- */ static herr_t -h5tools_set_vfd_fapl(hid_t fapl, h5tools_fapl_info_t *fapl_info) +h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) { herr_t ret_value = SUCCEED; - switch (fapl_info->type) { - /* Currently, only retrieving a VFD by name is supported */ - case VFD_BY_NAME: - /* Determine which driver the user wants to open the file with */ - if (!HDstrcmp(fapl_info->u.name, drivernames[SEC2_VFD_IDX])) { - /* SEC2 Driver */ - if (H5Pset_fapl_sec2(fapl) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed"); - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[DIRECT_VFD_IDX])) { + /* Determine which driver the user wants to open the file with */ + if (!HDstrcmp(vfd_info->name, drivernames[SEC2_VFD_IDX])) { + /* SEC2 Driver */ + if (H5Pset_fapl_sec2(fapl_id) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[DIRECT_VFD_IDX])) { #ifdef H5_HAVE_DIRECT - /* Direct Driver */ - if (H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_direct failed"); + /* Direct Driver */ + if (H5Pset_fapl_direct(fapl_id, 1024, 4096, 8 * 4096) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_direct failed"); #else - H5TOOLS_GOTO_ERROR(FAIL, "Direct VFD is not enabled"); + H5TOOLS_GOTO_ERROR(FAIL, "Direct VFD is not enabled"); #endif - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[LOG_VFD_IDX])) { - unsigned long long log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; + } + else if (!HDstrcmp(vfd_info->name, drivernames[LOG_VFD_IDX])) { + unsigned long long log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; - /* Log Driver */ - if (H5Pset_fapl_log(fapl, NULL, log_flags, (size_t) 0) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed"); - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[WINDOWS_VFD_IDX])) { + /* Log Driver */ + if (H5Pset_fapl_log(fapl_id, NULL, log_flags, (size_t) 0) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_log failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[WINDOWS_VFD_IDX])) { #ifdef H5_HAVE_WINDOWS - + /* There is no Windows VFD - use SEC2 */ + if (H5Pset_fapl_sec2(fapl_id) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed"); #else - H5TOOLS_GOTO_ERROR(FAIL, "Windows VFD is not enabled"); + H5TOOLS_GOTO_ERROR(FAIL, "Windows VFD is not enabled"); #endif - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[STDIO_VFD_IDX])) { - /* Stdio Driver */ - if (H5Pset_fapl_stdio(fapl) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_stdio failed"); - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[CORE_VFD_IDX])) { - /* Core Driver */ - if (H5Pset_fapl_core(fapl, (size_t) H5_MB, TRUE) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_stdio failed"); - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[FAMILY_VFD_IDX])) { - /* FAMILY Driver */ - - /* Set member size to be 0 to indicate the current first member size - * is the member size. - */ - if (H5Pset_fapl_family(fapl, (hsize_t) 0, H5P_DEFAULT) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_family failed"); - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[SPLIT_VFD_IDX])) { - /* SPLIT Driver */ - if (H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_split failed"); - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[MULTI_VFD_IDX])) { - /* MULTI Driver */ - if (H5Pset_fapl_multi(fapl, NULL, NULL, NULL, NULL, TRUE) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_multi failed"); - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[MPIO_VFD_IDX])) { + } + else if (!HDstrcmp(vfd_info->name, drivernames[STDIO_VFD_IDX])) { + /* Stdio Driver */ + if (H5Pset_fapl_stdio(fapl_id) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_stdio failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[CORE_VFD_IDX])) { + /* Core Driver */ + if (H5Pset_fapl_core(fapl_id, (size_t) H5_MB, TRUE) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_core failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[FAMILY_VFD_IDX])) { + /* FAMILY Driver */ + /* Set member size to be 0 to indicate the current first member size + * is the member size. + */ + if (H5Pset_fapl_family(fapl_id, (hsize_t) 0, H5P_DEFAULT) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_family failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[SPLIT_VFD_IDX])) { + /* SPLIT Driver */ + if (H5Pset_fapl_split(fapl_id, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_split failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[MULTI_VFD_IDX])) { + /* MULTI Driver */ + if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_multi failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[MPIO_VFD_IDX])) { #ifdef H5_HAVE_PARALLEL - int mpi_initialized, mpi_finalized; + int mpi_initialized, mpi_finalized; - /* MPI-I/O Driver */ + /* MPI-I/O Driver */ - /* check if MPI is available. */ - MPI_Initialized(&mpi_initialized); - MPI_Finalized(&mpi_finalized); + /* check if MPI is available. */ + MPI_Initialized(&mpi_initialized); + MPI_Finalized(&mpi_finalized); - if (mpi_initialized && !mpi_finalized) { - if (H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_mpio failed"); - } /* end if */ + if (mpi_initialized && !mpi_finalized) { + if (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_mpio failed"); + } #else - H5TOOLS_GOTO_ERROR(FAIL, "MPI-I/O VFD is not enabled"); + H5TOOLS_GOTO_ERROR(FAIL, "MPI-I/O VFD is not enabled"); #endif /* H5_HAVE_PARALLEL */ - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[ROS3_VFD_IDX])) { + } + else if (!HDstrcmp(vfd_info->name, drivernames[ROS3_VFD_IDX])) { #ifdef H5_HAVE_ROS3_VFD - if (!fapl_info->info_string) - H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD info is invalid"); - if (H5Pset_fapl_ros3(fapl, (H5FD_ros3_fapl_t *)fapl_info->info_string) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_ros3() failed"); + if (!vfd_info->info) + H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD info is invalid"); + if (H5Pset_fapl_ros3(fapl_id, (H5FD_ros3_fapl_t *)vfd_info->info) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_ros3() failed"); #else - H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD is not enabled"); + H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD is not enabled"); #endif - } - else if (!HDstrcmp(fapl_info->u.name, drivernames[HDFS_VFD_IDX])) { + } + else if (!HDstrcmp(vfd_info->name, drivernames[HDFS_VFD_IDX])) { #ifdef H5_HAVE_LIBHDFS - if (!fapl_info->info_string) - H5TOOLS_GOTO_ERROR(FAIL, "HDFS VFD info is invalid"); - if (H5Pset_fapl_hdfs(fapl, (H5FD_hdfs_fapl_t *)fapl_info->info_string) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_hdfs() failed"); + if (!vfd_info->info) + H5TOOLS_GOTO_ERROR(FAIL, "HDFS VFD info is invalid"); + if (H5Pset_fapl_hdfs(fapl_id, (H5FD_hdfs_fapl_t *)vfd_info->info) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_hdfs() failed"); #else - H5TOOLS_GOTO_ERROR(FAIL, "The HDFS VFD is not enabled"); + H5TOOLS_GOTO_ERROR(FAIL, "The HDFS VFD is not enabled"); #endif - } - else - H5TOOLS_GOTO_ERROR(FAIL, "invalid VFD name"); - - break; - - case VOL_BY_NAME: - case VOL_BY_VALUE: - default: - H5TOOLS_GOTO_ERROR(FAIL, "invalid VFD retrieval type"); } + else + H5TOOLS_GOTO_ERROR(FAIL, "invalid VFD name"); done: return ret_value; } /*------------------------------------------------------------------------- - * Function: h5tools_set_vol_fapl + * Function: h5tools_set_fapl_vol * * Purpose: Given a VOL connector name or ID, sets the appropriate * connector on the specified FAPL. @@ -575,83 +563,86 @@ done: *------------------------------------------------------------------------- */ static herr_t -h5tools_set_vol_fapl(hid_t fapl_id, h5tools_fapl_info_t *fapl_info) +h5tools_set_fapl_vol(hid_t fapl_id, h5tools_vol_info_t *vol_info) { htri_t connector_is_registered; hid_t connector_id = H5I_INVALID_HID; - void *vol_info = NULL; + void *connector_info = NULL; herr_t ret_value = SUCCEED; - switch (fapl_info->type) { + switch (vol_info->type) { case VOL_BY_NAME: /* Retrieve VOL connector by name */ - if ((connector_is_registered = H5VLis_connector_registered_by_name(fapl_info->u.name)) < 0) + if ((connector_is_registered = H5VLis_connector_registered_by_name(vol_info->u.name)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "can't check if VOL connector is registered"); if (connector_is_registered) { - if ((connector_id = H5VLget_connector_id_by_name(fapl_info->u.name)) < 0) + if ((connector_id = H5VLget_connector_id_by_name(vol_info->u.name)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "can't get VOL connector ID"); } else { - /* Check for VOL connectors that ship with the library */ - if (!HDstrcmp(fapl_info->u.name, H5VL_NATIVE_NAME)) { + /* Check for VOL connectors that ship with the library, then try + * registering by name if that fails. + */ + if (!HDstrcmp(vol_info->u.name, H5VL_NATIVE_NAME)) { connector_id = H5VL_NATIVE; } - else if (!HDstrcmp(fapl_info->u.name, H5VL_PASSTHRU_NAME)) { + else if (!HDstrcmp(vol_info->u.name, H5VL_PASSTHRU_NAME)) { connector_id = H5VL_PASSTHRU; } else { - if ((connector_id = H5VLregister_connector_by_name(fapl_info->u.name, H5P_DEFAULT)) < 0) + /* NOTE: Not being able to pass in a VIPL may be a limitation for some + * connectors. + */ + if ((connector_id = H5VLregister_connector_by_name(vol_info->u.name, H5P_DEFAULT)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "can't register VOL connector"); } } - /* Convert the info string */ - if (fapl_info->info_string) - if (H5VLconnector_str_to_info(fapl_info->info_string, connector_id, &vol_info) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "can't get VOL info from string"); - break; case VOL_BY_VALUE: /* Retrieve VOL connector by ID */ - if ((connector_is_registered = H5VLis_connector_registered_by_value(fapl_info->u.value)) < 0) + if ((connector_is_registered = H5VLis_connector_registered_by_value(vol_info->u.value)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "can't check if VOL connector is registered"); if (connector_is_registered) { - if ((connector_id = H5VLget_connector_id_by_value(fapl_info->u.value)) < 0) + if ((connector_id = H5VLget_connector_id_by_value(vol_info->u.value)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "can't get VOL connector ID"); } else { /* Check for VOL connectors that ship with the library */ - if (fapl_info->u.value == H5VL_NATIVE_VALUE) { + if (vol_info->u.value == H5VL_NATIVE_VALUE) { connector_id = H5VL_NATIVE; } - else if (fapl_info->u.value == H5VL_PASSTHRU_VALUE) { + else if (vol_info->u.value == H5VL_PASSTHRU_VALUE) { connector_id = H5VL_PASSTHRU; } else { - if ((connector_id = H5VLregister_connector_by_value(fapl_info->u.value, H5P_DEFAULT)) < 0) + /* NOTE: Not being able to pass in a VIPL may be a limitation for some + * connectors. + */ + if ((connector_id = H5VLregister_connector_by_value(vol_info->u.value, H5P_DEFAULT)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "can't register VOL connector"); } } - /* Convert the info string */ - if (fapl_info->info_string) - if (H5VLconnector_str_to_info(fapl_info->info_string, connector_id, &vol_info) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "can't get VOL info from string"); - break; - case VFD_BY_NAME: default: H5TOOLS_GOTO_ERROR(FAIL, "invalid VOL retrieval type"); } - if (H5Pset_vol(fapl_id, connector_id, vol_info) < 0) + /* Convert the info string, if provided */ + if (vol_info->info_string) + if (H5VLconnector_str_to_info(vol_info->info_string, connector_id, &connector_info) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "can't get VOL connector info from string"); + + /* Set the VOL connector on the fapl */ + if (H5Pset_vol(fapl_id, connector_id, connector_info) < 0) H5TOOLS_GOTO_ERROR(FAIL, "can't set VOL connector on FAPL"); done: - if (vol_info) - if (H5VLfree_connector_info(connector_id, vol_info)) + if (connector_info) + if (H5VLfree_connector_info(connector_id, connector_info)) H5TOOLS_ERROR(FAIL, "failed to free VOL connector-specific info"); if (ret_value < 0) { @@ -665,45 +656,43 @@ done: /*------------------------------------------------------------------------- * Function: h5tools_get_fapl * - * Purpose: Get a FAPL for a given VFL driver name, VOL connector name - * or VOL connector ID. + * Purpose: Copies an input fapl and then sets a VOL and/or a VFD on it. + * + * The returned fapl must be closed by the caller. * * Return: positive - succeeded * negative - failed *------------------------------------------------------------------------- */ hid_t -h5tools_get_fapl(hid_t prev_fapl_id, h5tools_fapl_info_t *fapl_info) +h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info, + h5tools_vfd_info_t *vfd_info) { hid_t new_fapl_id = H5I_INVALID_HID; hid_t ret_value = H5I_INVALID_HID; if (prev_fapl_id < 0) H5TOOLS_GOTO_ERROR(FAIL, "invalid FAPL"); - if (!fapl_info) - H5TOOLS_GOTO_ERROR(FAIL, "invalid FAPL retrieval info"); - /* Make a copy of the FAPL if necessary, or create a FAPL if - * H5P_DEFAULT is specified. */ + /* Make a copy of the FAPL or create one if H5P_DEFAULT is specified. */ if (H5P_DEFAULT == prev_fapl_id) { if ((new_fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Pcreate failed"); - } /* end if */ + } else { if ((new_fapl_id = H5Pcopy(prev_fapl_id)) < 0) H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Pcopy failed"); } - if (VFD_BY_NAME == fapl_info->type) { - if (h5tools_set_vfd_fapl(new_fapl_id, fapl_info) < 0) - H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to set VFD on FAPL"); - } - else if (VOL_BY_NAME == fapl_info->type || VOL_BY_VALUE == fapl_info->type) { - if (h5tools_set_vol_fapl(new_fapl_id, fapl_info) < 0) + /* Set non-default VOL connector, if requested */ + if (vol_info) + if (h5tools_set_fapl_vol(new_fapl_id, vol_info) < 0) H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to set VOL on FAPL"); - } - else - H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "invalid FAPL retrieval type"); + + /* Set non-default virtual file driver, if requested */ + if (vfd_info) + if (h5tools_set_fapl_vfd(new_fapl_id, vfd_info) < 0) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to set VFD on FAPL"); ret_value = new_fapl_id; @@ -851,13 +840,12 @@ done: *------------------------------------------------------------------------- */ hid_t -h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specific_driver, +h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_specific_driver, char *drivername, size_t drivername_size) { hid_t fid = H5I_INVALID_HID; - hid_t tmp_vol_fapl = H5I_INVALID_HID; - hid_t tmp_vfd_fapl = H5I_INVALID_HID; - hid_t used_fapl = H5I_INVALID_HID; + hid_t tmp_fapl_id = H5I_INVALID_HID; + hid_t used_fapl_id = H5I_INVALID_HID; unsigned volnum, drivernum; hid_t ret_value = H5I_INVALID_HID; @@ -872,17 +860,17 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specifi /* Allow error stack display if --enable-error-stack has optional arg number */ if (enable_error_stack > 1) { - fid = H5Fopen(fname, flags, fapl); + fid = H5Fopen(fname, flags, fapl_id); } else { H5E_BEGIN_TRY { - fid = H5Fopen(fname, flags, fapl); + fid = H5Fopen(fname, flags, fapl_id); } H5E_END_TRY; } /* If we succeeded in opening the file, we're done. */ if (fid >= 0) { - used_fapl = fapl; + used_fapl_id = fapl_id; H5TOOLS_GOTO_DONE(fid); } @@ -900,18 +888,16 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specifi * connector being looked at, also try using each of the available VFL drivers. */ for (volnum = 0; volnum < NUM_VOLS; volnum++) { - h5tools_fapl_info_t vol_info; + h5tools_vol_info_t vol_info; vol_info.type = VOL_BY_NAME; vol_info.info_string = NULL; vol_info.u.name = volnames[volnum]; - /* Get a FAPL for the current VOL connector */ - if ((tmp_vol_fapl = h5tools_get_fapl(fapl, &vol_info)) < 0) - continue; - /* TODO: For now, we have no way of determining if an arbitrary - * VOL connector is native-terminal. */ + * VOL connector is native-terminal so we only try VFDs with the + * actual native VOL connector. + */ if (NATIVE_VOL_IDX == volnum) { /* * If using the native VOL connector, or a VOL connector which has the @@ -919,7 +905,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specifi * VFL drivers as well. */ for (drivernum = 0; drivernum < NUM_DRIVERS; drivernum++) { - h5tools_fapl_info_t vfd_info; + h5tools_vfd_info_t vfd_info; /* Skip the log VFD as it prints out to standard out * and is fundamentally SEC2 anyway. @@ -927,34 +913,41 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specifi if (drivernum == LOG_VFD_IDX) continue; - vfd_info.type = VFD_BY_NAME; - vfd_info.info_string = NULL; - vfd_info.u.name = drivernames[drivernum]; + vfd_info.info = NULL; + vfd_info.name = drivernames[drivernum]; - /* Using the current VOL FAPL as a base, get the correct FAPL for the given VFL driver */ - if ((tmp_vfd_fapl = h5tools_get_fapl(tmp_vol_fapl, &vfd_info)) < 0) + /* Get a fapl reflecting the selected VOL connector and VFD */ + if ((tmp_fapl_id = h5tools_get_fapl(fapl_id, &vol_info, &vfd_info)) < 0) continue; - if ((fid = h5tools_fopen(fname, flags, tmp_vfd_fapl, TRUE, drivername, drivername_size)) >= 0) { - used_fapl = tmp_vfd_fapl; + /* Can we open the file with this combo? */ + if ((fid = h5tools_fopen(fname, flags, tmp_fapl_id, TRUE, drivername, drivername_size)) >= 0) { + used_fapl_id = tmp_fapl_id; H5TOOLS_GOTO_DONE(fid); } else { - /* Close the temporary VFD FAPL */ - H5Pclose(tmp_vfd_fapl); - tmp_vfd_fapl = H5I_INVALID_HID; + /* Close the temporary fapl */ + H5Pclose(tmp_fapl_id); + tmp_fapl_id = H5I_INVALID_HID; } } } else { - if ((fid = h5tools_fopen(fname, flags, tmp_vol_fapl, TRUE, drivername, drivername_size)) >= 0) { - used_fapl = tmp_vol_fapl; + /* NOT the native VOL connector */ + + /* Get a FAPL for the current VOL connector */ + if ((tmp_fapl_id = h5tools_get_fapl(fapl_id, &vol_info, NULL)) < 0) + continue; + + /* Can we open the file with this connector? */ + if ((fid = h5tools_fopen(fname, flags, tmp_fapl_id, TRUE, drivername, drivername_size)) >= 0) { + used_fapl_id = tmp_fapl_id; H5TOOLS_GOTO_DONE(fid); } else { /* Close the temporary VOL FAPL */ - H5Pclose(tmp_vol_fapl); - tmp_vol_fapl = H5I_INVALID_HID; + H5Pclose(tmp_fapl_id); + tmp_fapl_id = H5I_INVALID_HID; } } } @@ -965,13 +958,11 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specifi done: /* Save the driver name if using a native-terminal VOL connector */ if (drivername && drivername_size && ret_value >= 0) - if (used_fapl >= 0 && h5tools_get_vfd_name(used_fapl, drivername, drivername_size) < 0) + if (used_fapl_id >= 0 && h5tools_get_vfd_name(used_fapl_id, drivername, drivername_size) < 0) H5TOOLS_ERROR(H5I_INVALID_HID, "failed to retrieve name of VFD used to open file"); - if (tmp_vfd_fapl >= 0) - H5Pclose(tmp_vfd_fapl); - if (tmp_vol_fapl >= 0) - H5Pclose(tmp_vol_fapl); + if (tmp_fapl_id >= 0) + H5Pclose(tmp_fapl_id); return ret_value; } diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index b931dc8..2b6fffb 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -539,24 +539,36 @@ typedef struct h5tools_context_t { int display_char; /* */ } h5tools_context_t; +/* VOL and VFD info structs used to set the file access property + * lists in the tools. + */ + typedef enum { - VFD_BY_NAME, VOL_BY_NAME, VOL_BY_VALUE -} h5tools_fapl_info_type_t; +} h5tools_vol_info_type_t; -typedef struct h5tools_fapl_info_t { - h5tools_fapl_info_type_t type; +typedef struct h5tools_vol_info_t { + h5tools_vol_info_type_t type; - /* Pointer to information to be passed to the driver/connector for its setup */ + /* Pointer to information string to be passed to the connector for its setup */ const char *info_string; - /* Field specifying either the driver's/connector's name or ID */ + /* Field specifying either the connector's name or value (ID) */ union { - const char *name; /* VOL and VFD */ - H5VL_class_value_t value; /* VOL only */ + const char *name; + H5VL_class_value_t value; } u; -} h5tools_fapl_info_t; +} h5tools_vol_info_t; + +typedef struct h5tools_vfd_info_t { + + /* Pointer to information to be passed to the driver for its setup */ + const void *info; + + /* Name of the VFD */ + const char *name; +} h5tools_vfd_info_t; H5TOOLS_DLLVAR const char *volnames[]; H5TOOLS_DLLVAR const char *drivernames[]; @@ -637,7 +649,8 @@ H5TOOLS_DLL int h5tools_set_attr_output_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_input_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_output_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); -H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_fapl_info_t *fapl_info); +H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info, + h5tools_vfd_info_t *vfd_info); H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size); H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specific_driver, char *drivername, size_t drivername_size); diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index aecd3f5..12360a7 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -1148,7 +1148,7 @@ test_set_configured_fapl(void) TESTING("programmatic fapl set"); for (i = 0; i < n_cases; i++) { - h5tools_fapl_info_t fapl_info; + h5tools_vfd_info_t vfd_info; hid_t result; testcase C = cases[i]; @@ -1171,10 +1171,9 @@ test_set_configured_fapl(void) #endif /* UTIL_TEST_DEBUG */ /* test */ - fapl_info.type = VFD_BY_NAME; - fapl_info.info_string = C.conf_fa; - fapl_info.u.name = C.vfdname; - result = h5tools_get_fapl(H5P_DEFAULT, &fapl_info); + vfd_info.info = C.conf_fa; + vfd_info.name = C.vfdname; + result = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info); if (C.expected == 0) JSVERIFY( result, H5I_INVALID_HID, C.message) else diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 3de6454..d292b75 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -870,7 +870,7 @@ parse_command_line(int argc, const char *argv[]) } /* this will be plenty big enough to hold the info */ - if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) { + if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t))) == NULL) { goto error; } @@ -1415,16 +1415,14 @@ main(int argc, const char *argv[]) h5trav_set_index(sort_by, sort_order); if (driver != NULL) { - h5tools_fapl_info_t fapl_info; + h5tools_vfd_info_t vfd_info; - /* Currently, only retrieval of VFDs is supported. */ - fapl_info.type = VFD_BY_NAME; - fapl_info.info_string = NULL; - fapl_info.u.name = driver; + vfd_info.info = NULL; + vfd_info.name = driver; if (!HDstrcmp(driver, drivernames[ROS3_VFD_IDX])) { #ifdef H5_HAVE_ROS3_VFD - fapl_info.info_string = (void *)&ros3_fa; + vfd_info.info = (void *)&ros3_fa; #else error_msg("Read-Only S3 VFD not enabled.\n"); h5tools_setstatus(EXIT_FAILURE); @@ -1433,7 +1431,7 @@ main(int argc, const char *argv[]) } else if (!HDstrcmp(driver, drivernames[HDFS_VFD_IDX])) { #ifdef H5_HAVE_LIBHDFS - fapl_info.info_string = (void *)&hdfs_fa; + vfd_info.info = (void *)&hdfs_fa; #else error_msg("The HDFS VFD is not enabled.\n"); h5tools_setstatus(EXIT_FAILURE); @@ -1441,7 +1439,7 @@ main(int argc, const char *argv[]) #endif } - if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &fapl_info)) < 0) { + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info)) < 0) { error_msg("unable to create FAPL for file access\n"); h5tools_setstatus(EXIT_FAILURE); goto done; diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 9fc91f1..3036ae9 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -3148,16 +3148,14 @@ main(int argc, const char *argv[]) } if (preferred_driver) { - h5tools_fapl_info_t fapl_info; + h5tools_vfd_info_t vfd_info; - /* Currently, only retrieval of VFDs is supported. */ - fapl_info.type = VFD_BY_NAME; - fapl_info.info_string = NULL; - fapl_info.u.name = preferred_driver; + vfd_info.info = NULL; + vfd_info.name = preferred_driver; if (!HDstrcmp(preferred_driver, drivernames[ROS3_VFD_IDX])) { #ifdef H5_HAVE_ROS3_VFD - fapl_info.info_string = (void *)&ros3_fa; + vfd_info.info = (void *)&ros3_fa; #else HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n"); leave(EXIT_FAILURE); @@ -3165,14 +3163,14 @@ main(int argc, const char *argv[]) } else if (!HDstrcmp(preferred_driver, drivernames[HDFS_VFD_IDX])) { #ifdef H5_HAVE_LIBHDFS - fapl_info.info_string = (void *)&hdfs_fa; + vfd_info.info = (void *)&hdfs_fa; #else HDfprintf(rawerrorstream, "Error: The HDFS VFD is not enabled\n\n"); leave(EXIT_FAILURE); #endif } - if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &fapl_info)) < 0) { + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info)) < 0) { HDfprintf(rawerrorstream, "Error: Unable to create FAPL for file access\n\n"); leave(EXIT_FAILURE); } diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 03da8d9..d54827f 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -432,16 +432,16 @@ set_sort_order(const char *form) static int parse_command_line(int argc, const char **argv, pack_opt_t* options) { - h5tools_fapl_info_t in_vol_info; - h5tools_fapl_info_t out_vol_info; + h5tools_vol_info_t in_vol_info; + h5tools_vol_info_t out_vol_info; hbool_t custom_in_fapl = FALSE; hbool_t custom_out_fapl = FALSE; hid_t tmp_fapl = H5I_INVALID_HID; int bound, opt; int ret_value = 0; - HDmemset(&in_vol_info, 0, sizeof(h5tools_fapl_info_t)); - HDmemset(&out_vol_info, 0, sizeof(h5tools_fapl_info_t)); + HDmemset(&in_vol_info, 0, sizeof(h5tools_vol_info_t)); + HDmemset(&out_vol_info, 0, sizeof(h5tools_vol_info_t)); /* parse command line options */ while (EOF != (opt = get_option(argc, argv, s_opts, l_opts))) { @@ -747,7 +747,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) /* Setup FAPL for input and output file accesses */ if (custom_in_fapl) { - if ((tmp_fapl = h5tools_get_fapl(options->fin_fapl, &in_vol_info)) < 0) { + if ((tmp_fapl = h5tools_get_fapl(options->fin_fapl, &in_vol_info, NULL)) < 0) { error_msg("failed to setup FAPL for input file\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; @@ -767,7 +767,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) } if (custom_out_fapl) { - if ((tmp_fapl = h5tools_get_fapl(options->fout_fapl, &out_vol_info)) < 0) { + if ((tmp_fapl = h5tools_get_fapl(options->fout_fapl, &out_vol_info, NULL)) < 0) { error_msg("failed to setup FAPL for output file\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index bebe443..fb3d50d7 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -1813,16 +1813,14 @@ main(int argc, const char *argv[]) goto done; if (drivername) { - h5tools_fapl_info_t fapl_info; + h5tools_vfd_info_t vfd_info; - /* Currently, only retrieval of VFDs is supported. */ - fapl_info.type = VFD_BY_NAME; - fapl_info.info_string = NULL; - fapl_info.u.name = drivername; + vfd_info.info = NULL; + vfd_info.name = drivername; if (!HDstrcmp(drivername, drivernames[ROS3_VFD_IDX])) { #ifdef H5_HAVE_ROS3_VFD - fapl_info.info_string = (void *)&ros3_fa; + vfd_info.info = (void *)&ros3_fa; #else error_msg("Read-Only S3 VFD not enabled.\n"); goto done; @@ -1830,14 +1828,14 @@ main(int argc, const char *argv[]) } else if (!HDstrcmp(drivername, drivernames[HDFS_VFD_IDX])) { #ifdef H5_HAVE_LIBHDFS - fapl_info.info_string = (void *)&hdfs_fa; + vfd_info.info = (void *)&hdfs_fa; #else error_msg("HDFS VFD not enabled.\n"); goto done; #endif } - if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &fapl_info)) < 0) { + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info)) < 0) { error_msg("Unable to create FAPL for file access\n"); goto done; } -- cgit v0.12 From 8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Apr 2020 11:36:10 -0700 Subject: Added VOL command-line options to (p)h5diff, h5ls, h5dump, and h5mkgrp. --- tools/lib/h5diff.c | 29 ++- tools/lib/h5diff.h | 5 + tools/src/h5diff/h5diff_common.c | 52 ++++- tools/src/h5dump/h5dump.c | 128 +++++++---- tools/src/h5dump/h5dump.h | 1 + tools/src/h5ls/h5ls.c | 32 +++ tools/src/h5repack/h5repack_main.c | 1 + tools/src/misc/h5mkgrp.c | 234 ++++++++++++--------- tools/test/h5diff/testfiles/h5diff_10.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_600.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_603.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_606.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_612.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_615.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_621.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_622.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_623.txt | 12 ++ tools/test/h5diff/testfiles/h5diff_624.txt | 12 ++ tools/test/misc/testfiles/h5mkgrp_help.txt | 7 + tools/testfiles/h5dump-help.txt | 6 + tools/testfiles/help-1.ls | 6 + tools/testfiles/help-2.ls | 6 + tools/testfiles/help-3.ls | 6 + .../pbits/tnofilename-with-packed-bits.ddl | 6 + tools/testfiles/pbits/tpbitsIncomplete.ddl | 6 + tools/testfiles/pbits/tpbitsLengthExceeded.ddl | 6 + tools/testfiles/pbits/tpbitsLengthPositive.ddl | 6 + tools/testfiles/pbits/tpbitsMaxExceeded.ddl | 6 + tools/testfiles/pbits/tpbitsOffsetExceeded.ddl | 6 + tools/testfiles/pbits/tpbitsOffsetNegative.ddl | 6 + tools/testfiles/textlinksrc-nodangle-1.ls | 6 + tools/testfiles/tgroup-1.ls | 6 + 32 files changed, 540 insertions(+), 147 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index fff0b9a..d11d28f 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -519,6 +519,8 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char { hid_t file1_id = H5I_INVALID_HID; hid_t file2_id = H5I_INVALID_HID; + hid_t fapl1_id = H5P_DEFAULT; + hid_t fapl2_id = H5P_DEFAULT; char filenames[2][MAX_FILENAME]; hsize_t nfound = 0; int l_ret1 = -1; @@ -570,17 +572,32 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char *------------------------------------------------------------------------- */ /* open file 1 */ - if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { + if (opts->custom_in_vol) { + if((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->in_vol_info), NULL)) < 0 ) { + parallel_print("h5diff: unable to create fapl for input file\n"); + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create input fapl\n"); + } + } + + if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, fapl1_id, FALSE, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname1); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "<%s>: unable to open file\n", fname1); - } /* end if */ + } H5TOOLS_DEBUG("file1_id = %s", fname1); /* open file 2 */ - if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { + + if (opts->custom_out_vol) { + if((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->out_vol_info), NULL)) < 0 ) { + parallel_print("h5diff: unable to create fapl for output file\n"); + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create output fapl\n"); + } + } + + if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, fapl2_id, FALSE, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname2); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "<%s>: unable to open file\n", fname2); - } /* end if */ + } H5TOOLS_DEBUG("file2_id = %s", fname2); /*------------------------------------------------------------------------- @@ -967,6 +984,10 @@ done: { H5Fclose(file1_id); H5Fclose(file2_id); + if (fapl1_id != H5P_DEFAULT) + H5Pclose(fapl1_id); + if (fapl2_id != H5P_DEFAULT) + H5Pclose(fapl2_id); } H5E_END_TRY; H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat); diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index b04ec23..1ac1dd7 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -15,6 +15,7 @@ #define H5DIFF_H__ #include "hdf5.h" +#include "h5tools.h" #include "h5trav.h" /* @@ -86,6 +87,10 @@ typedef struct { int m_list_not_cmp; /* list not comparable messages */ int exclude_path; /* exclude path to an object */ struct exclude_path_list * exclude; /* keep exclude path list */ + h5tools_vol_info_t in_vol_info; /* VOL information for input file */ + h5tools_vol_info_t out_vol_info; /* VOL information for output file */ + hbool_t custom_in_vol; /* Using a custom input VOL? */ + hbool_t custom_out_vol; /* Using a custom output VOL? */ } diff_opt_t; diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index e05a8e3..e040696 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -42,6 +42,12 @@ static struct long_options l_opts[] = { { "no-dangling-links", no_arg, 'x' }, { "exclude-path", require_arg, 'E' }, { "enable-error-stack", no_arg, 'S' }, + { "src-vol-value", require_arg, '1' }, + { "src-vol-name", require_arg, '2' }, + { "src-vol-info", require_arg, '3' }, + { "dst-vol-value", require_arg, '4' }, + { "dst-vol-name", require_arg, '5' }, + { "dst-vol-info", require_arg, '6' }, { NULL, 0, '\0' } }; @@ -91,7 +97,7 @@ void parse_command_line(int argc, struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node; /* process the command-line */ - memset(opts, 0, sizeof (diff_opt_t)); + HDmemset(opts, 0, sizeof (diff_opt_t)); /* assume equal contents initially */ opts->contents = 1; @@ -258,6 +264,38 @@ void parse_command_line(int argc, case 'e': opts->use_system_epsilon = 1; break; + + case '1': + opts->in_vol_info.type = VOL_BY_VALUE; + opts->in_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + opts->custom_in_vol = TRUE; + break; + + case '2': + opts->in_vol_info.type = VOL_BY_NAME; + opts->in_vol_info.u.name = opt_arg; + opts->custom_in_vol = TRUE; + break; + + case '3': + opts->in_vol_info.info_string = opt_arg; + break; + + case '4': + opts->out_vol_info.type = VOL_BY_VALUE; + opts->out_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + opts->custom_out_vol = TRUE; + break; + + case '5': + opts->out_vol_info.type = VOL_BY_NAME; + opts->out_vol_info.u.name = opt_arg; + opts->custom_out_vol = TRUE; + break; + + case '6': + opts->out_vol_info.info_string = opt_arg; + break; } } @@ -469,6 +507,18 @@ void usage(void) PRINTVALSTREAM(rawoutstream, " Quiet mode. Do not produce output.\n"); PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); PRINTVALSTREAM(rawoutstream, " Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, " --src-vol-value Value (ID) of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " input HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --src-vol-name Name of the VOL connector to use for opening the input\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --src-vol-info VOL-specific info to pass to the VOL connector used for\n"); + PRINTVALSTREAM(rawoutstream, " opening the input HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --dst-vol-value Value (ID) of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " output HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --dst-vol-name Name of the VOL connector to use for opening the output\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --dst-vol-info VOL-specific info to pass to the VOL connector used for\n"); + PRINTVALSTREAM(rawoutstream, " opening the output HDF5 file specified\n"); PRINTVALSTREAM(rawoutstream, " --follow-symlinks\n"); PRINTVALSTREAM(rawoutstream, " Follow symbolic links (soft links and external links and compare the)\n"); PRINTVALSTREAM(rawoutstream, " links' target objects.\n"); diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index d292b75..dfaff17 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -18,15 +18,18 @@ /* Name of tool */ #define PROGRAMNAME "h5dump" -static const char *driver = NULL; /* The driver to open the file with. */ -const char *outfname=NULL; -static int doxml = 0; -static int useschema = 1; -static const char *xml_dtd_uri = NULL; +static const char *driver_name_g = NULL; /* The driver to open the file with. */ +const char *outfname_g = NULL; +static hbool_t doxml_g = FALSE; +static hbool_t useschema_g = TRUE; +static const char *xml_dtd_uri_g = NULL; + +static hbool_t use_custom_vol_g = FALSE; +static h5tools_vol_info_t vol_info_g; #ifdef H5_HAVE_ROS3_VFD /* Default "anonymous" S3 configuration */ -static H5FD_ros3_fapl_t ros3_fa = { +static H5FD_ros3_fapl_t ros3_fa_g = { 1, /* Structure Version */ false, /* Authenticate? */ "", /* AWS Region */ @@ -37,7 +40,7 @@ static H5FD_ros3_fapl_t ros3_fa = { #ifdef H5_HAVE_LIBHDFS /* "Default" HDFS configuration */ -static H5FD_hdfs_fapl_t hdfs_fa = { +static H5FD_hdfs_fapl_t hdfs_fa_g = { 1, /* Structure Version */ "localhost", /* Namenode Name */ 0, /* Namenode Port */ @@ -213,6 +216,9 @@ static struct long_options l_opts[] = { { "vds-gap-size", require_arg, 'G' }, { "s3-cred", require_arg, '$' }, { "hdfs-attrs", require_arg, '#' }, + { "vol-value", require_arg, '1' }, + { "vol-name", require_arg, '2' }, + { "vol-info", require_arg, '3' }, { NULL, 0, '\0' } }; @@ -270,6 +276,12 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " ,,\n"); PRINTVALSTREAM(rawoutstream, " )\n"); PRINTVALSTREAM(rawoutstream, " Any absent attribute will use a default value.\n"); + PRINTVALSTREAM(rawoutstream, " --vol-value Value (ID) of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-name Name of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-info VOL-specific info to pass to the VOL connector used for\n"); + PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n"); PRINTVALSTREAM(rawoutstream, "--------------- Object Options ---------------\n"); PRINTVALSTREAM(rawoutstream, " -a P, --attribute=P Print the specified attribute\n"); PRINTVALSTREAM(rawoutstream, " If an attribute name contains a slash (/), escape the\n"); @@ -863,7 +875,7 @@ parse_command_line(int argc, const char *argv[]) int opt; int last_was_dset = FALSE; - /* no arguments */ + /* no arguments */ if (argc == 1) { usage(h5tools_getprogname()); goto error; @@ -981,7 +993,7 @@ parse_start: last_was_dset = TRUE; break; case 'f': - driver = opt_arg; + driver_name_g = opt_arg; break; case 'g': display_all = 0; @@ -1051,7 +1063,7 @@ parse_start: usingdasho = TRUE; last_was_dset = FALSE; - outfname = opt_arg; + outfname_g = opt_arg; break; case 'b': @@ -1063,8 +1075,8 @@ parse_start: } } bin_output = TRUE; - if (outfname!=NULL) { - if (h5tools_set_data_output_file(outfname, 1) < 0) { + if (outfname_g != NULL) { + if (h5tools_set_data_output_file(outfname_g, 1) < 0) { /* failed to set output file */ usage(h5tools_getprogname()); goto error; @@ -1115,15 +1127,15 @@ parse_start: /** begin XML parameters **/ case 'x': /* select XML output */ - doxml = TRUE; - useschema = TRUE; + doxml_g = TRUE; + useschema_g = TRUE; h5tools_dump_header_format = NULL; dump_function_table = &xml_function_table; h5tools_nCols = 0; break; case 'u': - doxml = TRUE; - useschema = FALSE; + doxml_g = TRUE; + useschema_g = FALSE; xmlnsprefix = ""; h5tools_dump_header_format = NULL; dump_function_table = &xml_function_table; @@ -1132,7 +1144,7 @@ parse_start: case 'D': /* specify alternative XML DTD or schema */ /* To Do: check format of this value? */ - xml_dtd_uri = opt_arg; + xml_dtd_uri_g = opt_arg; h5tools_nCols = 0; break; @@ -1145,7 +1157,7 @@ parse_start: case 'X': /* specify XML namespace (default="hdf5:"), or none */ /* To Do: check format of this value? */ - if (!useschema) { + if (!useschema_g) { usage(h5tools_getprogname()); goto error; } @@ -1254,7 +1266,7 @@ end_collect: case '$': #ifdef H5_HAVE_ROS3_VFD - if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa) < 0) { + if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa_g) < 0) { error_msg("failed to parse S3 VFD credential info\n"); usage(h5tools_getprogname()); free_handler(hand, argc); @@ -1271,7 +1283,7 @@ end_collect: case '#': #ifdef H5_HAVE_LIBHDFS - if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa) < 0) { + if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa_g) < 0) { error_msg("failed to parse HDFS VFD configuration info\n"); usage(h5tools_getprogname()); free_handler(hand, argc); @@ -1286,6 +1298,22 @@ end_collect: #endif break; + case '1': + vol_info_g.type = VOL_BY_VALUE; + vol_info_g.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + use_custom_vol_g = TRUE; + break; + + case '2': + vol_info_g.type = VOL_BY_NAME; + vol_info_g.u.name = opt_arg; + use_custom_vol_g = TRUE; + break; + + case '3': + vol_info_g.info_string = opt_arg; + break; + case '?': default: usage(h5tools_getprogname()); @@ -1360,7 +1388,7 @@ main(int argc, const char *argv[]) goto done; } - if (bin_output && outfname == NULL) { + if (bin_output && outfname_g == NULL) { error_msg("binary output requires a file name, use -o \n"); h5tools_setstatus(EXIT_FAILURE); goto done; @@ -1372,7 +1400,7 @@ main(int argc, const char *argv[]) } /* Check for conflicting options */ - if (doxml) { + if (doxml_g) { if (!display_all) { error_msg("option \"%s\" not available for XML\n", "to display selected objects"); h5tools_setstatus(EXIT_FAILURE); @@ -1400,8 +1428,8 @@ main(int argc, const char *argv[]) } } else { - if (xml_dtd_uri) { - warn_msg("option \"%s\" only applies with XML: %s\n", "--xml-dtd", xml_dtd_uri); + if (xml_dtd_uri_g) { + warn_msg("option \"%s\" only applies with XML: %s\n", "--xml-dtd", xml_dtd_uri_g); } } @@ -1414,24 +1442,24 @@ main(int argc, const char *argv[]) /* Initialize indexing options */ h5trav_set_index(sort_by, sort_order); - if (driver != NULL) { + if (driver_name_g != NULL) { h5tools_vfd_info_t vfd_info; vfd_info.info = NULL; - vfd_info.name = driver; + vfd_info.name = driver_name_g; - if (!HDstrcmp(driver, drivernames[ROS3_VFD_IDX])) { + if (!HDstrcmp(driver_name_g, drivernames[ROS3_VFD_IDX])) { #ifdef H5_HAVE_ROS3_VFD - vfd_info.info = (void *)&ros3_fa; + vfd_info.info = (void *)&ros3_fa_g; #else error_msg("Read-Only S3 VFD not enabled.\n"); h5tools_setstatus(EXIT_FAILURE); goto done; #endif } - else if (!HDstrcmp(driver, drivernames[HDFS_VFD_IDX])) { + else if (!HDstrcmp(driver_name_g, drivernames[HDFS_VFD_IDX])) { #ifdef H5_HAVE_LIBHDFS - vfd_info.info = (void *)&hdfs_fa; + vfd_info.info = (void *)&hdfs_fa_g; #else error_msg("The HDFS VFD is not enabled.\n"); h5tools_setstatus(EXIT_FAILURE); @@ -1444,7 +1472,15 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } - } /* driver defined */ + } /* driver name defined */ + + if (use_custom_vol_g) { + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &vol_info_g, NULL)) < 0) { + error_msg("unable to create FAPL for file access\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + } while(opt_ind < argc) { fname = HDstrdup(argv[opt_ind++]); @@ -1464,23 +1500,23 @@ main(int argc, const char *argv[]) /* Prepare to find objects that might be targets of a reference */ fill_ref_path_table(fid); - if(doxml) { + if(doxml_g) { /* initialize XML */ /* reset prefix! */ HDstrcpy(prefix, ""); /* make sure the URI is initialized to something */ - if (xml_dtd_uri == NULL) { - if (useschema) { - xml_dtd_uri = DEFAULT_XSD; + if (xml_dtd_uri_g == NULL) { + if (useschema_g) { + xml_dtd_uri_g = DEFAULT_XSD; } else { - xml_dtd_uri = DEFAULT_DTD; + xml_dtd_uri_g = DEFAULT_DTD; xmlnsprefix = ""; } } else { - if (useschema && HDstrcmp(xmlnsprefix,"")) { + if (useschema_g && HDstrcmp(xmlnsprefix,"")) { error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); h5tools_setstatus(EXIT_FAILURE); goto done; @@ -1513,16 +1549,16 @@ main(int argc, const char *argv[]) } /* end if */ /* start to dump - display file header information */ - if (!doxml) { + if (!doxml_g) { begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin); } else { PRINTVALSTREAM(rawoutstream, "\n"); /* alternative first element, depending on schema or DTD. */ - if (useschema) { + if (useschema_g) { if (HDstrcmp(xmlnsprefix,"") == 0) { - PRINTSTREAM(rawoutstream, "\n", xml_dtd_uri); + PRINTSTREAM(rawoutstream, "\n", xml_dtd_uri_g); } else { /* TO DO: make -url option work in this case (may need new option) */ @@ -1542,12 +1578,12 @@ main(int argc, const char *argv[]) } } else { - PRINTSTREAM(rawoutstream, "\n", xml_dtd_uri); + PRINTSTREAM(rawoutstream, "\n", xml_dtd_uri_g); PRINTVALSTREAM(rawoutstream, "\n"); } } - if (!doxml) { + if (!doxml_g) { if (display_fi) { PRINTVALSTREAM(rawoutstream, "\n"); dump_fcontents(fid); @@ -1566,10 +1602,10 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); } else { - if (!doxml) + if (!doxml_g) dump_indent += COL; dump_function_table->dump_group_function(gid, "/" ); - if (!doxml) + if (!doxml_g) dump_indent -= COL; PRINTVALSTREAM(rawoutstream, "\n"); } @@ -1582,7 +1618,7 @@ main(int argc, const char *argv[]) } else { /* Note: this option is not supported for XML */ - if(doxml) { + if(doxml_g) { error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); h5tools_setstatus(EXIT_FAILURE); goto done; @@ -1596,7 +1632,7 @@ main(int argc, const char *argv[]) PRINTVALSTREAM(rawoutstream, "\n"); } - if (!doxml) { + if (!doxml_g) { end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); PRINTVALSTREAM(rawoutstream, "\n"); } diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h index 801f60d..ca1fef6 100644 --- a/tools/src/h5dump/h5dump.h +++ b/tools/src/h5dump/h5dump.h @@ -43,6 +43,7 @@ typedef struct h5dump_table_items_t { table_t *dset_table; /* Table of datasets */ table_t *type_table; /* Table of datatypes */ } h5dump_table_items_t; + typedef struct h5dump_table_list_t { size_t nalloc; size_t nused; diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 3036ae9..765ab63 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -218,6 +218,12 @@ usage (void) PRINTVALSTREAM(rawoutstream, " ...,,)\n"); PRINTVALSTREAM(rawoutstream, " If absent or A == '(,,,,)', all default values are used.\n"); PRINTVALSTREAM(rawoutstream, " Has no effect if vfd flag is not 'hdfs'.\n"); + PRINTVALSTREAM(rawoutstream, " --vol-value Value (ID) of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-name Name of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-info VOL-specific info to pass to the VOL connector used for\n"); + PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " file/OBJECT\n"); PRINTVALSTREAM(rawoutstream, " Each object consists of an HDF5 file name optionally followed by a\n"); @@ -2854,6 +2860,8 @@ main(int argc, const char *argv[]) H5E_auto2_t tools_func; void *edata; void *tools_edata; + hbool_t custom_vol_fapl = FALSE; + h5tools_vol_info_t vol_info; #ifdef H5_HAVE_ROS3_VFD /* Default "anonymous" S3 configuration */ @@ -2892,6 +2900,9 @@ main(int argc, const char *argv[]) H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); + /* Initialize fapl info struct */ + HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t)); + /* Build object display table */ DISPATCH(H5O_TYPE_GROUP, "Group", NULL, NULL); DISPATCH(H5O_TYPE_DATASET, "Dataset", dataset_list1, dataset_list2); @@ -2955,6 +2966,19 @@ main(int argc, const char *argv[]) else if (!HDstrncmp(argv[argno], "--vfd=", (size_t)6)) { preferred_driver = argv[argno]+6; } + else if (!HDstrncmp(argv[argno], "--vol-value=", (size_t)12)) { + vol_info.type = VOL_BY_VALUE; + vol_info.u.value = (H5VL_class_value_t)HDatoi(argv[argno]+12); + custom_vol_fapl = TRUE; + } + else if (!HDstrncmp(argv[argno], "--vol-name=", (size_t)11)) { + vol_info.type = VOL_BY_NAME; + vol_info.u.name = argv[argno]+11; + custom_vol_fapl = TRUE; + } + else if (!HDstrncmp(argv[argno], "--vol-info=", (size_t)11)) { + vol_info.info_string = argv[argno]+11; + } else if (!HDstrncmp(argv[argno], "--width=", (size_t)8)) { width_g = (int)HDstrtol(argv[argno]+8, &rest, 0); @@ -3147,6 +3171,14 @@ main(int argc, const char *argv[]) leave(EXIT_FAILURE); } + /* Setup a custom fapl for file accesses */ + if (custom_vol_fapl) { + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &vol_info, NULL)) < 0) { + error_msg("failed to setup file access property list (fapl) for file\n"); + leave(EXIT_FAILURE); + } + } + if (preferred_driver) { h5tools_vfd_info_t vfd_info; diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index d54827f..f7822ca 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -440,6 +440,7 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) int bound, opt; int ret_value = 0; + /* Initialize fapl info structs */ HDmemset(&in_vol_info, 0, sizeof(h5tools_vol_info_t)); HDmemset(&out_vol_info, 0, sizeof(h5tools_vol_info_t)); diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index a2cb68b..cbd6e6d 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -25,24 +25,29 @@ int d_status = EXIT_SUCCESS; /* command-line options: short and long-named parameters */ static const char *s_opts = "hlpvV"; static struct long_options l_opts[] = { - { "help", no_arg, 'h' }, - { "latest", no_arg, 'l' }, - { "parents", no_arg, 'p' }, - { "verbose", no_arg, 'v' }, - { "version", no_arg, 'V' }, + { "help", no_arg, 'h' }, + { "latest", no_arg, 'l' }, + { "parents", no_arg, 'p' }, + { "verbose", no_arg, 'v' }, + { "version", no_arg, 'V' }, + { "vol-value", require_arg, '1' }, + { "vol-name", require_arg, '2' }, + { "vol-info", require_arg, '3' }, { NULL, 0, '\0' } }; /* Command line parameter settings */ -typedef struct { +typedef struct mkgrp_opt_t { char *fname; /* File name to operate on */ hbool_t latest; /* Whether file should use latest format versions */ hbool_t verbose; /* Whether output should be verbose */ hbool_t parents; /* Whether to create intermediate groups */ size_t ngroups; /* Number of groups to create */ char **groups; /* Pointer to array of group names */ -} param_t; -param_t params; /* Command line parameter settings */ + hid_t fapl_id; /* fapl to use when opening the file */ +} mkgrp_opt_t; + +mkgrp_opt_t params_g; /* Command line parameter settings */ /*------------------------------------------------------------------------- @@ -61,13 +66,17 @@ leave(int ret) { size_t curr_group; - if (params.fname) - HDfree (params.fname); - if (params.ngroups) { - for(curr_group = 0; curr_group < params.ngroups; curr_group++) - HDfree (params.groups[curr_group]); - HDfree (params.groups); + if (params_g.fname) + HDfree(params_g.fname); + if (params_g.ngroups) { + for (curr_group = 0; curr_group < params_g.ngroups; curr_group++) + HDfree(params_g.groups[curr_group]); + HDfree(params_g.groups); } + if (H5I_INVALID_HID != params_g.fapl_id && H5P_DEFAULT != params_g.fapl_id) + if (H5Pclose(params_g.fapl_id) < 0) + error_msg("Could not close file access property list\n"); + h5tools_close(); HDexit(ret); } /* end leave() */ @@ -85,65 +94,79 @@ leave(int ret) *------------------------------------------------------------------------- */ static void -usage(void) +usage(const char *prog) { - HDfprintf(stdout, "\ -usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ - OPTIONS\n\ - -h, --help Print a usage message and exit\n\ - -l, --latest Use latest version of file format to create groups\n\ - -p, --parents No error if existing, make parent groups as needed\n\ - -v, --verbose Print information about OBJECTS and OPTIONS\n\ - -V, --version Print version number and exit\n"); + FLUSHSTREAM(rawoutstream); + PRINTSTREAM(rawoutstream, "usage: %s [OPTIONS] FILE GROUP...\n", prog); + PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n"); + PRINTVALSTREAM(rawoutstream, " -l, --latest Use latest version of file format to create groups\n"); + PRINTVALSTREAM(rawoutstream, " -p, --parents No error if existing, make parent groups as needed\n"); + PRINTVALSTREAM(rawoutstream, " -v, --verbose Print information about OBJECTS and OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, " --vol-value Value (ID) of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-name Name of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-info VOL-specific info to pass to the VOL connector used for\n"); + PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, "\n"); } /* end usage() */ /*------------------------------------------------------------------------- - * Function: parse_command_line + * Function: parse_command_line * - * Purpose: Parses command line and sets up global variable to control output + * Purpose: Parses command line and sets up global variable to control + * output * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * * Programmer: Quincey Koziol, 2/13/2007 * *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char *argv[], param_t *parms) +parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) { int opt; /* Option from command line */ size_t curr_group; /* Current group name to copy */ + hbool_t custom_fapl = FALSE; + h5tools_vol_info_t vol_info; + hid_t tmp_fapl_id = H5I_INVALID_HID; /* Check for empty command line */ if(argc == 1) { - usage(); + usage(h5tools_getprogname()); leave(EXIT_SUCCESS); - } /* end if */ + } + + /* Initialize fapl info struct */ + HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t)); /* Parse command line options */ while((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch((char)opt) { /* Display 'help' */ case 'h': - usage(); + usage(h5tools_getprogname()); leave(EXIT_SUCCESS); break; /* Create objects with the latest version of the format */ case 'l': - parms->latest = TRUE; + options->latest = TRUE; break; /* Create parent groups */ case 'p': - parms->parents = TRUE; + options->parents = TRUE; break; /* Verbose output */ case 'v': - parms->verbose = TRUE; + options->verbose = TRUE; break; /* Display version */ @@ -152,9 +175,25 @@ parse_command_line(int argc, const char *argv[], param_t *parms) leave(EXIT_SUCCESS); break; + case '1': + vol_info.type = VOL_BY_VALUE; + vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + custom_fapl = TRUE; + break; + + case '2': + vol_info.type = VOL_BY_NAME; + vol_info.u.name = opt_arg; + custom_fapl = TRUE; + break; + + case '3': + vol_info.info_string = opt_arg; + break; + /* Bad command line argument */ default: - usage(); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } /* end switch */ } /* end while */ @@ -162,43 +201,51 @@ parse_command_line(int argc, const char *argv[], param_t *parms) /* Check for file name to be processed */ if(argc <= opt_ind) { error_msg("missing file name\n"); - usage(); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); - } /* end if */ + } /* Retrieve file name */ - parms->fname = HDstrdup(argv[opt_ind]); + options->fname = HDstrdup(argv[opt_ind]); opt_ind++; /* Check for group(s) to be created */ if(argc <= opt_ind) { error_msg("missing group name(s)\n"); - usage(); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); - } /* end if */ + } /* Allocate space for the group name pointers */ - parms->ngroups = (size_t)(argc - opt_ind); - parms->groups = (char **)HDmalloc(parms->ngroups * sizeof(char *)); + options->ngroups = (size_t)(argc - opt_ind); + options->groups = (char **)HDmalloc(options->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; while(opt_ind < argc) { - parms->groups[curr_group] = HDstrdup(argv[opt_ind]); + options->groups[curr_group] = HDstrdup(argv[opt_ind]); curr_group++; opt_ind++; - } /* end while */ + } + + /* Setup a custom fapl for file accesses */ + if (custom_fapl) { + if ((tmp_fapl_id = h5tools_get_fapl(options->fapl_id, &vol_info, NULL)) < 0) { + error_msg("failed to setup file access property list (fapl) for file\n"); + leave(EXIT_FAILURE); + } + + /* Close the old fapl */ + if (options->fapl_id != H5P_DEFAULT) + if (H5Pclose(options->fapl_id) < 0) { + error_msg("failed to close file access property list (fapl)\n"); + leave(EXIT_FAILURE); + } -#ifdef QAK -HDfprintf(stderr, "parms->parents = %t\n", parms->parents); -HDfprintf(stderr, "parms->verbose = %t\n", parms->verbose); -HDfprintf(stderr, "parms->fname = '%s'\n", parms->fname); -HDfprintf(stderr, "parms->ngroups = %Zu\n", parms->ngroups); -for(curr_group = 0; curr_group < parms->ngroups; curr_group++) - HDfprintf(stderr, "parms->group[%Zu] = '%s'\n", curr_group, parms->groups[curr_group]); -#endif /* QAK */ + options->fapl_id = tmp_fapl_id; + } - return(0); + return 0; } /* parse_command_line() */ @@ -214,10 +261,9 @@ for(curr_group = 0; curr_group < parms->ngroups; curr_group++) int main(int argc, const char *argv[]) { - hid_t fid; /* HDF5 file ID */ - hid_t fapl_id; /* File access property list ID */ - hid_t lcpl_id; /* Link creation property list ID */ - size_t curr_group; /* Current group to create */ + hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */ + hid_t lcpl_id = H5I_INVALID_HID; /* Link creation property list ID */ + size_t curr_group; /* Current group to create */ h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -228,103 +274,99 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - /* Parse command line */ - HDmemset(¶ms, 0, sizeof(params)); - if(parse_command_line(argc, argv, ¶ms) < 0) { - error_msg("unable to parse command line arguments\n"); - leave(EXIT_FAILURE); - } /* end if */ + /* Initialize the parameters */ + HDmemset(¶ms_g, 0, sizeof(params_g)); /* Create file access property list */ - if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) { + if((params_g.fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) { error_msg("Could not create file access property list\n"); leave(EXIT_FAILURE); - } /* end if */ + } + + /* Parse command line */ + if(parse_command_line(argc, argv, ¶ms_g) < 0) { + error_msg("unable to parse command line arguments\n"); + leave(EXIT_FAILURE); + } /* Check for creating groups with new format version */ - if(params.latest) { + if(params_g.latest) { /* Set the "use the latest version of the format" bounds */ - if(H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { + if(H5Pset_libver_bounds(params_g.fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { error_msg("Could not set property for using latest version of the format\n"); leave(EXIT_FAILURE); - } /* end if */ + } /* Display some output if requested */ - if(params.verbose) + if(params_g.verbose) HDprintf("%s: Creating groups with latest version of the format\n", h5tools_getprogname()); - } /* end if */ + } /* Attempt to open an existing HDF5 file first */ - fid = h5tools_fopen(params.fname, H5F_ACC_RDWR, fapl_id, FALSE, NULL, 0); + fid = h5tools_fopen(params_g.fname, H5F_ACC_RDWR, params_g.fapl_id, FALSE, NULL, 0); /* If we couldn't open an existing file, try creating file */ /* (use "EXCL" instead of "TRUNC", so we don't blow away existing non-HDF5 file) */ if(fid < 0) - fid = H5Fcreate(params.fname, H5F_ACC_EXCL, H5P_DEFAULT, fapl_id); + fid = H5Fcreate(params_g.fname, H5F_ACC_EXCL, H5P_DEFAULT, params_g.fapl_id); /* Test for error in opening file */ if(fid < 0) { - error_msg("Could not open output file '%s'\n", params.fname); + error_msg("Could not open output file '%s'\n", params_g.fname); leave(EXIT_FAILURE); - } /* end if */ + } /* Create link creation property list */ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { error_msg("Could not create link creation property list\n"); leave(EXIT_FAILURE); - } /* end if */ + } /* Check for creating intermediate groups */ - if(params.parents) { + if(params_g.parents) { /* Set the intermediate group creation property */ if(H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) { error_msg("Could not set property for creating parent groups\n"); leave(EXIT_FAILURE); - } /* end if */ + } /* Display some output if requested */ - if(params.verbose) + if(params_g.verbose) HDprintf("%s: Creating parent groups\n", h5tools_getprogname()); - } /* end if */ + } /* Loop over creating requested groups */ - for(curr_group = 0; curr_group < params.ngroups; curr_group++) { + for(curr_group = 0; curr_group < params_g.ngroups; curr_group++) { hid_t gid; /* Group ID */ /* Attempt to create a group */ - if((gid = H5Gcreate2(fid, params.groups[curr_group], lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - error_msg("Could not create group '%s'\n", params.groups[curr_group]); + if((gid = H5Gcreate2(fid, params_g.groups[curr_group], lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + error_msg("Could not create group '%s'\n", params_g.groups[curr_group]); leave(EXIT_FAILURE); - } /* end if */ + } /* Close the group */ if(H5Gclose(gid) < 0) { - error_msg("Could not close group '%s'??\n", params.groups[curr_group]); + error_msg("Could not close group '%s'??\n", params_g.groups[curr_group]); leave(EXIT_FAILURE); - } /* end if */ + } /* Display some output if requested */ - if(params.verbose) - HDprintf("%s: created group '%s'\n", h5tools_getprogname(), params.groups[curr_group]); + if(params_g.verbose) + HDprintf("%s: created group '%s'\n", h5tools_getprogname(), params_g.groups[curr_group]); } /* end for */ /* Close link creation property list */ if(H5Pclose(lcpl_id) < 0) { error_msg("Could not close link creation property list\n"); leave(EXIT_FAILURE); - } /* end if */ + } /* Close file */ if(H5Fclose(fid) < 0) { - error_msg("Could not close output file '%s'??\n", params.fname); - leave(EXIT_FAILURE); - } /* end if */ - - /* Close file access property list */ - if(H5Pclose(fapl_id) < 0) { - error_msg("Could not close file access property list\n"); + error_msg("Could not close output file '%s'??\n", params_g.fname); leave(EXIT_FAILURE); - } /* end if */ + } leave(EXIT_SUCCESS); } /* end main() */ diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt index 11ad800..216ec1a 100644 --- a/tools/test/h5diff/testfiles/h5diff_10.txt +++ b/tools/test/h5diff/testfiles/h5diff_10.txt @@ -25,6 +25,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt index 13d627c..c515535 100644 --- a/tools/test/h5diff/testfiles/h5diff_600.txt +++ b/tools/test/h5diff/testfiles/h5diff_600.txt @@ -25,6 +25,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt index 0d6b474..7249d68 100644 --- a/tools/test/h5diff/testfiles/h5diff_603.txt +++ b/tools/test/h5diff/testfiles/h5diff_603.txt @@ -26,6 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt index 94f44e8..14f1115 100644 --- a/tools/test/h5diff/testfiles/h5diff_606.txt +++ b/tools/test/h5diff/testfiles/h5diff_606.txt @@ -26,6 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt index 7f83c64..6d447c8 100644 --- a/tools/test/h5diff/testfiles/h5diff_612.txt +++ b/tools/test/h5diff/testfiles/h5diff_612.txt @@ -26,6 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt index 3cfe6b9..5bb0cca 100644 --- a/tools/test/h5diff/testfiles/h5diff_615.txt +++ b/tools/test/h5diff/testfiles/h5diff_615.txt @@ -26,6 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt index 9c34945..8369159 100644 --- a/tools/test/h5diff/testfiles/h5diff_621.txt +++ b/tools/test/h5diff/testfiles/h5diff_621.txt @@ -26,6 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt index 2b2df2f..f7cd143 100644 --- a/tools/test/h5diff/testfiles/h5diff_622.txt +++ b/tools/test/h5diff/testfiles/h5diff_622.txt @@ -26,6 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt index 3e80438..0b73fcc 100644 --- a/tools/test/h5diff/testfiles/h5diff_623.txt +++ b/tools/test/h5diff/testfiles/h5diff_623.txt @@ -26,6 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt index 7a2f585..dc2e433 100644 --- a/tools/test/h5diff/testfiles/h5diff_624.txt +++ b/tools/test/h5diff/testfiles/h5diff_624.txt @@ -26,6 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --src-vol-value Value (ID) of the VOL connector to use for opening the + input HDF5 file specified + --src-vol-name Name of the VOL connector to use for opening the input + HDF5 file specified + --src-vol-info VOL-specific info to pass to the VOL connector used for + opening the input HDF5 file specified + --dst-vol-value Value (ID) of the VOL connector to use for opening the + output HDF5 file specified + --dst-vol-name Name of the VOL connector to use for opening the output + HDF5 file specified + --dst-vol-info VOL-specific info to pass to the VOL connector used for + opening the output HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/misc/testfiles/h5mkgrp_help.txt b/tools/test/misc/testfiles/h5mkgrp_help.txt index ba130f6..9525230 100644 --- a/tools/test/misc/testfiles/h5mkgrp_help.txt +++ b/tools/test/misc/testfiles/h5mkgrp_help.txt @@ -5,3 +5,10 @@ usage: h5mkgrp [OPTIONS] FILE GROUP... -p, --parents No error if existing, make parent groups as needed -v, --verbose Print information about OBJECTS and OPTIONS -V, --version Print version number and exit + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified + diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index 95dfc3b..a122dee 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -22,6 +22,12 @@ usage: h5dump [OPTIONS] files ,, ) Any absent attribute will use a default value. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/help-1.ls b/tools/testfiles/help-1.ls index 7409c16..0926c4c 100644 --- a/tools/testfiles/help-1.ls +++ b/tools/testfiles/help-1.ls @@ -46,6 +46,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] ...,,) If absent or A == '(,,,,)', all default values are used. Has no effect if vfd flag is not 'hdfs'. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified file/OBJECT Each object consists of an HDF5 file name optionally followed by a diff --git a/tools/testfiles/help-2.ls b/tools/testfiles/help-2.ls index 7409c16..0926c4c 100644 --- a/tools/testfiles/help-2.ls +++ b/tools/testfiles/help-2.ls @@ -46,6 +46,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] ...,,) If absent or A == '(,,,,)', all default values are used. Has no effect if vfd flag is not 'hdfs'. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified file/OBJECT Each object consists of an HDF5 file name optionally followed by a diff --git a/tools/testfiles/help-3.ls b/tools/testfiles/help-3.ls index 7409c16..0926c4c 100644 --- a/tools/testfiles/help-3.ls +++ b/tools/testfiles/help-3.ls @@ -46,6 +46,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] ...,,) If absent or A == '(,,,,)', all default values are used. Has no effect if vfd flag is not 'hdfs'. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified file/OBJECT Each object consists of an HDF5 file name optionally followed by a diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl index 95dfc3b..a122dee 100644 --- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl @@ -22,6 +22,12 @@ usage: h5dump [OPTIONS] files ,, ) Any absent attribute will use a default value. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl index 95dfc3b..a122dee 100644 --- a/tools/testfiles/pbits/tpbitsIncomplete.ddl +++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -22,6 +22,12 @@ usage: h5dump [OPTIONS] files ,, ) Any absent attribute will use a default value. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl index 95dfc3b..a122dee 100644 --- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl @@ -22,6 +22,12 @@ usage: h5dump [OPTIONS] files ,, ) Any absent attribute will use a default value. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl index 95dfc3b..a122dee 100644 --- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl +++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl @@ -22,6 +22,12 @@ usage: h5dump [OPTIONS] files ,, ) Any absent attribute will use a default value. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl index 95dfc3b..a122dee 100644 --- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl @@ -22,6 +22,12 @@ usage: h5dump [OPTIONS] files ,, ) Any absent attribute will use a default value. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl index 95dfc3b..a122dee 100644 --- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl @@ -22,6 +22,12 @@ usage: h5dump [OPTIONS] files ,, ) Any absent attribute will use a default value. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl index 95dfc3b..a122dee 100644 --- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl @@ -22,6 +22,12 @@ usage: h5dump [OPTIONS] files ,, ) Any absent attribute will use a default value. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/textlinksrc-nodangle-1.ls b/tools/testfiles/textlinksrc-nodangle-1.ls index 7409c16..0926c4c 100644 --- a/tools/testfiles/textlinksrc-nodangle-1.ls +++ b/tools/testfiles/textlinksrc-nodangle-1.ls @@ -46,6 +46,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] ...,,) If absent or A == '(,,,,)', all default values are used. Has no effect if vfd flag is not 'hdfs'. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified file/OBJECT Each object consists of an HDF5 file name optionally followed by a diff --git a/tools/testfiles/tgroup-1.ls b/tools/testfiles/tgroup-1.ls index 7409c16..0926c4c 100644 --- a/tools/testfiles/tgroup-1.ls +++ b/tools/testfiles/tgroup-1.ls @@ -46,6 +46,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...] ...,,) If absent or A == '(,,,,)', all default values are used. Has no effect if vfd flag is not 'hdfs'. + --vol-value Value (ID) of the VOL connector to use for opening the + HDF5 file specified + --vol-name Name of the VOL connector to use for opening the + HDF5 file specified + --vol-info VOL-specific info to pass to the VOL connector used for + opening the HDF5 file specified file/OBJECT Each object consists of an HDF5 file name optionally followed by a -- cgit v0.12 From 5a010aace9d205a6b859aadb0081de1c3a7a59e0 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 22 Apr 2020 09:43:15 -0500 Subject: Address PR suggestions and add overlooked GCC compiler version flags. --- config/cmake/HDFCXXCompilerFlags.cmake | 37 ++++++++++++++++++++++++---------- config/cmake/HDFCompilerFlags.cmake | 27 +++++++++++++++++-------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 721fca4..58ca865 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -104,11 +104,12 @@ if (NOT MSVC) endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED - AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2) - # autotools always add the C flags with the CXX flags, except for - # with older versions that are no longer supported + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) + # autotools adds the C flags with the CXX flags for g++ compiler + # versions 4.2 and above. ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") + ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") endif () elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") @@ -145,13 +146,26 @@ if (NOT MSVC) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... Only needed for gcc 4.X - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") endif () + + # Append warning flags for gcc 4.2-4.3 + # autotools always add the C flags with the CXX flags + if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.3") + endif () + + # Append warning flags for gcc 4.2-4.4 + # autotools always add the C flags with the CXX flags + if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.4 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.4") + endif () + # Append warning flags that only gcc 4.3+ knows about # autotools always add the C flags with the CXX flags - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") endif() @@ -175,7 +189,7 @@ if (NOT MSVC) endif () # Append more extra warning flags that only gcc 4.6 and less know about - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") endif () @@ -258,6 +272,7 @@ if (NOT MSVC) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") + ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") if (HDF5_ENABLE_DEV_WARNINGS) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") @@ -316,7 +331,7 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) else () if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS0}) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0}) endif () endif () endif () @@ -335,7 +350,7 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) else () if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS1}) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1}) endif () endif () endif () @@ -354,7 +369,7 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) else () if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS2}) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2}) endif () endif () endif () @@ -373,7 +388,7 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) else () if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS3}) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3}) endif () endif () endif () @@ -387,7 +402,7 @@ if (HDF5_ENABLE_GROUPFOUR_WARNINGS) if (NOT MSVC) if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CFLAGS4}) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4}) endif () endif () endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index a40b525..124f63c 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -111,8 +111,8 @@ if (NOT MSVC) list (APPEND H5_CFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings") endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - # Add general CFlags except for older versions that are no longer supported - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + # Add general CFlags for GCC versions 4.2 and above + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") endif () @@ -154,19 +154,29 @@ if (NOT MSVC) if (CMAKE_C_COMPILER_ID STREQUAL "GNU") # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... Only needed for gcc 4.X - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") endif () + + # Append warning flags for gcc 4.2-4.3 + if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.3") + endif () + + # Append warning flags for gcc 4.2-4.4 + if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.4 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.4") + endif () + # Append warning flags that only gcc 4.3+ knows about - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") endif () - # Append more extra warning flags that only gcc 4.4+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") - endif () + endif ( # Append more extra warning flags that only gcc 4.5+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) @@ -179,7 +189,7 @@ if (NOT MSVC) endif () # Append more extra warning flags that only gcc 4.6 and less know about - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") endif () @@ -223,7 +233,7 @@ if (NOT MSVC) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9") endif () - # Append more extra warning flags that only gcc 5.1+ know about + # Append more extra warning flags that only gcc 5.x+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") @@ -247,6 +257,7 @@ if (NOT MSVC) # Append more extra warning flags that only gcc 8.x+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") + ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") if (HDF5_ENABLE_DEV_WARNINGS) ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") else () -- cgit v0.12 From d965e53cc0904cbc66c586a49638b2285740533d Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 22 Apr 2020 10:42:32 -0500 Subject: Move macro ADD_H5_CFLAGS to cmake_ext_mod/HDFMacros.cmake and remove duplicate versions. --- config/cmake/HDFCXXCompilerFlags.cmake | 18 ------------------ config/cmake/HDFCompilerFlags.cmake | 18 ------------------ config/cmake/HDFFortranCompilerFlags.cmake | 18 ------------------ config/cmake_ext_mod/HDFMacros.cmake | 18 ++++++++++++++++++ 4 files changed, 18 insertions(+), 54 deletions(-) diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 58ca865..ec3b498 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -13,24 +13,6 @@ set(CMAKE_CXX_STANDARD 98) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_EXTENSIONS OFF) -macro (ADD_H5_FLAGS h5_flag_var infile) - file (STRINGS ${infile} TEST_FLAG_STREAM) - #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") - list (LENGTH TEST_FLAG_STREAM len_flag) - if (len_flag GREATER 0) - math (EXPR _FP_LEN "${len_flag} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET TEST_FLAG_STREAM ${line} str_flag) - string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") - #message (STATUS "str_flag=${str_flag}") - if (str_flag) - list (APPEND ${h5_flag_var} "${str_flag}") - endif () - endforeach () - endif () - #message (STATUS "h5_flag_var=${${h5_flag_var}}") -endmacro () - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") message (STATUS "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}") #----------------------------------------------------------------------------- diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 124f63c..006e7cd 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -12,24 +12,6 @@ set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED TRUE) -macro (ADD_H5_FLAGS h5_flag_var infile) - file (STRINGS ${infile} TEST_FLAG_STREAM) - #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") - list (LENGTH TEST_FLAG_STREAM len_flag) - if (len_flag GREATER 0) - math (EXPR _FP_LEN "${len_flag} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET TEST_FLAG_STREAM ${line} str_flag) - string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") - #message (STATUS "str_flag=${str_flag}") - if (str_flag) - list (APPEND ${h5_flag_var} "${str_flag}") - endif () - endforeach () - endif () - #message (STATUS "h5_flag_var=${${h5_flag_var}}") -endmacro () - set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_SANITIZER_FLAGS} ${CMAKE_C_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index a56ef28..495a0ca 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -10,24 +10,6 @@ # help@hdfgroup.org. # -macro (ADD_H5_FFLAGS h5_fflag_var infile) - file (STRINGS ${infile} TEST_FLAG_STREAM) - #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") - list (LENGTH TEST_FLAG_STREAM len_flag) - if (len_flag GREATER 0) - math (EXPR _FP_LEN "${len_flag} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET TEST_FLAG_STREAM ${line} str_flag) - string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") - #message (STATUS "str_flag=${str_flag}") - if (str_flag) - list (APPEND ${h5_fflag_var} "${str_flag}") - endif () - endforeach () - endif () - #message (STATUS "h5_fflag_var=${${h5_fflag_var}}") -endmacro () - message (STATUS "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index fee6def..5740740 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -429,3 +429,21 @@ macro (HDF_DIR_PATHS package_prefix) endif () endmacro () +macro (ADD_H5_FLAGS h5_flag_var infile) + file (STRINGS ${infile} TEST_FLAG_STREAM) + #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + list (LENGTH TEST_FLAG_STREAM len_flag) + if (len_flag GREATER 0) + math (EXPR _FP_LEN "${len_flag} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET TEST_FLAG_STREAM ${line} str_flag) + string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") + #message (STATUS "str_flag=${str_flag}") + if (str_flag) + list (APPEND ${h5_flag_var} "${str_flag}") + endif () + endforeach () + endif () + #message (STATUS "h5_flag_var=${${h5_flag_var}}") +endmacro () + -- cgit v0.12 From 16b1ee6899bc0874909d53cdd4558256a767d400 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 22 Apr 2020 11:48:45 -0500 Subject: OESS-65 add option to use AEC library in place of SZip --- CMakeFilters.cmake | 15 +- bin/release | 278 ++++++++++++++++---------------- config/cmake/cacheinit.cmake | 2 + config/cmake/mccacheinit.cmake | 2 + config/cmake_ext_mod/HDFLibMacros.cmake | 64 ++++---- release_docs/INSTALL_CMake.txt | 9 ++ release_docs/README_HDF5_CMake | 1 + release_docs/RELEASE.txt | 10 ++ 8 files changed, 197 insertions(+), 184 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 5a89564..0d64b55 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -9,6 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # +option (USE_LIBAEC "Use AEC library as SZip Filter" OFF) include (ExternalProject) #option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO") @@ -32,6 +33,9 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT message (STATUS "Filter ZLIB file ${ZLIB_URL} not found") endif () set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) + if (USE_LIBAEC) + set (SZIP_URL ${TGZPATH}/${SZAEC_TGZ_NAME}) + endif () if (NOT EXISTS "${SZIP_URL}") set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE) message (STATUS "Filter SZIP file ${SZIP_URL} not found") @@ -54,7 +58,6 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) find_package (ZLIB) # Legacy find if (ZLIB_FOUND) set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) - set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) endif () endif () endif () @@ -85,9 +88,6 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (H5_HAVE_FILTER_DEFLATE) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") endif () - if (BUILD_SHARED_LIBS) - set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) - endif () set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") @@ -105,7 +105,6 @@ if (HDF5_ENABLE_SZIP_SUPPORT) find_package (SZIP) # Legacy find if (SZIP_FOUND) set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) - set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) endif () endif () endif () @@ -122,13 +121,13 @@ if (HDF5_ENABLE_SZIP_SUPPORT) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) message (STATUS "Filter SZIP is built") + if (USE_LIBAEC) + message (STATUS "... with library AEC") + endif () else () message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") endif () endif () - if (BUILD_SHARED_LIBS) - set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) - endif () set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") diff --git a/bin/release b/bin/release index 1568e02..a34191e 100755 --- a/bin/release +++ b/bin/release @@ -39,36 +39,36 @@ USAGE() { cat << EOF Usage: $0 -d [--docver BRANCHNAME] [-h] [--nocheck] [--private] ... - -d DIR The name of the directory where the releas(es) should be + -d DIR The name of the directory where the releas(es) should be placed. --docver BRANCHNAME This is added for 1.8 and beyond to get the correct version of documentation files from the hdf5docs repository. BRANCHNAME for v1.8 should be hdf5_1_8. -h print the help page. - --nocheck Ignore errors in MANIFEST file. - --private Make a private release with today's date in version information. - + --nocheck Ignore errors in MANIFEST file. + --private Make a private release with today's date in version information. + This must be run at the top level of the source directory. The other command-line options are the names of the programs to use for compressing the resulting tar archive (if none are given then "tar" is assumed): - tar -- use tar and don't do any compressing. - gzip -- use gzip with "-9" and append ".gz" to the output name. + tar -- use tar and don't do any compressing. + gzip -- use gzip with "-9" and append ".gz" to the output name. bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name. - zip -- convert all text files to DOS style and form a zip file for Windows use. - cmake-tgz -- create a tar file using the gzip default level with a build-unix.sh + zip -- convert all text files to DOS style and form a zip file for Windows use. + cmake-tgz -- create a tar file using the gzip default level with a build-unix.sh command file and all other CMake files needed to build HDF5 source using CMake on unix machines. cmake-zip -- convert all text files to DOS style and create a zip file inluding cmake - scripts and .bat files to build HDF5 source using CMake on Windows. - hpc-cmake-tgz - -- create a tar file using the gzip default level with a build-unix.sh + scripts and .bat files to build HDF5 source using CMake on Windows. + hpc-cmake-tgz + -- create a tar file using the gzip default level with a build-unix.sh command file and all other CMake files needed to build HDF5 source using CMake on unix machines, with HDF5options.cmake files for serial and parallel builds on machines requiring batch jobs to run tests. The default is for parallel build, with serial only build by changing - the HDF5options.cmake symlink to ser-HDF5options.cmake. More + the HDF5options.cmake symlink to ser-HDF5options.cmake. More information is available in the README_HPC file. doc -- produce the latest doc tree in addition to the archive. @@ -122,8 +122,8 @@ EOF tar2zip() { if [ $# -ne 3 ]; then - echo "usage: tar2zip " - return 1 + echo "usage: tar2zip " + return 1 fi ztmpdir=/tmp/ztmpdir$$ mkdir -p $ztmpdir @@ -135,23 +135,23 @@ tar2zip() (cd $ztmpdir; tar xf -) < $tarfile # sanity check if [ ! -d $ztmpdir/$version ]; then - echo "untar did not create $ztmpdir/$version source dir" - # cleanup - rm -rf $ztmpdir - return 1 + echo "untar did not create $ztmpdir/$version source dir" + # cleanup + rm -rf $ztmpdir + return 1 fi # step 2: convert text files # There maybe a simpler way to do this. # options used in unix2dos: - # -k Keep the date stamp + # -k Keep the date stamp # -q quiet mode # grep redirect output to /dev/null because -q or -s are not portable. find $ztmpdir/$version | \ - while read inf; do \ - if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ - unix2dos -q -k $inf; \ - fi\ - done + while read inf; do \ + if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ + unix2dos -q -k $inf; \ + fi\ + done # step 3: make zipball # -9 maximum compression # -y Store symbolic links as such in the zip archive @@ -177,14 +177,14 @@ tar2zip() # Note: do this in a temporary directory to avoid changing # the original source directory which may be around. # 2. add build-unix.sh script. -# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory. +# 3. add LIBAEC.tar.gz, ZLib.tar.gz and cmake files to top level directory. # 4. create gzipped tar file with these contents: # build-unix.sh script # hdf5- source code directory extracted from tar file # CTestScript.cmake cmake file copied from /config/cmake/scripts # HDF5config.cmake cmake file copied from /config/cmake/scripts # HDF5options.cmake cmake file copied from /config/cmake/scripts -# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake +# LIBAEC.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake # ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake @@ -197,13 +197,13 @@ tar2zip() # # need function to create another temporary directory, extract the # $tmpdir/$HDF5_VERS.tar into it, create build-VS*.bat files, - # add CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz + # add CTestScript.cmake, HDF5config.cmake, LIBAEC.tar.gz # ZLib.tar.gz, HDF5 examples, and then zip it. tar2cmakezip() { if [ $# -ne 3 ]; then - echo "usage: tar2cmakezip " - return 1 + echo "usage: tar2cmakezip " + return 1 fi cmziptmpdir=/tmp/cmziptmpdir$$ cmziptmpsubdir=$cmziptmpdir/CMake-$HDF5_VERS @@ -216,10 +216,10 @@ tar2cmakezip() (cd $cmziptmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmziptmpsubdir/$version ]; then - echo "untar did not create $cmziptmpsubdir/$version source dir" - # cleanup - rm -rf $cmziptmpdir - return 1 + echo "untar did not create $cmziptmpsubdir/$version source dir" + # cleanup + rm -rf $cmziptmpdir + return 1 fi # step 2: add batch file for building CMake on window @@ -230,8 +230,8 @@ tar2cmakezip() (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2017 -C Release -V -O hdf5.log" > build-VS2017-32.bat; chmod 755 build-VS2017-32.bat) (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -V -O hdf5.log" > build-VS2017-64.bat; chmod 755 build-VS2017-64.bat) - # step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files - cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmziptmpsubdir + # step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files + cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmziptmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.1-Source.zip $cmziptmpsubdir cp $cmziptmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpsubdir @@ -241,15 +241,15 @@ tar2cmakezip() # step 4: convert text files # There maybe a simpler way to do this. # options used in unix2dos: - # -k Keep the date stamp + # -k Keep the date stamp # -q quiet mode # grep redirect output to /dev/null because -q or -s are not portable. find $cmziptmpsubdir/$version | \ - while read inf; do \ - if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ - unix2dos -q -k $inf; \ - fi\ - done + while read inf; do \ + if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ + unix2dos -q -k $inf; \ + fi\ + done # step 3: make zipball # -9 maximum compression @@ -276,14 +276,14 @@ tar2cmakezip() # Note: do this in a temporary directory to avoid changing # the original source directory which may be around. # 2. add build-unix.sh script. -# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory. +# 3. add LIBAEC.tar.gz, ZLib.tar.gz and cmake files to top level directory. # 4. create gzipped tar file with these contents: # build-unix.sh script # hdf5- source code directory extracted from tar file # CTestScript.cmake cmake file copied from /config/cmake/scripts # HDF5config.cmake cmake file copied from /config/cmake/scripts # HDF5options.cmake cmake file copied from /config/cmake/scripts -# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake +# LIBAEC.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake # ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake @@ -296,13 +296,13 @@ tar2cmakezip() # # need function to create another temporary directory, extract the # $tmpdir/$HDF5_VERS.tar into it, create build-unix.sh, - # add CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz + # add CTestScript.cmake, HDF5config.cmake, LIBAEC.tar.gz # ZLib.tar.gz, HDF5 examples, and then tar.gz it. tar2cmaketgz() { if [ $# -ne 3 ]; then - echo "usage: tar2cmaketgz " - return 1 + echo "usage: tar2cmaketgz " + return 1 fi cmgztmpdir=/tmp/cmgztmpdir$$ cmgztmpsubdir=$cmgztmpdir/CMake-$HDF5_VERS @@ -315,25 +315,25 @@ tar2cmaketgz() (cd $cmgztmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmgztmpsubdir/$version ]; then - echo "untar did not create $cmgztmpsubdir/$version source dir" - # cleanup - rm -rf $cmgztmpdir - return 1 + echo "untar did not create $cmgztmpsubdir/$version source dir" + # cleanup + rm -rf $cmgztmpdir + return 1 fi # step 2: add build-unix.sh script (cd $cmgztmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf5.log" > build-unix.sh; chmod 755 build-unix.sh) - # step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files - cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmgztmpsubdir + # step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files + cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmgztmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.1-Source.tar.gz $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmgztmpsubdir - tar czf $DEST/CMake-$HDF5_VERS.tar.gz -C $cmgztmpdir . || exit 1 - + tar czf $DEST/CMake-$HDF5_VERS.tar.gz -C $cmgztmpdir . || exit 1 + # cleanup rm -rf $cmgztmpdir } @@ -353,14 +353,14 @@ tar2cmaketgz() # Note: do this in a temporary directory to avoid changing # the original source directory which may be around. # 2. add build-unix.sh script. -# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory. +# 3. add LIBAEC.tar.gz, ZLib.tar.gz and cmake files to top level directory. # 4. create gzipped tar file with these contents: # build-unix.sh script # hdf5- source code directory extracted from tar file # CTestScript.cmake cmake file copied from /config/cmake/scripts # HDF5config.cmake cmake file copied from /config/cmake/scripts # HDF5options.cmake cmake file copied from /config/cmake/scripts -# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake +# LIBAEC.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake # ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake # # 5. For HPC-CMake tgz file the following are also needed in the top-level directory: @@ -379,13 +379,13 @@ tar2cmaketgz() # # need function to create another temporary directory, extract the # $tmpdir/$HDF5_VERS.tar into it, create build-unix.sh, - # add CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz + # add CTestScript.cmake, HDF5config.cmake, LIBAEC.tar.gz # ZLib.tar.gz, HDF5 examples, and then tar.gz it. tar2hpccmaketgz() { if [ $# -ne 3 ]; then - echo "usage: tar2hpccmaketgz " - return 1 + echo "usage: tar2hpccmaketgz " + return 1 fi cmgztmpdir=/tmp/cmgztmpdir$$ cmgztmpsubdir=$cmgztmpdir/HPC-CMake-$HDF5_VERS @@ -398,18 +398,18 @@ tar2hpccmaketgz() (cd $cmgztmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmgztmpsubdir/$version ]; then - echo "untar did not create $cmgztmpsubdir/$version source dir" - # cleanup - rm -rf $cmgztmpdir - return 1 + echo "untar did not create $cmgztmpsubdir/$version source dir" + # cleanup + rm -rf $cmgztmpdir + return 1 fi # step 2: add build-unix.sh script (cd $cmgztmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf5.log" > build-unix.sh; chmod 755 build-unix.sh) - # step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files - cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmgztmpsubdir + # step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files + cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmgztmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.1-Source.tar.gz $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir @@ -419,8 +419,8 @@ tar2hpccmaketgz() cp $cmgztmpsubdir/$version/config/cmake/scripts/HPC/ser-HDF5options.cmake $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/HPC/par-HDF5options.cmake $cmgztmpsubdir (cd $cmgztmpsubdir; ln -s par-HDF5options.cmake HDF5options.cmake) - tar czf $DEST/HPC-CMake-$HDF5_VERS.tar.gz -C $cmgztmpdir . || exit 1 - + tar czf $DEST/HPC-CMake-$HDF5_VERS.tar.gz -C $cmgztmpdir . || exit 1 + # cleanup rm -rf $cmgztmpdir } @@ -442,7 +442,7 @@ check=yes release_date=`date +%F` today=`date +%Y%m%d` pmode='no' -tmpdir="../#release_tmp.$$" # tmp work directory +tmpdir="../#release_tmp.$$" # tmp work directory DOC_URL=https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5doc.git CPPLUS_RM_NAME=cpplus_RM MAINT_MODE_ENABLED="" @@ -459,11 +459,11 @@ fi RESTORE_VERSION() { if [ X-${VERS_OLD} != X- ]; then - echo restoring version information back to $VERS_OLD - rm -f config/lt_vers.am - cp $tmpdir/lt_vers.am config/lt_vers.am - bin/h5vers -s $VERS_OLD - VERS_OLD= + echo restoring version information back to $VERS_OLD + rm -f config/lt_vers.am + cp $tmpdir/lt_vers.am config/lt_vers.am + bin/h5vers -s $VERS_OLD + VERS_OLD= fi } @@ -473,32 +473,32 @@ while [ -n "$1" ]; do arg=$1 shift case "$arg" in - -d) - DEST=$1 - shift - ;; - --nocheck) - check=no - ;; - -h) - USAGE - exit 0 - ;; - --private) - pmode=yes - ;; + -d) + DEST=$1 + shift + ;; + --nocheck) + check=no + ;; + -h) + USAGE + exit 0 + ;; + --private) + pmode=yes + ;; --docver) DOCVERSION=$1 shift ;; - -*) - echo "Unknown switch: $arg" 1>&2 - USAGE - exit 1 - ;; - *) - methods="$methods $arg" - ;; + -*) + echo "Unknown switch: $arg" 1>&2 + USAGE + exit 1 + ;; + *) + methods="$methods $arg" + ;; esac done @@ -548,12 +548,12 @@ if [ "X$fail" = "Xyes" ]; then echo "" echo "Note! If you are running bin/release in a development branch" echo "later than v 1.8 the MANIFEST check is expected to fail when" - echo "autogen.sh has not been run successfully. Either run autogen.sh " + echo "autogen.sh has not been run successfully. Either run autogen.sh " echo "with /usr/hdf/bin/AUTOTOOLS at the beginning of PATH or add the" echo "--nocheck argument to the bin/release command." exit 1 else - echo "Continuing anyway..." + echo "Continuing anyway..." fi fi @@ -587,7 +587,7 @@ test "$verbose" && echo " Running tar..." 1>&2 ( \ cd $tmpdir; \ tar cf $HDF5_VERS.tar $HDF5_VERS/Makefile \ - `sed 's/^\.\//hdf5-'$VERS'\//' $MANIFEST` || exit 1 \ + `sed 's/^\.\//hdf5-'$VERS'\//' $MANIFEST` || exit 1 \ ) # Compress @@ -595,61 +595,61 @@ MD5file=$HDF5_VERS.md5 cp /dev/null $DEST/$MD5file for comp in $methods; do case $comp in - tar) - cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar - (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file) - ;; - gzip) - test "$verbose" && echo " Running gzip..." 1>&2 - gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz - (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) - ;; + tar) + cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar + (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file) + ;; + gzip) + test "$verbose" && echo " Running gzip..." 1>&2 + gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz + (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) + ;; cmake-tgz) - test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2 - tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2 - (cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file) + test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2 + tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2 + (cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file) ;; hpc-cmake-tgz) - test "$verbose" && echo " Creating HPC-CMake tar.gz file..." 1>&2 - tar2hpccmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/HPC-CMake-$HDF5_VERS.tar.gz 1>&2 - (cd $DEST; md5sum HPC-CMake-$HDF5_VERS.tar.gz >> $MD5file) + test "$verbose" && echo " Creating HPC-CMake tar.gz file..." 1>&2 + tar2hpccmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/HPC-CMake-$HDF5_VERS.tar.gz 1>&2 + (cd $DEST; md5sum HPC-CMake-$HDF5_VERS.tar.gz >> $MD5file) ;; - bzip2) - test "$verbose" && echo " Running bzip2..." 1>&2 - bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 - (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file) - ;; - zip) - test "$verbose" && echo " Creating zip ball..." 1>&2 - tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 - (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) - ;; + bzip2) + test "$verbose" && echo " Running bzip2..." 1>&2 + bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 + (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file) + ;; + zip) + test "$verbose" && echo " Creating zip ball..." 1>&2 + tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 + (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) + ;; cmake-zip) test "$verbose" && echo " Creating CMake-zip ball..." 1>&2 tar2cmakezip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.zip 1>&2 (cd $DEST; md5sum CMake-$HDF5_VERS.zip >> $MD5file) ;; - doc) + doc) if [ "${DOCVERSION}" = "" ]; then DOCVERSION=master fi - test "$verbose" && echo " Creating docs..." 1>&2 - # Check out docs from git repo - (cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1 + test "$verbose" && echo " Creating docs..." 1>&2 + # Check out docs from git repo + (cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1 # Create doxygen C++ RM - (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 - # Replace version of C++ RM with just-created version - rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 - mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 + (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 + # Replace version of C++ RM with just-created version + rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 + mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 # Compress the docs and move them to the release area - mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1 - (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1 - mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1 - ;; - *) - echo "***Error*** Unknown method $comp" - exit 1 - ;; + mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1 + (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1 + mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1 + ;; + *) + echo "***Error*** Unknown method $comp" + exit 1 + ;; esac done diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 5254115..4efb185 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -43,6 +43,8 @@ set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) +set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE) +set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 1608202..f4bfb07 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -51,6 +51,8 @@ set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) +set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE) +set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 9df2b4b..cbca47f 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -20,7 +20,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) GIT_TAG ${JPEG_BRANCH} INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -39,7 +39,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) URL_MD5 "" INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -62,14 +62,6 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-static JPEG) set (JPEG_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-static") set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY}) - if (BUILD_SHARED_LIBS) - # Create imported target jpeg-shared - add_library(${HDF_PACKAGE_NAMESPACE}jpeg-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-shared "jpeg" SHARED "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-shared JPEG) - set (JPEG_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-shared") - set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY}) - endif () set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") @@ -97,7 +89,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) GIT_TAG ${SZIP_BRANCH} INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -117,7 +109,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) URL_MD5 "" INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -136,19 +128,21 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) ##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static - add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) - set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static") - set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) - if (BUILD_SHARED_LIBS) - # Create imported target szip-shared - add_library(${HDF_PACKAGE_NAMESPACE}szip-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-shared "szip" SHARED "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-shared SZIP) - set (SZIP_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-shared") - set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY}) + if (USE_LIBAEC) + add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "sz" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) + add_library(${HDF_PACKAGE_NAMESPACE}szaec-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szaec-static "aec" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szaec-static SZIP) + set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static;${HDF_PACKAGE_NAMESPACE}szaec-static") + else () + add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) + set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static") endif () + set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") @@ -158,11 +152,15 @@ endmacro () #------------------------------------------------------------------------------- macro (PACKAGE_SZIP_LIBRARY compress_type) + set (SZIP_HDR "SZconfig") + if (USE_LIBAEC) + set (SZIP_HDR "libaec_Export") + endif () add_custom_target (SZIP-GenHeader-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/${SZIP_HDR}.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/${SZIP_HDR}.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_HDR}.h) if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (SZIP-GenHeader-Copy SZIP) endif () @@ -176,7 +174,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) GIT_TAG ${ZLIB_BRANCH} INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -195,7 +193,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) URL_MD5 "" INSTALL_COMMAND "" CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DBUILD_SHARED_LIBS:BOOL=OFF -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} @@ -224,14 +222,6 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB) set (ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-static") set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY}) - if (BUILD_SHARED_LIBS) - # Create imported target zlib-shared - add_library(${HDF_PACKAGE_NAMESPACE}zlib-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-shared ${ZLIB_LIB_NAME} SHARED "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-shared ZLIB) - set (ZLIB_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-shared") - set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) - endif () set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index e1a34c5..a0386cd 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -61,6 +61,7 @@ CMake build script: CTestScript.cmake External compression szip and zlib libraries: + LIBAEC.tar.gz SZip.tar.gz ZLib.tar.gz @@ -475,6 +476,8 @@ These five steps are described in detail below. set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) + set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE) + set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) @@ -550,12 +553,17 @@ These five steps are described in detail below. file) are: ZLIB_TGZ_NAME:STRING="zlib_src.ext" SZIP_TGZ_NAME:STRING="szip_src.ext" + LIBAEC_TGZ_NAME:STRING="liaec_src.ext" TGZPATH:STRING="some_location" where "some_location/xxxx_src.ext" is the URL or full path to the compressed file and where ext is the type of the compression file such as .bz2, .tar, .tar.gz, .tgz, or .zip. Also define CMAKE_BUILD_TYPE to be the configuration type. + NOTE: the USE_LIBAEC option will use the file named by LIBAEC_TGZ_NAME + to build SZIP instead of the file named by SZIP_TGZ_NAME. This option + is also used to account for the different headers and library names. + 4. Test HDF5 To test the build, navigate to your build directory and execute: @@ -676,6 +684,7 @@ ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0 if (HDF5_ENABLE_SZIP_SUPPORT) HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF + USE_LIBAEC "Use libaec szip replacement" OFF if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" else () diff --git a/release_docs/README_HDF5_CMake b/release_docs/README_HDF5_CMake index 5737624..f1f2999 100644 --- a/release_docs/README_HDF5_CMake +++ b/release_docs/README_HDF5_CMake @@ -7,6 +7,7 @@ This tar file contains HDF5config.cmake CMake scripts for building HDF5 HDF5options.cmake hdf5-1.13.0 HDF5 1.13.0 source + LIBAEC.tar.gz source for building SZIP replacement SZip.tar.gz source for building SZIP ZLib.tar.gz source for building ZLIB diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6c43908..102402e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -48,6 +48,16 @@ New Features Configuration: ------------- + - CMake option to use AEC (open source SZip) library instead of SZip + + The open source AEC library is a replacement library for SZip. In + order to use it for hdf5 the libaec CMake source was changed to add + "-fPIC" and exclude test files. Autotools does not build the + compression libraries within hdf5 builds. New option USE_LIBAEC is + required to compensate for the different files produced by AEC build. + + (ADB - 2020/04/22, OESS-65) + - CMake ConfigureChecks.cmake file now uses CHECK_STRUCT_HAS_MEMBER Some handcrafted tests in HDFTests.c has been removed and the CMake -- cgit v0.12 From 785bd0975ba13c3033820d0fc809da963fcd54ca Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 22 Apr 2020 16:49:52 -0700 Subject: Fixed h5diff command-line parameters to use 1 and 2 instead of src and dst. --- tools/lib/h5diff.c | 8 +-- tools/lib/h5diff.h | 8 +-- tools/src/h5diff/h5diff_common.c | 86 +++++++++++++++--------------- tools/test/h5diff/testfiles/h5diff_10.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_600.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_603.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_606.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_612.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_615.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_621.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_622.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_623.txt | 20 +++---- tools/test/h5diff/testfiles/h5diff_624.txt | 20 +++---- 13 files changed, 151 insertions(+), 151 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index d11d28f..8b6ace9 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -572,8 +572,8 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char *------------------------------------------------------------------------- */ /* open file 1 */ - if (opts->custom_in_vol) { - if((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->in_vol_info), NULL)) < 0 ) { + if (opts->custom_vol_1) { + if((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->vol_info_1), NULL)) < 0 ) { parallel_print("h5diff: unable to create fapl for input file\n"); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create input fapl\n"); } @@ -587,8 +587,8 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* open file 2 */ - if (opts->custom_out_vol) { - if((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->out_vol_info), NULL)) < 0 ) { + if (opts->custom_vol_2) { + if((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->vol_info_2), NULL)) < 0 ) { parallel_print("h5diff: unable to create fapl for output file\n"); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create output fapl\n"); } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 1ac1dd7..8fe9d86 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -87,10 +87,10 @@ typedef struct { int m_list_not_cmp; /* list not comparable messages */ int exclude_path; /* exclude path to an object */ struct exclude_path_list * exclude; /* keep exclude path list */ - h5tools_vol_info_t in_vol_info; /* VOL information for input file */ - h5tools_vol_info_t out_vol_info; /* VOL information for output file */ - hbool_t custom_in_vol; /* Using a custom input VOL? */ - hbool_t custom_out_vol; /* Using a custom output VOL? */ + h5tools_vol_info_t vol_info_1; /* VOL information for input file */ + h5tools_vol_info_t vol_info_2; /* VOL information for output file */ + hbool_t custom_vol_1; /* Using a custom input VOL? */ + hbool_t custom_vol_2; /* Using a custom output VOL? */ } diff_opt_t; diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index e040696..771b20f 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -27,27 +27,27 @@ static int check_d_input(const char*); */ static const char *s_opts = "hVrv:qn:d:p:NcelxE:S"; static struct long_options l_opts[] = { - { "help", no_arg, 'h' }, - { "version", no_arg, 'V' }, - { "report", no_arg, 'r' }, - { "verbose", optional_arg, 'v' }, - { "quiet", no_arg, 'q' }, - { "count", require_arg, 'n' }, - { "delta", require_arg, 'd' }, - { "relative", require_arg, 'p' }, - { "nan", no_arg, 'N' }, - { "compare", no_arg, 'c' }, + { "help", no_arg, 'h' }, + { "version", no_arg, 'V' }, + { "report", no_arg, 'r' }, + { "verbose", optional_arg, 'v' }, + { "quiet", no_arg, 'q' }, + { "count", require_arg, 'n' }, + { "delta", require_arg, 'd' }, + { "relative", require_arg, 'p' }, + { "nan", no_arg, 'N' }, + { "compare", no_arg, 'c' }, { "use-system-epsilon", no_arg, 'e' }, - { "follow-symlinks", no_arg, 'l' }, - { "no-dangling-links", no_arg, 'x' }, - { "exclude-path", require_arg, 'E' }, + { "follow-symlinks", no_arg, 'l' }, + { "no-dangling-links", no_arg, 'x' }, + { "exclude-path", require_arg, 'E' }, { "enable-error-stack", no_arg, 'S' }, - { "src-vol-value", require_arg, '1' }, - { "src-vol-name", require_arg, '2' }, - { "src-vol-info", require_arg, '3' }, - { "dst-vol-value", require_arg, '4' }, - { "dst-vol-name", require_arg, '5' }, - { "dst-vol-info", require_arg, '6' }, + { "vol-value-1", require_arg, '1' }, + { "vol-name-1", require_arg, '2' }, + { "vol-info-1", require_arg, '3' }, + { "vol-value-2", require_arg, '4' }, + { "vol-name-2", require_arg, '5' }, + { "vol-info-2", require_arg, '6' }, { NULL, 0, '\0' } }; @@ -266,35 +266,35 @@ void parse_command_line(int argc, break; case '1': - opts->in_vol_info.type = VOL_BY_VALUE; - opts->in_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); - opts->custom_in_vol = TRUE; + opts->vol_info_1.type = VOL_BY_VALUE; + opts->vol_info_1.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + opts->custom_vol_1 = TRUE; break; case '2': - opts->in_vol_info.type = VOL_BY_NAME; - opts->in_vol_info.u.name = opt_arg; - opts->custom_in_vol = TRUE; + opts->vol_info_1.type = VOL_BY_NAME; + opts->vol_info_1.u.name = opt_arg; + opts->custom_vol_1 = TRUE; break; case '3': - opts->in_vol_info.info_string = opt_arg; + opts->vol_info_1.info_string = opt_arg; break; case '4': - opts->out_vol_info.type = VOL_BY_VALUE; - opts->out_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); - opts->custom_out_vol = TRUE; + opts->vol_info_2.type = VOL_BY_VALUE; + opts->vol_info_2.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + opts->custom_vol_2 = TRUE; break; case '5': - opts->out_vol_info.type = VOL_BY_NAME; - opts->out_vol_info.u.name = opt_arg; - opts->custom_out_vol = TRUE; + opts->vol_info_2.type = VOL_BY_NAME; + opts->vol_info_2.u.name = opt_arg; + opts->custom_vol_2 = TRUE; break; case '6': - opts->out_vol_info.info_string = opt_arg; + opts->vol_info_2.info_string = opt_arg; break; } } @@ -507,18 +507,18 @@ void usage(void) PRINTVALSTREAM(rawoutstream, " Quiet mode. Do not produce output.\n"); PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); PRINTVALSTREAM(rawoutstream, " Prints messages from the HDF5 error stack as they occur.\n"); - PRINTVALSTREAM(rawoutstream, " --src-vol-value Value (ID) of the VOL connector to use for opening the\n"); - PRINTVALSTREAM(rawoutstream, " input HDF5 file specified\n"); - PRINTVALSTREAM(rawoutstream, " --src-vol-name Name of the VOL connector to use for opening the input\n"); + PRINTVALSTREAM(rawoutstream, " --vol-value-1 Value (ID) of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " first HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-name-1 Name of the VOL connector to use for opening the first\n"); PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); - PRINTVALSTREAM(rawoutstream, " --src-vol-info VOL-specific info to pass to the VOL connector used for\n"); - PRINTVALSTREAM(rawoutstream, " opening the input HDF5 file specified\n"); - PRINTVALSTREAM(rawoutstream, " --dst-vol-value Value (ID) of the VOL connector to use for opening the\n"); - PRINTVALSTREAM(rawoutstream, " output HDF5 file specified\n"); - PRINTVALSTREAM(rawoutstream, " --dst-vol-name Name of the VOL connector to use for opening the output\n"); + PRINTVALSTREAM(rawoutstream, " --vol-info-1 VOL-specific info to pass to the VOL connector used for\n"); + PRINTVALSTREAM(rawoutstream, " opening the first HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-value-2 Value (ID) of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " second HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-name-2 Name of the VOL connector to use for opening the second\n"); PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); - PRINTVALSTREAM(rawoutstream, " --dst-vol-info VOL-specific info to pass to the VOL connector used for\n"); - PRINTVALSTREAM(rawoutstream, " opening the output HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-info-2 VOL-specific info to pass to the VOL connector used for\n"); + PRINTVALSTREAM(rawoutstream, " opening the second HDF5 file specified\n"); PRINTVALSTREAM(rawoutstream, " --follow-symlinks\n"); PRINTVALSTREAM(rawoutstream, " Follow symbolic links (soft links and external links and compare the)\n"); PRINTVALSTREAM(rawoutstream, " links' target objects.\n"); diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt index 216ec1a..0a2fd12 100644 --- a/tools/test/h5diff/testfiles/h5diff_10.txt +++ b/tools/test/h5diff/testfiles/h5diff_10.txt @@ -25,18 +25,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt index c515535..55b8da7 100644 --- a/tools/test/h5diff/testfiles/h5diff_600.txt +++ b/tools/test/h5diff/testfiles/h5diff_600.txt @@ -25,18 +25,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt index 7249d68..36cd0ef 100644 --- a/tools/test/h5diff/testfiles/h5diff_603.txt +++ b/tools/test/h5diff/testfiles/h5diff_603.txt @@ -26,18 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt index 14f1115..c2e9ac1 100644 --- a/tools/test/h5diff/testfiles/h5diff_606.txt +++ b/tools/test/h5diff/testfiles/h5diff_606.txt @@ -26,18 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt index 6d447c8..2e09432 100644 --- a/tools/test/h5diff/testfiles/h5diff_612.txt +++ b/tools/test/h5diff/testfiles/h5diff_612.txt @@ -26,18 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt index 5bb0cca..a07de54 100644 --- a/tools/test/h5diff/testfiles/h5diff_615.txt +++ b/tools/test/h5diff/testfiles/h5diff_615.txt @@ -26,18 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt index 8369159..5f44dd7 100644 --- a/tools/test/h5diff/testfiles/h5diff_621.txt +++ b/tools/test/h5diff/testfiles/h5diff_621.txt @@ -26,18 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt index f7cd143..2e28a42 100644 --- a/tools/test/h5diff/testfiles/h5diff_622.txt +++ b/tools/test/h5diff/testfiles/h5diff_622.txt @@ -26,18 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt index 0b73fcc..21cb90a 100644 --- a/tools/test/h5diff/testfiles/h5diff_623.txt +++ b/tools/test/h5diff/testfiles/h5diff_623.txt @@ -26,18 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt index dc2e433..92c98d9 100644 --- a/tools/test/h5diff/testfiles/h5diff_624.txt +++ b/tools/test/h5diff/testfiles/h5diff_624.txt @@ -26,18 +26,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Quiet mode. Do not produce output. --enable-error-stack Prints messages from the HDF5 error stack as they occur. - --src-vol-value Value (ID) of the VOL connector to use for opening the - input HDF5 file specified - --src-vol-name Name of the VOL connector to use for opening the input + --vol-value-1 Value (ID) of the VOL connector to use for opening the + first HDF5 file specified + --vol-name-1 Name of the VOL connector to use for opening the first HDF5 file specified - --src-vol-info VOL-specific info to pass to the VOL connector used for - opening the input HDF5 file specified - --dst-vol-value Value (ID) of the VOL connector to use for opening the - output HDF5 file specified - --dst-vol-name Name of the VOL connector to use for opening the output + --vol-info-1 VOL-specific info to pass to the VOL connector used for + opening the first HDF5 file specified + --vol-value-2 Value (ID) of the VOL connector to use for opening the + second HDF5 file specified + --vol-name-2 Name of the VOL connector to use for opening the second HDF5 file specified - --dst-vol-info VOL-specific info to pass to the VOL connector used for - opening the output HDF5 file specified + --vol-info-2 VOL-specific info to pass to the VOL connector used for + opening the second HDF5 file specified --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. -- cgit v0.12 From ec569a663ae98a2b5a1928c7c3bebb35121ecd5e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 23 Apr 2020 09:36:36 -0500 Subject: Remove old szip line --- release_docs/README_HDF5_CMake | 1 - 1 file changed, 1 deletion(-) diff --git a/release_docs/README_HDF5_CMake b/release_docs/README_HDF5_CMake index f1f2999..0584037 100644 --- a/release_docs/README_HDF5_CMake +++ b/release_docs/README_HDF5_CMake @@ -8,7 +8,6 @@ This tar file contains HDF5options.cmake hdf5-1.13.0 HDF5 1.13.0 source LIBAEC.tar.gz source for building SZIP replacement - SZip.tar.gz source for building SZIP ZLib.tar.gz source for building ZLIB For more information about building HDF5 with CMake, see USING_HDF5_CMake.txt in -- cgit v0.12 From de51001fcd9980bb313634ce17a7f7f22cbeed6d Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Thu, 23 Apr 2020 13:14:56 -0500 Subject: Add C++ warnings treated as error for autotools builds. --- config/commence.am | 2 +- configure.ac | 3 ++- src/libhdf5.settings.in | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/commence.am b/config/commence.am index 830c494..79dbd82 100644 --- a/config/commence.am +++ b/config/commence.am @@ -72,7 +72,7 @@ H5CPP=${DESTDIR}$(bindir)/h5c++ AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ AM_FCFLAGS=@AM_FCFLAGS@ @H5_FCFLAGS@ -AM_CXXFLAGS=@AM_CXXFLAGS@ @H5_CXXFLAGS@ +AM_CXXFLAGS=@AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ AM_CPPFLAGS=@AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_LDFLAGS=@AM_LDFLAGS@ @H5_LDFLAGS@ diff --git a/configure.ac b/configure.ac index 81e985e..db0cddf 100644 --- a/configure.ac +++ b/configure.ac @@ -104,13 +104,14 @@ AC_SUBST([AR_FLAGS]) ## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but ## not exported to h5cc (or h5fc, etc.) ## -## H5_ECFLAGS is for warnings that should be treated as errors. +## H5_ECFLAGS (and company) are for warnings that should be treated as errors. ## AC_SUBST([H5_CFLAGS]) AC_SUBST([H5_ECFLAGS]) AC_SUBST([H5_CPPFLAGS]) AC_SUBST([H5_FCFLAGS]) AC_SUBST([H5_CXXFLAGS]) +AC_SUBST([H5_ECXXFLAGS]) AC_SUBST([H5_JNIFLAGS]) AC_SUBST([H5_JAVACFLAGS]) AC_SUBST([H5_JAVAFLAGS]) diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index 192fc6f..fb9deec 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -56,7 +56,7 @@ Languages: C++: @HDF_CXX@ @BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CXX_VERSION@ @BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CXXFLAGS@ -@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ +@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ @H5_ECXXFLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ Shared C++ Library: @enable_shared@ @BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: @enable_static@ -- cgit v0.12 From 43424a1392b662a29542bb70014c253162ccfe48 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Thu, 23 Apr 2020 13:19:15 -0500 Subject: Add missing ')'. --- config/cmake/HDFCompilerFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 006e7cd..02bc8b1 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -158,7 +158,7 @@ if (NOT MSVC) # Append more extra warning flags that only gcc 4.4+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") - endif ( + endif () # Append more extra warning flags that only gcc 4.5+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) -- cgit v0.12 From f9a3ae50812a527c7b88a39d7d5b6629aa234a2d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 23 Apr 2020 14:32:29 -0500 Subject: TRILAB-244 separate CXX warnings and errors from C --- MANIFEST | 3 +++ c++/test/tarray.cpp | 1 - c++/test/tobject.cpp | 4 ++-- c++/test/ttypes.cpp | 6 +++--- config/cmake/HDFCXXCompilerFlags.cmake | 13 ++++++------ config/gnu-cxxflags | 34 ++++++++++++++---------------- config/gnu-fflags | 2 +- config/gnu-flags | 38 +++++++++++++++++----------------- config/gnu-warnings/cxx-5 | 1 + config/gnu-warnings/cxx-error-5 | 11 ++++++++++ config/gnu-warnings/cxx-error-general | 32 ++++++++++++++++++++++++++++ config/gnu-warnings/cxx-general | 16 ++++++++++++-- config/gnu-warnings/error-8 | 20 ++++++++++++++++-- 13 files changed, 126 insertions(+), 55 deletions(-) create mode 100644 config/gnu-warnings/cxx-5 create mode 100644 config/gnu-warnings/cxx-error-5 create mode 100644 config/gnu-warnings/cxx-error-general diff --git a/MANIFEST b/MANIFEST index d03b527..2430ee8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -166,6 +166,9 @@ ./config/gnu-warnings/9 ./config/gnu-warnings/cxx-general ./config/gnu-warnings/cxx-4.9 +./config/gnu-warnings/cxx-5 +./config/gnu-warnings/cxx-error-5 +./config/gnu-warnings/cxx-error-general ./config/gnu-warnings/developer-4.5 ./config/gnu-warnings/developer-4.6 ./config/gnu-warnings/developer-4.7 diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index f079780..d80de16 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -368,7 +368,6 @@ static void test_array_info() float f[ARRAY1_DIM1]; } s1_t; s1_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; // Information to write - s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; // Information read in hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; int ii; // counting variables diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index fd0f5ce..9b5dd68 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -430,7 +430,6 @@ const H5std_string DSETNAME("dataset"); static void test_open_object_header() { hsize_t dims[2]; - H5G_info_t ginfo; /* Group info struct */ // Output message about test being performed SUBTEST("Group::getObjId"); @@ -485,6 +484,7 @@ static void test_open_object_header() dset.setId(obj_dset); dspace = dset.getSpace(); bool is_simple = dspace.isSimple(); + verify_val(is_simple, true, "isSimple", __LINE__, __FILE__); dspace.close(); // Open datatype object from the group @@ -542,7 +542,7 @@ const H5std_string GROUP1NAME("group1"); const H5std_string GROUP2NAME("group2"); static void test_getobjectinfo_same_file() { - H5O_info2_t oinfo1, oinfo2; /* Object info structs */ + H5O_info2_t oinfo1, oinfo2; /* Object info structs */ // Output message about test being performed SUBTEST("Group::getObjinfo"); diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index ae79653..b8846f4 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -403,7 +403,7 @@ static void test_vltype() // Verify that the copied type has a valid id bool is_valid = IdComponent::isValid(vltype2.getId()); - verify_val(in_class, true, "isValid on vltype2", __LINE__, __FILE__); + verify_val(is_valid, true, "isValid on vltype2", __LINE__, __FILE__); in_class = vltype2.detectClass(H5T_VLEN); verify_val(in_class, true, "VarLenType::detectClass() with H5T_VLEN for vltype2", __LINE__, __FILE__); @@ -1010,8 +1010,8 @@ static void test_encode_decode() FloatType decoded_flttyp(decoded_flt_ptr->getId()); verify_val(flttyp == decoded_flttyp, true, "DataType::decode", __LINE__, __FILE__); - H5std_string norm_string; - H5T_norm_t mant_norm = decoded_flttyp.getNorm(norm_string); + //H5std_string norm_string; + //H5T_norm_t mant_norm = decoded_flttyp.getNorm(norm_string); //verify_val(decoded_flttyp.isVariableStr(), true, "DataType::decode", __LINE__, __FILE__); delete decoded_flt_ptr; diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index ec3b498..4bc646a 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -89,9 +89,8 @@ if (NOT MSVC) AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) # autotools adds the C flags with the CXX flags for g++ compiler # versions 4.2 and above. - ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") - ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") + ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general") endif () elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") @@ -163,10 +162,10 @@ if (NOT MSVC) ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5") if (HDF5_ENABLE_DEV_WARNINGS) # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") + #ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") else () # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5") + #ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5") endif () endif () @@ -228,8 +227,8 @@ if (NOT MSVC) # Append more extra warning flags that only gcc 5.1+ know about if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5") + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5") endif () # Append more extra warning flags that only gcc 6.x+ know about @@ -254,7 +253,7 @@ if (NOT MSVC) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") - ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + #ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") if (HDF5_ENABLE_DEV_WARNINGS) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index b3b082d..b2ef36d 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -44,7 +44,7 @@ demote_errors() load_gnu_arguments() { set -- $(for arg; do - sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors + sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} done) IFS=' ' echo "$*" } @@ -181,10 +181,8 @@ if test "X-g++" = "X-$cxx_vendor"; then ########### if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -gt 4; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments general)" - H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-general)" H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)" - #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-cxx-general)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-general)" fi ###################### @@ -240,29 +238,29 @@ if test "X-g++" = "X-$cxx_vendor"; then # gcc >= 4.5 if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.5)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.5)" + #DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.5)" + #NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.5)" fi # gcc >= 4.6 if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 6; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.6)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.6)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.6)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.6)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.6)" fi # gcc >= 4.7 if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 7; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.7)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.7)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.7)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.7)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.7)" fi # gcc >= 4.8 if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)" fi # gcc >= 4.9 @@ -273,8 +271,8 @@ if test "X-g++" = "X-$cxx_vendor"; then # gcc >= 5 if test $cxx_vers_major -ge 5; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 5)" - H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-5)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-5)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-5)" fi # gcc >= 6 @@ -285,15 +283,15 @@ if test "X-g++" = "X-$cxx_vendor"; then # gcc >= 7 if test $cxx_vers_major -ge 7; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-7)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-7)" fi # gcc 8 if test $cxx_vers_major -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)" - H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-8)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-8)" + #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-8)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-8)" fi # gcc 9 diff --git a/config/gnu-fflags b/config/gnu-fflags index f58f10c..eb3519c 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -26,7 +26,7 @@ load_gnu_arguments() { set -- $(for arg; do - sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors + sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} done) IFS=' ' echo "$*" } diff --git a/config/gnu-flags b/config/gnu-flags index dba9324..f391d7b 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -28,11 +28,11 @@ PROMOTE_ERRORS_DFLT=no # demote_errors() { - if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then - sed 's,-Werror=,-W,g' - else - cat - fi + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi } # @@ -44,7 +44,7 @@ demote_errors() load_gnu_arguments() { set -- $(for arg; do - sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} | demote_errors + sed 's,#.*$,,' $srcdir/config/gnu-warnings/${arg} done) IFS=' ' echo "$*" } @@ -212,7 +212,7 @@ if test "X-gcc" = "X-$cc_vendor"; then # GCC 4.2 through 4.3 if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.3)" - fi + fi # GCC 4.5 through 4.6 if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then @@ -236,7 +236,7 @@ if test "X-gcc" = "X-$cc_vendor"; then # gcc >= 4.3 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.3)" - fi + fi # gcc >= 4.4 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then @@ -246,29 +246,29 @@ if test "X-gcc" = "X-$cc_vendor"; then # gcc >= 4.5 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.5)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.5)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.5)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.5)" fi # gcc >= 4.6 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.6)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.6)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.6)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.6)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.6)" fi # gcc >= 4.7 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.7)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.7)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.7)" fi # gcc >= 4.8 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.8)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.8)" fi # gcc >= 4.9 @@ -290,15 +290,15 @@ if test "X-gcc" = "X-$cc_vendor"; then # gcc >= 7 if test $cc_vers_major -ge 7; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-7)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-7)" fi # gcc 8 if test $cc_vers_major -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 8)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-8)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-8)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-8)" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-8)" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-8)" fi # gcc 9 diff --git a/config/gnu-warnings/cxx-5 b/config/gnu-warnings/cxx-5 new file mode 100644 index 0000000..723e448 --- /dev/null +++ b/config/gnu-warnings/cxx-5 @@ -0,0 +1 @@ +-Warray-bounds=2 diff --git a/config/gnu-warnings/cxx-error-5 b/config/gnu-warnings/cxx-error-5 new file mode 100644 index 0000000..8cc8c9d --- /dev/null +++ b/config/gnu-warnings/cxx-error-5 @@ -0,0 +1,11 @@ +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Werror=shadow diff --git a/config/gnu-warnings/cxx-error-general b/config/gnu-warnings/cxx-error-general new file mode 100644 index 0000000..85cd9a3 --- /dev/null +++ b/config/gnu-warnings/cxx-error-general @@ -0,0 +1,32 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tcompound.cpp +# -Werror=cast-align +-Wcast-align +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp +# -Werror=missing-declarations +-Wmissing-declarations +-Werror=packed +-Werror=redundant-decls +-Werror=switch +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tattr.cpp +# -Werror=unused-but-set-variable +-Wunused-but-set-variable +-Werror=unused-function +-Werror=unused-variable +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp +# -Werror=unused-parameter +-Wunused-parameter +# +# Other files not compatible +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/titerate.cpp,c++/test/tarray.cpp +# -Werror=missing-declarations +# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp +# -Werror=unused-parameter diff --git a/config/gnu-warnings/cxx-general b/config/gnu-warnings/cxx-general index ee7ee22..9548cc0 100644 --- a/config/gnu-warnings/cxx-general +++ b/config/gnu-warnings/cxx-general @@ -6,14 +6,26 @@ # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it from the # environment variable at configure time. --Wabi +-Wall +-Wcast-qual +-Wconversion -Wctor-dtor-privacy -Weffc++ -##-Wendif-labels +-Wextra +-Wfloat-equal +-Wformat=2 +-Winit-self +-Winvalid-pch +-Wmissing-include-dirs +-Wno-format-nonliteral -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wreorder +-Wshadow -Wsign-promo ##-Wunreachable-code +-Wundef ##-Wvariadic-macros +-Wwrite-strings +-pedantic diff --git a/config/gnu-warnings/error-8 b/config/gnu-warnings/error-8 index 36c1414..2f54a4d 100644 --- a/config/gnu-warnings/error-8 +++ b/config/gnu-warnings/error-8 @@ -1,4 +1,7 @@ --Werror=cast-function-type +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Dchunk.c +# -Werror=cast-function-type +-Wcast-function-type # # For GCC 8, promote maybe-initialized warnings to an error. GCC 8 # reports 0 maybe-uninitialized warnings where earlier versions @@ -6,4 +9,17 @@ # in order to detect initializations that occur there. It's possible # that GCC 8 only performs that analysis at -O3, though. # --Werror=maybe-uninitialized +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDlog.c, +# -Werror=maybe-uninitialized +-Wmaybe-uninitialized +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Shyper.c,src/H5SL.c,src/H5Shyper.c +# -Werror=maybe-uninitialized +# NOTE: Test files are not compatible with these warnings as errors +# test/cache_common.c, +# -Werror=maybe-uninitialized +# NOTE: hl/src/ files are not compatible with these warnings as errors +# hl/src/H5DS.c, +# -Werror=maybe-uninitialized -- cgit v0.12 From 7f44915b442b4d65ccf2f78dae3c1f7224658bea Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Apr 2020 07:49:39 -0500 Subject: Fix NoFilter build --- hl/c++/test/ptableTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index fd85828..52f3a6b 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -267,13 +267,13 @@ error: const char* COMPRESS_PT("/compressTest"); int TestCompress() { +#ifdef H5_HAVE_FILTER_DEFLATE unsigned int flags = 0; unsigned int config = 0; size_t cd_nelemts = 0; printf("Testing %-62s", "compression"); HDfflush(stdout); -#ifdef H5_HAVE_FILTER_DEFLATE try { /* Prepare property list to set compression, randomly use deflate */ DSetCreatPropList dscreatplist; -- cgit v0.12 From 26e640da7e3cd2e57822516e45a1eb67ddc520f8 Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 24 Apr 2020 10:18:15 -0500 Subject: Fix `src/H5FDdirect.c:1346:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]`. --- src/H5FDdirect.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index d045987..34c4346 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -1335,16 +1335,13 @@ static herr_t H5FD_direct_lock(H5FD_t *_file, hbool_t rw) { H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ - int lock; /* The type of lock */ + const int lock = rw ? LOCK_EX : LOCK_SH; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(file); - /* Determine the type of lock */ - int lock = rw ? LOCK_EX : LOCK_SH; - /* Place the lock with non-blocking */ if(HDflock(file->fd, lock | LOCK_NB) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock file") -- cgit v0.12 From 737a28dc9700137f6deba34bc2419b5ea8df5900 Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 24 Apr 2020 10:22:28 -0500 Subject: Fix `test/swmr_sparse_reader.c:118:77: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]` and `test/snapshots-hdf5/current/test/swmr_sparse_reader.c:129:100: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]`. --- test/swmr_sparse_reader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index 6d5d257..704e463 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -115,7 +115,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t /* Emit informational message */ if(verbose) - HDfprintf(stderr, "Symbol = '%s', location = %lld\n", symbol->name, (long long)start); + HDfprintf(stderr, "Symbol = '%s', location = %ju,%ju\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1]); /* Read record from dataset */ record->rec_id = (uint64_t)ULLONG_MAX; @@ -126,7 +126,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t if(record->rec_id != start[1]) { HDfprintf(stderr, "*** ERROR ***\n"); HDfprintf(stderr, "Incorrect record value!\n"); - HDfprintf(stderr, "Symbol = '%s', location = %lld, record->rec_id = %llu\n", symbol->name, (long long)start, (unsigned long long)record->rec_id); + HDfprintf(stderr, "Symbol = '%s', location = %ju,%ju, record->rec_id = %" PRIu64 "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id); return -1; } /* end if */ -- cgit v0.12 From 709464301a058e8d44407d94e00919b926721f34 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Apr 2020 13:05:58 -0500 Subject: HDFFV-10576 add Option name to Error Message --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d6e7a2..922e814 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -777,28 +777,28 @@ if (HDF5_ENABLE_THREADSAFE) endif () if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") + message (FATAL_ERROR " **** parallel and thread-safety options are not supported, use ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") endif () endif () if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") + message (FATAL_ERROR " **** Fortran and thread-safety options are not supported, use ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") endif () endif () if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") + message (FATAL_ERROR " **** C++ and thread-safety options are not supported, use ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") endif () endif () if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") + message (FATAL_ERROR " **** HL and thread-safety options are not supported, use ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") endif () @@ -1014,7 +1014,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") # check for unsupported options if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") + message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, use ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported Parallel and C++ options **** ") endif () -- cgit v0.12 From 64fa9327d008c0c3d17c9489c32d99e0d514f88e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Apr 2020 16:23:28 -0500 Subject: Add "override with" to error message --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 922e814..b559446 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -777,28 +777,28 @@ if (HDF5_ENABLE_THREADSAFE) endif () if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** parallel and thread-safety options are not supported, use ALLOW_UNSUPPORTED option **** ") + message (FATAL_ERROR " **** parallel and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") endif () endif () if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** Fortran and thread-safety options are not supported, use ALLOW_UNSUPPORTED option **** ") + message (FATAL_ERROR " **** Fortran and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") endif () endif () if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** C++ and thread-safety options are not supported, use ALLOW_UNSUPPORTED option **** ") + message (FATAL_ERROR " **** C++ and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") endif () endif () if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** HL and thread-safety options are not supported, use ALLOW_UNSUPPORTED option **** ") + message (FATAL_ERROR " **** HL and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") endif () @@ -1014,7 +1014,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") # check for unsupported options if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, use ALLOW_UNSUPPORTED option **** ") + message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, override with ALLOW_UNSUPPORTED option **** ") else () message (STATUS " **** Allowing unsupported Parallel and C++ options **** ") endif () -- cgit v0.12 From ae9dc2d5f9016ef279ca9d0ca8ad9c8416e60df9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 24 Apr 2020 16:25:51 -0500 Subject: Restrict errors to gcc 4.8 and above. --- config/cmake/HDFCompilerFlags.cmake | 6 ++++-- config/gnu-flags | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 02bc8b1..6dbaa64 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -96,6 +96,8 @@ if (NOT MSVC) # Add general CFlags for GCC versions 4.2 and above if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") + endif () + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") endif () # gcc automatically inlines based on the optimization level @@ -140,12 +142,12 @@ if (NOT MSVC) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") endif () - # Append warning flags for gcc 4.2-4.3 + # Append warning flags for gcc 4.2-4.3 if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.3") endif () - # Append warning flags for gcc 4.2-4.4 + # Append warning flags for gcc 4.2-4.4 if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.4 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.4") endif () diff --git a/config/gnu-flags b/config/gnu-flags index f391d7b..7e69ede 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -190,6 +190,8 @@ if test "X-gcc" = "X-$cc_vendor"; then if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -gt 4; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" + fi + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" fi -- cgit v0.12 From d16eb45d536bd13ca3cf1b0bdc76c58d95d13f17 Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 24 Apr 2020 18:49:37 -0500 Subject: For compatibility with non-C99 Visual Studio versions, use "%" PRIuMAX instead of "%ju". --- test/swmr_sparse_reader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index 704e463..2d558df 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -115,7 +115,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t /* Emit informational message */ if(verbose) - HDfprintf(stderr, "Symbol = '%s', location = %ju,%ju\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1]); + HDfprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1]); /* Read record from dataset */ record->rec_id = (uint64_t)ULLONG_MAX; @@ -126,7 +126,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t if(record->rec_id != start[1]) { HDfprintf(stderr, "*** ERROR ***\n"); HDfprintf(stderr, "Incorrect record value!\n"); - HDfprintf(stderr, "Symbol = '%s', location = %ju,%ju, record->rec_id = %" PRIu64 "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id); + HDfprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX ", record->rec_id = %" PRIu64 "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id); return -1; } /* end if */ -- cgit v0.12 From ed833f1c8d07d32eaa9319c8e3220b5033485abd Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 24 Apr 2020 21:13:31 -0500 Subject: Extend h5debug to support 3-D datasets for chunks. --- tools/src/misc/h5debug.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index a167709..c1940f7 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -251,7 +251,7 @@ main(int argc, char *argv[]) hid_t fid, fapl; H5VL_object_t *vol_obj; H5F_t *f; - haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0; + haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0, extra5 = 0; uint8_t sig[H5F_SIGNATURE_LEN]; size_t u; H5E_auto2_t func; @@ -327,6 +327,8 @@ main(int argc, char *argv[]) extra3 = (haddr_t)HDstrtoll(argv[5], NULL, 0); if(argc > 6) extra4 = (haddr_t)HDstrtoll(argv[6], NULL, 0); + if(argc > 7) + extra5 = (haddr_t)HDstrtoll(argv[7], NULL, 0); /* * Read the signature at the specified file position. @@ -410,10 +412,12 @@ main(int argc, char *argv[]) dim[1] = (uint32_t)extra3; if(ndims > 2) dim[2] = (uint32_t)extra4; + if(ndims > 3) + dim[3] = (uint32_t)extra5; /* Check for dimension error */ - if(ndims > 3) { - HDfprintf(stderr, "ERROR: Only 3 dimensions support currently (fix h5debug)\n"); + if(ndims > 4) { + HDfprintf(stderr, "ERROR: Only 4 dimensions support currently (fix h5debug)\n"); HDfprintf(stderr, "B-tree chunked storage node usage:\n"); HDfprintf(stderr, "\th5debug <# of dimensions> ...\n"); HDexit(4); -- cgit v0.12 From a8676d74d9fc50c0da4dcf4cf5646e4a8b2352ba Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 25 Apr 2020 16:49:04 -0700 Subject: Fixes for warnings in the tools code. --- test/h5test.h | 59 ++++ tools/lib/h5diff.h | 6 +- tools/src/h5diff/h5diff_common.c | 18 +- tools/src/h5dump/h5dump_xml.c | 6 +- tools/src/h5jam/h5jam.c | 2 +- tools/test/h5dump/CMakeLists.txt | 2 +- tools/test/h5dump/Makefile.am | 2 +- tools/test/h5dump/h5dumpgentest.c | 475 ++++++++++++++++++++++++-------- tools/test/h5import/h5importtest.c | 9 +- tools/test/h5repack/CMakeLists.txt | 2 +- tools/test/h5repack/h5repacktst.c | 543 +++++++++++++++++++------------------ tools/test/misc/CMakeLists.txt | 2 +- tools/test/misc/Makefile.am | 2 +- tools/test/misc/h5clear_gentest.c | 24 +- tools/test/perform/pio_perf.c | 8 +- tools/test/perform/sio_perf.c | 8 +- tools/test/perform/zip_perf.c | 4 +- 17 files changed, 754 insertions(+), 418 deletions(-) diff --git a/test/h5test.h b/test/h5test.h index 39ec9d7..891697a 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -125,6 +125,65 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ #define H5_FILEACCESS_VFD 0x01 #define H5_FILEACCESS_LIBVER 0x02 +/* Macros to create and fill 2D arrays with a single heap allocation. + * These can be used to replace large stack and global arrays which raise + * warnings. + * + * The macros make a single heap allocation large enough to hold all the + * pointers and the data elements. The first part of the allocation holds + * the pointers, and the second part holds the data as a contiguous block + * in row-major order. + * + * To pass the data block to calls like H5Dread(), pass a pointer to the + * first array element as the data pointer (e.g., array[0] in a 2D array). + * + * The fill macro just fills the array with an increasing count value. + * + * Usage: + * + * int **array; + * + * H5TEST_ALLOCATE_2D_ARRAY(array, int, 5, 10); + * + * H5TEST_FILL_2D_ARRAY(array, int, 5, 10); + * + * (do stuff) + * + * HDfree(array); + */ +#define H5TEST_ALLOCATE_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \ +{ \ + /* Prefix with h5taa to avoid shadow warnings */ \ + size_t h5taa_pointers_size = 0; \ + size_t h5taa_data_size = 0; \ + int h5taa_i; \ + \ + h5taa_pointers_size = (DIMS_I) * sizeof(TYPE *); \ + h5taa_data_size = (DIMS_I) * (DIMS_J) * sizeof(TYPE); \ + \ + ARR = (TYPE **)HDmalloc(h5taa_pointers_size + h5taa_data_size); \ + \ + ARR[0] = (TYPE *)(ARR + (DIMS_I)); \ + \ + for (h5taa_i = 1; h5taa_i < (DIMS_I); h5taa_i++) \ + ARR[h5taa_i] = ARR[h5taa_i-1] + (DIMS_J); \ +} + +#define H5TEST_FILL_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \ +{ \ + /* Prefix with h5tfa to avoid shadow warnings */ \ + int h5tfa_i = 0; \ + int h5tfa_j = 0; \ + TYPE h5tfa_count = 0; \ + \ + for (h5tfa_i = 0; h5tfa_i < (DIMS_I); h5tfa_i++) \ + for (h5tfa_j = 0; h5tfa_j < (DIMS_J); h5tfa_j++) { \ + ARR[h5tfa_i][h5tfa_j] = h5tfa_count; \ + h5tfa_count++; \ + } \ +} + + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 8fe9d86..37eb775 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -53,9 +53,9 @@ typedef struct { */ /* linked list to keep exclude path list */ struct exclude_path_list { - char *obj_path; - h5trav_type_t obj_type; - struct exclude_path_list * next; + const char *obj_path; + h5trav_type_t obj_type; + struct exclude_path_list *next; }; /* Enumeration value for keeping track of whether an error occurred or differences were found */ diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 771b20f..e0e6f8c 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -197,7 +197,7 @@ void parse_command_line(int argc, } /* init */ - exclude_node->obj_path = (char*)opt_arg; + exclude_node->obj_path = opt_arg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; @@ -207,7 +207,7 @@ void parse_command_line(int argc, } else { while(NULL != exclude_prev->next) - exclude_prev=exclude_prev->next; + exclude_prev = exclude_prev->next; exclude_node->next = NULL; exclude_prev->next = exclude_node; @@ -215,14 +215,14 @@ void parse_command_line(int argc, break; case 'd': - opts->d=1; + opts->d = 1; if (check_d_input(opt_arg) == - 1) { HDprintf("<-d %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->delta = atof(opt_arg); + opts->delta = HDatof(opt_arg); /* -d 0 is the same as default */ if (H5_DBL_ABS_EQUAL(opts->delta, (double)0.0F)) @@ -230,13 +230,13 @@ void parse_command_line(int argc, break; case 'p': - opts->p=1; + opts->p = 1; if (check_p_input(opt_arg) == -1) { HDprintf("<-p %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->percent = atof(opt_arg); + opts->percent = HDatof(opt_arg); /* -p 0 is the same as default */ if (H5_DBL_ABS_EQUAL(opts->percent, (double)0.0F)) @@ -244,7 +244,7 @@ void parse_command_line(int argc, break; case 'n': - opts->n=1; + opts->n = 1; if ( check_n_input(opt_arg) == -1) { HDprintf("<-n %s> is not a valid option\n", opt_arg); usage(); @@ -427,7 +427,7 @@ check_p_input( const char *str ) if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x = atof(str); + x = HDatof(str); if (x < 0) return -1; @@ -461,7 +461,7 @@ check_d_input( const char *str ) if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x = atof(str); + x = HDatof(str); if (x < 0) return -1; diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 4f58b73..7edd962 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -732,7 +732,7 @@ xml_escape_the_name(const char *str) * Programmer: REMcG *------------------------------------------------------------------------- */ -static char * +static char * xml_escape_the_string(const char *str, int slen) { size_t extra; @@ -794,18 +794,22 @@ xml_escape_the_string(const char *str, int slen) else if (*cp == '\'') { esc_len = HDstrlen(apos); HDstrncpy(ncp, apos, esc_len); + ncp[sizeof(ncp) - 1] = '\0'; } else if (*cp == '<') { esc_len = HDstrlen(lt); HDstrncpy(ncp, lt, esc_len); + ncp[sizeof(ncp) - 1] = '\0'; } else if (*cp == '>') { esc_len = HDstrlen(gt); HDstrncpy(ncp, gt, esc_len); + ncp[sizeof(ncp) - 1] = '\0'; } else if (*cp == '&') { esc_len = HDstrlen(amp); HDstrncpy(ncp, amp, esc_len); + ncp[sizeof(ncp) - 1] = '\0'; } else { *ncp = *cp; diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 07797c8..009e527 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -148,7 +148,7 @@ parse_command_line (int argc, const char *argv[]) int opt = FALSE; /* parse command line options */ - while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) { diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index cfc542f..8a83699 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -35,7 +35,7 @@ endif () # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5dumpgentest STATIC) target_link_libraries (h5dumpgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index a7a2bcb..21560fb 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -19,7 +19,7 @@ include $(top_srcdir)/config/commence.am # Include files in /src directory and /tools/lib directory -AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib +AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib # Test programs and scripts TEST_PROG=h5dumpgentest diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 54b390f..b992a88 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -22,7 +22,7 @@ */ #include "hdf5.h" -#include "H5private.h" +#include "h5test.h" #include "h5tools.h" #define FILE1 "tgroup.h5" @@ -7209,19 +7209,43 @@ gent_dataset_idx(void) static void gent_packedbits(void) { - hid_t fid, dataset, space; + hid_t fid = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; hsize_t dims[2]; - uint8_t dsetu8[F66_XDIM][F66_YDIM8], valu8bits; - uint16_t dsetu16[F66_XDIM][F66_YDIM16], valu16bits; - uint32_t dsetu32[F66_XDIM][F66_YDIM32], valu32bits; - uint64_t dsetu64[F66_XDIM][F66_YDIM64], valu64bits; - int8_t dset8[F66_XDIM][F66_YDIM8], val8bits; - int16_t dset16[F66_XDIM][F66_YDIM16], val16bits; - int32_t dset32[F66_XDIM][F66_YDIM32], val32bits; - int64_t dset64[F66_XDIM][F66_YDIM64], val64bits; - double dsetdbl[F66_XDIM][F66_YDIM8]; + + uint8_t **dsetu8 = NULL; + uint16_t **dsetu16 = NULL; + uint32_t **dsetu32 = NULL; + uint64_t **dsetu64 = NULL; + int8_t **dset8 = NULL; + int16_t **dset16 = NULL; + int32_t **dset32 = NULL; + int64_t **dset64 = NULL; + double **dsetdbl = NULL; + + uint8_t valu8bits; + uint16_t valu16bits; + uint32_t valu32bits; + uint64_t valu64bits; + int8_t val8bits; + int16_t val16bits; + int32_t val32bits; + int64_t val64bits; + unsigned int i, j; + /* Create arrays */ + H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F66_XDIM, F66_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F66_XDIM, F66_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F66_XDIM, F66_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F66_XDIM, F66_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F66_XDIM, F66_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F66_XDIM, F66_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F66_XDIM, F66_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F66_XDIM, F66_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F66_XDIM, F66_YDIM8); + fid = H5Fcreate(FILE66, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Dataset of 8 bits unsigned int */ @@ -7237,7 +7261,7 @@ gent_packedbits(void) valu8bits = (uint8_t)(valu8bits << 1); } - H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); + H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8[0]); H5Sclose(space); H5Dclose(dataset); @@ -7254,7 +7278,7 @@ gent_packedbits(void) valu16bits = (uint16_t)(valu16bits << 1); } - H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); + H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16[0]); H5Sclose(space); H5Dclose(dataset); @@ -7271,7 +7295,7 @@ gent_packedbits(void) valu32bits <<= 1; } - H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32); + H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32[0]); H5Sclose(space); H5Dclose(dataset); @@ -7288,7 +7312,7 @@ gent_packedbits(void) valu64bits <<= 1; } - H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64); + H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64[0]); H5Sclose(space); H5Dclose(dataset); @@ -7305,7 +7329,7 @@ gent_packedbits(void) val8bits = (int8_t)(val8bits << 1); } - H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); + H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8[0]); H5Sclose(space); H5Dclose(dataset); @@ -7322,7 +7346,7 @@ gent_packedbits(void) val16bits = (int16_t)(val16bits << 1); } - H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); + H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16[0]); H5Sclose(space); H5Dclose(dataset); @@ -7339,7 +7363,7 @@ gent_packedbits(void) val32bits <<= 1; } - H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32); + H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32[0]); H5Sclose(space); H5Dclose(dataset); @@ -7356,7 +7380,7 @@ gent_packedbits(void) val64bits <<= 1; } - H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64); + H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64[0]); H5Sclose(space); H5Dclose(dataset); @@ -7369,11 +7393,21 @@ gent_packedbits(void) for(j = 0; j < dims[1]; j++) dsetdbl[i][j] = 0.0001F * (float)j + (float)i; - H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl); + H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl[0]); H5Sclose(space); H5Dclose(dataset); H5Fclose(fid); + + HDfree(dsetu8); + HDfree(dsetu16); + HDfree(dsetu32); + HDfree(dsetu64); + HDfree(dset8); + HDfree(dset16); + HDfree(dset32); + HDfree(dset64); + HDfree(dsetdbl); } /*------------------------------------------------------------------------- @@ -7390,19 +7424,44 @@ gent_packedbits(void) static void gent_attr_intsize(void) { - hid_t fid, attr, space, root; + hid_t fid = H5I_INVALID_HID; + hid_t attr = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t root = H5I_INVALID_HID; hsize_t dims[2]; - uint8_t dsetu8[F66_XDIM][F66_YDIM8], valu8bits; - uint16_t dsetu16[F66_XDIM][F66_YDIM16], valu16bits; - uint32_t dsetu32[F66_XDIM][F66_YDIM32], valu32bits; - uint64_t dsetu64[F66_XDIM][F66_YDIM64], valu64bits; - int8_t dset8[F66_XDIM][F66_YDIM8], val8bits; - int16_t dset16[F66_XDIM][F66_YDIM16], val16bits; - int32_t dset32[F66_XDIM][F66_YDIM32], val32bits; - int64_t dset64[F66_XDIM][F66_YDIM64], val64bits; - double dsetdbl[F66_XDIM][F66_YDIM8]; + + uint8_t **dsetu8 = NULL; + uint16_t **dsetu16 = NULL; + uint32_t **dsetu32 = NULL; + uint64_t **dsetu64 = NULL; + int8_t **dset8 = NULL; + int16_t **dset16 = NULL; + int32_t **dset32 = NULL; + int64_t **dset64 = NULL; + double **dsetdbl = NULL; + + uint8_t valu8bits; + uint16_t valu16bits; + uint32_t valu32bits; + uint64_t valu64bits; + int8_t val8bits; + int16_t val16bits; + int32_t val32bits; + int64_t val64bits; + unsigned int i, j; + /* Create arrays */ + H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F66_XDIM, F66_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F66_XDIM, F66_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F66_XDIM, F66_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F66_XDIM, F66_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F66_XDIM, F66_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F66_XDIM, F66_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F66_XDIM, F66_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F66_XDIM, F66_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F66_XDIM, F66_YDIM8); + fid = H5Fcreate(FILE69, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); root = H5Gopen2(fid, "/", H5P_DEFAULT); @@ -7420,7 +7479,7 @@ gent_attr_intsize(void) valu8bits = (uint8_t)(valu8bits << 1); } - H5Awrite(attr, H5T_NATIVE_UINT8, dsetu8); + H5Awrite(attr, H5T_NATIVE_UINT8, dsetu8[0]); H5Sclose(space); H5Aclose(attr); @@ -7438,7 +7497,7 @@ gent_attr_intsize(void) valu16bits = (uint16_t)(valu16bits << 1); } - H5Awrite(attr, H5T_NATIVE_UINT16, dsetu16); + H5Awrite(attr, H5T_NATIVE_UINT16, dsetu16[0]); H5Sclose(space); H5Aclose(attr); @@ -7456,7 +7515,7 @@ gent_attr_intsize(void) valu32bits <<= 1; } - H5Awrite(attr, H5T_NATIVE_UINT32, dsetu32); + H5Awrite(attr, H5T_NATIVE_UINT32, dsetu32[0]); H5Sclose(space); H5Aclose(attr); @@ -7474,7 +7533,7 @@ gent_attr_intsize(void) valu64bits <<= 1; } - H5Awrite(attr, H5T_NATIVE_UINT64, dsetu64); + H5Awrite(attr, H5T_NATIVE_UINT64, dsetu64[0]); H5Sclose(space); H5Aclose(attr); @@ -7492,7 +7551,7 @@ gent_attr_intsize(void) val8bits = (int8_t)(val8bits << 1); } - H5Awrite(attr, H5T_NATIVE_INT8, dset8); + H5Awrite(attr, H5T_NATIVE_INT8, dset8[0]); H5Sclose(space); H5Aclose(attr); @@ -7510,7 +7569,7 @@ gent_attr_intsize(void) val16bits = (int16_t)(val16bits << 1); } - H5Awrite(attr, H5T_NATIVE_INT16, dset16); + H5Awrite(attr, H5T_NATIVE_INT16, dset16[0]); H5Sclose(space); H5Aclose(attr); @@ -7528,7 +7587,7 @@ gent_attr_intsize(void) val32bits <<= 1; } - H5Awrite(attr, H5T_NATIVE_INT32, dset32); + H5Awrite(attr, H5T_NATIVE_INT32, dset32[0]); H5Sclose(space); H5Aclose(attr); @@ -7546,7 +7605,7 @@ gent_attr_intsize(void) val64bits <<= 1; } - H5Awrite(attr, H5T_NATIVE_INT64, dset64); + H5Awrite(attr, H5T_NATIVE_INT64, dset64[0]); H5Sclose(space); H5Aclose(attr); @@ -7559,13 +7618,23 @@ gent_attr_intsize(void) for(j = 0; j < dims[1]; j++) dsetdbl[i][j] = 0.0001F * (float)j + (float)i; - H5Awrite(attr, H5T_NATIVE_DOUBLE, dsetdbl); + H5Awrite(attr, H5T_NATIVE_DOUBLE, dsetdbl[0]); H5Sclose(space); H5Aclose(attr); H5Gclose(root); H5Fclose(fid); + + HDfree(dsetu8); + HDfree(dsetu16); + HDfree(dsetu32); + HDfree(dsetu64); + HDfree(dset8); + HDfree(dset16); + HDfree(dset32); + HDfree(dset64); + HDfree(dsetdbl); } static void @@ -8407,19 +8476,44 @@ static void gent_nested_compound_dt(void) { /* test nested data type */ static void gent_intscalars(void) { - hid_t fid, dataset, space, tid; + hid_t fid = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; hsize_t dims[2]; - uint8_t dsetu8[F73_XDIM][F73_YDIM8], valu8bits; - uint16_t dsetu16[F73_XDIM][F73_YDIM16], valu16bits; - uint32_t dsetu32[F73_XDIM][F73_YDIM32], valu32bits; - uint64_t dsetu64[F73_XDIM][F73_YDIM64], valu64bits; - int8_t dset8[F73_XDIM][F73_YDIM8], val8bits; - int16_t dset16[F73_XDIM][F73_YDIM16], val16bits; - int32_t dset32[F73_XDIM][F73_YDIM32], val32bits; - int64_t dset64[F73_XDIM][F73_YDIM64], val64bits; - double dsetdbl[F73_XDIM][F73_YDIM8]; + + uint8_t **dsetu8 = NULL; + uint16_t **dsetu16 = NULL; + uint32_t **dsetu32 = NULL; + uint64_t **dsetu64 = NULL; + int8_t **dset8 = NULL; + int16_t **dset16 = NULL; + int32_t **dset32 = NULL; + int64_t **dset64 = NULL; + double **dsetdbl = NULL; + + uint8_t valu8bits; + uint16_t valu16bits; + uint32_t valu32bits; + uint64_t valu64bits; + int8_t val8bits; + int16_t val16bits; + int32_t val32bits; + int64_t val64bits; + unsigned int i, j; + /* Create arrays */ + H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F73_XDIM, F73_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F73_XDIM, F73_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F73_XDIM, F73_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F73_XDIM, F73_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F73_XDIM, F73_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F73_XDIM, F73_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F73_XDIM, F73_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F73_XDIM, F73_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F73_XDIM, F73_YDIM8); + fid = H5Fcreate(FILE73, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Dataset of 8 bits unsigned int */ @@ -8437,7 +8531,7 @@ gent_intscalars(void) valu8bits = (uint8_t)(valu8bits << 1); } - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8[0]); H5Sclose(space); H5Dclose(dataset); @@ -8456,7 +8550,7 @@ gent_intscalars(void) valu16bits = (uint16_t)(valu16bits << 1); } - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16[0]); H5Sclose(space); H5Dclose(dataset); @@ -8475,7 +8569,7 @@ gent_intscalars(void) valu32bits <<= 1; } - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32[0]); H5Sclose(space); H5Dclose(dataset); @@ -8494,7 +8588,7 @@ gent_intscalars(void) valu64bits <<= 1; } - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64[0]); H5Sclose(space); H5Dclose(dataset); @@ -8513,7 +8607,7 @@ gent_intscalars(void) val8bits = (int8_t)(val8bits << 1); } - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8[0]); H5Sclose(space); H5Dclose(dataset); @@ -8532,7 +8626,7 @@ gent_intscalars(void) val16bits = (int16_t)(val16bits << 1); } - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16[0]); H5Sclose(space); H5Dclose(dataset); @@ -8551,7 +8645,7 @@ gent_intscalars(void) val32bits <<= 1; } - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32[0]); H5Sclose(space); H5Dclose(dataset); @@ -8570,7 +8664,7 @@ gent_intscalars(void) val64bits <<= 1; } - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64[0]); H5Sclose(space); H5Dclose(dataset); @@ -8584,11 +8678,21 @@ gent_intscalars(void) for(j = 0; j < dims[1]; j++) dsetdbl[i][j] = 0.0001F * (float)j + (float)i; - H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl); + H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl[0]); H5Sclose(space); H5Dclose(dataset); H5Fclose(fid); + + HDfree(dsetu8); + HDfree(dsetu16); + HDfree(dsetu32); + HDfree(dsetu64); + HDfree(dset8); + HDfree(dset16); + HDfree(dset32); + HDfree(dset64); + HDfree(dsetdbl); } /*------------------------------------------------------------------------- @@ -8605,19 +8709,46 @@ gent_intscalars(void) static void gent_attr_intscalars(void) { - hid_t fid, attr, space, root, tid; + hid_t fid = H5I_INVALID_HID; + hid_t attr = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t root = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; hsize_t dims[2]; - uint8_t dsetu8[F73_XDIM][F73_YDIM8], valu8bits; - uint16_t dsetu16[F73_XDIM][F73_YDIM16], valu16bits; - uint32_t dsetu32[F73_XDIM][F73_YDIM32], valu32bits; - uint64_t dsetu64[F73_XDIM][F73_YDIM64], valu64bits; - int8_t dset8[F73_XDIM][F73_YDIM8], val8bits; - int16_t dset16[F73_XDIM][F73_YDIM16], val16bits; - int32_t dset32[F73_XDIM][F73_YDIM32], val32bits; - int64_t dset64[F73_XDIM][F73_YDIM64], val64bits; - double dsetdbl[F73_XDIM][F73_YDIM8]; + + + uint8_t **dsetu8 = NULL; + uint16_t **dsetu16 = NULL; + uint32_t **dsetu32 = NULL; + uint64_t **dsetu64 = NULL; + int8_t **dset8 = NULL; + int16_t **dset16 = NULL; + int32_t **dset32 = NULL; + int64_t **dset64 = NULL; + double **dsetdbl = NULL; + + uint8_t valu8bits; + uint16_t valu16bits; + uint32_t valu32bits; + uint64_t valu64bits; + int8_t val8bits; + int16_t val16bits; + int32_t val32bits; + int64_t val64bits; + unsigned int i, j; + /* Create arrays */ + H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F73_XDIM, F73_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F73_XDIM, F73_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F73_XDIM, F73_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F73_XDIM, F73_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F73_XDIM, F73_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F73_XDIM, F73_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F73_XDIM, F73_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F73_XDIM, F73_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F73_XDIM, F73_YDIM8); + fid = H5Fcreate(FILE74, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); root = H5Gopen2(fid, "/", H5P_DEFAULT); @@ -8636,7 +8767,7 @@ gent_attr_intscalars(void) valu8bits = (uint8_t)(valu8bits << 1); } - H5Awrite(attr, tid, dsetu8); + H5Awrite(attr, tid, dsetu8[0]); H5Sclose(space); H5Aclose(attr); @@ -8655,7 +8786,7 @@ gent_attr_intscalars(void) valu16bits = (uint16_t)(valu16bits << 1); } - H5Awrite(attr, tid, dsetu16); + H5Awrite(attr, tid, dsetu16[0]); H5Sclose(space); H5Aclose(attr); @@ -8674,7 +8805,7 @@ gent_attr_intscalars(void) valu32bits <<= 1; } - H5Awrite(attr, tid, dsetu32); + H5Awrite(attr, tid, dsetu32[0]); H5Sclose(space); H5Aclose(attr); @@ -8693,7 +8824,7 @@ gent_attr_intscalars(void) valu64bits <<= 1; } - H5Awrite(attr, tid, dsetu64); + H5Awrite(attr, tid, dsetu64[0]); H5Sclose(space); H5Aclose(attr); @@ -8712,7 +8843,7 @@ gent_attr_intscalars(void) val8bits = (int8_t)(val8bits << 1); } - H5Awrite(attr, tid, dset8); + H5Awrite(attr, tid, dset8[0]); H5Sclose(space); H5Aclose(attr); @@ -8731,7 +8862,7 @@ gent_attr_intscalars(void) val16bits = (int16_t)(val16bits << 1); } - H5Awrite(attr, tid, dset16); + H5Awrite(attr, tid, dset16[0]); H5Sclose(space); H5Aclose(attr); @@ -8750,7 +8881,7 @@ gent_attr_intscalars(void) val32bits <<= 1; } - H5Awrite(attr, tid, dset32); + H5Awrite(attr, tid, dset32[0]); H5Sclose(space); H5Aclose(attr); @@ -8769,7 +8900,7 @@ gent_attr_intscalars(void) val64bits <<= 1; } - H5Awrite(attr, tid, dset64); + H5Awrite(attr, tid, dset64[0]); H5Sclose(space); H5Aclose(attr); @@ -8783,13 +8914,23 @@ gent_attr_intscalars(void) for(j = 0; j < dims[1]; j++) dsetdbl[i][j] = 0.0001F * (float)j + (float)i; - H5Awrite(attr, tid, dsetdbl); + H5Awrite(attr, tid, dsetdbl[0]); H5Sclose(space); H5Aclose(attr); H5Gclose(root); H5Fclose(fid); + + HDfree(dsetu8); + HDfree(dsetu16); + HDfree(dsetu32); + HDfree(dsetu64); + HDfree(dset8); + HDfree(dset16); + HDfree(dset32); + HDfree(dset64); + HDfree(dsetdbl); } /*------------------------------------------------------------------------- @@ -9344,19 +9485,45 @@ static void gent_compound_ints(void) { static void gent_intattrscalars(void) { - hid_t fid, attr, dataset, space, tid; + hid_t fid = H5I_INVALID_HID; + hid_t attr = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; hsize_t dims[2]; - uint8_t dsetu8[F73_XDIM][F73_YDIM8], valu8bits; - uint16_t dsetu16[F73_XDIM][F73_YDIM16], valu16bits; - uint32_t dsetu32[F73_XDIM][F73_YDIM32], valu32bits; - uint64_t dsetu64[F73_XDIM][F73_YDIM64], valu64bits; - int8_t dset8[F73_XDIM][F73_YDIM8], val8bits; - int16_t dset16[F73_XDIM][F73_YDIM16], val16bits; - int32_t dset32[F73_XDIM][F73_YDIM32], val32bits; - int64_t dset64[F73_XDIM][F73_YDIM64], val64bits; - double dsetdbl[F73_XDIM][F73_YDIM8]; + + uint8_t **dsetu8 = NULL; + uint16_t **dsetu16 = NULL; + uint32_t **dsetu32 = NULL; + uint64_t **dsetu64 = NULL; + int8_t **dset8 = NULL; + int16_t **dset16 = NULL; + int32_t **dset32 = NULL; + int64_t **dset64 = NULL; + double **dsetdbl = NULL; + + uint8_t valu8bits; + uint16_t valu16bits; + uint32_t valu32bits; + uint64_t valu64bits; + int8_t val8bits; + int16_t val16bits; + int32_t val32bits; + int64_t val64bits; + unsigned int i, j; + /* Create arrays */ + H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F73_XDIM, F73_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F73_XDIM, F73_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F73_XDIM, F73_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F73_XDIM, F73_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F73_XDIM, F73_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F73_XDIM, F73_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F73_XDIM, F73_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F73_XDIM, F73_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F73_XDIM, F73_YDIM8); + fid = H5Fcreate(FILE78, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Dataset of 8 bits unsigned int */ @@ -9377,7 +9544,7 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); /* Attribute of 8 bits unsigned int */ attr = H5Acreate2(dataset, F73_DATASETU08, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dsetu8); + H5Awrite(attr, tid, dsetu8[0]); H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); @@ -9400,7 +9567,7 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); /* Attribute of 16 bits unsigned int */ attr = H5Acreate2(dataset, F73_DATASETU16, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dsetu16); + H5Awrite(attr, tid, dsetu16[0]); H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); @@ -9423,7 +9590,7 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32); /* Attribute of 32 bits unsigned int */ attr = H5Acreate2(dataset, F73_DATASETU32, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dsetu32); + H5Awrite(attr, tid, dsetu32[0]); H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); @@ -9446,7 +9613,7 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64); /* Attribute of 64 bits unsigned int */ attr = H5Acreate2(dataset, F73_DATASETU64, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dsetu64); + H5Awrite(attr, tid, dsetu64[0]); H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); @@ -9469,7 +9636,7 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); /* Attribute of 8 bits signed int */ attr = H5Acreate2(dataset, F73_DATASETS08, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dset8); + H5Awrite(attr, tid, dset8[0]); H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); @@ -9492,7 +9659,7 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); /* Attribute of 16 bits signed int */ attr = H5Acreate2(dataset, F73_DATASETS16, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dset16); + H5Awrite(attr, tid, dset16[0]); H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); @@ -9515,7 +9682,7 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32); /* Attribute of 32 bits signed int */ attr = H5Acreate2(dataset, F73_DATASETS32, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dset32); + H5Awrite(attr, tid, dset32[0]); H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); @@ -9538,7 +9705,7 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64); /* Attribute of 64 bits signed int */ attr = H5Acreate2(dataset, F73_DATASETS64, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dset64); + H5Awrite(attr, tid, dset64[0]); H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); @@ -9556,11 +9723,22 @@ gent_intattrscalars(void) H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl); /* Attribute of double */ attr = H5Acreate2(dataset, F73_DUMMYDBL, tid, space, H5P_DEFAULT, H5P_DEFAULT); - H5Awrite(attr, tid, dsetdbl); + H5Awrite(attr, tid, dsetdbl[0]); + H5Aclose(attr); H5Sclose(space); H5Dclose(dataset); H5Fclose(fid); + + HDfree(dsetu8); + HDfree(dsetu16); + HDfree(dsetu32); + HDfree(dsetu64); + HDfree(dset8); + HDfree(dset16); + HDfree(dset32); + HDfree(dset64); + HDfree(dsetdbl); } /*------------------------------------------------------------------------- @@ -9576,19 +9754,66 @@ gent_intattrscalars(void) static void gent_intsattrs(void) { - hid_t fid, attr, dataset, space, aspace; + hid_t fid = H5I_INVALID_HID; + hid_t attr = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t aspace = H5I_INVALID_HID; hsize_t dims[2], adims[1]; - uint8_t dsetu8[F66_XDIM][F66_YDIM8], asetu8[F66_XDIM*F66_YDIM8], valu8bits; - uint16_t dsetu16[F66_XDIM][F66_YDIM16], asetu16[F66_XDIM*F66_YDIM16], valu16bits; - uint32_t dsetu32[F66_XDIM][F66_YDIM32], asetu32[F66_XDIM*F66_YDIM32], valu32bits; - uint64_t dsetu64[F66_XDIM][F66_YDIM64], asetu64[F66_XDIM*F66_YDIM64], valu64bits; - int8_t dset8[F66_XDIM][F66_YDIM8], aset8[F66_XDIM*F66_YDIM8], val8bits; - int16_t dset16[F66_XDIM][F66_YDIM16], aset16[F66_XDIM*F66_YDIM16], val16bits; - int32_t dset32[F66_XDIM][F66_YDIM32], aset32[F66_XDIM*F66_YDIM32], val32bits; - int64_t dset64[F66_XDIM][F66_YDIM64], aset64[F66_XDIM*F66_YDIM64], val64bits; - double dsetdbl[F66_XDIM][F66_YDIM8], asetdbl[F66_XDIM*F66_YDIM8]; + + + uint8_t **dsetu8 = NULL; + uint16_t **dsetu16 = NULL; + uint32_t **dsetu32 = NULL; + uint64_t **dsetu64 = NULL; + int8_t **dset8 = NULL; + int16_t **dset16 = NULL; + int32_t **dset32 = NULL; + int64_t **dset64 = NULL; + double **dsetdbl = NULL; + + uint8_t *asetu8 = NULL; + uint16_t *asetu16 = NULL; + uint32_t *asetu32 = NULL; + uint64_t *asetu64 = NULL; + int8_t *aset8 = NULL; + int16_t *aset16 = NULL; + int32_t *aset32 = NULL; + int64_t *aset64 = NULL; + double *asetdbl = NULL; + + uint8_t valu8bits; + uint16_t valu16bits; + uint32_t valu32bits; + uint64_t valu64bits; + int8_t val8bits; + int16_t val16bits; + int32_t val32bits; + int64_t val64bits; + unsigned int i, j; + /* Create arrays */ + H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F66_XDIM, F66_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F66_XDIM, F66_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F66_XDIM, F66_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F66_XDIM, F66_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F66_XDIM, F66_YDIM8); + H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F66_XDIM, F66_YDIM16); + H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F66_XDIM, F66_YDIM32); + H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F66_XDIM, F66_YDIM64); + H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F66_XDIM, F66_YDIM8); + + asetu8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(uint8_t)); + asetu16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(uint16_t)); + asetu32 = HDcalloc(F66_XDIM * F66_YDIM32, sizeof(uint32_t)); + asetu64 = HDcalloc(F66_XDIM * F66_YDIM64, sizeof(uint64_t)); + aset8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(int8_t)); + aset16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(int16_t)); + aset32 = HDcalloc(F66_XDIM * F66_YDIM32, sizeof(int32_t)); + aset64 = HDcalloc(F66_XDIM * F66_YDIM64, sizeof(int64_t)); + asetdbl = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(double)); + fid = H5Fcreate(FILE79, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Dataset of 8 bits unsigned int */ @@ -9607,7 +9832,7 @@ gent_intsattrs(void) valu8bits = (uint8_t)(valu8bits << 1); } - H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); + H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8[0]); /* Attribute of 8 bits unsigned int */ adims[0] = F66_XDIM * F66_YDIM8; aspace = H5Screate_simple(1, adims, NULL); @@ -9634,7 +9859,7 @@ gent_intsattrs(void) valu16bits = (uint16_t)(valu16bits << 1); } - H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); + H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16[0]); /* Attribute of 16 bits unsigned int */ adims[0] = F66_XDIM * F66_YDIM16; aspace = H5Screate_simple(1, adims, NULL); @@ -9661,7 +9886,7 @@ gent_intsattrs(void) valu32bits <<= 1; } - H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32); + H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32[0]); /* Attribute of 32 bits unsigned int */ adims[0] = F66_XDIM * F66_YDIM32; aspace = H5Screate_simple(1, adims, NULL); @@ -9688,7 +9913,7 @@ gent_intsattrs(void) valu64bits <<= 1; } - H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64); + H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64[0]); /* Attribute of 64 bits unsigned int */ adims[0] = F66_XDIM * F66_YDIM64; aspace = H5Screate_simple(1, adims, NULL); @@ -9715,7 +9940,7 @@ gent_intsattrs(void) val8bits = (int8_t)(val8bits << 1); } - H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); + H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8[0]); /* Attribute of 8 bits signed int */ adims[0] = F66_XDIM * F66_YDIM8; aspace = H5Screate_simple(1, adims, NULL); @@ -9742,7 +9967,7 @@ gent_intsattrs(void) val16bits = (int16_t)(val16bits << 1); } - H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); + H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16[0]); /* Attribute of 16 bits signed int */ adims[0] = F66_XDIM * F66_YDIM16; aspace = H5Screate_simple(1, adims, NULL); @@ -9769,7 +9994,7 @@ gent_intsattrs(void) val32bits <<= 1; } - H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32); + H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32[0]); /* Attribute of 32 bits signed int */ adims[0] = F66_XDIM * F66_YDIM32; aspace = H5Screate_simple(1, adims, NULL); @@ -9796,7 +10021,7 @@ gent_intsattrs(void) val64bits <<= 1; } - H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64); + H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64[0]); /* Attribute of 64 bits signed int */ adims[0] = F66_XDIM * F66_YDIM64; aspace = H5Screate_simple(1, adims, NULL); @@ -9818,7 +10043,7 @@ gent_intsattrs(void) asetdbl[i*dims[1]+j] = dsetdbl[i][j]; } - H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl); + H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl[0]); /* Attribute of double */ adims[0] = F66_XDIM * F66_YDIM8; aspace = H5Screate_simple(1, adims, NULL); @@ -9829,6 +10054,26 @@ gent_intsattrs(void) H5Sclose(space); H5Dclose(dataset); H5Fclose(fid); + + HDfree(dsetu8); + HDfree(dsetu16); + HDfree(dsetu32); + HDfree(dsetu64); + HDfree(dset8); + HDfree(dset16); + HDfree(dset32); + HDfree(dset64); + HDfree(dsetdbl); + + HDfree(asetu8); + HDfree(asetu16); + HDfree(asetu32); + HDfree(asetu64); + HDfree(aset8); + HDfree(aset16); + HDfree(aset32); + HDfree(aset64); + HDfree(asetdbl); } static void gent_bitnopaquefields(void) diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index 560f1b3..580530a 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -68,13 +68,12 @@ main(void) double rowi8 = 1.0F, coli8 = 2.0F, plni8 = 5.0F; /* Initialize machine endian */ - volatile uint32_t ibyte=0x01234567; + volatile uint32_t ibyte = 0x01234567; /* 0 for big endian, 1 for little endian. */ - if ((*((uint8_t*)(&ibyte))) == 0x67) - HDstrncpy(machine_order, "LE", 2); + if ((*((volatile uint8_t *)(&ibyte))) == 0x67) + HDstrcpy(machine_order, "LE"); else - HDstrncpy(machine_order, "BE", 2); - + HDstrcpy(machine_order, "BE"); /* * initialize the row, column, and plane vectors diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 6f0b284..54cff64 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -28,7 +28,7 @@ set (REPACK_COMMON_SOURCES ) add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repacktst.c) target_include_directories (h5repacktest - PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" ) if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5repacktest STATIC) diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index ac1fbe0..ab0dbb7 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -2479,24 +2479,24 @@ int make_szip(hid_t loc_id) unsigned szip_pixels_per_block = 8; hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; + int **buf = NULL; int szip_can_encode = 0; - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); + /* create a space */ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dcpl */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; /*------------------------------------------------------------------------- * SZIP @@ -2509,25 +2509,30 @@ int make_szip(hid_t loc_id) if (szip_can_encode) { /* set szip data */ if(H5Pset_szip (dcpl, szip_options_mask, szip_pixels_per_block) < 0) - goto out; - if (make_dset(loc_id, "dset_szip", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_szip", sid, dcpl, buf[0]) < 0) + goto error; } else /* WARNING? SZIP is decoder only, can't generate test files */ if(H5Sclose(sid) < 0) - goto out; + goto error; if(H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } #endif /* H5_HAVE_FILTER_SZIP */ @@ -2548,26 +2553,25 @@ int make_deflate(hid_t loc_id) hid_t sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; - int buf[DIM1][DIM2]; + int **buf = NULL; hobj_ref_t bufref[1]; /* reference */ hsize_t dims1r[1] = {1}; - int i, j, n; - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); /* create a space */ if((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dcpl */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; /*------------------------------------------------------------------------- * GZIP @@ -2576,16 +2580,16 @@ int make_deflate(hid_t loc_id) #if defined (H5_HAVE_FILTER_DEFLATE) /* set deflate data */ if(H5Pset_deflate(dcpl, 9) < 0) - goto out; - if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf[0]) < 0) + goto error; /* create a reference to the dataset, test second seeep of file for references */ if (H5Rcreate(&bufref[0], loc_id, "dset_deflate", H5R_OBJECT, (hid_t)-1) < 0) - goto out; + goto error; if (write_dset(loc_id, 1, dims1r, "ref", H5T_STD_REF_OBJ, bufref) < 0) - goto out; + goto error; #endif @@ -2594,17 +2598,22 @@ int make_deflate(hid_t loc_id) *------------------------------------------------------------------------- */ if(H5Sclose(sid) < 0) - goto out; + goto error; if(H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } @@ -2619,29 +2628,27 @@ out: static int make_shuffle(hid_t loc_id) { - hid_t dcpl; /* dataset creation property list */ - hid_t sid; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK]={DIM1,DIM2}; hsize_t chunk_dims[RANK]={CDIM1,CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; + int **buf = NULL; + + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); - for (i=n=0; i) add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) - target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5clear_gentest STATIC) target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) diff --git a/tools/test/misc/Makefile.am b/tools/test/misc/Makefile.am index f2d2489..c58ba38 100644 --- a/tools/test/misc/Makefile.am +++ b/tools/test/misc/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/config/commence.am SUBDIRS=vds # Include src directory -AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib +AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib #test scripts and programs TEST_PROG=h5repart_gentest h5clear_gentest talign diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index d5f415e..06ba473 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "hdf5.h" -#include "H5private.h" +#include "h5test.h" /* The HDF5 test files */ const char *FILENAME[] = { @@ -62,13 +62,18 @@ gen_cache_image_file(const char *fname) hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ hsize_t dims[2]; /* Dimension sizes */ hsize_t chunks[2]; /* Chunked dimension sizes */ - int buf[50][100]; /* Buffer for data to write */ - int i, j; /* Local index variables */ + int **buf = NULL; /* Buffer for data to write */ H5AC_cache_image_config_t cache_image_config = /* Cache image input configuration */ { H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, TRUE, FALSE, H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE}; + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, 50, 100); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, 50, 100); + /* Create a copy of file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; @@ -91,11 +96,6 @@ gen_cache_image_file(const char *fname) if((sid = H5Screate_simple(2, dims, NULL)) < 0) goto error; - /* Initialize buffer for writing to dataset */ - for(i = 0; i < 50; i++) - for(j = 0; j < 100; j++) - buf[i][j] = i * j; - /* Set up to create a chunked dataset */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; @@ -107,7 +107,7 @@ gen_cache_image_file(const char *fname) goto error; /* Write to the dataset */ - if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) goto error; /* Closing */ @@ -121,6 +121,9 @@ gen_cache_image_file(const char *fname) goto error; if(H5Fclose(fid) < 0) goto error; + + HDfree(buf); + return 0; error: @@ -132,6 +135,9 @@ error: H5Pclose(fapl); H5Pclose(dcpl); } H5E_END_TRY; + + HDfree(buf); + return 1; } /* gen_cache_image_file() */ diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 8146d84..044ce0c 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -300,7 +300,7 @@ typedef struct _minmax { /* local functions */ static off_t parse_size_directive(const char *size); -static struct options *parse_command_line(int argc, char *argv[]); +static struct options *parse_command_line(int argc, const char *argv[]); static void run_test_loop(struct options *options); static int run_test(iotype iot, parameters parms, struct options *opts); static void output_all_info(minmax *mm, int count, int indent_level); @@ -327,7 +327,7 @@ static off_t squareo(off_t); * Modifications: */ int -main(int argc, char **argv) +main(int argc, const char *argv[]) { int ret; int exit_value = EXIT_SUCCESS; @@ -1262,7 +1262,7 @@ report_parameters(struct options *opts) * Added 2D testing (Christian Chilan, 10. August 2005) */ static struct options * -parse_command_line(int argc, char *argv[]) +parse_command_line(int argc, const char *argv[]) { register int opt; struct options *cl_opts; @@ -1291,7 +1291,7 @@ parse_command_line(int argc, char *argv[]) cl_opts->h5_write_only = FALSE; /* Do both read and write by default */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ - while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'a': cl_opts->h5_alignment = parse_size_directive(opt_arg); diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index a56558e..d2eb3fc 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -303,7 +303,7 @@ typedef struct _minmax { /* local functions */ static hsize_t parse_size_directive(const char *size); -static struct options *parse_command_line(int argc, char *argv[]); +static struct options *parse_command_line(int argc, const char *argv[]); static void run_test_loop(struct options *options); static int run_test(iotype iot, parameters parms, struct options *opts); static void output_all_info(minmax *mm, int count, int indent_level); @@ -324,7 +324,7 @@ static void report_parameters(struct options *opts); * Modifications: */ int -main(int argc, char **argv) +main(int argc, const char *argv[]) { int exit_value = EXIT_SUCCESS; struct options *opts = NULL; @@ -944,7 +944,7 @@ report_parameters(struct options *opts) * Added multidimensional testing (Christian Chilan, April, 2008) */ static struct options * -parse_command_line(int argc, char *argv[]) +parse_command_line(int argc, const char *argv[]) { int opt; struct options *cl_opts; @@ -984,7 +984,7 @@ parse_command_line(int argc, char *argv[]) cl_opts->h5_extendable = FALSE; /* Use extendable dataset */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ - while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'a': cl_opts->h5_alignment = parse_size_directive(opt_arg); diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index e301bb3..8f1f584 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -552,7 +552,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, * Modifications: */ int -main(int argc, char **argv) +main(int argc, const char *argv[]) { unsigned long min_buf_size = 128 * ONE_KB, max_buf_size = ONE_MB; unsigned long file_size = 64 * ONE_MB; @@ -563,7 +563,7 @@ main(int argc, char **argv) /* Initialize h5tools lib */ h5tools_init(); - while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) > 0) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) > 0) { switch ((char)opt) { case '0': case '1': case '2': case '3': case '4': case '5': -- cgit v0.12 From c18ed719ecf6eda956189e642aab80b0ff8a3a4e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 25 Apr 2020 20:48:32 -0500 Subject: Refactor "extra" command-line arguments, and clean up code so the tool doesn't assert when exiting. --- tools/src/misc/h5debug.c | 399 +++++++++++++++++++++++++---------------------- 1 file changed, 216 insertions(+), 183 deletions(-) diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index c1940f7..1b8d460 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -77,65 +77,64 @@ static const H5B2_class_t * get_H5B2_class(const uint8_t *sig) { H5B2_subid_t subtype = (H5B2_subid_t)sig[H5_SIZEOF_MAGIC + 1]; - const H5B2_class_t *cls; + const H5B2_class_t *cls = NULL; switch(subtype) { - case H5B2_TEST_ID: - cls = H5B2_TEST; - break; - - case H5B2_FHEAP_HUGE_INDIR_ID: - cls = H5HF_HUGE_BT2_INDIR; - break; - - case H5B2_FHEAP_HUGE_FILT_INDIR_ID: - cls = H5HF_HUGE_BT2_FILT_INDIR; - break; - - case H5B2_FHEAP_HUGE_DIR_ID: - cls = H5HF_HUGE_BT2_DIR; - break; - - case H5B2_FHEAP_HUGE_FILT_DIR_ID: - cls = H5HF_HUGE_BT2_FILT_DIR; - break; - - case H5B2_GRP_DENSE_NAME_ID: - cls = H5G_BT2_NAME; - break; - - case H5B2_GRP_DENSE_CORDER_ID: - cls = H5G_BT2_CORDER; - break; - - case H5B2_SOHM_INDEX_ID: - cls = H5SM_INDEX; - break; - - case H5B2_ATTR_DENSE_NAME_ID: - cls = H5A_BT2_NAME; - break; - - case H5B2_ATTR_DENSE_CORDER_ID: - cls = H5A_BT2_CORDER; - break; - - case H5B2_CDSET_ID: - cls = H5D_BT2; - break; - - case H5B2_CDSET_FILT_ID: - cls = H5D_BT2_FILT; - break; - - case H5B2_TEST2_ID: - cls = H5B2_TEST2; - break; - - case H5B2_NUM_BTREE_ID: - default: - HDfprintf(stderr, "Unknown v2 B-tree subtype %u\n", (unsigned)(subtype)); - HDexit(4); + case H5B2_TEST_ID: + cls = H5B2_TEST; + break; + + case H5B2_FHEAP_HUGE_INDIR_ID: + cls = H5HF_HUGE_BT2_INDIR; + break; + + case H5B2_FHEAP_HUGE_FILT_INDIR_ID: + cls = H5HF_HUGE_BT2_FILT_INDIR; + break; + + case H5B2_FHEAP_HUGE_DIR_ID: + cls = H5HF_HUGE_BT2_DIR; + break; + + case H5B2_FHEAP_HUGE_FILT_DIR_ID: + cls = H5HF_HUGE_BT2_FILT_DIR; + break; + + case H5B2_GRP_DENSE_NAME_ID: + cls = H5G_BT2_NAME; + break; + + case H5B2_GRP_DENSE_CORDER_ID: + cls = H5G_BT2_CORDER; + break; + + case H5B2_SOHM_INDEX_ID: + cls = H5SM_INDEX; + break; + + case H5B2_ATTR_DENSE_NAME_ID: + cls = H5A_BT2_NAME; + break; + + case H5B2_ATTR_DENSE_CORDER_ID: + cls = H5A_BT2_CORDER; + break; + + case H5B2_CDSET_ID: + cls = H5D_BT2; + break; + + case H5B2_CDSET_FILT_ID: + cls = H5D_BT2_FILT; + break; + + case H5B2_TEST2_ID: + cls = H5B2_TEST2; + break; + + case H5B2_NUM_BTREE_ID: + default: + HDfprintf(stderr, "Unknown v2 B-tree subtype %u\n", (unsigned)(subtype)); } /* end switch */ return(cls); @@ -161,25 +160,24 @@ static const H5EA_class_t * get_H5EA_class(const uint8_t *sig) { H5EA_cls_id_t clsid = (H5EA_cls_id_t)sig[H5_SIZEOF_MAGIC + 1]; - const H5EA_class_t *cls; + const H5EA_class_t *cls = NULL; switch(clsid) { - case H5EA_CLS_TEST_ID: - cls = H5EA_CLS_TEST; - break; - - case H5EA_CLS_CHUNK_ID: - cls = H5EA_CLS_CHUNK; - break; - - case H5EA_CLS_FILT_CHUNK_ID: - cls = H5EA_CLS_FILT_CHUNK; - break; - - case H5EA_NUM_CLS_ID: - default: - HDfprintf(stderr, "Unknown extensible array class %u\n", (unsigned)(clsid)); - HDexit(4); + case H5EA_CLS_TEST_ID: + cls = H5EA_CLS_TEST; + break; + + case H5EA_CLS_CHUNK_ID: + cls = H5EA_CLS_CHUNK; + break; + + case H5EA_CLS_FILT_CHUNK_ID: + cls = H5EA_CLS_FILT_CHUNK; + break; + + case H5EA_NUM_CLS_ID: + default: + HDfprintf(stderr, "Unknown extensible array class %u\n", (unsigned)(clsid)); } /* end switch */ return(cls); @@ -205,25 +203,24 @@ static const H5FA_class_t * get_H5FA_class(const uint8_t *sig) { H5FA_cls_id_t clsid = (H5FA_cls_id_t)sig[H5_SIZEOF_MAGIC + 1]; - const H5FA_class_t *cls; + const H5FA_class_t *cls = NULL; switch(clsid) { - case H5FA_CLS_TEST_ID: - cls = H5FA_CLS_TEST; - break; - - case H5FA_CLS_CHUNK_ID: - cls = H5FA_CLS_CHUNK; - break; - - case H5FA_CLS_FILT_CHUNK_ID: - cls = H5FA_CLS_FILT_CHUNK; - break; - - case H5FA_NUM_CLS_ID: - default: - HDfprintf(stderr, "Unknown fixed array class %u\n", (unsigned)(clsid)); - HDexit(4); + case H5FA_CLS_TEST_ID: + cls = H5FA_CLS_TEST; + break; + + case H5FA_CLS_CHUNK_ID: + cls = H5FA_CLS_CHUNK; + break; + + case H5FA_CLS_FILT_CHUNK_ID: + cls = H5FA_CLS_FILT_CHUNK; + break; + + case H5FA_NUM_CLS_ID: + default: + HDfprintf(stderr, "Unknown fixed array class %u\n", (unsigned)(clsid)); } /* end switch */ return(cls); @@ -248,26 +245,32 @@ get_H5FA_class(const uint8_t *sig) int main(int argc, char *argv[]) { - hid_t fid, fapl; + hid_t fid = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; H5VL_object_t *vol_obj; H5F_t *f; - haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0, extra5 = 0; + haddr_t addr = 0; + int extra_count = 0; /* Number of extra arguments */ + haddr_t extra[10]; uint8_t sig[H5F_SIGNATURE_LEN]; size_t u; H5E_auto2_t func; void *edata; hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t status = SUCCEED; + int exit_value = 0; if(argc == 1) { - HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); - HDexit(1); + HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]*]\n", argv[0]); + exit_value = 1; + goto done; } /* end if */ /* Initialize the library */ if(H5open() < 0) { HDfprintf(stderr, "cannot initialize the library\n"); - HDexit(1); + exit_value = 1; + goto done; } /* end if */ /* Disable error reporting */ @@ -279,56 +282,63 @@ main(int argc, char *argv[]) */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { HDfprintf(stderr, "cannot create file access property list\n"); - HDexit(1); + exit_value = 1; + goto done; } /* end if */ if(HDstrchr(argv[1], '%')) if(H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT) < 0) { HDfprintf(stderr, "cannot set file access property list\n"); - HDexit(1); + exit_value = 1; + goto done; } if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { HDfprintf(stderr, "cannot open file\n"); - HDexit(1); + exit_value = 1; + goto done; } /* end if */ /* Push API context */ if(H5CX_push() < 0) { HDfprintf(stderr, "cannot set API context\n"); - HDexit(1); + exit_value = 1; + goto done; } api_ctx_pushed = TRUE; if(NULL == (vol_obj = (H5VL_object_t *)H5VL_vol_object(fid))) { HDfprintf(stderr, "cannot obtain vol_obj pointer\n"); - HDexit(2); + exit_value = 2; + goto done; } /* end if */ if(NULL == (f = (H5F_t *)H5VL_object_data(vol_obj))) { HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); - HDexit(2); + exit_value = 2; + goto done; } /* end if */ /* Ignore metadata tags while using h5debug */ if(H5AC_ignore_tags(f) < 0) { HDfprintf(stderr, "cannot ignore metadata tags\n"); - HDexit(1); + exit_value = 1; + goto done; } /* * Parse command arguments. */ + + /* Primary data structure to dump */ if(argc > 2) addr = (haddr_t)HDstrtoll(argv[2], NULL, 0); - if(argc > 3) - extra = (haddr_t)HDstrtoll(argv[3], NULL, 0); - if(argc > 4) - extra2 = (haddr_t)HDstrtoll(argv[4], NULL, 0); - if(argc > 5) - extra3 = (haddr_t)HDstrtoll(argv[5], NULL, 0); - if(argc > 6) - extra4 = (haddr_t)HDstrtoll(argv[6], NULL, 0); - if(argc > 7) - extra5 = (haddr_t)HDstrtoll(argv[7], NULL, 0); + + /* Extra arguments for primary data structure */ + HDmemset(extra, 0, sizeof(extra)); + if(argc > 3) { + extra_count = argc - 3; /* Number of extra arguments */ + for(u = 0; u < (size_t)extra_count; u++) + extra[u] = (haddr_t)HDstrtoll(argv[u + 3], NULL, 0); + } /* end if */ /* * Read the signature at the specified file position. @@ -336,7 +346,8 @@ main(int argc, char *argv[]) HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr); if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), sig) < 0) { HDfprintf(stderr, "cannot read signature\n"); - HDexit(3); + exit_value = 3; + goto done; } if(!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) { /* @@ -364,13 +375,13 @@ main(int argc, char *argv[]) */ /* Check for extra parameters */ - if(extra == 0) { + if(extra_count == 0 || extra[0] == 0) { HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); HDfprintf(stderr, "Symbol table node usage:\n"); HDfprintf(stderr, "\th5debug
\n\n"); } /* end if */ - status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra); + status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra[0]); } else if(!HDmemcmp(sig, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -386,48 +397,51 @@ main(int argc, char *argv[]) switch(subtype) { case H5B_SNODE_ID: /* Check for extra parameters */ - if(extra == 0) { + if(extra_count == 0 || extra[0] == 0) { HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); HDfprintf(stderr, "B-tree symbol table node usage:\n"); HDfprintf(stderr, "\th5debug
\n\n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra); + status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra[0]); break; case H5B_CHUNK_ID: /* Check for extra parameters */ - if(extra == 0) { + if(extra_count == 0 || extra[0] == 0) { HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); HDfprintf(stderr, "B-tree chunked storage node usage:\n"); HDfprintf(stderr, "\th5debug <# of dimensions> ...\n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - /* Build array of chunk dimensions */ - ndims = (unsigned)extra; - dim[0] = (uint32_t)extra2; - if(ndims > 1) - dim[1] = (uint32_t)extra3; - if(ndims > 2) - dim[2] = (uint32_t)extra4; - if(ndims > 3) - dim[3] = (uint32_t)extra5; + /* Set # of dimensions */ + ndims = (unsigned)extra[0]; /* Check for dimension error */ - if(ndims > 4) { - HDfprintf(stderr, "ERROR: Only 4 dimensions support currently (fix h5debug)\n"); + if(ndims > 9) { + HDfprintf(stderr, "ERROR: Only 9 dimensions support currently (fix h5debug)\n"); HDfprintf(stderr, "B-tree chunked storage node usage:\n"); HDfprintf(stderr, "\th5debug <# of dimensions> ...\n"); - HDexit(4); + exit_value = 4; + goto done; } /* end for */ + + /* Build array of chunk dimensions */ + for(u = 0; u < ndims; u++) + dim[u] = (uint32_t)extra[u + 1]; + + /* Check for dimension error */ for(u = 0; u < ndims; u++) if(0 == dim[u]) { HDfprintf(stderr, "ERROR: Chunk dimensions should be >0\n"); HDfprintf(stderr, "B-tree chunked storage node usage:\n"); HDfprintf(stderr, "\th5debug <# of dimensions> ...\n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ /* Set the last dimension (the element size) to zero */ @@ -439,7 +453,8 @@ main(int argc, char *argv[]) case H5B_NUM_BTREE_ID: default: HDfprintf(stderr, "Unknown v1 B-tree subtype %u\n", (unsigned)(subtype)); - HDexit(4); + exit_value = 4; + goto done; } } @@ -450,14 +465,15 @@ main(int argc, char *argv[]) const H5B2_class_t *cls = get_H5B2_class(sig); HDassert(cls); - if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && extra == 0) { + if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra_count == 0 || extra[0] == 0)) { HDfprintf(stderr, "ERROR: Need v2 B-tree header address and object header address containing the layout message in order to dump header\n"); HDfprintf(stderr, "v2 B-tree hdr usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5B2__hdr_debug(f, addr, stdout, 0, VCOL, cls, (haddr_t)extra); + status = H5B2__hdr_debug(f, addr, stdout, 0, VCOL, cls, (haddr_t)extra[0]); } else if(!HDmemcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -468,23 +484,25 @@ main(int argc, char *argv[]) HDassert(cls); /* Check for enough valid parameters */ - if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra == 0 || extra2 == 0 || extra3 == 0 || extra4 == 0)) { + if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0 || extra[3] == 0)) { HDfprintf(stderr, "ERROR: Need v2 B-tree header address, the node's number of records, depth, and object header address containing the layout message in order to dump internal node\n"); HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); HDfprintf(stderr, "v2 B-tree internal node usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } - else if(extra == 0 || extra2 == 0 || extra3 == 0) { + else if(extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0) { HDfprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n"); HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); HDfprintf(stderr, "v2 B-tree internal node usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5B2__int_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (unsigned)extra3, (haddr_t)extra4); + status = H5B2__int_debug(f, addr, stdout, 0, VCOL, cls, extra[0], (unsigned)extra[1], (unsigned)extra[2], (haddr_t)extra[3]); } else if(!HDmemcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -495,22 +513,24 @@ main(int argc, char *argv[]) HDassert(cls); /* Check for enough valid parameters */ - if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra == 0 || extra2 == 0 || extra3 == 0 )) { + if((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0 )) { HDfprintf(stderr, "ERROR: Need v2 B-tree header address, number of records, and object header address containing the layout message in order to dump leaf node\n"); HDfprintf(stderr, "v2 B-tree leaf node usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } - else if(extra == 0 || extra2 == 0) { + else if(extra_count == 0 || extra[0] == 0 || extra[1] == 0) { HDfprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n"); HDfprintf(stderr, "v2 B-tree leaf node usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5B2__leaf_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (haddr_t)extra3); + status = H5B2__leaf_debug(f, addr, stdout, 0, VCOL, cls, extra[0], (unsigned)extra[1], (haddr_t)extra[2]); } else if(!HDmemcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -526,14 +546,15 @@ main(int argc, char *argv[]) */ /* Check for enough valid parameters */ - if(extra == 0 || extra2 == 0) { + if(extra_count == 0 || extra[0] == 0 || extra[1] == 0) { HDfprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n"); HDfprintf(stderr, "Fractal heap direct block usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5HF_dblock_debug(f, addr, stdout, 0, VCOL, extra, (size_t)extra2); + status = H5HF_dblock_debug(f, addr, stdout, 0, VCOL, extra[0], (size_t)extra[1]); } else if(!HDmemcmp(sig, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -542,14 +563,15 @@ main(int argc, char *argv[]) */ /* Check for enough valid parameters */ - if(extra == 0 || extra2 == 0) { + if(extra_count == 0 || extra[0] == 0 || extra[1] == 0) { HDfprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n"); HDfprintf(stderr, "Fractal heap indirect block usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5HF_iblock_debug(f, addr, stdout, 0, VCOL, extra, (unsigned)extra2); + status = H5HF_iblock_debug(f, addr, stdout, 0, VCOL, extra[0], (unsigned)extra[1]); } else if(!HDmemcmp(sig, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -566,14 +588,15 @@ main(int argc, char *argv[]) */ /* Check for enough valid parameters */ - if(extra == 0 || extra2 == 0) { + if(extra_count == 0 || extra[0] == 0 || extra[1] == 0) { HDfprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n"); HDfprintf(stderr, "Free space serialized sections usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5FS_sects_debug(f, addr, stdout, 0, VCOL, extra, extra2); + status = H5FS_sects_debug(f, addr, stdout, 0, VCOL, extra[0], extra[1]); } else if(!HDmemcmp(sig, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -590,14 +613,15 @@ main(int argc, char *argv[]) */ /* Check for enough valid parameters */ - if(extra == 0) { + if(extra_count == 0 || extra[0] == 0) { HDfprintf(stderr, "ERROR: Need shared message header address in order to shared message list\n"); HDfprintf(stderr, "Shared message list usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5SM_list_debug(f, addr, stdout, 0, VCOL, (haddr_t)extra); + status = H5SM_list_debug(f, addr, stdout, 0, VCOL, (haddr_t)extra[0]); } else if(!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -608,14 +632,15 @@ main(int argc, char *argv[]) HDassert(cls); /* Check for enough valid parameters */ - if(extra == 0) { + if(extra_count == 0 || extra[0] == 0) { HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); HDfprintf(stderr, "Extensible array header block usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5EA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra); + status = H5EA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra[0]); } else if(!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -626,14 +651,15 @@ main(int argc, char *argv[]) HDassert(cls); /* Check for enough valid parameters */ - if(extra == 0 || extra2 == 0) { + if(extra_count == 0 || extra[0] == 0 || extra[1] == 0) { HDfprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n"); HDfprintf(stderr, "Extensible array index block usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5EA__sblock_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, extra3); + status = H5EA__sblock_debug(f, addr, stdout, 0, VCOL, cls, extra[0], (unsigned)extra[1], extra[2]); } else if(!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -662,14 +689,15 @@ main(int argc, char *argv[]) HDassert(cls); /* Check for enough valid parameters */ - if(extra == 0 || extra2 == 0 || extra3 == 0) { + if(extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0) { HDfprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n"); HDfprintf(stderr, "Extensible array data block usage:\n"); HDfprintf(stderr, "\th5debug <# of elements in data block> \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5FA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra); + status = H5FA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra[0]); } else if(!HDmemcmp(sig, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -698,14 +727,15 @@ main(int argc, char *argv[]) HDassert(cls); /* Check for enough valid parameters */ - if(extra == 0 || extra2 == 0) { + if(extra_count == 0 || extra[0] == 0 || extra[1] == 0) { HDfprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n"); HDfprintf(stderr, "fixed array data block usage:\n"); HDfprintf(stderr, "\th5debug \n"); - HDexit(4); + exit_value = 4; + goto done; } /* end if */ - status = H5FA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra, extra2); + status = H5FA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra[0], extra[1]); } else if(!HDmemcmp(sig, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { @@ -742,24 +772,27 @@ main(int argc, char *argv[]) HDputchar('\n'); HDfprintf(stderr, "unknown signature\n"); - HDexit(4); + exit_value = 4; + goto done; } /* end else */ /* Check for an error when dumping information */ if(status < 0) { HDfprintf(stderr, "An error occurred!\n"); H5Eprint2(H5E_DEFAULT, stderr); - HDexit(5); + exit_value = 5; + goto done; } /* end if */ - H5Pclose(fapl); - H5Fclose(fid); +done: + if(fapl > 0) H5Pclose(fapl); + if(fid > 0) H5Fclose(fid); /* Pop API context */ if(api_ctx_pushed) H5CX_pop(); H5Eset_auto2(H5E_DEFAULT, func, edata); - return 0; + return exit_value; } /* main() */ -- cgit v0.12 From 3f3363177d5cc1efc8fcfc70e1feed7a293da2d4 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 25 Apr 2020 22:52:52 -0500 Subject: Range check # of 'extra' command-line parameters against array size. --- tools/src/misc/h5debug.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index 1b8d460..e9a783b 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -335,7 +335,15 @@ main(int argc, char *argv[]) /* Extra arguments for primary data structure */ HDmemset(extra, 0, sizeof(extra)); if(argc > 3) { - extra_count = argc - 3; /* Number of extra arguments */ + /* Number of extra arguments */ + extra_count = argc - 3; + + /* Range check against 'extra' array size */ + if(extra_count > (int)(sizeof(extra) / sizeof(haddr_t))) { + HDfprintf(stderr, "\nWARNING: Only using first %d extra parameters\n\n", (int)(sizeof(extra) / sizeof(haddr_t))); + extra_count = (int)(sizeof(extra) / sizeof(haddr_t)); + } /* end if */ + for(u = 0; u < (size_t)extra_count; u++) extra[u] = (haddr_t)HDstrtoll(argv[u + 3], NULL, 0); } /* end if */ -- cgit v0.12 From de3bfa697a9fcb4fabf755b2bda7fa553abfcebb Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 26 Apr 2020 02:54:29 -0700 Subject: Updates to tools warning PR from code review. --- test/h5test.h | 8 ++++---- tools/src/h5dump/h5dump_xml.c | 12 ++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/test/h5test.h b/test/h5test.h index 891697a..b1ddc58 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -152,7 +152,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ * HDfree(array); */ #define H5TEST_ALLOCATE_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \ -{ \ +do { \ /* Prefix with h5taa to avoid shadow warnings */ \ size_t h5taa_pointers_size = 0; \ size_t h5taa_data_size = 0; \ @@ -167,10 +167,10 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ \ for (h5taa_i = 1; h5taa_i < (DIMS_I); h5taa_i++) \ ARR[h5taa_i] = ARR[h5taa_i-1] + (DIMS_J); \ -} +} while(0) #define H5TEST_FILL_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \ -{ \ +do { \ /* Prefix with h5tfa to avoid shadow warnings */ \ int h5tfa_i = 0; \ int h5tfa_j = 0; \ @@ -181,7 +181,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ ARR[h5tfa_i][h5tfa_j] = h5tfa_count; \ h5tfa_count++; \ } \ -} +} while(0) #ifdef __cplusplus diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 7edd962..bd822bc 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -792,24 +792,20 @@ xml_escape_the_string(const char *str, int slen) esc_len = 1; } else if (*cp == '\'') { + HDstrncpy(ncp, apos, ncp_len); esc_len = HDstrlen(apos); - HDstrncpy(ncp, apos, esc_len); - ncp[sizeof(ncp) - 1] = '\0'; } else if (*cp == '<') { + HDstrncpy(ncp, lt, ncp_len); esc_len = HDstrlen(lt); - HDstrncpy(ncp, lt, esc_len); - ncp[sizeof(ncp) - 1] = '\0'; } else if (*cp == '>') { + HDstrncpy(ncp, gt, ncp_len); esc_len = HDstrlen(gt); - HDstrncpy(ncp, gt, esc_len); - ncp[sizeof(ncp) - 1] = '\0'; } else if (*cp == '&') { + HDstrncpy(ncp, amp, ncp_len); esc_len = HDstrlen(amp); - HDstrncpy(ncp, amp, esc_len); - ncp[sizeof(ncp) - 1] = '\0'; } else { *ncp = *cp; -- cgit v0.12 From c3367e6634d4dee88ff855da08e312f6685c23af Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 26 Apr 2020 04:22:12 -0700 Subject: Moved -Woverlength-strings to the developer flags. --- config/gnu-warnings/no-developer-general | 4 ++++ src/H5make_libsettings.c | 32 +++++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/config/gnu-warnings/no-developer-general b/config/gnu-warnings/no-developer-general index 85dc0a3..18831dd 100644 --- a/config/gnu-warnings/no-developer-general +++ b/config/gnu-warnings/no-developer-general @@ -2,3 +2,7 @@ -Wno-inline -Wno-missing-format-attribute -Wno-missing-noreturn +# NOTE: -pedantic includes -Woverlength-strings which triggers a warning +# regarding the library settings string (H5libhdf5_settings). We'll turn +# it off here but leave it on in the developer flags. +-Wno-overlength-strings diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c index fd67184..72041ed 100644 --- a/src/H5make_libsettings.c +++ b/src/H5make_libsettings.c @@ -32,16 +32,15 @@ static const char *FileHeader = "\n\ *------------------------------------------------------------------------- */ -#include -#include #include "H5private.h" + /* Do NOT use HDfprintf in this file as it is not linked with the library, * which contains the H5system.c file in which the function is defined. */ #define LIBSETTINGSFNAME "libhdf5.settings" -FILE *rawoutstream = NULL; +FILE *rawoutstream = NULL; /*------------------------------------------------------------------------- @@ -66,7 +65,7 @@ insert_libhdf5_settings(FILE *flibinfo) if(NULL == (fsettings = HDfopen(LIBSETTINGSFNAME, "r"))) { HDperror(LIBSETTINGSFNAME); HDexit(EXIT_FAILURE); - } /* end if */ + } /* print variable definition and the string */ /* Do not use const else AIX strings does not show it. */ @@ -77,30 +76,31 @@ insert_libhdf5_settings(FILE *flibinfo) /* Start a new line */ fprintf(flibinfo, "\t\""); bol = 0; - } /* end if */ + } if(inchar == '\n') { /* end of a line */ fprintf(flibinfo, "\\n\"\n"); bol++; - } /* end if */ + } else HDputc(inchar, flibinfo); - } /* end while */ + } + if(HDfeof(fsettings)) { /* wrap up */ if(!bol) /* EOF found without a new line */ fprintf(flibinfo, "\\n\"\n"); fprintf(flibinfo, ";\n\n"); - } /* end if */ + } else { fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME); HDexit(EXIT_FAILURE); - } /* end else */ + } if(0 != HDfclose(fsettings)) { HDperror(LIBSETTINGSFNAME); HDexit(EXIT_FAILURE); - } /* end if */ + } #else /* print variable definition and an empty string */ /* Do not use const else AIX strings does not show it. */ @@ -170,12 +170,12 @@ information about the library build configuration\n"; n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos)); HDstrncpy(real_name, pwd->pw_gecos, n); real_name[n] = '\0'; - } /* end if */ + } else { HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); real_name[sizeof(real_name) - 1] = '\0'; - } /* end else */ - } /* end if */ + } + } else real_name[0] = '\0'; } @@ -214,13 +214,15 @@ information about the library build configuration\n"; if(real_name[0]) fprintf(rawoutstream, ">"); HDfputc('\n', rawoutstream); - } /* end if */ + } + fprintf(rawoutstream, " *\n * Purpose:\t\t"); + for(s = purpose; *s; s++) { HDfputc(*s, rawoutstream); if('\n' == *s && s[1]) fprintf(rawoutstream, " *\t\t\t"); - } /* end for */ + } fprintf(rawoutstream, " *\n * Modifications:\n *\n"); fprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n"); -- cgit v0.12 From c03ee563f46013d22f36a1895664a9ba876558e9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Apr 2020 08:50:27 -0700 Subject: Further updates to the tools warnings fixes from code review. --- tools/src/h5dump/h5dump_xml.c | 10 +++++++--- tools/test/misc/h5clear_gentest.c | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index bd822bc..07cff6a 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -738,9 +738,9 @@ xml_escape_the_string(const char *str, int slen) size_t extra; size_t len; size_t i; - const char *cp; - char *ncp; - char *rcp; + const char *cp = NULL; + char *ncp = NULL; + char *rcp = NULL; size_t ncp_len; if (!str) @@ -793,18 +793,22 @@ xml_escape_the_string(const char *str, int slen) } else if (*cp == '\'') { HDstrncpy(ncp, apos, ncp_len); + ncp[ncp_len - 1] = '\0'; esc_len = HDstrlen(apos); } else if (*cp == '<') { HDstrncpy(ncp, lt, ncp_len); + ncp[ncp_len - 1] = '\0'; esc_len = HDstrlen(lt); } else if (*cp == '>') { HDstrncpy(ncp, gt, ncp_len); + ncp[ncp_len - 1] = '\0'; esc_len = HDstrlen(gt); } else if (*cp == '&') { HDstrncpy(ncp, amp, ncp_len); + ncp[ncp_len - 1] = '\0'; esc_len = HDstrlen(amp); } else { diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 06ba473..8d6883c 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -62,6 +62,7 @@ gen_cache_image_file(const char *fname) hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ hsize_t dims[2]; /* Dimension sizes */ hsize_t chunks[2]; /* Chunked dimension sizes */ + int i, j; /* Local index variables */ int **buf = NULL; /* Buffer for data to write */ H5AC_cache_image_config_t cache_image_config = /* Cache image input configuration */ { H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, @@ -72,7 +73,9 @@ gen_cache_image_file(const char *fname) H5TEST_ALLOCATE_2D_ARRAY(buf, int, 50, 100); if (NULL == buf) goto error; - H5TEST_FILL_2D_ARRAY(buf, int, 50, 100); + for(i = 0; i < 50; i++) + for(j = 0; j < 100; j++) + buf[i][j] = i * j; /* Create a copy of file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) -- cgit v0.12 From bf5e832acc0527050d63f5cb91fe15e040bf7e48 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Apr 2020 09:58:11 -0700 Subject: Fixed pio_perf const pointers. --- tools/test/perform/pio_perf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 044ce0c..cb15f64 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -300,7 +300,7 @@ typedef struct _minmax { /* local functions */ static off_t parse_size_directive(const char *size); -static struct options *parse_command_line(int argc, const char *argv[]); +static struct options *parse_command_line(int argc, char *argv[]); static void run_test_loop(struct options *options); static int run_test(iotype iot, parameters parms, struct options *opts); static void output_all_info(minmax *mm, int count, int indent_level); @@ -327,7 +327,7 @@ static off_t squareo(off_t); * Modifications: */ int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { int ret; int exit_value = EXIT_SUCCESS; @@ -1262,7 +1262,7 @@ report_parameters(struct options *opts) * Added 2D testing (Christian Chilan, 10. August 2005) */ static struct options * -parse_command_line(int argc, const char *argv[]) +parse_command_line(int argc, char *argv[]) { register int opt; struct options *cl_opts; @@ -1291,7 +1291,7 @@ parse_command_line(int argc, const char *argv[]) cl_opts->h5_write_only = FALSE; /* Do both read and write by default */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'a': cl_opts->h5_alignment = parse_size_directive(opt_arg); -- cgit v0.12 From 2442de3389b8a7892eb05ea0c30e7a91f58a7f38 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 27 Apr 2020 18:57:36 -0500 Subject: Fix memory error in h5dump xml 'escape the string' routine --- tools/src/h5dump/h5dump_xml.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 07cff6a..95aff48 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -783,32 +783,30 @@ xml_escape_the_string(const char *str, int slen) if (*cp == '\\') { *ncp++ = '\\'; + ncp_len--; *ncp = *cp; esc_len = 1; } else if (*cp == '\"') { *ncp++ = '\\'; + ncp_len--; *ncp = *cp; esc_len = 1; } else if (*cp == '\'') { HDstrncpy(ncp, apos, ncp_len); - ncp[ncp_len - 1] = '\0'; esc_len = HDstrlen(apos); } else if (*cp == '<') { HDstrncpy(ncp, lt, ncp_len); - ncp[ncp_len - 1] = '\0'; esc_len = HDstrlen(lt); } else if (*cp == '>') { HDstrncpy(ncp, gt, ncp_len); - ncp[ncp_len - 1] = '\0'; esc_len = HDstrlen(gt); } else if (*cp == '&') { HDstrncpy(ncp, amp, ncp_len); - ncp[ncp_len - 1] = '\0'; esc_len = HDstrlen(amp); } else { -- cgit v0.12 From dc3b8372c7ac63b5b0f00ad94a4f8f32cbb8d391 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 28 Apr 2020 04:21:47 -0700 Subject: Protected H5Oset_comment() in h5dump test generator. (Assumes environment variable overrides default VOL connector) --- tools/test/h5dump/h5dumpgentest.c | 84 ++++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 24 deletions(-) diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index b992a88..731e233 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -2113,6 +2113,7 @@ static void gent_objref(void) uint32_t *tu32; /* Temporary pointer to uint32 data */ int i; /* counting variables */ const char *write_comment = "Foo!"; /* Comments for group */ + hbool_t supports_comments = FALSE; /* Allocate write & read buffers */ wbuf = (hobj_ref_t*) HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); @@ -2128,8 +2129,12 @@ static void gent_objref(void) /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + /* Check if we support comments in the current VOL connector */ + H5VLquery_optional(fid1, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_SET_COMMENT, &supports_comments); + /* Set group's comment */ - H5Oset_comment(group, write_comment); + if (supports_comments) + H5Oset_comment(group, write_comment); /* Create a dataset (inside Group1) */ dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -3628,62 +3633,81 @@ static void gent_empty(void) static void gent_group_comments(void) { - hid_t fid, group; + hid_t fid = H5I_INVALID_HID; + hid_t group = H5I_INVALID_HID; + hbool_t supports_comments = FALSE; fid = H5Fcreate(FILE33, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + /* Check if we support comments in the current VOL connector */ + H5VLquery_optional(fid, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_SET_COMMENT, &supports_comments); + /* / */ group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g1", "Comment for group /g1", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g1", "Comment for group /g1", H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g2", "Comment for group /g2", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g2", "Comment for group /g2", H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g3", "Comment for group /g3", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g3", "Comment for group /g3", H5P_DEFAULT); H5Gclose(group); /* /g1 */ group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g1/g1.1", "Comment for group /g1/g1.1", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g1/g1.1", "Comment for group /g1/g1.1", H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g1/g1.2", "Comment for group /g1/g1.2", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g1/g1.2", "Comment for group /g1/g1.2", H5P_DEFAULT); H5Gclose(group); /* /g2 */ group = H5Gcreate2(fid, "/g2/g2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g2/g2.1", "Comment for group /g2/g2.1", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g2/g2.1", "Comment for group /g2/g2.1", H5P_DEFAULT); H5Gclose(group); /* /g3 */ group = H5Gcreate2(fid, "/g3/g3.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g3/g3.1", "Comment for group /g3/g3.1", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g3/g3.1", "Comment for group /g3/g3.1", H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g3/g3.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g3/g3.2", "Comment for group /g3/g3.2", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g3/g3.2", "Comment for group /g3/g3.2", H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g3/g3.3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g3/g3.3", "Comment for group /g3/g3.3", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g3/g3.3", "Comment for group /g3/g3.3", H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g3/g3.4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g3/g3.4", "Comment for group /g3/g3.4", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g3/g3.4", "Comment for group /g3/g3.4", H5P_DEFAULT); H5Gclose(group); /* /g2/g2.1 */ group = H5Gcreate2(fid, "/g2/g2.1/g2.1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.1", "Comment for group /g2/g2.1/g2.1.1", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.1", "Comment for group /g2/g2.1/g2.1.1", H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g2/g2.1/g2.1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.2", "Comment for group /g2/g2.1/g2.1.2", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.2", "Comment for group /g2/g2.1/g2.1.2", H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g2/g2.1/g2.1.3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.3", "Comment for group /g2/g2.1/g2.1.3", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.3", "Comment for group /g2/g2.1/g2.1.3", H5P_DEFAULT); H5Gclose(group); /* /glongcomment */ group = H5Gcreate2(fid, "/glongcomment", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Oset_comment_by_name(group, "/glongcomment", "Comment for group /glongcomment with a really, really, really long, long, long comment", H5P_DEFAULT); + if (supports_comments) + H5Oset_comment_by_name(group, "/glongcomment", "Comment for group /glongcomment with a really, really, really long, long, long comment", H5P_DEFAULT); H5Gclose(group); H5Fclose(fid); @@ -5425,6 +5449,7 @@ static void gent_filters(void) int buf1[DIM1][DIM2]; int i, j, n; int H5_ATTR_NDEBUG_UNUSED ret; + hbool_t supports_comments = FALSE; for(i=n=0; i=0); + /* Check if we support comments in the current VOL connector */ + H5VLquery_optional(fid, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_SET_COMMENT, &supports_comments); + /* create a space */ sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); @@ -5453,8 +5481,10 @@ static void gent_filters(void) ret=make_dset(fid,"compact",sid,H5T_NATIVE_INT,dcpl,buf1); HDassert(ret >= 0); - ret = H5Oset_comment_by_name(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); - HDassert(ret >= 0); + if (supports_comments) { + ret = H5Oset_comment_by_name(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); + HDassert(ret >= 0); + } ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); HDassert(ret >= 0); @@ -5462,8 +5492,10 @@ static void gent_filters(void) ret=make_dset(fid,"contiguous",sid,H5T_NATIVE_INT,dcpl,buf1); HDassert(ret >= 0); - ret = H5Oset_comment_by_name(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); - HDassert(ret >= 0); + if (supports_comments) { + ret = H5Oset_comment_by_name(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); + HDassert(ret >= 0); + } ret = H5Pset_layout(dcpl, H5D_CHUNKED); HDassert(ret >= 0); @@ -5474,8 +5506,10 @@ static void gent_filters(void) ret=make_dset(fid,"chunked",sid,H5T_NATIVE_INT,dcpl,buf1); HDassert(ret >= 0); - ret = H5Oset_comment_by_name(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); - HDassert(ret >= 0); + if (supports_comments) { + ret = H5Oset_comment_by_name(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); + HDassert(ret >= 0); + } /*------------------------------------------------------------------------- * make several dataset with filters @@ -5691,8 +5725,10 @@ static void gent_filters(void) ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); HDassert(ret >= 0); - ret = H5Oset_comment_by_name(fid, "mytype", "This is a commited datatype", H5P_DEFAULT); - HDassert(ret >= 0); + if (supports_comments) { + ret = H5Oset_comment_by_name(fid, "mytype", "This is a commited datatype", H5P_DEFAULT); + HDassert(ret >= 0); + } ret = H5Tclose(tid); HDassert(ret >= 0); -- cgit v0.12 From ac069841f3e4fd415750ebfa08c9011cfa688418 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 1 May 2020 17:59:57 -0500 Subject: Avoid allocating a chunk index for datasets with 0-sized dimensions, until the dataset is extended. --- src/H5Dint.c | 2 +- src/H5Dlayout.c | 6 +- test/Makefile.am | 3 +- test/dsets.c | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 219 insertions(+), 23 deletions(-) diff --git a/src/H5Dint.c b/src/H5Dint.c index 4c6814d..574bc0d 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2296,7 +2296,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, * We assume that external storage is already * allocated by the caller, or at least will be before I/O is performed. */ - if(!(H5S_NULL == H5S_GET_EXTENT_TYPE(dset->shared->space) || dset->shared->dcpl_cache.efl.nused > 0)) { + if(!(0 == H5S_GET_EXTENT_NPOINTS(dset->shared->space) || dset->shared->dcpl_cache.efl.nused > 0)) { /* Get a pointer to the dataset's layout information */ layout = &(dset->shared->layout); diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index b882578..e257140 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -559,10 +559,12 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id) } /* end if */ /* Create layout message */ - /* (Don't make layout message constant unless allocation time is early and non-filtered, since space may not be allocated) */ + /* (Don't make layout message constant unless allocation time is early and + * non-filtered and has >0 elements, since space may not be allocated -QAK) */ /* (Note: this is relying on H5D__alloc_storage not calling H5O_msg_write during dataset creation) */ if(fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY && H5D_COMPACT != layout->type - && !dset->shared->dcpl_cache.pline.nused) + && !dset->shared->dcpl_cache.pline.nused + && (0 != H5S_GET_EXTENT_NPOINTS(dset->shared->space))) layout_mesg_flags = H5O_MSG_FLAG_CONSTANT; else layout_mesg_flags = 0; diff --git a/test/Makefile.am b/test/Makefile.am index 6bea16a..9876ea7 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -184,7 +184,8 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse chunk_fixed.h5 copy_dcpl_newfile.h5 partial_chunks.h5 layout_extend.h5 \ zero_chunk.h5 chunk_single.h5 swmr_non_latest.h5 \ earray_hdr_fd.h5 farray_hdr_fd.h5 bt2_hdr_fd.h5 \ - storage_size.h5 dls_01_strings.h5 \ + storage_size.h5 dls_01_strings.h5 power2up.h5 version_bounds.h5 \ + alloc_0sized.h5 \ extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \ sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ stab.h5 extern_[1-5].h5 extern_[1-4][rw].raw gheap[0-4].h5 \ diff --git a/test/dsets.c b/test/dsets.c index 34108d6..4ab3efa 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -83,6 +83,7 @@ const char *FILENAME[] = { "dls_01_strings", /* 23 */ "power2up", /* 24 */ "version_bounds", /* 25 */ + "alloc_0sized", /* 26 */ NULL }; @@ -3114,7 +3115,7 @@ test_nbit_float(hid_t file) */ for(i = 0; i < (size_t)size[0]; i++) { for(j = 0; j < (size_t)size[1]; j++) { - if(!(orig_data[i][j] == orig_data[i][j])) + if(HDisnan(orig_data[i][j])) continue; /* skip if value is NaN */ if(!H5_FLT_ABS_EQUAL(new_data[i][j], orig_data[i][j])) { H5_FAILED(); @@ -3168,18 +3169,18 @@ test_nbit_double(hid_t file) */ double orig_data[2][5] = { { - 1.6081706885101836e+60, - -255.32099170994480, - 1.2677579992621376e-61, - 64568.289448797700, - -1.0619721778839084e-75 + (double)1.6081706885101836e+60L, + -255.32099170994480f, + (double)1.2677579992621376e-61L, + 64568.289448797700f, + (double)-1.0619721778839084e-75L }, { - 2.1499497833454840e+56, - 6.6562295504670740e-3, - -1.5747263393432150, - 1.0711093225222612, - -9.8971679387636870e-1 + (double)2.1499497833454840e+56L, + 6.6562295504670740e-3f, + -1.5747263393432150f, + 1.0711093225222612f, + -9.8971679387636870e-1f }}; double new_data[2][5]; size_t precision, offset; @@ -3246,7 +3247,7 @@ test_nbit_double(hid_t file) */ for(i = 0; i < (size_t)size[0]; i++) { for(j = 0; j < (size_t)size[1]; j++) { - if(!(orig_data[i][j] == orig_data[i][j])) + if(HDisnan(orig_data[i][j])) continue; /* skip if value is NaN */ if(!H5_DBL_ABS_EQUAL(new_data[i][j], orig_data[i][j])) { H5_FAILED(); @@ -3581,7 +3582,7 @@ test_nbit_compound(hid_t file) if(((unsigned)new_data[i][j].i & i_mask) != ((unsigned)orig_data[i][j].i & i_mask) || ((unsigned)new_data[i][j].c & c_mask) != ((unsigned)orig_data[i][j].c & c_mask) || ((unsigned)new_data[i][j].s & s_mask) != ((unsigned)orig_data[i][j].s & s_mask) || - (orig_data[i][j].f == orig_data[i][j].f && !H5_FLT_ABS_EQUAL(new_data[i][j].f, orig_data[i][j].f))) + (!HDisnan(orig_data[i][j].f) && !H5_FLT_ABS_EQUAL(new_data[i][j].f, orig_data[i][j].f))) { H5_FAILED(); HDprintf(" Read different values than written.\n"); @@ -3903,7 +3904,7 @@ test_nbit_compound_2(hid_t file) if(((unsigned)new_data[i][j].d[m][n].i & i_mask) != ((unsigned)orig_data[i][j].d[m][n].i & i_mask)|| ((unsigned)new_data[i][j].d[m][n].c & c_mask) != ((unsigned)orig_data[i][j].d[m][n].c & c_mask)|| ((unsigned)new_data[i][j].d[m][n].s & s_mask) != ((unsigned)orig_data[i][j].d[m][n].s & s_mask)|| - (new_data[i][j].d[m][n].f == new_data[i][j].d[m][n].f && !H5_FLT_ABS_EQUAL(new_data[i][j].d[m][n].f, new_data[i][j].d[m][n].f))) { + (!HDisnan(new_data[i][j].d[m][n].f) && !H5_FLT_ABS_EQUAL(new_data[i][j].d[m][n].f, new_data[i][j].d[m][n].f))) { d_failed = 1; goto out; } @@ -3912,7 +3913,7 @@ out: if(((unsigned)new_data[i][j].a.i & i_mask) != ((unsigned)orig_data[i][j].a.i & i_mask)|| ((unsigned)new_data[i][j].a.c & c_mask) != ((unsigned)orig_data[i][j].a.c & c_mask)|| ((unsigned)new_data[i][j].a.s & s_mask) != ((unsigned)orig_data[i][j].a.s & s_mask)|| - (new_data[i][j].a.f == new_data[i][j].a.f && !H5_FLT_ABS_EQUAL(new_data[i][j].a.f, new_data[i][j].a.f)) || + (!HDisnan(new_data[i][j].a.f) && !H5_FLT_ABS_EQUAL(new_data[i][j].a.f, new_data[i][j].a.f)) || new_data[i][j].v != orig_data[i][j].v || b_failed || d_failed) { H5_FAILED(); HDprintf(" Read different values than written.\n"); @@ -7138,12 +7139,12 @@ error: * * If either argument is zero, then the result is undefined. */ -static long -gcd(const long l0, const long r0) +static H5_ATTR_CONST long +gcd(long l0, long r0) { long magnitude, remainder; bool negative = ((l0 < 0) != (r0 < 0)); - long l = labs(l0), r = labs(r0); + long l = HDlabs(l0), r = HDlabs(r0); do { if (l < r) { @@ -13484,6 +13485,197 @@ error: } /* end test_object_header_minimization_dcpl() */ +/*----------------------------------------------------------------------------- + * Function: test_0sized_dset_metadata_alloc + * + * Purpose: Tests the metadata allocation for 0-sized datasets. + * + * Return: Success/pass: 0 + * Failure/error: -1 + * + * Programmer: Quincey Koziol + * 2020 April 30 + * + *----------------------------------------------------------------------------- + */ +static herr_t +test_0sized_dset_metadata_alloc(hid_t fapl_id) +{ + char filename[FILENAME_BUF_SIZE] = ""; + hid_t file_id = H5I_INVALID_HID; + hid_t fapl_id_copy = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t dcpl_id = H5I_INVALID_HID; + hid_t dcpl_id_copy = H5I_INVALID_HID; + hid_t dset_space_id = H5I_INVALID_HID; + hid_t buf_space_id = H5I_INVALID_HID; + unsigned new_format; /* Whether to use latest file format */ + + TESTING("allocation of metadata for 0-sized datasets"); + + /*********/ + /* SETUP */ + /*********/ + + if(NULL == h5_fixname(FILENAME[26], fapl_id, filename, sizeof(filename))) + FAIL_STACK_ERROR + + /* Create DCPL for the dataset */ + if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + FAIL_STACK_ERROR + + + /*************/ + /* RUN TESTS */ + /*************/ + + /* Iterate over file format versions */ + for(new_format = FALSE; new_format <= TRUE; new_format++) { + H5D_layout_t layout; /* Dataset layout type */ + H5D_alloc_time_t alloc_time; /* Storage allocation time */ + + /* Copy the file access property list */ + if((fapl_id_copy = H5Pcopy(fapl_id)) < 0) + FAIL_STACK_ERROR + + /* Set the "use the latest version of the format" bounds for creating objects in the file */ + if(new_format) + if(H5Pset_libver_bounds(fapl_id_copy, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + FAIL_STACK_ERROR + + /* Create test file */ + if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id_copy)) < 0) + FAIL_STACK_ERROR + + /* Close the copy of the FAPL */ + if(H5Pclose(fapl_id_copy) < 0) + FAIL_STACK_ERROR + + /* Iterate over combinations of testing parameters */ + for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) { + for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) { + const hsize_t dims[1] = {0}; /* Dataset dimensions */ + const hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dataset dimensions */ + const hsize_t chunk_dims[1] = {100}; /* Chunk dimensions */ + char dset_name[32]; /* Dataset name */ + H5O_native_info_t nat_info; /* Information about the dataset */ + + /* Compact storage must have early allocation */ + if(H5D_COMPACT == layout && H5D_ALLOC_TIME_EARLY != alloc_time) + continue; + + /* Compose dataset name */ + HDsnprintf(dset_name, sizeof(dset_name), "/Dataset-%u-%u", (unsigned)alloc_time, (unsigned)layout); + + /* Set up DCPL */ + if((dcpl_id_copy = H5Pcopy(dcpl_id)) < 0) + FAIL_STACK_ERROR + if(H5Pset_alloc_time(dcpl_id_copy, alloc_time) < 0) + FAIL_STACK_ERROR + if(H5Pset_layout(dcpl_id_copy, layout) < 0) + FAIL_STACK_ERROR + if(H5D_CHUNKED == layout) + if(H5Pset_chunk(dcpl_id_copy, 1, chunk_dims) < 0) + FAIL_STACK_ERROR + + /* Create the dataspace for the dataset */ + if((dset_space_id = H5Screate_simple(1, dims, (H5D_CHUNKED == layout ? max_dims : NULL))) < 0) + FAIL_STACK_ERROR + + /* Create the dataset with the appropriate parameters */ + if((dset_id = H5Dcreate2(file_id, dset_name, H5T_NATIVE_INT, dset_space_id, H5P_DEFAULT, dcpl_id_copy, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close objects used to create dataset */ + if(H5Pclose(dcpl_id_copy) < 0) + FAIL_STACK_ERROR + if(H5Sclose(dset_space_id) < 0) + FAIL_STACK_ERROR + + /* Retrieve & verify the dataset's index info */ + HDmemset(&nat_info, 0, sizeof(nat_info)); + if(H5Oget_native_info(dset_id, &nat_info, H5O_NATIVE_INFO_META_SIZE) < 0) + FAIL_STACK_ERROR + if(0 != nat_info.meta_size.obj.index_size) + FAIL_PUTS_ERROR("dataset index allocation size is non-zero") + + /* If chunked, try extending and verify that the index is allocated */ + if(H5D_CHUNKED == layout) { + const hsize_t new_dims[1] = {1500}; /* New dataset dimensions */ + const hsize_t mem_dims[1] = {1}; /* Memory buffer dataset dimensions */ + const hsize_t coord = 0; /* Dataset selection coordinate */ + int val = 0; /* Data value */ + + /* Extend dataset */ + if(H5Dset_extent(dset_id, new_dims) < 0) + FAIL_STACK_ERROR + + /* Get the dataspace for the dataset & set single point selection */ + if((dset_space_id = H5Dget_space(dset_id)) < 0) + FAIL_STACK_ERROR + if(H5Sselect_elements(dset_space_id, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord) < 0) + FAIL_STACK_ERROR + + /* Create memory dataspace, with only one element */ + if((buf_space_id = H5Screate_simple(1, mem_dims, NULL)) < 0) + FAIL_STACK_ERROR + + /* Write the data to the dataset */ + if(H5Dwrite(dset_id, H5T_NATIVE_INT, buf_space_id, dset_space_id, H5P_DEFAULT, &val) < 0) + FAIL_STACK_ERROR + + /* Close objects used to perform I/O */ + if(H5Sclose(dset_space_id) < 0) + FAIL_STACK_ERROR + if(H5Sclose(buf_space_id) < 0) + FAIL_STACK_ERROR + + /* Retrieve & verify the dataset's index info */ + HDmemset(&nat_info, 0, sizeof(nat_info)); + if(H5Oget_native_info(dset_id, &nat_info, H5O_NATIVE_INFO_META_SIZE) < 0) + FAIL_STACK_ERROR + if(0 == nat_info.meta_size.obj.index_size) + FAIL_PUTS_ERROR("dataset index allocation size is zero") + } /* end if */ + + /* Close dataset */ + if(H5Dclose(dset_id) < 0) + FAIL_STACK_ERROR + } /* end for */ + } /* end for */ + + /* Close test file */ + if(H5Fclose(file_id) < 0) + FAIL_STACK_ERROR + } /* end for */ + + + /************/ + /* TEARDOWN */ + /************/ + + if(H5Pclose(dcpl_id) < 0) + FAIL_STACK_ERROR + + PASSED(); + + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Pclose(dset_space_id); + H5Pclose(buf_space_id); + H5Pclose(fapl_id_copy); + H5Pclose(dcpl_id_copy); + H5Pclose(dcpl_id); + H5Dclose(dset_id); + H5Fclose(file_id); + } H5E_END_TRY; + + return FAIL; +} /* end test_0sized_dset_metadata_alloc() */ + + /*------------------------------------------------------------------------- * Function: main * @@ -13729,7 +13921,8 @@ main(void) nerrors += (test_object_header_minimization_dcpl() < 0 ? 1 : 0); /* Run misc tests */ - nerrors += dls_01_main(); + nerrors += (dls_01_main() < 0 ? 1 : 0); + nerrors += (test_0sized_dset_metadata_alloc(fapl) < 0 ? 1 : 0); /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); -- cgit v0.12 From deadf2546561caa01537334dbb209e60c28d26c5 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 2 May 2020 20:42:33 -0500 Subject: Align contents of CMake and autotools testfile cleanup lists. --- test/CMakeTests.cmake | 122 +++++++++++++++++--------------------------------- test/Makefile.am | 17 +++---- 2 files changed, 49 insertions(+), 90 deletions(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index c73aeda..2371468 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -263,6 +263,9 @@ set (test_CLEANFILES bt2_hdr_fd.h5 storage_size.h5 dls_01_strings.h5 + power2up.h5 + version_bounds.h5 + alloc_0sized.h5 extend.h5 istore.h5 extlinks*.h5 @@ -285,60 +288,19 @@ set (test_CLEANFILES dt_arith2 links.h5 links*.h5 - extlinks16A00000.h5 - extlinks16A00001.h5 - extlinks16A00002.h5 - extlinks16B-b.h5 - extlinks16B-g.h5 - extlinks16B-l.h5 - extlinks16B-r.h5 - extlinks16B-s.h5 - extlinks19B00000.h5 - extlinks19B00001.h5 - extlinks19B00002.h5 - extlinks19B00003.h5 - extlinks19B00004.h5 - extlinks19B00005.h5 - extlinks19B00006.h5 - extlinks19B00007.h5 - extlinks19B00008.h5 - extlinks19B00009.h5 - extlinks19B00010.h5 - extlinks19B00011.h5 - extlinks19B00012.h5 - extlinks19B00013.h5 - extlinks19B00014.h5 - extlinks19B00015.h5 - extlinks19B00016.h5 - extlinks19B00017.h5 - extlinks19B00018.h5 - extlinks19B00019.h5 - extlinks19B00020.h5 - extlinks19B00021.h5 - extlinks19B00022.h5 - extlinks19B00023.h5 - extlinks19B00024.h5 - extlinks19B00025.h5 - extlinks19B00026.h5 - extlinks19B00027.h5 - extlinks19B00028.h5 + extlinks*.h5 + tmp + tmp_links + tmp2_links + tmp_links_env + tmp_vds/* + tmp_vds_env/* big.data big*.h5 stdio.h5 sec2.h5 - dtypes0.h5 - dtypes1.h5 - dtypes2.h5 - dtypes3.h5 - dtypes4.h5 - dtypes5.h5 - dtypes6.h5 - dtypes7.h5 - dtypes8.h5 - dtypes9.h5 - dtypes10.h5 - dt_arith1.h5 - dt_arith2.h5 + dtypes*.h5 + dt_arith*.h5 tattr.h5 tselect.h5 mtime.h5 @@ -350,40 +312,38 @@ set (test_CLEANFILES mount_*.h5 testmeta.h5 ttime.h5 - trefer1.h5 - trefer2.h5 - trefer3.h5 + trefer*.h5 + trefer_*.h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 twriteorder.dat + flush.h5 + flush-swmr.h5 + noflush.h5 + noflush-swmr.h5 + flush_extend.h5 + flush_extend-swmr.h5 + noflush_extend.h5 + noflush_extend-swmr.h5 enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 tmisc*.h5 - set_extent1.h5 - set_extent2.h5 - set_extent3.h5 - set_extent4.h5 - set_extent5.h5 - ext1.bin - ext2.bin + set_extent*.h5 + ext*.bin getname.h5 - getname1.h5 - getname2.h5 - getname3.h5 + getname*.h5 sec2_file.h5 direct_file.h5 family_file000*.h5 new_family_v16_000*.h5 - multi_file-r.h5 - multi_file-s.h5 + multi_file-*.h5 core_file filter_plugin.h5 - new_move_a.h5 - new_move_b.h5 + new_move_*.h5 ntypes.h5 dangle.h5 error_test.h5 @@ -391,28 +351,22 @@ set (test_CLEANFILES dtransform.h5 test_filters.h5 get_file_name.h5 - tstint1.h5 - tstint2.h5 + tstint*.h5 unlink_chunked.h5 btree2.h5 btree2_tmp.h5 objcopy_src.h5 objcopy_dst.h5 objcopy_ext.dat - trefer1.h5 - trefer2.h5 app_ref.h5 farray.h5 farray_tmp.h5 earray.h5 earray_tmp.h5 - efc0.h5 - efc1.h5 - efc2.h5 - efc3.h5 - efc4.h5 - efc5.h5 + efc*.h5 log_vfd_out.log + log_ros3_out.log + log_s3comms_out.log new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 @@ -422,13 +376,11 @@ set (test_CLEANFILES unregister_filter_2.h5 vds_virt.h5 vds_dapl.h5 - vds_src_0.h5 - vds_src_1.h5 + vds_src_*.h5 swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 use_disable_mdc_flushes.h5 - tbogus.h5.copy flushrefresh.h5 flushrefresh_VERIFICATION_START flushrefresh_VERIFICATION_CHECKPOINT1 @@ -444,13 +396,19 @@ set (test_CLEANFILES cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 - tmp_vds_env/vds_src_2.h5 + swmr*.h5 + swmr_writer.out + swmr_writer.log.* + swmr_reader.out.* + swmr_reader.log.* + tbogus.h5.copy + cache_image_test.h5 direct_chunk.h5 + native_vol_test.h5 splitter*.h5 splitter.log mirror_rw/* mirror_wo/* - native_vol_test.h5 ) # Remove any output file left over from previous test run diff --git a/test/Makefile.am b/test/Makefile.am index 9876ea7..805b482 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -189,10 +189,10 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \ sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ stab.h5 extern_[1-5].h5 extern_[1-4][rw].raw gheap[0-4].h5 \ - ohdr_min_a.h5 ohdr_min_b.h5 min_dset_ohdr_testfile.h5\ + ohdr_min_a.h5 ohdr_min_b.h5 min_dset_ohdr_testfile.h5 \ dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 \ - tmp tmp_links tmp2_links tmp_links_env tmp_vds_env \ - big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ + tmp tmp_links tmp2_links tmp_links_env tmp_vds tmp_vds_env \ + big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \ @@ -207,20 +207,21 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 \ dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 btree2_tmp.h5 objcopy_src.h5 objcopy_dst.h5 \ - objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 farray_tmp.h5 \ + objcopy_ext.dat app_ref.h5 farray.h5 farray_tmp.h5 \ earray.h5 earray_tmp.h5 efc[0-5].h5 log_vfd_out.log log_ros3_out.log \ log_s3comms_out.log new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 \ vds_virt.h5 vds_dapl.h5 vds_src_[0-1].h5 \ - swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 use_disable_mdc_flushes.h5 \ - flushrefresh.h5 flushrefresh_VERIFICATION_START \ + swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 \ + use_disable_mdc_flushes.h5 flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 \ - flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \ + flushrefresh_VERIFICATION_DONE filenotclosed.h5 del_many_dense_attrs.h5 \ + atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \ test_swmr*.h5 cache_logging.h5 cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 \ swmr[0-2].h5 swmr_writer.out swmr_writer.log.* swmr_reader.out.* swmr_reader.log.* \ tbogus.h5.copy cache_image_test.h5 direct_chunk.h5 native_vol_test.h5 \ - splitter*.h5 splitter.log + splitter*.h5 splitter.log mirror_rw mirror_ro # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ -- cgit v0.12 From 521c3f8ff6b3db7def4d64bdce3a39b5ae059f39 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 May 2020 08:10:02 -0500 Subject: Add github actions --- .github/workflows/main.yml | 80 ++++++++++++++++++++++++++++++++++++++++++++++ MANIFEST | 2 ++ 2 files changed, 82 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a4e4e44 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,80 @@ +name: hdf5 dev CI + +# Controls when the action will run. Triggers the workflow on push or pull request +on: + push: + branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ] + pull_request: + branches: [ develop ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + strategy: + fail-fast: false + matrix: + name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "macOS Latest Clang"] + include: + - name: "Windows Latest MSVC" + artifact: "Windows-MSVC.tar.xz" + os: windows-latest + build_type: "Release" + toolchain: "" + fortran: OFF + generator: "-G \"Visual Studio 16 2019\" -A x64" + - name: "Ubuntu Latest GCC" + artifact: "Linux.tar.xz" + os: ubuntu-latest + build_type: "Release" + fortran: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "macOS Latest Clang" + artifact: "macOS.tar.xz" + os: macos-latest + build_type: "Release" + fortran: OFF + toolchain: "config/toolchain/clang.cmake" + generator: "-G Ninja" + + name: ${{ matrix.name }} + # The type of runner that the job will run on + runs-on: ${{ matrix.os }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Install Dependencies (Linux) + run: sudo apt-get install ninja-build + if: matrix.os == 'ubuntu-latest' + - name: Install Dependencies (Windows) + run: choco install ninja + if: matrix.os == 'windows-latest' + - name: Install Dependencies (macOS) + run: brew install ninja + if: matrix.os == 'macos-latest' + - name: Set environment for MSVC (Windows) + if: matrix.os == 'windows-latest' + run: | + # Set these env vars so cmake picks the correct compiler + echo "::set-env name=CXX::cl.exe" + echo "::set-env name=CC::cl.exe" + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v2 + + - name: Setup CMake + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} -DHDF5_BUILD_JAVA=ON $GITHUB_WORKSPACE + shell: bash + + - name: Build + run: cmake --build . --config ${{ matrix.build_type }} + working-directory: ${{ runner.workspace }}/build + + - name: Test + run: ctest --build . -C ${{ matrix.build_type }} -V + working-directory: ${{ runner.workspace }}/build diff --git a/MANIFEST b/MANIFEST index 2430ee8..523f5b0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -33,6 +33,8 @@ ./autogen.sh ./configure.ac +./github/workflows/main.yml _DO_NOT_DISTRIBUTE_ + ./m4/aclocal_cxx.m4 ./m4/aclocal_fc.m4 ./m4/aclocal_fc.f90 -- cgit v0.12 From c1565d2b576e2bf98918704dcda7f3187b89b28e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 May 2020 09:38:59 -0500 Subject: Correct test --- java/test/TestH5E.java | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index 6f4f473..ac641c3 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -81,6 +81,7 @@ public class TestH5E { long errnum = hdferr.getMajorErrorNumber(); int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; String msg = null; + try { msg = H5.H5Eget_msg(errnum, error_msg_type); } @@ -91,15 +92,15 @@ public class TestH5E { assertNotNull("H5.H5Eget_msg: " + msg, msg); assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, error_msg_type[0]); - /* - * If HDF5_VOL_CONNECTOR is set, this might not be the - * native connector and the error string might be different. - * Only check for the specific error message if the native - * connector is being used. - */ - String connector = System.getenv("HDF5_VOL_CONNECTOR"); - if (connector == null) - assertEquals("H5.H5Eget_msg: ", "File accessibility", msg); + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector and the error string might be different. + * Only check for the specific error message if the native + * connector is being used. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) + assertTrue("H5.H5Eget_msg: ", msg.contains("File accessibility")); } catch (Throwable err) { err.printStackTrace(); @@ -116,6 +117,7 @@ public class TestH5E { long errnum = hdferr.getMinorErrorNumber(); int[] error_msg_type = { HDF5Constants.H5E_MINOR }; String msg = null; + try { msg = H5.H5Eget_msg(errnum, error_msg_type); } @@ -126,15 +128,15 @@ public class TestH5E { assertNotNull("H5.H5Eget_msg: " + msg, msg); assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, error_msg_type[0]); - /* - * If HDF5_VOL_CONNECTOR is set, this might not be the - * native connector and the error string might be different. - * Only check for the specific error message if the native - * connector is being used. - */ - String connector = System.getenv("HDF5_VOL_CONNECTOR"); - if (connector == null) - assertEquals("H5.H5Eget_msg: ", "Unable to open file", msg); + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector and the error string might be different. + * Only check for the specific error message if the native + * connector is being used. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) + assertTrue("H5.H5Eget_msg: ", msg.contains("Unable to open file")); } catch (Throwable err) { err.printStackTrace(); -- cgit v0.12 From a1ce9b2242774c9ef8f7200dc7e3d9e31fd33676 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 May 2020 11:08:12 -0500 Subject: Correct step name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4e4e44..5c38961 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,7 +64,7 @@ jobs: - name: Get Sources uses: actions/checkout@v2 - - name: Setup CMake + - name: Configure run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" -- cgit v0.12 From b147797449503e9a166b277fdabffafd5561d718 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 May 2020 08:50:12 -0500 Subject: Correct path --- MANIFEST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 523f5b0..46b4f01 100644 --- a/MANIFEST +++ b/MANIFEST @@ -33,7 +33,7 @@ ./autogen.sh ./configure.ac -./github/workflows/main.yml _DO_NOT_DISTRIBUTE_ +./.github/workflows/main.yml _DO_NOT_DISTRIBUTE_ ./m4/aclocal_cxx.m4 ./m4/aclocal_fc.m4 -- cgit v0.12 From aef4c9b02b85a20f6df1fce7832bc9cd9041fc1b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 May 2020 08:58:22 -0500 Subject: OESS-65 fix packaging config files --- CMakeFilters.cmake | 3 +++ config/cmake/cacheinit.cmake | 2 +- config/cmake/mccacheinit.cmake | 2 +- config/cmake_ext_mod/HDFLibMacros.cmake | 2 +- release_docs/INSTALL_CMake.txt | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 0d64b55..962c68b 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -123,6 +123,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) message (STATUS "Filter SZIP is built") if (USE_LIBAEC) message (STATUS "... with library AEC") + set (SZ_PACKAGE_NAME LIBAEC_PACKAGE_NAME) + else () + set (SZ_PACKAGE_NAME SZIP_PACKAGE_NAME) endif () else () message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 4efb185..4846997 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -47,5 +47,5 @@ set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed f set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) - +set (LIBAEC_PACKAGE_NAME "libaec" CACHE STRING "Name of AEC SZIP package" FORCE) set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index f4bfb07..af07894 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -59,5 +59,5 @@ set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) set (CTEST_CONFIGURATION_TYPE "Debug" CACHE STRING "Build Debug" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) - +set (LIBAEC_PACKAGE_NAME "libaec" CACHE STRING "Name of AEC SZIP package" FORCE) set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index cbca47f..2e658ce 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -126,7 +126,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) -##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) +##include (${BINARY_DIR}/${SZ_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static if (USE_LIBAEC) add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index a0386cd..5442f6c 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -479,6 +479,7 @@ These five steps are described in detail below. set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE) set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + set (LIBAEC_PACKAGE_NAME "libaec" CACHE STRING "Name of AEC SZIP package" FORCE) set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) 2. Configure the cache settings -- cgit v0.12 From 8cff990553fe735c871abb980d134c40ae2e9222 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 May 2020 10:10:49 -0500 Subject: Fix name setting --- CMakeFilters.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 962c68b..2706542 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -123,9 +123,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) message (STATUS "Filter SZIP is built") if (USE_LIBAEC) message (STATUS "... with library AEC") - set (SZ_PACKAGE_NAME LIBAEC_PACKAGE_NAME) + set (SZ_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME}) else () - set (SZ_PACKAGE_NAME SZIP_PACKAGE_NAME) + set (SZ_PACKAGE_NAME ${SZIP_PACKAGE_NAME}) endif () else () message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") -- cgit v0.12 From 9a097529ab9538514a7401335529bcb5a3f6ddd9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 May 2020 10:51:07 -0500 Subject: Change to use alias --- config/cmake/hdf5-config.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index b5a12a6..a0e93df 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -114,7 +114,7 @@ if (NOT TARGET "@HDF5_PACKAGE@") include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) - include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + include (@PACKAGE_SHARE_INSTALL_DIR@/@SZ_PACKAGE_NAME@/@SZ_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) endif () -- cgit v0.12 From a5a3a5d9b367f96257d349e834b13ad9af0895c3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 May 2020 12:57:44 -0500 Subject: Correct filename --- config/cmake_ext_mod/HDFLibMacros.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 2e658ce..fe633bf 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -129,13 +129,13 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) ##include (${BINARY_DIR}/${SZ_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static if (USE_LIBAEC) - add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "sz" STATIC "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) - add_library(${HDF_PACKAGE_NAMESPACE}szaec-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szaec-static "aec" STATIC "") - add_dependencies (${HDF_PACKAGE_NAMESPACE}szaec-static SZIP) - set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static;${HDF_PACKAGE_NAMESPACE}szaec-static") + add_library(${HDF_PACKAGE_NAMESPACE}sz-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}sz-static "sz" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}sz-static SZIP) + add_library(${HDF_PACKAGE_NAMESPACE}aec-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}aec-static "aec" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}aec-static SZIP) + set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}sz-static;${HDF_PACKAGE_NAMESPACE}aec-static") else () add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "") -- cgit v0.12 From f82348f80940e6ea197b7913f6357a5bbde3c43d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 May 2020 15:32:15 -0500 Subject: Comment out pull-request action and enable fail fast --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c38961..a3fdadb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,15 +4,15 @@ name: hdf5 dev CI on: push: branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ] - pull_request: - branches: [ develop ] +# pull_request: +# branches: [ develop ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: strategy: - fail-fast: false +# fail-fast: false matrix: name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "macOS Latest Clang"] include: -- cgit v0.12 From ad8f72ca29699dea6cd87bd1b0c04e539aef77ee Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 10 May 2020 03:33:54 -0700 Subject: Removed HDgets macros since gets was deprecated in C99 and removed in C11 (gets() is not used in our repo). --- src/H5private.h | 7 +++++-- tools/test/perform/pio_standalone.h | 2 +- tools/test/perform/sio_standalone.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index 95d4885..2236ee6 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1030,9 +1030,12 @@ typedef off_t h5_stat_size_t; #ifndef HDgetrusage #define HDgetrusage(X,S) getrusage(X,S) #endif /* HDgetrusage */ -#ifndef HDgets - #define HDgets(S) gets(S) + +/* Don't define HDgets - gets() was deprecated in C99 and removed in C11 */ +#ifdef HDgets + #undef HDgets #endif /* HDgets */ + #ifndef HDgettimeofday #define HDgettimeofday(S,P) gettimeofday(S,P) #endif /* HDgettimeofday */ diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index cf6d980..f2cda4f 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -213,7 +213,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDgetpwnam(S) getpwnam(S) #define HDgetpwuid(U) getpwuid(U) #define HDgetrusage(X,S) getrusage(X,S) -#define HDgets(S) gets(S) +/* Don't define a macro for gets() - it was removed in C11 */ #ifdef H5_HAVE_WIN32_API H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz); #define HDgettimeofday(V,Z) Wgettimeofday(V,Z) diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 45f6d25..99e13bc 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -228,7 +228,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDgetpwnam(S) getpwnam(S) #define HDgetpwuid(U) getpwuid(U) #define HDgetrusage(X,S) getrusage(X,S) -#define HDgets(S) gets(S) +/* Don't define a macro for gets() - it was removed in C11 */ #ifdef H5_HAVE_WIN32_API H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz); #define HDgettimeofday(V,Z) Wgettimeofday(V,Z) -- cgit v0.12 From 55844f79e94d49f7ccc8fff1fa3d80f153bb13ea Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 10 May 2020 09:48:30 -0700 Subject: Misc warning fixes. --- test/del_many_dense_attrs.c | 22 +++++++++++----------- test/fillval.c | 31 ++++++++++++++++++++++++++----- test/use.h | 2 +- test/use_common.c | 2 +- utils/mirror_vfd/mirror_server.c | 2 +- utils/mirror_vfd/mirror_server_stop.c | 12 ++++++------ 6 files changed, 46 insertions(+), 25 deletions(-) diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c index 4c1efae..6f48901 100644 --- a/test/del_many_dense_attrs.c +++ b/test/del_many_dense_attrs.c @@ -62,17 +62,17 @@ static void catch_signal(int H5_ATTR_UNUSED signo) int main(void) { - hid_t fid = -1; /* HDF5 File ID */ - hid_t gid = -1; /* Group ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t fapl = -1; /* File access property lists */ - hid_t gcpl = -1; /* Group creation property list */ - char aname[50]; /* Name of attribute */ - char *basename="attr"; /* Name prefix for attribute */ - char filename[100]; /* File name */ - int i; /* Local index variable */ + hid_t fid = -1; /* HDF5 File ID */ + hid_t gid = -1; /* Group ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t fapl = -1; /* File access property lists */ + hid_t gcpl = -1; /* Group creation property list */ + char aname[50]; /* Name of attribute */ + const char *basename="attr"; /* Name prefix for attribute */ + char filename[100]; /* File name */ + int i; /* Local index variable */ /* Testing setup */ h5_reset(); diff --git a/test/fillval.c b/test/fillval.c index 019744a..72b8dcb 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -1453,12 +1453,16 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, void *val_rd, *odd_val; const void *init_val, *should_be, *even_val; int val_rd_i, init_val_i = 9999; - comp_vl_datatype init_val_c = {87, "baz", "mumble", 129}; + comp_vl_datatype init_val_c = {87, NULL, NULL, 129}; comp_vl_datatype val_rd_c; void *buf = NULL; unsigned odd; /* Whether an odd or even coord. was read */ unsigned i, j; /* Local index variables */ + /* Set vl datatype init value strings */ + init_val_c.a = HDstrdup("baz"); + init_val_c.b = HDstrdup("mumble"); + /* Make copy of dataset creation property list */ if((dcpl = H5Pcopy(_dcpl)) < 0) TEST_ERROR @@ -1802,8 +1806,10 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, /* Release elements & memory buffer */ for(i = 0; i < nelmts; i++) release_rtn((void *)((char *)buf + (val_size * i))); + + HDfree(init_val_c.a); + HDfree(init_val_c.b); HDfree(buf); - buf = NULL; /* Cleanup IDs */ if(H5Pclose(dcpl) < 0) TEST_ERROR @@ -1813,8 +1819,10 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, return 0; error: - if(buf) - HDfree(buf); + HDfree(init_val_c.a); + HDfree(init_val_c.b); + HDfree(buf); + H5E_BEGIN_TRY { H5Pclose(dcpl); H5Dclose(dset); @@ -1856,7 +1864,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) #else int fillval_i = 0x4c70f1cd; #endif - comp_vl_datatype fillval_c = {32, "foo", "bar", 64}; /* Fill value for compound+vl datatype tests */ + comp_vl_datatype fillval_c = {32, NULL, NULL, 64}; /* Fill value for compound+vl datatype tests */ char filename[1024]; /* Print testing message */ @@ -1865,6 +1873,10 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) else TESTING("contiguous dataset extend") + /* Set vl datatype fill value strings */ + fillval_c.a = HDstrdup("foo"); + fillval_c.b = HDstrdup("bar"); + /* Create dataset creation property list */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR if(H5D_CHUNKED == layout) @@ -1945,11 +1957,17 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pclose(dcpl) < 0) TEST_ERROR if(H5Fclose(file) < 0) TEST_ERROR + HDfree(fillval_c.a); + HDfree(fillval_c.b); + PASSED(); return 0; error: + HDfree(fillval_c.a); + HDfree(fillval_c.b); + H5E_BEGIN_TRY { H5Tclose(cmpd_vl_tid); H5Pclose(dcpl); @@ -1958,6 +1976,9 @@ error: return 1; skip: + HDfree(fillval_c.a); + HDfree(fillval_c.b); + H5E_BEGIN_TRY { H5Pclose(dcpl); H5Fclose(file); diff --git a/test/use.h b/test/use.h index e5eced2..52537d6 100644 --- a/test/use.h +++ b/test/use.h @@ -47,7 +47,7 @@ typedef struct options_t { hbool_t use_swmr; /* use swmr open (1) or not */ int iterations; /* iterations, default 1 */ hid_t fapl_id; /* instance-specific FAPL ID */ - char *progname; /* Program name (used in usage and dset name) */ + const char *progname; /* Program name (used in usage and dset name) */ } options_t; /* prototype declarations */ diff --git a/test/use_common.c b/test/use_common.c index b537741..7e19167 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -70,7 +70,7 @@ parse_option(int argc, char * const argv[], options_t * opts) exit(EXIT_SUCCESS); break; case 'f': /* usecase data file name */ - opts->filename = optarg; + opts->filename = HDstrdup(optarg); break; case 'i': /* iterations */ if ((opts->iterations = HDatoi(optarg)) <= 0) { diff --git a/utils/mirror_vfd/mirror_server.c b/utils/mirror_vfd/mirror_server.c index 2583e60..db7cf04 100644 --- a/utils/mirror_vfd/mirror_server.c +++ b/utils/mirror_vfd/mirror_server.c @@ -656,7 +656,7 @@ main(int argc, char **argv) #else /* H5_HAVE_MIRROR_VFD */ int -main(int argc, char **argv) +main(void) { HDprintf("Mirror VFD was not built -- cannot launch server.\n"); HDexit(EXIT_FAILURE); diff --git a/utils/mirror_vfd/mirror_server_stop.c b/utils/mirror_vfd/mirror_server_stop.c index ccd5824..f2414e0 100644 --- a/utils/mirror_vfd/mirror_server_stop.c +++ b/utils/mirror_vfd/mirror_server_stop.c @@ -184,20 +184,20 @@ main(int argc, char **argv) if (parse_args(argc, argv, &opts) < 0) { HDprintf("Unable to parse arguments\n"); - return EXIT_FAILURE; + HDexit(EXIT_FAILURE); } if (opts.help) { usage(); - return EXIT_SUCCESS; + HDexit(EXIT_FAILURE); } if (send_shutdown(&opts) < 0) { HDprintf("Unable to send shutdown command\n"); - return EXIT_FAILURE; + HDexit(EXIT_FAILURE); } - return EXIT_SUCCESS; + HDexit(EXIT_SUCCESS); } /* end main() */ #else /* H5_HAVE_MIRROR_VFD */ @@ -205,10 +205,10 @@ main(int argc, char **argv) /* ------------------------------------------------------------------------- */ int -main(int argc, char **argv) +main(void) { HDprintf("Mirror VFD not built -- unable to perform shutdown.\n"); - return EXIT_FAILURE; + HDexit(EXIT_FAILURE); } #endif /* H5_HAVE_MIRROR_VFD */ -- cgit v0.12 From ae07c9ba2429a9c49291bcd9f02c0ce36b0a60ce Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 15 May 2020 06:44:01 -0700 Subject: Replaced a few calls to HDmemcpy with H5MM_memcpy, which does overlap checking. --- src/H5Odeprec.c | 12 ++++++------ src/H5Tref.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c index e43213d..aca0d59 100644 --- a/src/H5Odeprec.c +++ b/src/H5Odeprec.c @@ -189,10 +189,10 @@ H5O__iterate1_adapter(hid_t obj_id, const char *name, const H5O_info2_t *oinfo2, /* Set the native fields */ if(shim_data->fields & H5O_INFO_HDR) - HDmemcpy(&(oinfo.hdr), &(nat_info.hdr), sizeof(H5O_hdr_info_t)); + H5MM_memcpy(&(oinfo.hdr), &(nat_info.hdr), sizeof(H5O_hdr_info_t)); if(shim_data->fields & H5O_INFO_META_SIZE) { - HDmemcpy(&(oinfo.meta_size.obj), &(nat_info.meta_size.obj), sizeof(H5_ih_info_t)); - HDmemcpy(&(oinfo.meta_size.attr), &(nat_info.meta_size.attr), sizeof(H5_ih_info_t)); + H5MM_memcpy(&(oinfo.meta_size.obj), &(nat_info.meta_size.obj), sizeof(H5_ih_info_t)); + H5MM_memcpy(&(oinfo.meta_size.attr), &(nat_info.meta_size.attr), sizeof(H5_ih_info_t)); } } @@ -279,10 +279,10 @@ H5O__get_info_old(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, /* Set the native fields */ if(fields & H5O_INFO_HDR) - HDmemcpy(&(oinfo->hdr), &(nat_info.hdr), sizeof(H5O_hdr_info_t)); + H5MM_memcpy(&(oinfo->hdr), &(nat_info.hdr), sizeof(H5O_hdr_info_t)); if(fields & H5O_INFO_META_SIZE) { - HDmemcpy(&(oinfo->meta_size.obj), &(nat_info.meta_size.obj), sizeof(H5_ih_info_t)); - HDmemcpy(&(oinfo->meta_size.attr), &(nat_info.meta_size.attr), sizeof(H5_ih_info_t)); + H5MM_memcpy(&(oinfo->meta_size.obj), &(nat_info.meta_size.obj), sizeof(H5_ih_info_t)); + H5MM_memcpy(&(oinfo->meta_size.attr), &(nat_info.meta_size.attr), sizeof(H5_ih_info_t)); } /* end if */ } /* end if */ diff --git a/src/H5Tref.c b/src/H5Tref.c index f97b78a..b357baa 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -800,7 +800,7 @@ H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_ HDassert(dst_size); /* Copy header manually */ - HDmemcpy(q, p, H5R_ENCODE_HEADER_SIZE); + H5MM_memcpy(q, p, H5R_ENCODE_HEADER_SIZE); p += H5R_ENCODE_HEADER_SIZE; q += H5R_ENCODE_HEADER_SIZE; blob_size -= H5R_ENCODE_HEADER_SIZE; @@ -860,7 +860,7 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, } /* end if */ /* Copy header manually so that it does not get encoded into the blob */ - HDmemcpy(q, p, H5R_ENCODE_HEADER_SIZE); + H5MM_memcpy(q, p, H5R_ENCODE_HEADER_SIZE); p += H5R_ENCODE_HEADER_SIZE; q += H5R_ENCODE_HEADER_SIZE; src_size -= H5R_ENCODE_HEADER_SIZE; -- cgit v0.12 From d14b87bfc8e86e5a818a90da1731155e5f57a92c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 May 2020 13:05:22 -0500 Subject: Correct path for mingw --- config/toolchain/mingw64.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/toolchain/mingw64.cmake b/config/toolchain/mingw64.cmake index fde5e38..4a3e295 100644 --- a/config/toolchain/mingw64.cmake +++ b/config/toolchain/mingw64.cmake @@ -4,11 +4,11 @@ set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) -set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} /usr/local/${TOOLCHAIN_PREFIX}) +set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} /usr/${TOOLCHAIN_PREFIX}) set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set (CMAKE_CROSSCOMPILING_EMULATOR wine64) -include_directories(/usr/local/${TOOLCHAIN_PREFIX}/include) +include_directories(/usr/${TOOLCHAIN_PREFIX}/include) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols") -- cgit v0.12 From ad8f45d267a4ffb0696a4e30b590fa11ef68d06f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 May 2020 13:21:43 -0500 Subject: Correct mingw paths --- config/toolchain/build32.cmake | 16 ++++++++++------ config/toolchain/mingw64.cmake | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/config/toolchain/build32.cmake b/config/toolchain/build32.cmake index 207d03e..a2566c3 100644 --- a/config/toolchain/build32.cmake +++ b/config/toolchain/build32.cmake @@ -5,10 +5,11 @@ elseif(APPLE) set (CMAKE_OSX_ARCHITECTURES "i386") elseif(MINGW) set (CMAKE_SYSTEM_NAME Windows) - set (CMAKE_C_COMPILER i686-w64-mingw32-gcc) - set (CMAKE_CXX_COMPILER i686-w64-mingw32-g++) - set (CMAKE_RC_COMPILER i686-w64-mingw32-windres) - set (CMAKE_Fortran_COMPILER i686-w64-mingw32-gfortran) + set (TOOLCHAIN_PREFIX i686-w64-mingw32) + set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) + set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) + set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) + set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags") @@ -34,11 +35,14 @@ elseif(MINGW) set (ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig) endif () - set (CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) + set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - set (CMAKE_CROSSCOMPILING_EMULATOR wine32) + set (CMAKE_CROSSCOMPILING_EMULATOR wine) + + include_directories(/usr/${TOOLCHAIN_PREFIX}/include) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols") else () set (CMAKE_SYSTEM_NAME Linux) diff --git a/config/toolchain/mingw64.cmake b/config/toolchain/mingw64.cmake index 4a3e295..1830488 100644 --- a/config/toolchain/mingw64.cmake +++ b/config/toolchain/mingw64.cmake @@ -4,7 +4,7 @@ set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran) -set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} /usr/${TOOLCHAIN_PREFIX}) +set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -- cgit v0.12 From fcd87d2569ca4d8396c7db4eddb46cab04010abf Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 18 May 2020 14:28:51 -0500 Subject: Revise gnu-*flags and cmake/HDF*CompilerFlags.cmake files to add warning flags for GCC compilers version 4.8 and above. Removed files from gnu-warnings that only apply to versions < 4.8. Consolidated warnings from versions < 4.8 that apply to versions >= 4.8 into the 4.8 warnings files. --- config/cmake/HDFCXXCompilerFlags.cmake | 84 ++---------------------------- config/cmake/HDFCompilerFlags.cmake | 74 +++----------------------- config/cmake/HDFFortranCompilerFlags.cmake | 19 +------ config/gnu-cxxflags | 67 ++++-------------------- config/gnu-fflags | 19 ------- config/gnu-flags | 69 ++++-------------------- config/gnu-warnings/4.2-4.3 | 3 -- config/gnu-warnings/4.2-4.4 | 2 - config/gnu-warnings/4.2-4.6 | 2 - config/gnu-warnings/4.2-4.last | 3 -- config/gnu-warnings/4.3 | 2 - config/gnu-warnings/4.4 | 3 -- config/gnu-warnings/4.5 | 1 - config/gnu-warnings/4.5-4.6 | 3 -- config/gnu-warnings/4.6 | 2 - config/gnu-warnings/4.7 | 5 -- config/gnu-warnings/4.8 | 24 +++++++++ config/gnu-warnings/4.8-4.last | 3 ++ config/gnu-warnings/developer-4.5 | 7 --- config/gnu-warnings/developer-4.6 | 1 - config/gnu-warnings/developer-4.7 | 7 --- config/gnu-warnings/developer-4.8 | 22 ++++++++ config/gnu-warnings/gfort-4.4 | 2 - config/gnu-warnings/gfort-4.5 | 1 - config/gnu-warnings/gfort-4.7 | 2 - config/gnu-warnings/gfort-4.8 | 12 +++++ config/gnu-warnings/no-developer-4.5 | 1 - config/gnu-warnings/no-developer-4.6 | 1 - config/gnu-warnings/no-developer-4.7 | 2 - config/gnu-warnings/no-developer-4.8 | 12 +++++ 30 files changed, 102 insertions(+), 353 deletions(-) delete mode 100644 config/gnu-warnings/4.2-4.3 delete mode 100644 config/gnu-warnings/4.2-4.4 delete mode 100644 config/gnu-warnings/4.2-4.6 delete mode 100644 config/gnu-warnings/4.2-4.last delete mode 100644 config/gnu-warnings/4.3 delete mode 100644 config/gnu-warnings/4.4 delete mode 100644 config/gnu-warnings/4.5 delete mode 100644 config/gnu-warnings/4.5-4.6 delete mode 100644 config/gnu-warnings/4.6 delete mode 100644 config/gnu-warnings/4.7 create mode 100644 config/gnu-warnings/4.8-4.last delete mode 100644 config/gnu-warnings/developer-4.5 delete mode 100644 config/gnu-warnings/developer-4.6 delete mode 100644 config/gnu-warnings/developer-4.7 delete mode 100644 config/gnu-warnings/gfort-4.4 delete mode 100644 config/gnu-warnings/gfort-4.5 delete mode 100644 config/gnu-warnings/gfort-4.7 delete mode 100644 config/gnu-warnings/no-developer-4.5 delete mode 100644 config/gnu-warnings/no-developer-4.6 delete mode 100644 config/gnu-warnings/no-developer-4.7 diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 4bc646a..02bf5cd 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -86,9 +86,8 @@ if (NOT MSVC) endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED - AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - # autotools adds the C flags with the CXX flags for g++ compiler - # versions 4.2 and above. + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + # add the general CXX flags for g++ compiler versions 4.8 and above. ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general") endif () @@ -127,84 +126,9 @@ if (NOT MSVC) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... Only needed for gcc 4.X - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") - endif () - - # Append warning flags for gcc 4.2-4.3 - # autotools always add the C flags with the CXX flags - if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.3") - endif () - - # Append warning flags for gcc 4.2-4.4 - # autotools always add the C flags with the CXX flags - if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.4 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.4") - endif () - - # Append warning flags that only gcc 4.3+ knows about - # autotools always add the C flags with the CXX flags - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") - endif() - - # Append more extra warning flags that only gcc 4.4+ know about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") - endif () - - # Append more extra warning flags that only gcc 4.5+ know about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5") - if (HDF5_ENABLE_DEV_WARNINGS) - # autotools always add the C flags with the CXX flags - #ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") - else () - # autotools always add the C flags with the CXX flags - #ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5") - endif () - endif () - - # Append more extra warning flags that only gcc 4.6 and less know about - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") - endif () - - # Append more extra warning flags that only gcc 4.5-4.6 know about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6") - endif () - - # Append more extra warning flags that only gcc 4.6+ know about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6") - if (HDF5_ENABLE_DEV_WARNINGS) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6") - else () - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.6") - endif () - endif () - - # Append more extra warning flags that only gcc 4.7+ know about - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7") - if (HDF5_ENABLE_DEV_WARNINGS) - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7") - else () - # autotools always add the C flags with the CXX flags - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.7") - endif () + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") endif () # Append more extra warning flags that only gcc 4.8+ know about diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 6dbaa64..cd4ab48 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -93,11 +93,9 @@ if (NOT MSVC) list (APPEND H5_CFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings") endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") - # Add general CFlags for GCC versions 4.2 and above - if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") - endif () + # Add general CFlags for GCC versions 4.8 and above if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") endif () # gcc automatically inlines based on the optimization level @@ -121,13 +119,13 @@ if (NOT MSVC) message (STATUS "....HDF5 developer group warnings are enabled") if (CMAKE_C_COMPILER_ID STREQUAL "Intel") list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing") - elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") + elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general") elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general") endif () else () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general") elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general") @@ -138,68 +136,8 @@ if (NOT MSVC) if (CMAKE_C_COMPILER_ID STREQUAL "GNU") # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... Only needed for gcc 4.X - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last") - endif () - - # Append warning flags for gcc 4.2-4.3 - if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.3") - endif () - - # Append warning flags for gcc 4.2-4.4 - if (CMAKE_C_COMPILER_VERSION VERSION_LESS_EQUAL 4.4 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.4") - endif () - - # Append warning flags that only gcc 4.3+ knows about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") - endif () - - # Append more extra warning flags that only gcc 4.4+ know about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4") - endif () - - # Append more extra warning flags that only gcc 4.5+ know about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5") - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5") - else () - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5") - endif () - endif () - - # Append more extra warning flags that only gcc 4.6 and less know about - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6") - endif () - - # Append more extra warning flags that only gcc 4.5-4.6 know about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6") - endif () - - # Append more extra warning flags that only gcc 4.6+ know about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6") - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6") - else () - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.6") - endif () - endif () - - # Append more extra warning flags that only gcc 4.7+ know about - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7") - if (HDF5_ENABLE_DEV_WARNINGS) - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7") - else () - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.7") - endif () + if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") endif () # Append more extra warning flags that only gcc 4.8+ know about diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index 495a0ca..15edaa8 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -67,23 +67,6 @@ if (NOT MSVC) message (STATUS "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") - # Append warning flags that only gcc 4.4+ knows about - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.4") - - # Append more extra warning flags that only gcc 4.5+ know about - if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.5) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5") - endif () - - # Append more extra warning flags that only gcc 4.6+ know about - #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6) - # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6") - #endif () - - # Append more extra warning flags that only gcc 4.7+ know about - if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.7) - ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7") - endif () # Append more extra warning flags that only gcc 4.8+ know about if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8) @@ -95,7 +78,7 @@ if (NOT MSVC) # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9") #endif () - # Append more extra warning flags that only gcc 5.1+ know about + # Append more extra warning flags that only gcc 5.x+ know about if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5") endif () diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index b2ef36d..44cbc69 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -180,82 +180,33 @@ if test "X-g++" = "X-$cxx_vendor"; then # General # ########### - if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -gt 4; then + # Add various general warning flags in gnu-warnings for gcc versions 4.8 and later. + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-general)" - fi ###################### # Developer warnings # ###################### - NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general) - DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general) + NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general) + DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general) + + fi ####################### # gcc 4 special cases # ####################### - # GCC 4.2 through 4.6 - if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 6; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.6)" - fi - - # GCC 4.2 through 4.3 - if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 3; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.3)" - fi - - # GCC 4.5 through 4.6 - if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 6; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5-4.6)" - fi - - # GCC 4.2 through 4.4 - if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -a $cxx_vers_major -eq 4 -a $cxx_vers_minor -le 4; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.4)" - fi - - # GCC 4.2 through the end of GCC 4 series - if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.2-4.last)" + # GCC 4.8 through the end of GCC 4 series + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8-4.last)" fi ############################# # Version-specific warnings # ############################# - # gcc >= 4.3 - if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 3; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.3)" - fi - - # gcc >= 4.4 - if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 4; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.4)" - fi - - # gcc >= 4.5 - if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 5; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.5)" - #DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.5)" - #NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.5)" - fi - - # gcc >= 4.6 - if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 6; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.6)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.6)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.6)" - fi - - # gcc >= 4.7 - if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 7; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.7)" - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.7)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.7)" - fi - # gcc >= 4.8 if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)" diff --git a/config/gnu-fflags b/config/gnu-fflags index eb3519c..105a990 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -145,25 +145,6 @@ if test "X-gfortran" = "X-$f9x_vendor"; then # Version-specific warnings # ############################# - # gfortran 4.3 (nothing new) - - # gfortran >= 4.4 - if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 4; then - H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.4)" - fi - - # gfortran >= 4.5 - if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 5; then - H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.5)" - fi - - # gfortran 4.6 (nothing new) - - # gfortran >= 4.7 - if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 7; then - H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.7)" - fi - # gfortran >= 4.8 if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 8; then H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.8)" diff --git a/config/gnu-flags b/config/gnu-flags index 7e69ede..7cf90b8 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -188,84 +188,33 @@ if test "X-gcc" = "X-$cc_vendor"; then # General # ########### - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -gt 4; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" - fi + # Add various general warning flags in gnu-warnings for gcc versions 4.8 and later. if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" - fi ###################### # Developer warnings # ###################### - NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general) - DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general) + NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general) + DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general) + + fi ####################### # gcc 4 special cases # ####################### - # GCC 4.2 through 4.6 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.6)" - fi - - # GCC 4.2 through 4.3 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 3; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.3)" - fi - - # GCC 4.5 through 4.6 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -le 6; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5-4.6)" - fi - - # GCC 4.2 through 4.4 - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -a $cc_vers_major -eq 4 -a $cc_vers_minor -le 4; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.4)" - fi - - # GCC 4.2 through the end of GCC 4 series - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.2-4.last)" + # GCC 4.8 through the end of GCC 4 series + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8-4.last)" fi ############################# # Version-specific warnings # ############################# - # gcc >= 4.3 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 3; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.3)" - fi - - # gcc >= 4.4 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 4; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.4)" - fi - - # gcc >= 4.5 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 5; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.5)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.5)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.5)" - fi - - # gcc >= 4.6 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 6; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.6)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.6)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.6)" - fi - - # gcc >= 4.7 - if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 7; then - H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.7)" - DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-4.7)" - NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-4.7)" - fi - # gcc >= 4.8 if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 4.8)" diff --git a/config/gnu-warnings/4.2-4.3 b/config/gnu-warnings/4.2-4.3 deleted file mode 100644 index 1881797..0000000 --- a/config/gnu-warnings/4.2-4.3 +++ /dev/null @@ -1,3 +0,0 @@ -# -Wvolatile-register-var was later incorporated into -Wall and -# only needs to be specified explicitly for gcc 4.2-4.3 --Wvolatile-register-var diff --git a/config/gnu-warnings/4.2-4.4 b/config/gnu-warnings/4.2-4.4 deleted file mode 100644 index ec4876f..0000000 --- a/config/gnu-warnings/4.2-4.4 +++ /dev/null @@ -1,2 +0,0 @@ -# The non-valued form of -Wstrict-overflow is used in gcc 4.2-4.4 --Wstrict-overflow diff --git a/config/gnu-warnings/4.2-4.6 b/config/gnu-warnings/4.2-4.6 deleted file mode 100644 index 37df4ab..0000000 --- a/config/gnu-warnings/4.2-4.6 +++ /dev/null @@ -1,2 +0,0 @@ -# Disable warnings about using the 'long long' type w/ gcc 4.6 and earlier --Wno-long-long diff --git a/config/gnu-warnings/4.2-4.last b/config/gnu-warnings/4.2-4.last deleted file mode 100644 index 2db90fb..0000000 --- a/config/gnu-warnings/4.2-4.last +++ /dev/null @@ -1,3 +0,0 @@ -# -Wvla was later incorporated into -Wpedantic and -# only needs to be specified explicitly for gcc 4 --Wvla diff --git a/config/gnu-warnings/4.3 b/config/gnu-warnings/4.3 deleted file mode 100644 index 13d8558..0000000 --- a/config/gnu-warnings/4.3 +++ /dev/null @@ -1,2 +0,0 @@ --Wlarger-than=2560 --Wlogical-op diff --git a/config/gnu-warnings/4.4 b/config/gnu-warnings/4.4 deleted file mode 100644 index 42929b5..0000000 --- a/config/gnu-warnings/4.4 +++ /dev/null @@ -1,3 +0,0 @@ --Wframe-larger-than=16384 --Wpacked-bitfield-compat --Wsync-nand diff --git a/config/gnu-warnings/4.5 b/config/gnu-warnings/4.5 deleted file mode 100644 index ddb96df..0000000 --- a/config/gnu-warnings/4.5 +++ /dev/null @@ -1 +0,0 @@ --Wstrict-overflow=5 diff --git a/config/gnu-warnings/4.5-4.6 b/config/gnu-warnings/4.5-4.6 deleted file mode 100644 index d3035fe..0000000 --- a/config/gnu-warnings/4.5-4.6 +++ /dev/null @@ -1,3 +0,0 @@ -# -Wstrict-aliasing was later incorporated into -Wall and -# only needs to be specified explicitly for gcc 4.5-4.6 --Wstrict-aliasing diff --git a/config/gnu-warnings/4.6 b/config/gnu-warnings/4.6 deleted file mode 100644 index 140a20c..0000000 --- a/config/gnu-warnings/4.6 +++ /dev/null @@ -1,2 +0,0 @@ --Wdouble-promotion --Wtrampolines diff --git a/config/gnu-warnings/4.7 b/config/gnu-warnings/4.7 deleted file mode 100644 index c47fe4b..0000000 --- a/config/gnu-warnings/4.7 +++ /dev/null @@ -1,5 +0,0 @@ -# -# -Wstack-usage=8192 warnings need to be swept up on a branch so -# that we can stop burdening the whole development team. -# --Wstack-usage=8192 diff --git a/config/gnu-warnings/4.8 b/config/gnu-warnings/4.8 index 5dc577f..c7e3dd1 100644 --- a/config/gnu-warnings/4.8 +++ b/config/gnu-warnings/4.8 @@ -1 +1,25 @@ +# warning flags added for GCC >= 4.3 +-Wlarger-than=2560 +-Wlogical-op + +# warning flags added for GCC >= 4.4 +-Wframe-larger-than=16384 +-Wpacked-bitfield-compat +-Wsync-nand + +# warning flag added for GCC >= 4.5 +-Wstrict-overflow=5 + +# warning flags added for GCC >= 4.6 +-Wdouble-promotion +-Wtrampolines + +# warning flag added for GCC >= 4.7 +# +# -Wstack-usage=8192 warnings need to be swept up on a branch so +# that we can stop burdening the whole development team. +# +-Wstack-usage=8192 + +# warning flag added for GCC >= 4.8 -Wmaybe-uninitialized diff --git a/config/gnu-warnings/4.8-4.last b/config/gnu-warnings/4.8-4.last new file mode 100644 index 0000000..2db90fb --- /dev/null +++ b/config/gnu-warnings/4.8-4.last @@ -0,0 +1,3 @@ +# -Wvla was later incorporated into -Wpedantic and +# only needs to be specified explicitly for gcc 4 +-Wvla diff --git a/config/gnu-warnings/developer-4.5 b/config/gnu-warnings/developer-4.5 deleted file mode 100644 index 48df846..0000000 --- a/config/gnu-warnings/developer-4.5 +++ /dev/null @@ -1,7 +0,0 @@ -# -# -Wjump-misses-init makes lots of noise for a questionable benefit. -# Can jumping over an initialization in C cause any harm, if -# the variable is never *used* before it has been initialized? -# --Wjump-misses-init --Wunsuffixed-float-constants diff --git a/config/gnu-warnings/developer-4.6 b/config/gnu-warnings/developer-4.6 deleted file mode 100644 index 2372fbf..0000000 --- a/config/gnu-warnings/developer-4.6 +++ /dev/null @@ -1 +0,0 @@ --Wsuggest-attribute=const diff --git a/config/gnu-warnings/developer-4.7 b/config/gnu-warnings/developer-4.7 deleted file mode 100644 index a3b0781..0000000 --- a/config/gnu-warnings/developer-4.7 +++ /dev/null @@ -1,7 +0,0 @@ --Wsuggest-attribute=noreturn --Wsuggest-attribute=pure -# -# It's not clear that -Wvector-operation-performance warnings are -# actionable, so they are demoted to "developer" warnings. -# --Wvector-operation-performance diff --git a/config/gnu-warnings/developer-4.8 b/config/gnu-warnings/developer-4.8 index b0109e2..fd76f6c 100644 --- a/config/gnu-warnings/developer-4.8 +++ b/config/gnu-warnings/developer-4.8 @@ -1 +1,23 @@ +# developer warning flags added for GCC >= 4.5 +# +# -Wjump-misses-init makes lots of noise for a questionable benefit. +# Can jumping over an initialization in C cause any harm, if +# the variable is never *used* before it has been initialized? +# +-Wjump-misses-init +-Wunsuffixed-float-constants + +# developer warning flag added for GCC >= 4.6 +-Wsuggest-attribute=const + +# developer warning flags added for GCC >= 4.7 +-Wsuggest-attribute=noreturn +-Wsuggest-attribute=pure +# +# It's not clear that -Wvector-operation-performance warnings are +# actionable, so they are demoted to "developer" warnings. +# +-Wvector-operation-performance + +# developer warning flag added for GCC >= 4.8 -Wsuggest-attribute=format diff --git a/config/gnu-warnings/gfort-4.4 b/config/gnu-warnings/gfort-4.4 deleted file mode 100644 index 59fe9a2..0000000 --- a/config/gnu-warnings/gfort-4.4 +++ /dev/null @@ -1,2 +0,0 @@ --Warray-temporaries --Wintrinsics-std \ No newline at end of file diff --git a/config/gnu-warnings/gfort-4.5 b/config/gnu-warnings/gfort-4.5 deleted file mode 100644 index 4490d4e..0000000 --- a/config/gnu-warnings/gfort-4.5 +++ /dev/null @@ -1 +0,0 @@ --Wimplicit-procedure diff --git a/config/gnu-warnings/gfort-4.7 b/config/gnu-warnings/gfort-4.7 deleted file mode 100644 index a7532bb..0000000 --- a/config/gnu-warnings/gfort-4.7 +++ /dev/null @@ -1,2 +0,0 @@ --Wreal-q-constant --Wfunction-elimination diff --git a/config/gnu-warnings/gfort-4.8 b/config/gnu-warnings/gfort-4.8 index 1b96a51..9d880de 100644 --- a/config/gnu-warnings/gfort-4.8 +++ b/config/gnu-warnings/gfort-4.8 @@ -1,3 +1,15 @@ +# warning flags added for gfortran >= 4.4 +-Warray-temporaries +-Wintrinsics-std + +# warning flag added for gfortran >= 4.5 +-Wimplicit-procedure + +# warning flags added for gfortran >= 4.7 +-Wreal-q-constant +-Wfunction-elimination + +# warning flags added for gfortran >= 4.8 -Wrealloc-lhs -Wrealloc-lhs-all # Turn off warnings for passing non-ANSI types to BIND(). diff --git a/config/gnu-warnings/no-developer-4.5 b/config/gnu-warnings/no-developer-4.5 deleted file mode 100644 index ef7d38f..0000000 --- a/config/gnu-warnings/no-developer-4.5 +++ /dev/null @@ -1 +0,0 @@ --Wno-unsuffixed-float-constants diff --git a/config/gnu-warnings/no-developer-4.6 b/config/gnu-warnings/no-developer-4.6 deleted file mode 100644 index ea9cc66..0000000 --- a/config/gnu-warnings/no-developer-4.6 +++ /dev/null @@ -1 +0,0 @@ --Wno-suggest-attribute=const diff --git a/config/gnu-warnings/no-developer-4.7 b/config/gnu-warnings/no-developer-4.7 deleted file mode 100644 index 5b85e1f..0000000 --- a/config/gnu-warnings/no-developer-4.7 +++ /dev/null @@ -1,2 +0,0 @@ --Wno-suggest-attribute=noreturn --Wno-suggest-attribute=pure diff --git a/config/gnu-warnings/no-developer-4.8 b/config/gnu-warnings/no-developer-4.8 index e42e09f..1e29c78 100644 --- a/config/gnu-warnings/no-developer-4.8 +++ b/config/gnu-warnings/no-developer-4.8 @@ -1 +1,13 @@ +# no-developer warning flag added for GCC >= 4.5 +-Wno-jump-misses-init +-Wno-unsuffixed-float-constants + +# no-developer warning flag added for GCC >= 4.6 +-Wno-suggest-attribute=const + +# no-developer warning flags added for GCC >= 4.7 +-Wno-suggest-attribute=noreturn +-Wno-suggest-attribute=pure + +# no-developer warning flag added for GCC >= 4.8 -Wno-suggest-attribute=format -- cgit v0.12 From 60244c54fcf74e6635aadf7badf0bed4dd92a635 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 20 May 2020 09:12:43 -0500 Subject: Update MANIFEST for removal of older warnings files. --- MANIFEST | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/MANIFEST b/MANIFEST index 46b4f01..d9d8ab8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -149,16 +149,7 @@ ./config/clang-warnings/error-general ./config/clang-warnings/general ./config/clang-warnings/no-developer-general -./config/gnu-warnings/4.2-4.3 -./config/gnu-warnings/4.2-4.4 -./config/gnu-warnings/4.2-4.6 -./config/gnu-warnings/4.2-4.last -./config/gnu-warnings/4.3 -./config/gnu-warnings/4.4 -./config/gnu-warnings/4.5 -./config/gnu-warnings/4.5-4.6 -./config/gnu-warnings/4.6 -./config/gnu-warnings/4.7 +./config/gnu-warnings/4.8-4.last ./config/gnu-warnings/4.8 ./config/gnu-warnings/4.9 ./config/gnu-warnings/5 @@ -171,9 +162,6 @@ ./config/gnu-warnings/cxx-5 ./config/gnu-warnings/cxx-error-5 ./config/gnu-warnings/cxx-error-general -./config/gnu-warnings/developer-4.5 -./config/gnu-warnings/developer-4.6 -./config/gnu-warnings/developer-4.7 ./config/gnu-warnings/developer-4.8 ./config/gnu-warnings/developer-7 ./config/gnu-warnings/developer-8 @@ -183,16 +171,10 @@ ./config/gnu-warnings/error-general ./config/gnu-warnings/general ./config/gnu-warnings/gfort-general -./config/gnu-warnings/gfort-4.4 -./config/gnu-warnings/gfort-4.5 -./config/gnu-warnings/gfort-4.7 ./config/gnu-warnings/gfort-4.8 ./config/gnu-warnings/gfort-5 ./config/gnu-warnings/gfort-6 ./config/gnu-warnings/gfort-8 -./config/gnu-warnings/no-developer-4.5 -./config/gnu-warnings/no-developer-4.6 -./config/gnu-warnings/no-developer-4.7 ./config/gnu-warnings/no-developer-4.8 ./config/gnu-warnings/no-developer-8 ./config/gnu-warnings/no-developer-general -- cgit v0.12 From 4cebd8aa6c965fe2e5dde6dbff36b2be3ca58bf1 Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 26 May 2020 10:43:20 -0500 Subject: Make examples installation respect DESTDIR. Fixes HDFFV-11060. --- c++/examples/Makefile.am | 4 ++-- examples/Makefile.am | 4 ++-- fortran/examples/Makefile.am | 4 ++-- hl/c++/examples/Makefile.am | 4 ++-- hl/examples/Makefile.am | 4 ++-- hl/fortran/examples/Makefile.am | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am index 0648504..cbec8f8 100644 --- a/c++/examples/Makefile.am +++ b/c++/examples/Makefile.am @@ -49,8 +49,8 @@ CXX_API=yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=$(examplesdir)/c++ -EXAMPLETOPDIR=$(examplesdir) +EXAMPLEDIR=${DESTDIR}$(examplesdir)/c++ +EXAMPLETOPDIR=${DESTDIR}$(examplesdir) # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/examples/Makefile.am b/examples/Makefile.am index b7850a7..c00f0b9 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -86,8 +86,8 @@ CHECK_CLEANFILES+=$(EXTLINK_DIRS) # Example directory # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=$(examplesdir)/c -EXAMPLETOPDIR=$(examplesdir) +EXAMPLEDIR=${DESTDIR}$(examplesdir)/c +EXAMPLETOPDIR=${DESTDIR}$(examplesdir) # List dependencies for each program. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index fb510bc..474126d 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -74,8 +74,8 @@ endif # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=$(examplesdir)/fortran -EXAMPLETOPDIR=$(examplesdir) +EXAMPLEDIR=${DESTDIR}$(examplesdir)/fortran +EXAMPLETOPDIR=${DESTDIR}$(examplesdir) # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/hl/c++/examples/Makefile.am b/hl/c++/examples/Makefile.am index 592e8da..7234bfc 100644 --- a/hl/c++/examples/Makefile.am +++ b/hl/c++/examples/Makefile.am @@ -33,8 +33,8 @@ CXX_API=yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=$(examplesdir)/hl/c++ -EXAMPLETOPDIR=$(examplesdir)/hl +EXAMPLEDIR=${DESTDIR}$(examplesdir)/hl/c++ +EXAMPLETOPDIR=${DESTDIR}$(examplesdir)/hl # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/hl/examples/Makefile.am b/hl/examples/Makefile.am index cc2d671..c9d90dd 100644 --- a/hl/examples/Makefile.am +++ b/hl/examples/Makefile.am @@ -25,8 +25,8 @@ endif # Example directory # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=$(examplesdir)/hl/c -EXAMPLETOPDIR=$(examplesdir)/hl +EXAMPLEDIR=${DESTDIR}$(examplesdir)/hl/c +EXAMPLETOPDIR=${DESTDIR}$(examplesdir)/hl INSTALL_SCRIPT_FILES = run-hlc-ex.sh INSTALL_TOP_SCRIPT_FILES = run-hl-ex.sh diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index b81cc6f..32f279c 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -51,8 +51,8 @@ endif # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am -EXAMPLEDIR=$(examplesdir)/hl/fortran -EXAMPLETOPDIR=$(examplesdir)/hl +EXAMPLEDIR=${DESTDIR}$(examplesdir)/hl/fortran +EXAMPLETOPDIR=${DESTDIR}$(examplesdir)/hl # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it -- cgit v0.12 From 7a4d7da14a745333c4e8f3955a0afd9db70969c0 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 26 May 2020 15:39:39 -0500 Subject: Fix HDFFV-11053 Description: A superblock pointer was set to a temporary structure, as a kluge, and meant to be reset back to NULL after the processing was completed. However, in the case of failure before the completion, this setting caused the superblock pointer to be unpinned twice in the error recovery process. As a result, that generated a segfault in h5clear. The fix resets the superblock pointer to NULL after H5F__super_ext_remove_msg fails so that h5clear can fail properly. Note: After the fix, when built in debug mode, there will be an assertion failure with the user's file, which appeared to be corrupted: H5MM_final_sanity_check: Assertion `0 == H5MM_curr_alloc_bytes_s' failed. This did not happen on a good file or on the corrupted file with the library built in production mode. The un-freed memory were allocated during error recovery. Platforms tested: Linux/64 (jelly) --- src/H5Fsuper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index e5d4cde..40e93ec 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -897,7 +897,11 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) } else { if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) + { + f->shared->sblock = NULL; + HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") + } if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") -- cgit v0.12 From 03ab219996e562502e90c508e669141b0e601e54 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 26 May 2020 14:01:09 -0700 Subject: Removed trailing space from Fortran files. --- config/cmake/HDFCXXCompilerFlags.cmake | 2 +- fortran/src/H5Aff.F90 | 10 +- fortran/src/H5Dff.F90 | 50 +- fortran/src/H5Eff.F90 | 2 +- fortran/src/H5Fff.F90 | 8 +- fortran/src/H5Gff.F90 | 22 +- fortran/src/H5Iff.F90 | 20 +- fortran/src/H5Lff.F90 | 34 +- fortran/src/H5Off.F90 | 154 +- fortran/src/H5Pff.F90 | 2582 ++++++++++++++++---------------- fortran/src/H5Rff.F90 | 2 +- fortran/src/H5Sff.F90 | 94 +- fortran/src/H5Tff.F90 | 182 +-- fortran/src/H5VLff.F90 | 14 +- fortran/src/H5Zff.F90 | 4 +- fortran/src/H5_buildiface.F90 | 42 +- fortran/src/H5_ff.F90 | 76 +- fortran/src/H5f90global.F90 | 32 +- fortran/src/H5fortkit.F90 | 4 +- fortran/test/H5_test_buildiface.F90 | 16 +- fortran/test/fflush1.F90 | 2 +- fortran/test/fortranlib_test.F90 | 20 +- fortran/test/fortranlib_test_F03.F90 | 16 +- fortran/test/tH5A.F90 | 2 +- fortran/test/tH5A_1_8.F90 | 636 ++++---- fortran/test/tH5D.F90 | 114 +- fortran/test/tH5E_F03.F90 | 6 +- fortran/test/tH5F.F90 | 12 +- fortran/test/tH5F_F03.F90 | 28 +- fortran/test/tH5G_1_8.F90 | 582 +++---- fortran/test/tH5I.F90 | 20 +- fortran/test/tH5L_F03.F90 | 76 +- fortran/test/tH5MISC_1_8.F90 | 76 +- fortran/test/tH5O.F90 | 138 +- fortran/test/tH5O_F03.F90 | 30 +- fortran/test/tH5P.F90 | 138 +- fortran/test/tH5P_F03.F90 | 220 +-- fortran/test/tH5R.F90 | 14 +- fortran/test/tH5S.F90 | 4 +- fortran/test/tH5Sselect.F90 | 438 +++--- fortran/test/tH5T.F90 | 34 +- fortran/test/tH5T_F03.F90 | 608 ++++---- fortran/test/tH5VL.F90 | 4 +- fortran/test/tHDF5_F03.F90 | 2 +- fortran/test/tf.F90 | 30 +- fortran/test/vol_connector.F90 | 8 +- hl/fortran/src/H5DSff.F90 | 68 +- hl/fortran/src/H5HL_buildiface.F90 | 50 +- hl/fortran/src/H5IMff.F90 | 102 +- hl/fortran/src/H5LTff.F90 | 90 +- hl/fortran/src/H5TBff.F90 | 128 +- hl/fortran/test/tstds.F90 | 36 +- hl/fortran/test/tstlite.F90 | 16 +- hl/fortran/test/tsttable.F90 | 14 +- 54 files changed, 3556 insertions(+), 3556 deletions(-) diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 02bf5cd..8527327 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -85,7 +85,7 @@ if (NOT MSVC) list (APPEND H5_CXXFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings") endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) # add the general CXX flags for g++ compiler versions 4.8 and above. ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") diff --git a/fortran/src/H5Aff.F90 b/fortran/src/H5Aff.F90 index abfaae9..f514c37 100644 --- a/fortran/src/H5Aff.F90 +++ b/fortran/src/H5Aff.F90 @@ -344,7 +344,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN), VALUE :: attr_id END FUNCTION H5Aget_space END INTERFACE - + space_id = H5Aget_space(attr_id) hdferr = 0 @@ -389,7 +389,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN), VALUE :: attr_id END FUNCTION H5Aget_type END INTERFACE - + type_id = H5Aget_type(attr_id) hdferr = 0 @@ -508,7 +508,7 @@ CONTAINS ! Returns attribute name size, ! -1 if fail INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, ! of the attribute !***** INTEGER(HID_T) :: lapl_id_default @@ -1766,7 +1766,7 @@ CONTAINS ! up to 7 dimensions. ! ! Fortran2003 Interface: -!! SUBROUTINE H5Awrite_f(attr_id, memtype_id, buf, hdferr) +!! SUBROUTINE H5Awrite_f(attr_id, memtype_id, buf, hdferr) !! INTEGER(HID_T) , INTENT(IN) :: attr_id !! INTEGER(HID_T) , INTENT(IN) :: memtype_id !! TYPE(C_PTR) , INTENT(IN) :: buf @@ -1851,7 +1851,7 @@ CONTAINS ! REAL, REAL(KIND=C_DOUBLE) and CHARACTER buffers ! up to 7 dimensions. ! Fortran2003 Interface: -!! SUBROUTINE H5Aread_f(attr_id, memtype_id, buf, hdferr) +!! SUBROUTINE H5Aread_f(attr_id, memtype_id, buf, hdferr) !! INTEGER(HID_T) , INTENT(IN) :: attr_id !! INTEGER(HID_T) , INTENT(IN) :: memtype_id !! TYPE(C_PTR) , INTENT(INOUT) :: buf diff --git a/fortran/src/H5Dff.F90 b/fortran/src/H5Dff.F90 index ec73f60..7128698 100644 --- a/fortran/src/H5Dff.F90 +++ b/fortran/src/H5Dff.F90 @@ -86,7 +86,7 @@ #include MODULE H5D - + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR USE H5GLOBAL @@ -1088,7 +1088,7 @@ CONTAINS SUBROUTINE h5dget_offset_f(dset_id, offset, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HADDR_T), INTENT(OUT) :: offset + INTEGER(HADDR_T), INTENT(OUT) :: offset INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE @@ -1100,7 +1100,7 @@ CONTAINS END INTERFACE offset = h5dget_offset(dset_id) - + hdferr = 0 ! never returns a function error because C API never returns a function error. END SUBROUTINE h5dget_offset_f @@ -1164,7 +1164,7 @@ CONTAINS ! plist_id - Dataset access property list identifier ! hdferr - Returns 0 if successful and -1 if fails ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! April 13, 2009 ! @@ -1172,8 +1172,8 @@ CONTAINS SUBROUTINE h5dget_access_plist_f(dset_id, plist_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(OUT) :: plist_id - INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(OUT) :: plist_id + INTEGER , INTENT(OUT) :: hdferr !***** INTERFACE INTEGER FUNCTION h5dget_access_plist_c(dset_id, plist_id) BIND(C,NAME='h5dget_access_plist_c') @@ -1183,9 +1183,9 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: plist_id END FUNCTION h5dget_access_plist_c END INTERFACE - + hdferr = h5dget_access_plist_c(dset_id, plist_id) - + END SUBROUTINE h5dget_access_plist_f @@ -1295,7 +1295,7 @@ CONTAINS INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - + CALL h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), dims, hdferr, & mem_space_id, file_space_id, xfer_prp) @@ -1483,17 +1483,17 @@ CONTAINS !****s* H5D (F03)/h5dwrite_f_F03 ! -! NAME +! NAME ! h5dwrite_f_F03 ! ! PURPOSE -! Writes raw data from a dataset into a buffer. +! Writes raw data from a dataset into a buffer. ! ! Inputs: ! dset_id - Identifier of the dataset to write to. ! mem_type_id - Identifier of the memory datatype. ! buf - Buffer with data to be written to the file. -! +! ! Outputs: ! hdferr - Returns 0 if successful and -1 if fails ! @@ -1548,16 +1548,16 @@ CONTAINS !****s* H5D (F03)/h5dread_f_F03 ! -! NAME +! NAME ! h5dread_f_F03 ! ! PURPOSE -! Reads raw data from a dataset into a buffer. +! Reads raw data from a dataset into a buffer. ! ! Inputs: ! dset_id - Identifier of the dataset read from. ! mem_type_id - Identifier of the memory datatype. -! +! ! Outputs: ! buf - Buffer to receive data read from file. ! hdferr - Returns 0 if successful and -1 if fails @@ -1612,10 +1612,10 @@ CONTAINS END SUBROUTINE h5dread_ptr ! -! NAME +! NAME ! h5dfill_integer ! -! PURPOSE +! PURPOSE ! Fills dataspace elements with a fill value in a memory buffer. ! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes ! of the fillvalues and buffers are supported. Buffer and fillvalue @@ -1786,10 +1786,10 @@ CONTAINS END SUBROUTINE h5dfill_c_long_double #endif ! -! NAME +! NAME ! h5dfill_char ! -! PURPOSE +! PURPOSE ! Fills dataspace elements with a fill value in a memory buffer. ! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes ! of the fillvalues and buffers are supported. Buffer and fillvalue @@ -1835,15 +1835,15 @@ CONTAINS ! NAME ! h5dvlen_reclaim_f ! -! PURPOSE -! Reclaims VL datatype memory buffers. +! PURPOSE +! Reclaims VL datatype memory buffers. ! ! Inputs: ! -! type_id - Identifier of the datatype. -! space_id - Identifier of the dataspace. -! plist_id - Identifier of the property list used to create the buffer. -! buf - Pointer to the buffer to be reclaimed. +! type_id - Identifier of the datatype. +! space_id - Identifier of the dataspace. +! plist_id - Identifier of the property list used to create the buffer. +! buf - Pointer to the buffer to be reclaimed. ! ! Outputs: ! hdferr - Returns 0 if successful and -1 if fails diff --git a/fortran/src/H5Eff.F90 b/fortran/src/H5Eff.F90 index 435d967..1e94c7a 100644 --- a/fortran/src/H5Eff.F90 +++ b/fortran/src/H5Eff.F90 @@ -254,7 +254,7 @@ CONTAINS ! estack_id - Error stack identifier. ! func - Function to be called upon an error condition. ! client_data - Data passed to the error function -! +! ! Outputs: ! hdferr - Returns 0 if successful and -1 if fails ! diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90 index 62e8de8..d74400c 100644 --- a/fortran/src/H5Fff.F90 +++ b/fortran/src/H5Fff.F90 @@ -690,7 +690,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: obj_count END FUNCTION h5fget_obj_count_c END INTERFACE - + hdferr = h5fget_obj_count_c(file_id, obj_type, obj_count) ! Don't include objects created by H5open in the H5F_OBJ_ALL_F count @@ -929,7 +929,7 @@ CONTAINS ! h5fget_file_image_f ! ! PURPOSE -! Retrieves a copy of the image of an existing, open file. +! Retrieves a copy of the image of an existing, open file. ! ! INPUTS ! file_id - Target file identifier. @@ -939,7 +939,7 @@ CONTAINS ! OUTPUTS ! hdferr - error code: ! 0 on success and -1 on failure -! OPTIONAL PARAMETERS +! OPTIONAL PARAMETERS ! buf_size - Returns the size in bytes of the buffer required to store the file image, ! no data will be copied. ! @@ -1024,7 +1024,7 @@ CONTAINS hdferr = INT(h5fget_dset_no_attrs_hint_c(file_id, c_minimize)) - ! Transfer value of C C_BOOL type to Fortran LOGICAL + ! Transfer value of C C_BOOL type to Fortran LOGICAL minimize = c_minimize END SUBROUTINE h5fget_dset_no_attrs_hint_f diff --git a/fortran/src/H5Gff.F90 b/fortran/src/H5Gff.F90 index 0684508..942cc51 100644 --- a/fortran/src/H5Gff.F90 +++ b/fortran/src/H5Gff.F90 @@ -64,11 +64,11 @@ CONTAINS ! gcpl_id - Property list for group creation ! gapl_id - Property list for group access ! -! AUTHOR +! AUTHOR ! Elena Pourmal ! August 12, 1999 ! -! HISTORY +! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). March 5, 2001 @@ -668,7 +668,7 @@ CONTAINS !***** INTEGER :: namelen ! Lenghth of the current_name string INTEGER :: new_namelen ! Lenghth of the new_name string - + INTERFACE INTEGER FUNCTION h5gmove_c(loc_id, name, namelen, new_name, new_namelen) BIND(C,NAME='h5gmove_c') IMPORT :: C_CHAR @@ -680,7 +680,7 @@ CONTAINS INTEGER :: new_namelen END FUNCTION h5gmove_c END INTERFACE - + namelen = LEN(name) new_namelen = LEN(new_name) hdferr = h5gmove_c(loc_id, name, namelen, new_name, new_namelen) @@ -716,7 +716,7 @@ CONTAINS !***** INTEGER :: src_namelen ! Length of the current_name string INTEGER :: dst_namelen ! Lenghth of the new_name string - + INTERFACE INTEGER FUNCTION h5gmove2_c(src_loc_id, src_name, src_namelen, & dst_loc_id, dst_name, dst_namelen) BIND(C,NAME='h5gmove2_c') @@ -730,7 +730,7 @@ CONTAINS INTEGER :: dst_namelen END FUNCTION h5gmove2_c END INTERFACE - + src_namelen = LEN(src_name) dst_namelen = LEN(dst_name) hdferr = h5gmove2_c(src_loc_id, src_name, src_namelen, dst_loc_id, dst_name, dst_namelen) @@ -777,7 +777,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code !***** INTEGER :: namelen ! Lenghth of the current_name string - + INTERFACE INTEGER FUNCTION h5gget_linkval_c(loc_id, name, namelen, size, buffer) BIND(C,NAME='h5gget_linkval_c') IMPORT :: C_CHAR, SIZE_T @@ -789,7 +789,7 @@ CONTAINS CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buffer END FUNCTION h5gget_linkval_c END INTERFACE - + namelen = LEN(name) hdferr = h5gget_linkval_c(loc_id, name, namelen, size, buffer) END SUBROUTINE h5gget_linkval_f @@ -829,7 +829,7 @@ CONTAINS !***** INTEGER :: namelen ! Lenghth of the current_name string INTEGER :: commentlen ! Lenghth of the comment string - + INTERFACE INTEGER FUNCTION h5gset_comment_c(loc_id, name, namelen, & comment, commentlen) BIND(C,NAME='h5gset_comment_c') @@ -842,7 +842,7 @@ CONTAINS INTEGER :: commentlen END FUNCTION h5gset_comment_c END INTERFACE - + namelen = LEN(name) commentlen = LEN(comment) hdferr = h5gset_comment_c(loc_id, name, namelen, comment, commentlen) @@ -1004,7 +1004,7 @@ CONTAINS ! INPUTS ! group_id - Group identifier ! -! OUTPUTS +! OUTPUTS ! storage_type - Type of storage for links in group ! H5G_STORAGE_TYPE_COMPACT: Compact storage ! H5G_STORAGE_TYPE_DENSE: Indexed storage diff --git a/fortran/src/H5Iff.F90 b/fortran/src/H5Iff.F90 index 351dd4b..d9c3d49 100644 --- a/fortran/src/H5Iff.F90 +++ b/fortran/src/H5Iff.F90 @@ -38,7 +38,7 @@ !***** MODULE H5I - + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR USE H5GLOBAL @@ -305,10 +305,10 @@ CONTAINS ! Check if an ID is valid without producing an error message ! ! INPUTS -! id - identifier -! OUTPUTS +! id - identifier +! OUTPUTS ! valid - status of id as a valid identifier -! hdferr: - error code +! hdferr: - error code ! Success: 0 ! Failure: -1 ! @@ -318,26 +318,26 @@ CONTAINS ! SOURCE SUBROUTINE h5iis_valid_f(id, valid, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: id ! Identifier + INTEGER(HID_T), INTENT(IN) :: id ! Identifier LOGICAL, INTENT(OUT) :: valid ! Status of id as a valid identifier INTEGER, INTENT(OUT) :: hdferr ! Error code !***** INTEGER :: c_valid ! 0 = .false, 1 = .true. - + INTERFACE INTEGER FUNCTION h5iis_valid_c(id, c_valid) BIND(C, NAME='h5iis_valid_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: id ! Identifier + INTEGER(HID_T), INTENT(IN) :: id ! Identifier INTEGER :: c_valid END FUNCTION h5iis_valid_c END INTERFACE - + hdferr = h5iis_valid_c(id, c_valid) - + valid = .FALSE. ! Default IF(c_valid.EQ.1) valid = .TRUE. - + END SUBROUTINE h5iis_valid_f END MODULE H5I diff --git a/fortran/src/H5Lff.F90 b/fortran/src/H5Lff.F90 index 66f5b5c..2901a16 100644 --- a/fortran/src/H5Lff.F90 +++ b/fortran/src/H5Lff.F90 @@ -64,10 +64,10 @@ MODULE H5L ! H5L_TYPE_HARD Hard link ! H5L_TYPE_SOFT Soft link ! H5L_TYPE_EXTERNAL External link -! H5L_TYPE_ERROR Error +! H5L_TYPE_ERROR Error !cset specifies the character set in which the link name is encoded. Valid values include the following: ! H5T_CSET_ASCII US ASCII -! H5T_CSET_UTF8 UTF-8 Unicode encoding +! H5T_CSET_UTF8 UTF-8 Unicode encoding CONTAINS @@ -593,7 +593,7 @@ CONTAINS ! link_loc_id - File or group identifier. ! link_name - Name of the link for which information is being sought ! -! OUTPUTS +! OUTPUTS ! NOTE: In C these are contained in the structure H5L_info_t ! ! cset - indicates the character set used for link’s name. @@ -605,8 +605,8 @@ CONTAINS ! H5L_TYPE_EXTERNAL_F - External link ! H5L_TYPE_ERROR_ F - Error ! token - If the link is a hard link, token specifies the object token that the link points to -! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., -! the length of the name of the pointed-to object with a null terminator. +! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., +! the length of the name of the pointed-to object with a null terminator. ! hdferr - Returns 0 if successful and -1 if fails ! ! OPTIONAL PARAMETERS @@ -642,8 +642,8 @@ CONTAINS ! H5L_TYPE_EXTERNAL_F - External link ! H5L_TYPE_ERROR _F - Error TYPE(H5O_TOKEN_T_F), INTENT(OUT), TARGET :: token ! If the link is a hard link, token specifies the object token that the link points to - INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., - ! the length of the name of the pointed-to object with a null terminator. + INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., + ! the length of the name of the pointed-to object with a null terminator. INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list @@ -701,13 +701,13 @@ CONTAINS ! order - Order within field or index ! n - Link for which to retrieve information ! -! OUTPUTS +! OUTPUTS ! NOTE: In C these are defined as a structure: H5L_info_t ! corder_valid - Indicates whether the creation order data is valid for this attribute ! corder - Is a positive integer containing the creation order of the attribute -! cset - Indicates the character set used for the attribute’s name +! cset - Indicates the character set used for the attribute’s name ! token - If the link is a hard link, token specifies the object token that the link points to -! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., +! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., ! the length of the name of the pointed-to object with a null terminator. ! hdferr - Returns 0 if successful and -1 if fails ! @@ -723,13 +723,13 @@ CONTAINS ! H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F ! to ! H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F -! MSB January 8, 2010. +! MSB January 8, 2010. ! ! SOURCE SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, & link_type, f_corder_valid, corder, cset, token, val_size, hdferr, lapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order ! H5_INDEX_UNKNOWN_F - Unknown index type @@ -747,12 +747,12 @@ CONTAINS ! H5L_TYPE_SOFT_F - Soft link ! H5L_TYPE_EXTERNAL_F - External link ! H5L_TYPE_ERROR _F - Error - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute + LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name TYPE(H5O_TOKEN_T_F), INTENT(OUT), TARGET :: token ! If the link is a hard link, token specifies the object token that the link points to - INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., - ! the length of the name of the pointed-to object with a null terminator. + INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., + ! the length of the name of the pointed-to object with a null terminator. INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list @@ -1426,11 +1426,11 @@ CONTAINS USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name + CHARACTER(LEN=*), INTENT(IN) :: group_name INTEGER , INTENT(IN) :: index_type INTEGER , INTENT(IN) :: order INTEGER(HSIZE_T), INTENT(INOUT) :: idx - TYPE(C_FUNPTR) , INTENT(IN) :: op + TYPE(C_FUNPTR) , INTENT(IN) :: op TYPE(C_PTR) , INTENT(IN) :: op_data INTEGER , INTENT(OUT) :: return_value INTEGER , INTENT(OUT) :: hdferr diff --git a/fortran/src/H5Off.F90 b/fortran/src/H5Off.F90 index fb17942..d3b02e5 100644 --- a/fortran/src/H5Off.F90 +++ b/fortran/src/H5Off.F90 @@ -92,7 +92,7 @@ MODULE H5O END TYPE space_t TYPE, BIND(C) :: mesg_t - INTEGER(c_int64_t) :: present ! Flags to indicate presence of message type in header + INTEGER(c_int64_t) :: present ! Flags to indicate presence of message type in header INTEGER(c_int64_t) :: shared ! Flags to indicate message type is shared in header END TYPE mesg_t @@ -341,13 +341,13 @@ CONTAINS END SUBROUTINE h5oopen_by_token_f ! !****s* H5O/h5ocopy_f -! NAME -! h5ocopy_f +! NAME +! h5ocopy_f ! ! PURPOSE ! Copies an object in an HDF5 file. ! -! Inputs: +! Inputs: ! src_loc_id - Object identifier indicating the location of the source object to be copied. ! src_name - Name of the source object to be copied. ! dst_loc_id - Location identifier specifying the destination. @@ -357,13 +357,13 @@ CONTAINS ! ocpypl_id - Object copy property list. ! lcpl_id - Link creation property list for the new hard link. ! -! Outputs: +! Outputs: ! hdferr - Returns 0 if successful and -1 if fails. ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! March 14, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5ocopy_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr, ocpypl_id, lcpl_id) IMPLICIT NONE @@ -411,22 +411,22 @@ CONTAINS END SUBROUTINE h5ocopy_f !****s* H5O/h5odecr_refcount_f -! NAME +! NAME ! h5odecr_refcount_f ! ! PURPOSE -! Decrements an object reference count. +! Decrements an object reference count. ! -! Inputs: +! Inputs: ! object_id - Object identifier. ! -! Outputs: +! Outputs: ! hdferr - Returns 0 if successful and -1 if fails. ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! May 11, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5odecr_refcount_f(object_id, hdferr) IMPLICIT NONE @@ -442,33 +442,33 @@ CONTAINS END FUNCTION h5odecr_refcount_c END INTERFACE - hdferr = h5odecr_refcount_c(object_id) + hdferr = h5odecr_refcount_c(object_id) END SUBROUTINE h5odecr_refcount_f !****s* H5O/h5oexists_by_name_f -! NAME +! NAME ! h5oexists_by_name_f ! ! PURPOSE ! Determines whether a link resolves to an actual object. ! ! Inputs: -! loc_id - Identifier of the file or group to query. -! name - The name of the link to check. -! +! loc_id - Identifier of the file or group to query. +! name - The name of the link to check. +! ! ! Optional parameters: ! lapl_id - Link access property list identifier. ! -! Outputs: +! Outputs: ! link_exists - Existing link resolves to an object. ! hdferr - Returns 0 if successful and -1 if fails. ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! May 11, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5oexists_by_name_f(loc_id, name, link_exists, hdferr, lapl_id) IMPLICIT NONE @@ -498,7 +498,7 @@ CONTAINS END INTERFACE namelen = LEN(name) - + lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id @@ -517,11 +517,11 @@ CONTAINS END SUBROUTINE h5oexists_by_name_f !****s* H5O/h5oget_comment_f -! NAME +! NAME ! h5oget_comment_f ! ! PURPOSE -! Retrieves comment for specified object. +! Retrieves comment for specified object. ! ! Inputs: ! obj_id - Identifier for the target object. @@ -529,21 +529,21 @@ CONTAINS ! Optional parameters: ! bufsize - Size of the comment buffer. ! -! Outputs: +! Outputs: ! comment - The comment. ! hdferr - Returns 0 if successful and -1 if fails. ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! May 11, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5oget_comment_f(obj_id, comment, hdferr, bufsize) IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: obj_id CHARACTER(LEN=*) , INTENT(OUT) :: comment INTEGER , INTENT(OUT) :: hdferr - INTEGER(HSSIZE_T), INTENT(OUT), OPTIONAL :: bufsize + INTEGER(HSSIZE_T), INTENT(OUT), OPTIONAL :: bufsize !***** INTEGER(SIZE_T) :: commentsize_default @@ -565,13 +565,13 @@ CONTAINS commentsize_default = LEN(comment) hdferr = h5oget_comment_c(obj_id, comment, commentsize_default, bufsize_default) - + IF(PRESENT(bufsize)) bufsize = bufsize_default END SUBROUTINE h5oget_comment_f !****s* H5O/h5oget_comment_by_name_f -! NAME +! NAME ! h5oget_comment_by_name_f ! ! PURPOSE @@ -579,20 +579,20 @@ CONTAINS ! ! Inputs: ! loc_id - Identifier of a file, group, dataset, or named datatype. -! name - Name of the object whose comment is to be retrieved, -! specified as a path relative to loc_id. +! name - Name of the object whose comment is to be retrieved, +! specified as a path relative to loc_id. ! ! Optional parameters: ! bufsize - Size of the comment buffer. ! -! Outputs: +! Outputs: ! comment - The comment. ! hdferr - Returns 0 if successful and -1 if fails. ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! July 6, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5oget_comment_by_name_f(loc_id, name, comment, hdferr, bufsize, lapl_id) IMPLICIT NONE @@ -600,8 +600,8 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name CHARACTER(LEN=*), INTENT(OUT) :: comment INTEGER , INTENT(OUT) :: hdferr - INTEGER(SIZE_T) , INTENT(OUT), OPTIONAL :: bufsize - INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id + INTEGER(SIZE_T) , INTENT(OUT), OPTIONAL :: bufsize + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id !***** INTEGER(SIZE_T) :: commentsize_default @@ -632,28 +632,28 @@ CONTAINS hdferr = h5oget_comment_by_name_c(loc_id, name, name_size, & comment, commentsize_default, bufsize_default, lapl_id_default) - + IF(PRESENT(bufsize)) bufsize = bufsize_default END SUBROUTINE h5oget_comment_by_name_f !****s* H5O/h5oincr_refcount_f -! NAME +! NAME ! h5oincr_refcount_f ! ! PURPOSE ! Increments an object reference count. ! -! Inputs: +! Inputs: ! obj_id - Object identifier. ! -! Outputs: +! Outputs: ! hdferr - Returns 0 if successful and -1 if fails. ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! May 15, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5oincr_refcount_f(obj_id, hdferr) IMPLICIT NONE @@ -669,7 +669,7 @@ CONTAINS END FUNCTION h5oincr_refcount_c END INTERFACE - hdferr = h5oincr_refcount_c(obj_id) + hdferr = h5oincr_refcount_c(obj_id) END SUBROUTINE h5oincr_refcount_f @@ -679,7 +679,7 @@ CONTAINS ! h5oopen_by_idx_f ! ! PURPOSE -! Open the nth object in a group. +! Open the nth object in a group. ! ! Inputs: ! loc_id - A file or group identifier. @@ -714,7 +714,7 @@ CONTAINS !***** INTEGER(SIZE_T) :: group_namelen INTEGER(HID_T) :: lapl_id_default - + INTERFACE INTEGER FUNCTION h5oopen_by_idx_c(loc_id, group_name, group_namelen, index_type, order, n, obj_id, lapl_id_default) & BIND(C,NAME='h5oopen_by_idx_c') @@ -743,23 +743,23 @@ CONTAINS END SUBROUTINE H5Oopen_by_idx_f !****s* H5O/h5oset_comment_f -! NAME +! NAME ! h5oset_comment_f ! ! PURPOSE ! Sets comment for specified object. ! -! Inputs: +! Inputs: ! obj_id - Identifier of the target object. ! comment - The new comment. ! -! Outputs: +! Outputs: ! hdferr - Returns 0 if successful and -1 if fails. ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! May 15, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5oset_comment_f(obj_id, comment, hdferr) IMPLICIT NONE @@ -782,34 +782,34 @@ CONTAINS END INTERFACE commentlen = LEN(comment) - + hdferr = h5oset_comment_c(obj_id, comment, commentlen) END SUBROUTINE h5oset_comment_f !****s* H5O/h5oset_comment_by_name_f -! NAME +! NAME ! h5oset_comment_by_name_f ! ! PURPOSE -! Sets comment for specified object. +! Sets comment for specified object. ! -! Inputs: +! Inputs: ! loc_id - Identifier of a file, group, dataset, or named datatype. -! name - Name of the object whose comment is to be set or reset, -! specified as a path relative to loc_id. +! name - Name of the object whose comment is to be set or reset, +! specified as a path relative to loc_id. ! comment - The new comment. ! -! Outputs: +! Outputs: ! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: ! lapl_id - Link access property list identifier. ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! May 15, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5oset_comment_by_name_f(loc_id, name, comment, hdferr, lapl_id) IMPLICIT NONE @@ -843,7 +843,7 @@ CONTAINS lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - + hdferr = h5oset_comment_by_name_c(loc_id, name, namelen, comment, commentlen, lapl_id_default) END SUBROUTINE h5oset_comment_by_name_f @@ -869,7 +869,7 @@ CONTAINS ! op_data - User-defined pointer to data required by the application for its processing of the group ! ! Outputs: -! return_value - returns the return value of the first operator that returns a positive value, or +! return_value - returns the return value of the first operator that returns a positive value, or ! zero if all members were processed with no operator returning non-zero. ! hdferr - Returns 0 if successful and -1 if fails ! @@ -884,14 +884,14 @@ CONTAINS SUBROUTINE h5ovisit_f(object_id, index_type, order, op, op_data, return_value, hdferr, fields) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: index_type INTEGER, INTENT(IN) :: order TYPE(C_FUNPTR):: op TYPE(C_PTR) :: op_data INTEGER, INTENT(OUT) :: return_value INTEGER, INTENT(OUT) :: hdferr - INTEGER, INTENT(IN), OPTIONAL :: fields + INTEGER, INTENT(IN), OPTIONAL :: fields !***** INTEGER :: fields_c @@ -932,11 +932,11 @@ CONTAINS ! Retrieves the metadata for an object, identifying the object by location and relative name. ! ! Inputs: -! loc_id - File or group identifier specifying location of group +! loc_id - File or group identifier specifying location of group ! in which object is located. ! name - Name of group, relative to loc_id. ! -! Outputs: +! Outputs: ! object_info - Buffer in which to return object information. ! hdferr - Returns 0 if successful and -1 if fails. ! @@ -956,13 +956,13 @@ CONTAINS TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info INTEGER , INTENT(OUT) :: hdferr INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id - INTEGER , INTENT(IN) , OPTIONAL :: fields + INTEGER , INTENT(IN) , OPTIONAL :: fields !***** INTEGER(SIZE_T) :: namelen INTEGER(HID_T) :: lapl_id_default TYPE(C_PTR) :: ptr INTEGER :: fields_c - + INTERFACE INTEGER FUNCTION h5oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, object_info, fields) & BIND(C, NAME='h5oget_info_by_name_c') @@ -1022,7 +1022,7 @@ CONTAINS INTEGER(HID_T) , INTENT(IN) :: object_id TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info INTEGER , INTENT(OUT) :: hdferr - INTEGER , INTENT(IN), OPTIONAL :: fields + INTEGER , INTENT(IN), OPTIONAL :: fields !***** TYPE(C_PTR) :: ptr INTEGER :: fields_c @@ -1056,14 +1056,14 @@ CONTAINS ! Retrieves the metadata for an object, identifying the object by an index position. ! ! Inputs: -! loc_id - File or group identifier specifying location of group +! loc_id - File or group identifier specifying location of group ! in which object is located. ! group_name - Name of group in which object is located. ! index_field - Index or field that determines the order. ! order - Order within field or index. ! n - Object for which information is to be returned ! -! Outputs: +! Outputs: ! object_info - Buffer in which to return object information. ! hdferr - Returns 0 if successful and -1 if fails. ! @@ -1089,13 +1089,13 @@ CONTAINS TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info INTEGER , INTENT(OUT) :: hdferr INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id - INTEGER , INTENT(IN) , OPTIONAL :: fields + INTEGER , INTENT(IN) , OPTIONAL :: fields !***** INTEGER(SIZE_T) :: namelen INTEGER(HID_T) :: lapl_id_default TYPE(C_PTR) :: ptr INTEGER :: fields_c - + INTERFACE INTEGER FUNCTION h5oget_info_by_idx_c(loc_id, group_name, namelen, & index_field, order, n, lapl_id_default, object_info, fields) BIND(C, NAME='h5oget_info_by_idx_c') @@ -1137,7 +1137,7 @@ CONTAINS ! ! Inputs: ! loc_id - Identifier of a file or group. -! object_name - Name of the object, generally relative to loc_id, that will serve as root of the iteration +! object_name - Name of the object, generally relative to loc_id, that will serve as root of the iteration ! index_type - Type of index; valid values include: ! H5_INDEX_NAME_F ! H5_INDEX_CRT_ORDER_F @@ -1149,7 +1149,7 @@ CONTAINS ! op_data - User-defined pointer to data required by the application for its processing of the group ! ! Outputs: -! return_value - Returns the return value of the first operator that returns a positive value, or +! return_value - Returns the return value of the first operator that returns a positive value, or ! zero if all members were processed with no operator returning non-zero. ! hdferr - Returns 0 if successful and -1 if fails ! @@ -1167,7 +1167,7 @@ CONTAINS IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: object_name - INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: index_type INTEGER , INTENT(IN) :: order TYPE(C_FUNPTR) :: op @@ -1175,7 +1175,7 @@ CONTAINS INTEGER , INTENT(OUT) :: return_value INTEGER , INTENT(OUT) :: hdferr INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id - INTEGER , INTENT(IN) , OPTIONAL :: fields + INTEGER , INTENT(IN) , OPTIONAL :: fields !***** INTEGER(SIZE_T) :: namelen diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 883e49a..7e06cf3 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -141,7 +141,7 @@ MODULE H5P BIND(C, NAME='h5pget_c') IMPORT :: c_char, c_ptr IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER :: name_len TYPE(C_PTR), VALUE :: value @@ -178,12 +178,12 @@ MODULE H5P CONTAINS -!****s* H5P/h5pcreate_f +!****s* H5P/h5pcreate_f ! NAME -! h5pcreate_f +! h5pcreate_f ! ! PURPOSE -! Creates a new property as an instance of a property +! Creates a new property as an instance of a property ! list class. ! ! INPUTS @@ -208,18 +208,18 @@ CONTAINS ! ! OUTPUTS ! prp_id - property list identifier -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 +! port). March 14, 2001 ! ! Fortran90 Interface: SUBROUTINE h5pcreate_f(class, prp_id, hdferr) @@ -238,15 +238,15 @@ CONTAINS END FUNCTION h5pcreate_c END INTERFACE - hdferr = h5pcreate_c(class, prp_id) + hdferr = h5pcreate_c(class, prp_id) END SUBROUTINE h5pcreate_f -!****s* H5P/h5pset_preserve_f +!****s* H5P/h5pset_preserve_f ! NAME -! h5pset_preserve_f +! h5pset_preserve_f ! ! PURPOSE -! Sets the dataset transfer property list status to +! Sets the dataset transfer property list status to ! TRUE or FALSE for initializing compound datatype ! members during write/read operations. ! @@ -262,20 +262,20 @@ CONTAINS ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Datatype of the flag parameter is changed from +! port). March 14, 2001 +! +! Datatype of the flag parameter is changed from ! INTEGER to LOGICAL June 4, 2003 ! ! Fortran90 Interface: SUBROUTINE h5pset_preserve_f(prp_id, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier LOGICAL, INTENT(IN) :: flag ! TRUE/FALSE flag to set the dataset ! transfer property for partila writing/reading ! compound datatype @@ -295,12 +295,12 @@ CONTAINS END INTERFACE flag_c = 0 IF(flag) flag_c = 1 - hdferr = h5pset_preserve_c(prp_id, flag_c) + hdferr = h5pset_preserve_c(prp_id, flag_c) END SUBROUTINE h5pset_preserve_f -!****s* H5P/h5pget_preserve_f +!****s* H5P/h5pget_preserve_f ! NAME -! h5pget_preserve_f +! h5pget_preserve_f ! ! PURPOSE ! Checks status of the dataset transfer property list. @@ -310,26 +310,26 @@ CONTAINS ! ! OUTPUTS ! flag - status flag -! hdferr - error code +! hdferr - error code ! Success: 0 ! Failure: -1 ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). March 14, 2001 -! -! Datatype of the flag parameter is changed from -! INTEGER to LOGICAL -! June 4, 2003 -! +! +! Datatype of the flag parameter is changed from +! INTEGER to LOGICAL +! June 4, 2003 +! ! Fortran90 Interface: SUBROUTINE h5pget_preserve_f(prp_id, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag. Shows status of the dataset's ! transfer property for partial writing/reading ! compound datatype @@ -347,15 +347,15 @@ CONTAINS INTEGER :: flag_c END FUNCTION h5pget_preserve_c END INTERFACE - - hdferr = h5pget_preserve_c(prp_id, flag_c) + + hdferr = h5pget_preserve_c(prp_id, flag_c) flag = .FALSE. IF(flag_c .EQ. 1) flag = .TRUE. END SUBROUTINE h5pget_preserve_f -!****s* H5P/h5pget_class_f +!****s* H5P/h5pget_class_f ! NAME -! h5pget_class_f +! h5pget_class_f ! ! PURPOSE ! Returns the property list class for a property list. @@ -365,24 +365,24 @@ CONTAINS ! ! OUTPUTS ! classtype - property list class -! hdferr: - error code +! hdferr: - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 +! port). March 14, 2001 ! ! Fortran90 Interface: SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: classtype ! The type of the property list + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: classtype ! The type of the property list ! to be created. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -394,42 +394,42 @@ CONTAINS IMPORT :: HID_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(OUT) :: classtype + INTEGER(HID_T), INTENT(OUT) :: classtype END FUNCTION h5pget_class_c END INTERFACE - hdferr = h5pget_class_c(prp_id, classtype) + hdferr = h5pget_class_c(prp_id, classtype) END SUBROUTINE h5pget_class_f -!****s* H5P/h5pcopy_f +!****s* H5P/h5pcopy_f ! NAME -! h5pcopy_f +! h5pcopy_f ! ! PURPOSE -! Copies an existing property list to create a new +! Copies an existing property list to create a new ! property list ! ! INPUTS ! prp_id - property list identifier ! OUTPUTS ! new_prp_id - new property list identifier -! hdferr: - error code +! hdferr: - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). March 14, 2001 ! ! Fortran90 Interface: SUBROUTINE h5pcopy_f(prp_id, new_prp_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HID_T), INTENT(OUT) :: new_prp_id ! Identifier of property list INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -444,38 +444,38 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: new_prp_id END FUNCTION h5pcopy_c END INTERFACE - + hdferr = h5pcopy_c(prp_id, new_prp_id) END SUBROUTINE h5pcopy_f -!****s* H5P/h5pclose_f +!****s* H5P/h5pclose_f ! NAME -! h5pclose_f +! h5pclose_f ! ! PURPOSE -! Terminates access to a property list. +! Terminates access to a property list. ! ! INPUTS -! prp_id - identifier of the property list to -! terminate access to. +! prp_id - identifier of the property list to +! terminate access to. ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pclose_f(prp_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -484,45 +484,45 @@ CONTAINS BIND(C,NAME='h5pclose_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id END FUNCTION h5pclose_c END INTERFACE - + hdferr = h5pclose_c(prp_id) END SUBROUTINE h5pclose_f -!****s* H5P/h5pset_chunk_f +!****s* H5P/h5pset_chunk_f ! NAME -! h5pset_chunk_f +! h5pset_chunk_f ! ! PURPOSE -! Sets the size of the chunks used to store -! a chunked layout dataset. +! Sets the size of the chunks used to store +! a chunked layout dataset. ! ! INPUTS ! prp_id - datatset creation property list identifier ! ndims - number of dimensions for each chunk ! dims - array with dimension sizes for each chunk ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_chunk_f(prp_id, ndims, dims, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions - INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims + INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims ! Array containing sizes of ! chunk dimensions INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -538,16 +538,16 @@ CONTAINS INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims END FUNCTION h5pset_chunk_c END INTERFACE - + hdferr = h5pset_chunk_c(prp_id, ndims, dims) END SUBROUTINE h5pset_chunk_f -!****s* H5P/h5pget_chunk_f +!****s* H5P/h5pget_chunk_f ! NAME -! h5pget_chunk_f +! h5pget_chunk_f ! ! PURPOSE -! Retrieves the size of chunks for the raw data of a +! Retrieves the size of chunks for the raw data of a ! chunked layout dataset ! ! INPUTS @@ -555,26 +555,26 @@ CONTAINS ! ndims - size of dims array ! OUTPUTS ! dims - array with dimension sizes for each chunk -! hdferr - error code +! hdferr - error code ! Success: number of chunk dimensions ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_chunk_f(prp_id, ndims, dims, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions to ! to return - INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims + INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims ! Array containing sizes of ! chunk dimensions INTEGER, INTENT(OUT) :: hdferr ! Error code: @@ -596,19 +596,19 @@ CONTAINS hdferr = h5pget_chunk_c(prp_id, ndims, dims) END SUBROUTINE h5pget_chunk_f -!****s* H5P/h5pset_deflate_f +!****s* H5P/h5pset_deflate_f ! NAME -! h5pset_deflate_f +! h5pset_deflate_f ! ! PURPOSE -! Sets compression method and compression level. +! Sets compression method and compression level. ! ! INPUTS ! prp_id - property list identifier ! level - compression level ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 ! Failure: -1 ! @@ -617,15 +617,15 @@ CONTAINS ! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). March 14, 2001 -! +! ! Fortran90 Interface: SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: level ! Compression level + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: level ! Compression level INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -643,15 +643,15 @@ CONTAINS END FUNCTION h5pset_deflate_c END INTERFACE hdferr = h5pset_deflate_c(prp_id, level) - + END SUBROUTINE h5pset_deflate_f -!****s* H5P/h5pget_version_f +!****s* H5P/h5pget_version_f ! NAME -! h5pget_version_f +! h5pget_version_f ! ! PURPOSE -! Retrieves the version information of various objects +! Retrieves the version information of various objects ! for a file creation property list ! ! INPUTS @@ -661,24 +661,24 @@ CONTAINS ! freelist - global freelist version number ! stab - symbol table version number ! shhdr - shared object header version number -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: +! port). March 14, 2001 +! +! Fortran90 Interface: SUBROUTINE h5pget_version_f(prp_id, boot, freelist, & stab, shhdr, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, DIMENSION(:), INTENT(OUT) :: boot ! Array to put boot ! block version number INTEGER, DIMENSION(:), INTENT(OUT) :: freelist ! Array to put global @@ -698,19 +698,19 @@ CONTAINS IMPORT :: HID_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, DIMENSION(*), INTENT(OUT) :: boot - INTEGER, DIMENSION(*), INTENT(OUT) :: freelist + INTEGER, DIMENSION(*), INTENT(OUT) :: boot + INTEGER, DIMENSION(*), INTENT(OUT) :: freelist INTEGER, DIMENSION(*), INTENT(OUT) :: stab INTEGER, DIMENSION(*), INTENT(OUT) :: shhdr END FUNCTION h5pget_version_c END INTERFACE - + hdferr = h5pget_version_c(prp_id, boot, freelist, stab, shhdr) END SUBROUTINE h5pget_version_f -!****s* H5P/h5pset_userblock_f +!****s* H5P/h5pset_userblock_f ! NAME -! h5pset_userblock_f +! h5pset_userblock_f ! ! PURPOSE ! Sets user block size @@ -720,24 +720,24 @@ CONTAINS ! size - size of the user-block in bytes ! ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 +! port). March 14, 2001 ! ! Fortran90 Interface: SUBROUTINE h5pset_userblock_f (prp_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Size of the user-block in bytes + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Size of the user-block in bytes INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -754,38 +754,38 @@ CONTAINS hdferr = h5pset_userblock_c(prp_id, size) END SUBROUTINE h5pset_userblock_f -!****s* H5P/h5pget_userblock_f +!****s* H5P/h5pget_userblock_f ! NAME -! h5pget_userblock_f +! h5pget_userblock_f ! ! PURPOSE ! Gets user block size. ! ! INPUTS -! +! ! prp_id - file creation property list identifier ! OUTPUTS -! +! ! block_size - size of the user block in bytes -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_userblock_f(prp_id, block_size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: block_size ! Size of the - ! user-block in bytes + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: block_size ! Size of the + ! user-block in bytes INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -801,41 +801,41 @@ CONTAINS hdferr = h5pget_userblock_c(prp_id, block_size) END SUBROUTINE h5pget_userblock_f -!****s* H5P/h5pset_sizes_f +!****s* H5P/h5pset_sizes_f ! NAME -! h5pset_sizes_f +! h5pset_sizes_f ! ! PURPOSE -! Sets the byte size of the offsets and lengths used +! Sets the byte size of the offsets and lengths used ! to address objects in an HDF5 file. ! ! INPUTS ! prp_id - file creation property list identifier -! sizeof_addr - size of an object offset in bytes +! sizeof_addr - size of an object offset in bytes ! sizeof_size - size of an object length in bytes ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_sizes_f (prp_id, sizeof_addr, sizeof_size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr ! Size of an object - ! offset in bytes - INTEGER(SIZE_T), INTENT(IN) :: sizeof_size ! Size of an object - ! length in bytes + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr ! Size of an object + ! offset in bytes + INTEGER(SIZE_T), INTENT(IN) :: sizeof_size ! Size of an object + ! length in bytes INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -844,50 +844,50 @@ CONTAINS BIND(C,NAME='h5pset_sizes_c') IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr INTEGER(SIZE_T), INTENT(IN) :: sizeof_size END FUNCTION h5pset_sizes_c END INTERFACE - + hdferr = h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size) END SUBROUTINE h5pset_sizes_f -!****s* H5P/h5pget_sizes_f +!****s* H5P/h5pget_sizes_f ! NAME -! h5pget_sizes_f +! h5pget_sizes_f ! ! PURPOSE -! Retrieves the size of the offsets and lengths used +! Retrieves the size of the offsets and lengths used ! in an HDF5 file ! ! INPUTS ! prp_id - file creation property list identifier ! OUTPUTS -! -! sizeof_addr - size of an object offset in bytes +! +! sizeof_addr - size of an object offset in bytes ! sizeof_size - size of an object length in bytes -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_sizes_f(prp_id, sizeof_addr, sizeof_size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr ! Size of an object - ! offset in bytes + ! offset in bytes INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size ! Size of an object - ! length in bytes + ! length in bytes INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -896,49 +896,49 @@ CONTAINS BIND(C,NAME='h5pget_sizes_c') IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size END FUNCTION h5pget_sizes_c END INTERFACE - + hdferr = h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size) END SUBROUTINE h5pget_sizes_f -!****s* H5P/h5pset_sym_k_f +!****s* H5P/h5pset_sym_k_f ! NAME -! h5pset_sym_k_f +! h5pset_sym_k_f ! ! PURPOSE -! Sets the size of parameters used to control the +! Sets the size of parameters used to control the !symbol table nodes ! ! INPUTS -! +! ! prp_id - file creation property list identifier ! ik - symbol table tree rank ! lk - symbol table node size ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_sym_k_f (prp_id, ik, lk, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ik ! Symbol table tree rank - INTEGER, INTENT(IN) :: lk ! Symbol table node size + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ik ! Symbol table tree rank + INTEGER, INTENT(IN) :: lk ! Symbol table node size INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -947,46 +947,46 @@ CONTAINS BIND(C,NAME='h5pset_sym_k_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: ik INTEGER, INTENT(IN) :: lk END FUNCTION h5pset_sym_k_c END INTERFACE - + hdferr = h5pset_sym_k_c(prp_id, ik, lk) END SUBROUTINE h5pset_sym_k_f -!****s* H5P/h5pget_sym_k_f +!****s* H5P/h5pget_sym_k_f ! NAME -! h5pget_sym_k_f +! h5pget_sym_k_f ! ! PURPOSE ! Retrieves the size of the symbol table B-tree 1/2 rank -! and the symbol table leaf node 1/2 size. +! and the symbol table leaf node 1/2 size. ! ! INPUTS -! +! ! prp_id - file creation property list identifier ! OUTPUTS -! +! ! ik - symbol table tree 1/2 rank ! lk - symbol table node 1/2 size -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_sym_k_f(prp_id, ik, lk, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: ik ! Symbol table tree rank INTEGER, INTENT(OUT) :: lk ! Symbol table node size INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -997,45 +997,45 @@ CONTAINS BIND(C,NAME='h5pget_sym_k_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: ik INTEGER, INTENT(OUT) :: lk END FUNCTION h5pget_sym_k_c END INTERFACE - + hdferr = h5pget_sym_k_c(prp_id, ik, lk) END SUBROUTINE h5pget_sym_k_f -!****s* H5P/h5pset_istore_k_f +!****s* H5P/h5pset_istore_k_f ! NAME -! h5pset_istore_k_f +! h5pset_istore_k_f ! ! PURPOSE -! Sets the size of the parameter used to control the +! Sets the size of the parameter used to control the ! B-trees for indexing chunked datasets ! ! INPUTS -! +! ! prp_id - file creation property list identifier ! ik - 1/2 rank of chunked storage B-tree ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_istore_k_f (prp_id, ik, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: ik ! 1/2 rank of chunked storage B-tree INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1049,40 +1049,40 @@ CONTAINS INTEGER, INTENT(IN) :: ik END FUNCTION h5pset_istore_k_c END INTERFACE - + hdferr = h5pset_istore_k_c(prp_id, ik) END SUBROUTINE h5pset_istore_k_f -!****s* H5P/h5pget_istore_k_f +!****s* H5P/h5pget_istore_k_f ! NAME -! h5pget_istore_k_f +! h5pget_istore_k_f ! ! PURPOSE -! Queries the 1/2 rank of an indexed storage B-tree. +! Queries the 1/2 rank of an indexed storage B-tree. ! ! INPUTS -! +! ! prp_id - file creation property list identifier ! OUTPUTS -! +! ! ik - 1/2 rank of chunked storage B-tree -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_istore_k_f(prp_id, ik, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: ik ! 1/2 rank of chunked storage B-tree INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1096,41 +1096,41 @@ CONTAINS INTEGER, INTENT(OUT) :: ik END FUNCTION h5pget_istore_k_c END INTERFACE - + hdferr = h5pget_istore_k_c(prp_id, ik) END SUBROUTINE h5pget_istore_k_f -!****s* H5P/h5pget_driver_f +!****s* H5P/h5pget_driver_f ! NAME -! h5pget_driver_f +! h5pget_driver_f ! ! PURPOSE -! Returns low-lever driver identifier. +! Returns low-lever driver identifier. ! ! INPUTS -! -! prp_id - file access or data transfer property -! list identifier. +! +! prp_id - file access or data transfer property +! list identifier. ! OUTPUTS -! +! ! driver - low-level driver identifier -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_driver_f(prp_id, driver, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HID_T), INTENT(OUT) :: driver ! Low-level file driver identifier INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1144,39 +1144,39 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: driver END FUNCTION h5pget_driver_c END INTERFACE - + hdferr = h5pget_driver_c(prp_id, driver) END SUBROUTINE h5pget_driver_f -!****s* H5P/h5pset_fapl_stdio_f +!****s* H5P/h5pset_fapl_stdio_f ! NAME -! h5pset_fapl_stdio_f +! h5pset_fapl_stdio_f ! ! PURPOSE -! Sets the standard I/O driver. +! Sets the standard I/O driver. ! ! INPUTS -! +! ! prp_id - file access property list identifier ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_fapl_stdio_f (prp_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -1188,34 +1188,34 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: prp_id END FUNCTION h5pset_fapl_stdio_c END INTERFACE - + hdferr = h5pset_fapl_stdio_c(prp_id) END SUBROUTINE h5pset_fapl_stdio_f -!****s* H5P/h5pget_stdio_f +!****s* H5P/h5pget_stdio_f ! NAME -! h5pget_stdio_f +! h5pget_stdio_f ! ! PURPOSE ! NOT AVAILABLE ! ! INPUTS -! +! ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! SOURCE ! SUBROUTINE h5pget_stdio_f (prp_id, io, hdferr) ! @@ -1231,35 +1231,35 @@ CONTAINS ! hdferr = h5pget_stdio_c(prp_id, io) ! END SUBROUTINE h5pget_stdio_f -!****s* H5P/h5pset_fapl_sec2_f +!****s* H5P/h5pset_fapl_sec2_f ! NAME -! h5pset_fapl_sec2_f +! h5pset_fapl_sec2_f ! ! PURPOSE -! Sets the sec2 driver. +! Sets the sec2 driver. ! ! INPUTS -! +! ! prp_id - file access property list identifier ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_fapl_sec2_f (prp_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -1268,38 +1268,38 @@ CONTAINS BIND(C,NAME='h5pset_fapl_sec2_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier END FUNCTION h5pset_fapl_sec2_c END INTERFACE - + hdferr = h5pset_fapl_sec2_c(prp_id) END SUBROUTINE h5pset_fapl_sec2_f -!****s* H5P/h5pget_sec2_f +!****s* H5P/h5pget_sec2_f ! NAME -! h5pget_sec2_f +! h5pget_sec2_f ! ! PURPOSE ! NOT AVAILABLE ! ! INPUTS -! +! ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! SOURCE! SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr) +! port). March 14, 2001 +! +! SOURCE! SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr) ! IMPLICIT NONE ! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier ! INTEGER, INTENT(OUT) :: sec2 ! value indicates whether the file @@ -1312,37 +1312,37 @@ CONTAINS ! hdferr = h5pget_sec2_c(prp_id, sec2) ! END SUBROUTINE h5pget_sec2_f -!****s* H5P/h5pset_alignment_f +!****s* H5P/h5pset_alignment_f ! NAME -! h5pset_alignment_f +! h5pset_alignment_f ! ! PURPOSE -! Sets alignment properties of a file access property list. +! Sets alignment properties of a file access property list. ! ! INPUTS -! +! ! prp_id - file access property list identifier -! threshold - threshold value +! threshold - threshold value ! alignment - alignment value ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_alignment_f(prp_id, threshold, alignment, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HSIZE_T), INTENT(IN) :: threshold ! Threshold value INTEGER(HSIZE_T), INTENT(IN) :: alignment ! alignment value INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1358,41 +1358,41 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN) :: alignment END FUNCTION h5pset_alignment_c END INTERFACE - + hdferr = h5pset_alignment_c(prp_id, threshold, alignment) END SUBROUTINE h5pset_alignment_f -!****s* H5P/h5pget_alignment_f +!****s* H5P/h5pget_alignment_f ! NAME -! h5pget_alignment_f +! h5pget_alignment_f ! ! PURPOSE -! Retrieves the current settings for alignment -! properties from a file access property list. +! Retrieves the current settings for alignment +! properties from a file access property list. ! ! INPUTS ! prp_id - file access property list identifier ! ! OUTPUTS -! threshold - threshold value +! threshold - threshold value ! alignment - alignment value -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_alignment_f(prp_id, threshold, alignment, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HSIZE_T), INTENT(OUT) :: threshold ! Threshold value INTEGER(HSIZE_T), INTENT(OUT) :: alignment ! alignment value INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1408,44 +1408,44 @@ CONTAINS INTEGER(HSIZE_T), INTENT(OUT) :: alignment END FUNCTION h5pget_alignment_c END INTERFACE - + hdferr = h5pget_alignment_c(prp_id, threshold, alignment) END SUBROUTINE h5pget_alignment_f -!****s* H5P/h5pset_fapl_core_f +!****s* H5P/h5pset_fapl_core_f ! NAME -! h5pset_fapl_core_f +! h5pset_fapl_core_f ! ! PURPOSE -! Modifies the file access property list to use the -! H5FD_CORE driver. +! Modifies the file access property list to use the +! H5FD_CORE driver. ! ! INPUTS ! prp_id - file access property list identifier -! increment - size, in bytes, of memory increments -! backing_store - boolean flag indicating whether to write -! the file contents to disk when the file is closed. +! increment - size, in bytes, of memory increments +! backing_store - boolean flag indicating whether to write +! the file contents to disk when the file is closed. ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_fapl_core_f(prp_id, increment, backing_store, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(SIZE_T), INTENT(IN) :: increment ! File block size in bytes. LOGICAL, INTENT(IN) :: backing_store ! Flag to indicate that - ! entire file contents are flushed to a file + ! entire file contents are flushed to a file ! with the same name as this core file. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1456,9 +1456,9 @@ CONTAINS BIND(C,NAME='h5pset_fapl_core_c') IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(IN) :: increment - INTEGER :: backing_store_flag + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(IN) :: increment + INTEGER :: backing_store_flag END FUNCTION h5pset_fapl_core_c END INTERFACE backing_store_flag = 0 @@ -1466,96 +1466,96 @@ CONTAINS hdferr = h5pset_fapl_core_c(prp_id, increment, backing_store_flag) END SUBROUTINE h5pset_fapl_core_f -!****s* H5P/h5pget_fapl_core_f +!****s* H5P/h5pget_fapl_core_f ! NAME -! h5pget_fapl_core_f +! h5pget_fapl_core_f ! ! PURPOSE -! Queries core file driver properties. +! Queries core file driver properties. ! ! INPUTS ! prp_id - file access property list identifier ! OUTPUTS -! -! increment - size, in bytes, of memory increments -! backing_store - boolean flag indicating whether to write -! the file contents to disk when the file is closed. -! hdferr - error code +! +! increment - size, in bytes, of memory increments +! backing_store - boolean flag indicating whether to write +! the file contents to disk when the file is closed. +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_fapl_core_f(prp_id, increment, backing_store, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(SIZE_T), INTENT(OUT) :: increment ! File block size in bytes. LOGICAL, INTENT(OUT) :: backing_store ! Flag to indicate that - ! entire file contents are flushed to a file + ! entire file contents are flushed to a file ! with the same name as this core file. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** - INTEGER :: backing_store_flag + INTEGER :: backing_store_flag INTERFACE INTEGER FUNCTION h5pget_fapl_core_c(prp_id, increment, backing_store_flag) & BIND(C,NAME='h5pget_fapl_core_c') IMPORT :: HID_T,SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(OUT) :: increment - INTEGER :: backing_store_flag + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(OUT) :: increment + INTEGER :: backing_store_flag END FUNCTION h5pget_fapl_core_c END INTERFACE - + hdferr = h5pget_fapl_core_c(prp_id, increment, backing_store_flag) backing_store =.FALSE. IF (backing_store_flag .EQ. 1) backing_store =.TRUE. END SUBROUTINE h5pget_fapl_core_f -!****s* H5P/ h5pset_fapl_family_f +!****s* H5P/ h5pset_fapl_family_f ! NAME -! h5pset_fapl_family_f +! h5pset_fapl_family_f ! ! PURPOSE -! Sets the file access property list to use the family driver. +! Sets the file access property list to use the family driver. ! ! INPUTS ! prp_id - file access property list identifier -! memb_size - size in bytes of each file member -! memb_plist - identifier of the file access property +! memb_size - size in bytes of each file member +! memb_plist - identifier of the file access property ! list to be used for each family member ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HSIZE_T), INTENT(IN) :: memb_size ! Logical size, in bytes, ! of each family member - INTEGER(HID_T), INTENT(IN) :: memb_plist ! Identifier of the file - ! access property list for + INTEGER(HID_T), INTENT(IN) :: memb_plist ! Identifier of the file + ! access property list for ! each member of the family INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1574,39 +1574,39 @@ CONTAINS hdferr = h5pset_fapl_family_c(prp_id, memb_size, memb_plist) END SUBROUTINE h5pset_fapl_family_f -!****s* H5P/h5pget_fapl_family_f +!****s* H5P/h5pget_fapl_family_f ! NAME -! h5pget_fapl_family_f +! h5pget_fapl_family_f ! ! PURPOSE -! Returns file access property list information. +! Returns file access property list information. ! ! INPUTS ! prp_id - file access property list identifier ! OUTPUTS -! memb_size - size in bytes of each file member -! memb_plist - identifier of the file access property +! memb_size - size in bytes of each file member +! memb_plist - identifier of the file access property ! list to be used for each family member -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HSIZE_T), INTENT(OUT) :: memb_size ! Logical size, in bytes, ! of each family member - INTEGER(HID_T), INTENT(OUT) :: memb_plist ! Identifier of the file - ! access property list for + INTEGER(HID_T), INTENT(OUT) :: memb_plist ! Identifier of the file + ! access property list for ! each member of the family INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1621,52 +1621,52 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: memb_plist END FUNCTION h5pget_fapl_family_c END INTERFACE - + hdferr = h5pget_fapl_family_c(prp_id, memb_size, memb_plist) END SUBROUTINE h5pget_fapl_family_f -!****s* H5P/h5pset_cache_f +!****s* H5P/h5pset_cache_f ! NAME -! h5pset_cache_f +! h5pset_cache_f ! ! PURPOSE -! Sets the meta data cache and raw data chunk +! Sets the meta data cache and raw data chunk ! cache parameters ! ! INPUTS -! +! ! prp_id - file access property list identifier -! mdc_nelmts - number of elements (objects) in the meta -! data cache -! rdcc_nelmts - number of elements (objects) in the raw -! data chunk cache -! rdcc_nbytes - total size of the raw data chunk cache, in bytes +! mdc_nelmts - number of elements (objects) in the meta +! data cache +! rdcc_nelmts - number of elements (objects) in the raw +! data chunk cache +! rdcc_nbytes - total size of the raw data chunk cache, in bytes ! rdcc_w0 - preemption policy (0 or 1) ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: mdc_nelmts ! Number of elements (objects) ! in the meta data cache INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts ! Number of elements (objects) ! in the meta data cache - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! Total size of the raw data - ! chunk cache, in bytes + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! Total size of the raw data + ! chunk cache, in bytes REAL, INTENT(IN) :: rdcc_w0 ! Preemption policy INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1677,8 +1677,8 @@ CONTAINS IMPORT :: HID_T, SIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: mdc_nelmts - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts + INTEGER, INTENT(IN) :: mdc_nelmts + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes REAL, INTENT(IN) :: rdcc_w0 END FUNCTION h5pset_cache_c @@ -1687,50 +1687,50 @@ CONTAINS hdferr = h5pset_cache_c(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) END SUBROUTINE h5pset_cache_f -!****s* H5P/h5pget_cache_f +!****s* H5P/h5pget_cache_f ! NAME -! h5pget_cache_f +! h5pget_cache_f ! ! PURPOSE -! Queries the meta data cache and raw data chunk cache -! parameters. +! Queries the meta data cache and raw data chunk cache +! parameters. ! ! INPUTS ! prp_id - file access property list identifier ! ! OUTPUTS -! mdc_nelmts - number of elements (objects) in the meta -! data cache -! rdcc_nelmts - number of elements (objects) in the raw -! data chunk cache -! rdcc_nbytes - total size of the raw data chunk cache, in bytes +! mdc_nelmts - number of elements (objects) in the meta +! data cache +! rdcc_nelmts - number of elements (objects) in the raw +! data chunk cache +! rdcc_nbytes - total size of the raw data chunk cache, in bytes ! rdcc_w0 - preemption policy (0 or 1) -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 +! port). March 14, 2001 ! ! Bug fix: type of the rdcc_nelmts parameter should be INTEGER -! instead of INTEGER(SIZE_T) October 10, 2003 -! +! instead of INTEGER(SIZE_T) October 10, 2003 +! ! Fortran90 Interface: SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: mdc_nelmts ! Number of elements (objects) ! in the meta data cache INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts ! Number of elements (objects) ! in the meta data cache - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data - ! chunk cache, in bytes + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data + ! chunk cache, in bytes REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1741,58 +1741,58 @@ CONTAINS IMPORT :: HID_T, SIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: mdc_nelmts - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts + INTEGER, INTENT(OUT) :: mdc_nelmts + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes REAL, INTENT(OUT) :: rdcc_w0 END FUNCTION h5pget_cache_c END INTERFACE - + hdferr = h5pget_cache_c(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) END SUBROUTINE h5pget_cache_f -!****s* H5P/h5pset_fapl_split_f +!****s* H5P/h5pset_fapl_split_f ! NAME -! h5pset_fapl_split_f +! h5pset_fapl_split_f ! ! PURPOSE -! Emulates the old split file driver. +! Emulates the old split file driver. ! ! INPUTS -! +! ! prp_id - file access property list identifier -! meta_ext - name of the extension for the metafile +! meta_ext - name of the extension for the metafile ! filename -! meta_plist - identifier of the meta file access property +! meta_plist - identifier of the meta file access property ! list ! raw_ext - name extension for the raw file filename ! raw_plist - identifier of the raw file access property list ! ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_fapl_split_f(prp_id, meta_ext, meta_plist, raw_ext, raw_plist, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier CHARACTER(LEN=*), INTENT(IN) :: meta_ext ! Name of the extension for ! the metafile filename INTEGER(HID_T), INTENT(IN) :: meta_plist ! Identifier of the meta file ! access property list CHARACTER(LEN=*), INTENT(IN) :: raw_ext ! Name extension for the raw file filename - INTEGER(HID_T), INTENT(IN) :: raw_plist ! Identifier of the raw file + INTEGER(HID_T), INTENT(IN) :: raw_plist ! Identifier of the raw file ! access property list INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -1805,10 +1805,10 @@ CONTAINS IMPORT :: HID_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: meta_ext + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: meta_ext INTEGER(HID_T), INTENT(IN) :: meta_plist CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: raw_ext - INTEGER(HID_T), INTENT(IN) :: raw_plist + INTEGER(HID_T), INTENT(IN) :: raw_plist INTEGER :: meta_len, raw_len END FUNCTION h5pset_fapl_split_c END INTERFACE @@ -1818,30 +1818,30 @@ CONTAINS hdferr = h5pset_fapl_split_c(prp_id,meta_len,meta_ext,meta_plist,raw_len,raw_ext,raw_plist) END SUBROUTINE h5pset_fapl_split_f -!****s* H5P/h5pget_split_f +!****s* H5P/h5pget_split_f ! NAME -! h5pget_split_f +! h5pget_split_f ! ! PURPOSE ! NOT AVAILABLE ! ! INPUTS -! +! ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! SOURCE ! SUBROUTINE h5pget_split_f(prp_id, meta_ext_size, meta_ext, meta_plist,raw_ext_size,& ! raw_ext, raw_plist, hdferr) @@ -1870,37 +1870,37 @@ CONTAINS ! raw_ext_size, raw_ext, raw_plist ) ! END SUBROUTINE h5pget_split_f -!****s* H5P/h5pset_gc_references_f +!****s* H5P/h5pset_gc_references_f ! NAME -! h5pset_gc_references_f +! h5pset_gc_references_f ! ! PURPOSE -! Sets garbage collecting references flag. +! Sets garbage collecting references flag. ! ! INPUTS -! +! ! prp_id - file access property list identifier -! gc_reference - flag for stting garbage collection on +! gc_reference - flag for stting garbage collection on ! and off (1 or 0) ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Fortran90 Interface: +! port). March 14, 2001 +! +! Fortran90 Interface: SUBROUTINE h5pset_gc_references_f (prp_id, gc_reference, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: gc_reference ! The flag for garbage collecting ! references for the file INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1919,37 +1919,37 @@ CONTAINS hdferr = h5pset_gc_references_c(prp_id, gc_reference) END SUBROUTINE h5pset_gc_references_f -!****s* H5P/h5pget_gc_references_f +!****s* H5P/h5pget_gc_references_f ! NAME -! h5pget_gc_references_f +! h5pget_gc_references_f ! ! PURPOSE -! Returns garbage collecting references setting. +! Returns garbage collecting references setting. ! ! INPUTS -! +! ! prp_id - file access property list identifier ! OUTPUTS -! -! gc_reference - flag for stting garbage collection on +! +! gc_reference - flag for stting garbage collection on ! and off (1 or 0) -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_gc_references_f(prp_id, gc_reference, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: gc_reference ! The flag for garbage collecting ! references for the file INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1964,20 +1964,20 @@ CONTAINS INTEGER, INTENT(OUT) :: gc_reference END FUNCTION h5pget_gc_references_c END INTERFACE - + hdferr = h5pget_gc_references_c(prp_id, gc_reference) END SUBROUTINE h5pget_gc_references_f -!****s* H5P/h5pset_layout_f +!****s* H5P/h5pset_layout_f ! NAME -! h5pset_layout_f +! h5pset_layout_f ! ! PURPOSE -! Sets the type of storage used store the raw data -! for a dataset. +! Sets the type of storage used store the raw data +! for a dataset. ! ! INPUTS -! +! ! prp_id - data creation property list identifier ! layout - type of storage layout for raw data ! possible values are: @@ -1985,24 +1985,24 @@ CONTAINS ! H5D_CONTIGUOUS_F ! H5D_CHUNKED_F ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_layout_f (prp_id, layout, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: layout ! Type of storage layout for raw data ! possible values are: ! H5D_COMPACT_F @@ -2020,44 +2020,44 @@ CONTAINS INTEGER, INTENT(IN) :: layout END FUNCTION h5pset_layout_c END INTERFACE - + hdferr = h5pset_layout_c(prp_id, layout) END SUBROUTINE h5pset_layout_f -!****s* H5P/h5pget_layout_f +!****s* H5P/h5pget_layout_f ! NAME -! h5pget_layout_f +! h5pget_layout_f ! ! PURPOSE -! Returns the layout of the raw data for a dataset. +! Returns the layout of the raw data for a dataset. ! ! INPUTS -! +! ! prp_id - data creation property list identifier ! OUTPUTS -! +! ! layout - type of storage layout for raw data ! possible values are: ! H5D_COMPACT_F ! H5D_CONTIGUOUS_F ! H5D_CHUNKED_F -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_layout_f (prp_id, layout, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: layout ! Type of storage layout for raw data ! possible values are: ! H5D_COMPACT_F(0) @@ -2075,31 +2075,31 @@ CONTAINS INTEGER, INTENT(OUT) :: layout END FUNCTION h5pget_layout_c END INTERFACE - + hdferr = h5pget_layout_c(prp_id, layout) END SUBROUTINE h5pget_layout_f -!****s* H5P/h5pset_filter_f +!****s* H5P/h5pset_filter_f ! NAME -! h5pset_filter_f +! h5pset_filter_f ! ! PURPOSE -! Adds a filter to the filter pipeline. +! Adds a filter to the filter pipeline. ! ! INPUTS -! -! prp_id - data creation or transfer property list +! +! prp_id - data creation or transfer property list ! identifier -! filter - filter to be added to the pipeline +! filter - filter to be added to the pipeline ! flags - bit vector specifying certain general ! properties of the filter ! cd_nelmts - number of elements in cd_values ! cd_values - auxiliary data for the filter ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -2108,7 +2108,7 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pset_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: filter ! Filter to be added to the pipeline. INTEGER, INTENT(IN) :: flags ! Bit vector specifying certain general ! properties of the filter. @@ -2122,48 +2122,48 @@ CONTAINS BIND(C,NAME='h5pset_filter_c') IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(IN) :: flags - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(IN) :: flags + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values END FUNCTION h5pset_filter_c END INTERFACE - + hdferr = h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) END SUBROUTINE h5pset_filter_f -!****s* H5P/h5pget_nfilters_f +!****s* H5P/h5pget_nfilters_f ! NAME -! h5pget_nfilters_f +! h5pget_nfilters_f ! ! PURPOSE -! Returns the number of filters in the pipeline. +! Returns the number of filters in the pipeline. ! ! INPUTS -! -! prp_id - data creation or transfer property list +! +! prp_id - data creation or transfer property list ! identifier ! OUTPUTS -! +! ! nfilters - number of filters in the pipeline -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_nfilters_f (prp_id, nfilters, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: nfilters ! The number of filters in the pipeline INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -2177,26 +2177,26 @@ CONTAINS INTEGER, INTENT(OUT) :: nfilters END FUNCTION h5pget_nfilters_c END INTERFACE - + hdferr = h5pget_nfilters_c(prp_id, nfilters) END SUBROUTINE h5pget_nfilters_f -!****s* H5P/h5pget_filter_f +!****s* H5P/h5pget_filter_f ! NAME -! h5pget_filter_f +! h5pget_filter_f ! ! PURPOSE ! Returns information about a filter in a pipeline ! ! INPUTS -! -! prp_id - data creation or transfer property list +! +! prp_id - data creation or transfer property list ! identifier ! filter_number - sequence number within the filter -! pipeline of the filter for which +! pipeline of the filter for which ! information is sought ! OUTPUTS -! +! ! filter_id - filter identification number ! flags - bit vector specifying certain general ! properties of the filter @@ -2204,25 +2204,25 @@ CONTAINS ! cd_values - auxiliary data for the filter ! namelen - number of characters in the name buffer ! name - buffer to retrieve filter name -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_filter_f(prp_id, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: filter_number ! Sequence number within the filter - ! pipeline of the filter for which + ! pipeline of the filter for which ! information is sought INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter. INTEGER, INTENT(OUT) :: flags ! Bit vector specifying certain general @@ -2230,7 +2230,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts ! Number of elements in cd_values. INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name. CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of the filter - INTEGER, INTENT(OUT) :: filter_id ! Filter identification number + INTEGER, INTENT(OUT) :: filter_id ! Filter identification number INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -2247,60 +2247,60 @@ CONTAINS IMPORT :: HID_T, SIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter_number + INTEGER, INTENT(IN) :: filter_number INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values - INTEGER, INTENT(OUT) :: flags + INTEGER, INTENT(OUT) :: flags INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts INTEGER(SIZE_T), INTENT(IN) :: namelen CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name INTEGER, INTENT(OUT) :: filter_id END FUNCTION h5pget_filter_c END INTERFACE - - hdferr = h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & + + hdferr = h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & cd_values, namelen, name, filter_id ) END SUBROUTINE h5pget_filter_f -!****s* H5P/h5pset_external_f +!****s* H5P/h5pset_external_f ! NAME -! h5pset_external_f +! h5pset_external_f ! ! PURPOSE -! Adds an external file to the list of external files. +! Adds an external file to the list of external files. ! ! INPUTS -! +! ! prp_id - dataset creation property list identifier ! name - name of external file -! offset - offset in bytes from the beginning of the +! offset - offset in bytes from the beginning of the ! file to the location in the file ! where the data starts -! bytes - size of the external file data. +! bytes - size of the external file data. ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). March 14, 2001 ! ! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5pset_external_f(prp_id, name, offset, bytes, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an external file - INTEGER(OFF_T), INTENT(IN) :: offset ! Offset, in bytes, from the beginning - ! of the file to the location in the file + INTEGER(OFF_T), INTENT(IN) :: offset ! Offset, in bytes, from the beginning + ! of the file to the location in the file ! where the data starts. - INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the + INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the ! file for the data INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -2320,43 +2320,43 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN) :: bytes END FUNCTION h5pset_external_c END INTERFACE - + namelen = LEN(name) hdferr = h5pset_external_c(prp_id, name, namelen, offset, bytes) END SUBROUTINE h5pset_external_f -!****s* H5P/h5pget_external_count_f +!****s* H5P/h5pget_external_count_f ! NAME -! h5pget_external_count_f +! h5pget_external_count_f ! ! PURPOSE -! Returns the number of external files for a dataset. +! Returns the number of external files for a dataset. ! ! INPUTS -! +! ! prp_id - dataset creation property list identifier ! OUTPUTS -! -! count - number of external files for the +! +! count - number of external files for the ! specified dataset -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_external_count_f (prp_id, count, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: count ! Number of external files for the + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: count ! Number of external files for the ! Specified dataset INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -2366,60 +2366,60 @@ CONTAINS BIND(C,NAME='h5pget_external_count_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(OUT) :: count END FUNCTION h5pget_external_count_c END INTERFACE - + hdferr = h5pget_external_count_c(prp_id, count) END SUBROUTINE h5pget_external_count_f -!****s* H5P/h5pget_external_f +!****s* H5P/h5pget_external_f ! NAME -! h5pget_external_f +! h5pget_external_f ! ! PURPOSE -! Returns information about an external file. +! Returns information about an external file. ! ! INPUTS -! +! ! prp_id - dataset creation property list identifier ! OUTPUTS -! -! idx - external file index +! +! idx - external file index ! name_size - maximum size of name array -! name - name of the external file +! name - name of the external file ! name - name of external file -! offset - offset in bytes from the beginning of the +! offset - offset in bytes from the beginning of the ! file to the location in the file ! where the data starts ! bytes - size of the external file data -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). March 14, 2001 ! ! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 -! +! ! Fortran90 Interface: SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: idx ! External file index. - INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array + INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of an external file - INTEGER(OFF_T), INTENT(OUT) :: offset ! Offset, in bytes, from the beginning - ! of the file to the location in the file + INTEGER(OFF_T), INTENT(OUT) :: offset ! Offset, in bytes, from the beginning + ! of the file to the location in the file ! where the data starts. - INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the + INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the ! file for the data INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -2431,54 +2431,54 @@ CONTAINS IMPORT :: HID_T, SIZE_T, HSIZE_T, OFF_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: idx + INTEGER, INTENT(IN) :: idx INTEGER(SIZE_T), INTENT(IN) :: name_size CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name INTEGER(OFF_T), INTENT(OUT) :: offset INTEGER(HSIZE_T), INTENT(OUT) :: bytes END FUNCTION h5pget_external_c END INTERFACE - + hdferr = h5pget_external_c(prp_id, idx, name_size, name, offset, bytes) END SUBROUTINE h5pget_external_f -!****s* H5P/h5pset_btree_ratios_f +!****s* H5P/h5pset_btree_ratios_f ! NAME -! h5pset_btree_ratios_f +! h5pset_btree_ratios_f ! ! PURPOSE -! Sets B-tree split ratios for a dataset transfer -! property list. +! Sets B-tree split ratios for a dataset transfer +! property list. ! ! INPUTS -! -! prp_id - the dataset transfer property list -! identifier -! left - the B-tree split ratio for left-most nodes +! +! prp_id - the dataset transfer property list +! identifier +! left - the B-tree split ratio for left-most nodes ! middle - the B-tree split ratio for all other nodes ! right - the B-tree split ratio for right-most nodes ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pset_btree_ratios_f(prp_id, left, middle, right, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier REAL, INTENT(IN) :: left ! The B-tree split ratio for left-most nodes. - REAL, INTENT(IN) :: middle ! The B-tree split ratio for all other nodes - REAL, INTENT(IN) :: right ! The B-tree split ratio for right-most - ! nodes and lone nodes. + REAL, INTENT(IN) :: middle ! The B-tree split ratio for all other nodes + REAL, INTENT(IN) :: right ! The B-tree split ratio for right-most + ! nodes and lone nodes. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -2493,7 +2493,7 @@ CONTAINS REAL, INTENT(IN) :: right END FUNCTION h5pset_btree_ratios_c END INTERFACE - + hdferr = h5pset_btree_ratios_c(prp_id, left, middle, right) END SUBROUTINE h5pset_btree_ratios_f @@ -2505,34 +2505,34 @@ CONTAINS ! Gets B-tree split ratios for a dataset transfer property list ! ! INPUTS -! -! prp_id - the dataset transfer property list -! identifier +! +! prp_id - the dataset transfer property list +! identifier ! OUTPUTS -! -! left - the B-tree split ratio for left-most nodes +! +! left - the B-tree split ratio for left-most nodes ! middle - the B-tree split ratio for all other nodes ! right - the B-tree split ratio for right-most nodes -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! August 12, 1999 +! August 12, 1999 ! ! HISTORY -! Explicit Fortran interfaces were added for +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 -! +! port). March 14, 2001 +! ! Fortran90 Interface: SUBROUTINE h5pget_btree_ratios_f(prp_id, left, middle, right, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier REAL, INTENT(OUT) :: left ! The B-tree split ratio for left-most nodes. - REAL, INTENT(OUT) :: middle ! The B-tree split ratio for all other nodes - REAL, INTENT(OUT) :: right ! The B-tree split ratio for right-most + REAL, INTENT(OUT) :: middle ! The B-tree split ratio for all other nodes + REAL, INTENT(OUT) :: right ! The B-tree split ratio for right-most ! nodes and lone nodes. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -2548,43 +2548,43 @@ CONTAINS REAL, INTENT(OUT) :: right END FUNCTION h5pget_btree_ratios_c END INTERFACE - + hdferr = h5pget_btree_ratios_c(prp_id, left, middle, right) END SUBROUTINE h5pget_btree_ratios_f -!****s* H5P/h5pget_fclose_degree_f +!****s* H5P/h5pget_fclose_degree_f ! NAME -! h5pget_fclose_degree_f +! h5pget_fclose_degree_f ! ! PURPOSE ! Returns the degree for the file close behavior. ! ! INPUTS -! +! ! fapl_id - File access property list identifier ! OUTPUTS -! +! ! degree - Possible values are: ! H5F_CLOSE_DEFAULT_F ! H5F_CLOSE_WEAK_F ! H5F_CLOSE_SEMI_F ! H5F_CLOSE_STRONG_F -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! September 26, 2002 +! September 26, 2002 ! ! HISTORY -! -! +! +! ! Fortran90 Interface: SUBROUTINE h5pget_fclose_degree_f(fapl_id, degree, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier - INTEGER, INTENT(OUT) :: degree ! Possible values are: + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier + INTEGER, INTENT(OUT) :: degree ! Possible values are: ! H5F_CLOSE_DEFAULT_F ! H5F_CLOSE_WEAK_F ! H5F_CLOSE_SEMI_F @@ -2601,19 +2601,19 @@ CONTAINS INTEGER, INTENT(OUT) :: degree END FUNCTION h5pget_fclose_degree_c END INTERFACE - - hdferr = h5pget_fclose_degree_c(fapl_id, degree) + + hdferr = h5pget_fclose_degree_c(fapl_id, degree) END SUBROUTINE h5pget_fclose_degree_f -!****s* H5P/h5pset_fclose_degree_f +!****s* H5P/h5pset_fclose_degree_f ! NAME -! h5pset_fclose_degree_f +! h5pset_fclose_degree_f ! ! PURPOSE ! Sets the degree for the file close behavior. ! ! INPUTS -! +! ! fapl_id - file access property list identifier ! degree - Possible values are: ! H5F_CLOSE_DEFAULT_F @@ -2621,19 +2621,19 @@ CONTAINS ! H5F_CLOSE_SEMI_F ! H5F_CLOSE_STRONG_F ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! September 26, 2002 +! September 26, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pset_fclose_degree_f(fapl_id, degree, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier - INTEGER, INTENT(IN) :: degree ! Possible values are: + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier + INTEGER, INTENT(IN) :: degree ! Possible values are: ! H5F_CLOSE_DEFAULT_F ! H5F_CLOSE_WEAK_F ! H5F_CLOSE_SEMI_F @@ -2651,43 +2651,43 @@ CONTAINS END FUNCTION h5pset_fclose_degree_c END INTERFACE - hdferr = h5pset_fclose_degree_c(fapl_id, degree) + hdferr = h5pset_fclose_degree_c(fapl_id, degree) END SUBROUTINE h5pset_fclose_degree_f -!****s* H5P/h5pequal_f +!****s* H5P/h5pequal_f ! NAME -! h5pequal_f +! h5pequal_f ! ! PURPOSE ! Checks if two property lists are eqaul ! ! INPUTS -! +! ! plist1_id - property list identifier ! plist2_id - property list identifier ! OUTPUTS -! +! ! flag - flag, possible values ! .TRUE. or .FALSE. -! hdferr: - error code +! hdferr: - error code ! Success: 0 -! Failure: -1, flag is set to .FALSE. +! Failure: -1, flag is set to .FALSE. ! ! AUTHOR ! Elena Pourmal -! September 30, 2002 +! September 30, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pequal_f(plist1_id, plist2_id, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist1_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: plist2_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: plist1_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: plist2_id ! Property list identifier LOGICAL, INTENT(OUT) :: flag ! Flag INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** INTEGER :: c_flag - + INTERFACE INTEGER FUNCTION h5pequal_c(plist1_id, plist2_id, c_flag) & BIND(C,NAME='h5pequal_c') @@ -2700,36 +2700,36 @@ CONTAINS END INTERFACE flag = .FALSE. - hdferr = h5pequal_c(plist1_id, plist2_id, c_flag) + hdferr = h5pequal_c(plist1_id, plist2_id, c_flag) IF (c_flag .GT. 0) flag = .TRUE. END SUBROUTINE h5pequal_f !****s* H5P/h5pset_buffer_f ! NAME -! h5pset_buffer_f +! h5pset_buffer_f ! ! PURPOSE ! Sets sixe for conversion buffer ! ! INPUTS ! plist_id - data transfer property list identifier -! size - buffer size +! size - buffer size ! OUTPUTS -! -! hdferr: - error code +! +! hdferr: - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 2, 2002 +! October 2, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pset_buffer_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Buffer size in bytes; - ! buffer is allocated and freed by + INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Buffer size in bytes; + ! buffer is allocated and freed by ! the library. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -2745,36 +2745,36 @@ CONTAINS END FUNCTION h5pset_buffer_c END INTERFACE - hdferr = h5pset_buffer_c(plist_id, size) + hdferr = h5pset_buffer_c(plist_id, size) END SUBROUTINE h5pset_buffer_f !****s* H5P/h5pget_buffer_f ! NAME -! h5pget_buffer_f +! h5pget_buffer_f ! ! PURPOSE ! Gets size for conversion buffer ! ! INPUTS -! +! ! plist_id - data transfer property list identifier ! OUTPUTS -! -! size - buffer size -! hdferr - error code +! +! size - buffer size +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 2, 2002 +! October 2, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_buffer_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Buffer size in bytes; - ! buffer is allocated and freed by + INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Buffer size in bytes; + ! buffer is allocated and freed by ! the library. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -2790,7 +2790,7 @@ CONTAINS END FUNCTION h5pget_buffer_c END INTERFACE - hdferr = h5pget_buffer_c(plist_id, size) + hdferr = h5pget_buffer_c(plist_id, size) END SUBROUTINE h5pget_buffer_f !****s* H5P/h5pfill_value_defined_f @@ -2801,17 +2801,17 @@ CONTAINS ! Check if fill value is defined. ! ! INPUTS -! +! ! plist_id - dataset creation property list identifier ! OUTPUTS -! +! ! flag - fill value status flag ! Possible values are: ! H5D_FILL_VALUE_ERROR_F ! H5D_FILL_VALUE_UNDEFINED_F ! H5D_FILL_VALUE_DEFAULT_F ! H5D_FILL_VALUE_USER_DEFINED_F -! hdferr - error code +! hdferr - error code ! Success: 0 ! Failure: -1 ! @@ -2841,7 +2841,7 @@ CONTAINS END FUNCTION h5pfill_value_defined_c END INTERFACE - hdferr = h5pfill_value_defined_c(plist_id, flag) + hdferr = h5pfill_value_defined_c(plist_id, flag) END SUBROUTINE h5pfill_value_defined_f !****s* H5P/h5pset_alloc_time_f @@ -2852,7 +2852,7 @@ CONTAINS ! Set space allocation time for dataset during creation. ! ! INPUTS -! +! ! plist_id - dataset creation property list identifier ! flag - allocation time flag: ! H5D_ALLOC_TIME_ERROR_F @@ -2861,14 +2861,14 @@ CONTAINS ! H5D_ALLOC_TIME_LATE_F ! H5D_ALLOC_TIME_INCR_F ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 4, 2002 +! October 4, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pset_alloc_time_f(plist_id, flag, hdferr) @@ -2882,8 +2882,8 @@ CONTAINS ! H5D_ALLOC_TIME_INCR_F INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** - +!***** + INTERFACE INTEGER FUNCTION h5pset_alloc_time_c(plist_id, flag) & BIND(C,NAME='h5pset_alloc_time_c') @@ -2893,8 +2893,8 @@ CONTAINS INTEGER, INTENT(IN) :: flag END FUNCTION h5pset_alloc_time_c END INTERFACE - - hdferr = h5pset_alloc_time_c(plist_id, flag) + + hdferr = h5pset_alloc_time_c(plist_id, flag) END SUBROUTINE h5pset_alloc_time_f !****s* H5P/h5pget_alloc_time_f @@ -2905,23 +2905,23 @@ CONTAINS ! Get space allocation time for dataset during creation. ! ! INPUTS -! +! ! plist_id - dataset creation property list identifier ! OUTPUTS -! +! ! flag - allocation time flag: ! H5D_ALLOC_TIME_ERROR_F ! H5D_ALLOC_TIME_DEFAULT_F ! H5D_ALLOC_TIME_EARLY_F ! H5D_ALLOC_TIME_LATE_F ! H5D_ALLOC_TIME_INCR_F -! hdferr: - error code +! hdferr: - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 4, 2002 +! October 4, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_alloc_time_f(plist_id, flag, hdferr) @@ -2946,8 +2946,8 @@ CONTAINS INTEGER, INTENT(OUT) :: flag END FUNCTION h5pget_alloc_time_c END INTERFACE - - hdferr = h5pget_alloc_time_c(plist_id, flag) + + hdferr = h5pget_alloc_time_c(plist_id, flag) END SUBROUTINE h5pget_alloc_time_f !****s* H5P/h5pset_fill_time_f @@ -2958,21 +2958,21 @@ CONTAINS ! Set fill value writing time for dataset ! ! INPUTS -! +! ! plist_id - dataset creation property list identifier ! flag - fill time flag: ! H5D_FILL_TIME_ERROR_F ! H5D_FILL_TIME_ALLOC_F ! H5D_FILL_TIME_NEVER_F ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 4, 2002 +! October 4, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pset_fill_time_f(plist_id, flag, hdferr) @@ -2984,7 +2984,7 @@ CONTAINS ! H5D_FILL_TIME_NEVER_F INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTERFACE INTEGER FUNCTION h5pset_fill_time_c(plist_id, flag) & @@ -2995,8 +2995,8 @@ CONTAINS INTEGER, INTENT(IN) :: flag END FUNCTION h5pset_fill_time_c END INTERFACE - - hdferr = h5pset_fill_time_c(plist_id, flag) + + hdferr = h5pset_fill_time_c(plist_id, flag) END SUBROUTINE h5pset_fill_time_f !****s* H5P/h5pget_fill_time_f @@ -3007,11 +3007,11 @@ CONTAINS ! Get fill value writing time for dataset ! ! INPUTS -! +! ! plist_id - dataset creation property list identifier ! OUTPUTS -! -! hdferr: - error code +! +! hdferr: - error code ! Success: 0 ! Failure: -1 ! OPTIONAL PARAMETERS @@ -3022,7 +3022,7 @@ CONTAINS ! H5D_FILL_TIME_NEVER_F ! AUTHOR ! Elena Pourmal -! October 4, 2002 +! October 4, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_fill_time_f(plist_id, flag, hdferr) @@ -3034,8 +3034,8 @@ CONTAINS ! H5D_FILL_TIME_NEVER_F INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** - +!***** + INTERFACE INTEGER FUNCTION h5pget_fill_time_c(plist_id, flag) & BIND(C,NAME='h5pget_fill_time_c') @@ -3045,36 +3045,36 @@ CONTAINS INTEGER, INTENT(OUT) :: flag END FUNCTION h5pget_fill_time_c END INTERFACE - - hdferr = h5pget_fill_time_c(plist_id, flag) + + hdferr = h5pget_fill_time_c(plist_id, flag) END SUBROUTINE h5pget_fill_time_f -!****s* H5P/ h5pset_meta_block_size_f +!****s* H5P/ h5pset_meta_block_size_f ! NAME -! h5pset_meta_block_size_f +! h5pset_meta_block_size_f ! ! PURPOSE -! Sets the minimum size of metadata block allocations +! Sets the minimum size of metadata block allocations ! ! INPUTS -! +! ! plist_id - file access property list identifier ! size - metatdata block size ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 7, 2002 +! October 7, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pset_meta_block_size_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Block size in bytes; + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Block size in bytes; INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -3087,78 +3087,78 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN) :: size END FUNCTION h5pset_meta_block_size_c END INTERFACE - - hdferr = h5pset_meta_block_size_c(plist_id, size) + + hdferr = h5pset_meta_block_size_c(plist_id, size) END SUBROUTINE h5pset_meta_block_size_f -!****s* H5P/h5pget_meta_block_size_f +!****s* H5P/h5pget_meta_block_size_f ! NAME -! h5pget_meta_block_size_f +! h5pget_meta_block_size_f ! ! PURPOSE -! Gets the minimum size of metadata block allocations +! Gets the minimum size of metadata block allocations ! ! INPUTS -! +! ! plist_id - file access property list identifier ! OUTPUTS -! +! ! size - metatdata block size -! hdferr - error code +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 7, 2002 +! October 7, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_meta_block_size_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Block size in bytes; + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Block size in bytes; INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** INTERFACE INTEGER FUNCTION h5pget_meta_block_size_c(plist_id, size) & BIND(C,NAME='h5pget_meta_block_size_c') - IMPORT :: HID_T, HSIZE_T + IMPORT :: HID_T, HSIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist_id INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5pget_meta_block_size_c END INTERFACE - - hdferr = h5pget_meta_block_size_c(plist_id, size) + + hdferr = h5pget_meta_block_size_c(plist_id, size) END SUBROUTINE h5pget_meta_block_size_f -!****s* H5P/h5pset_sieve_buf_size_f +!****s* H5P/h5pset_sieve_buf_size_f ! NAME -! h5pset_sieve_buf_size_f +! h5pset_sieve_buf_size_f ! ! PURPOSE ! Sets the maximum size of the data sieve buffer ! ! INPUTS -! +! ! plist_id - file access property list identifier ! size - sieve buffer size ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 7, 2002 +! October 7, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pset_sieve_buf_size_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size in bytes; + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size in bytes; INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -3171,36 +3171,36 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: size END FUNCTION h5pset_sieve_buf_size_c END INTERFACE - - hdferr = h5pset_sieve_buf_size_c(plist_id, size) + + hdferr = h5pset_sieve_buf_size_c(plist_id, size) END SUBROUTINE h5pset_sieve_buf_size_f !****s* H5P/h5pget_sieve_buf_size_f ! NAME -! h5pget_sieve_buf_size_f +! h5pget_sieve_buf_size_f ! ! PURPOSE ! Gets the maximum size of the data sieve buffer ! ! INPUTS -! +! ! plist_id - file access property list identifier ! OUTPUTS -! +! ! size - sieve buffer size -! hdferr - error code +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 7, 2002 +! October 7, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_sieve_buf_size_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: size ! Buffer size in bytes + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: size ! Buffer size in bytes INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -3213,35 +3213,35 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: size END FUNCTION h5pget_sieve_buf_size_c END INTERFACE - - hdferr = h5pget_sieve_buf_size_c(plist_id, size) + + hdferr = h5pget_sieve_buf_size_c(plist_id, size) END SUBROUTINE h5pget_sieve_buf_size_f -!****s* H5P/h5pset_small_data_block_size_f +!****s* H5P/h5pset_small_data_block_size_f ! NAME -! h5pset_small_data_block_size_f +! h5pset_small_data_block_size_f ! ! PURPOSE ! Sets the minimum size of "small" raw data block ! ! INPUTS -! +! ! plist_id - file access property list identifier ! size - small raw data block size ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 7, 2002 +! October 7, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pset_small_data_block_size_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier INTEGER(HSIZE_T), INTENT(IN) :: size ! Small raw data block size INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -3256,34 +3256,34 @@ CONTAINS END FUNCTION h5pset_small_data_block_size_c END INTERFACE - hdferr = h5pset_small_data_block_size_c(plist_id, size) + hdferr = h5pset_small_data_block_size_c(plist_id, size) END SUBROUTINE h5pset_small_data_block_size_f -!****s* H5P/h5pget_small_data_block_size_f +!****s* H5P/h5pget_small_data_block_size_f ! NAME -! h5pget_small_data_block_size_f +! h5pget_small_data_block_size_f ! ! PURPOSE ! Gets the minimum size of "small" raw data block ! ! INPUTS -! +! ! plist_id - file access property list identifier ! OUTPUTS -! +! ! size - small raw data block size -! hdferr - error code +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 7, 2002 +! October 7, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_small_data_block_size_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier INTEGER(HSIZE_T), INTENT(OUT) :: size ! Small raw data block size INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -3297,35 +3297,35 @@ CONTAINS INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5pget_small_data_block_size_c END INTERFACE - - hdferr = h5pget_small_data_block_size_c(plist_id, size) + + hdferr = h5pget_small_data_block_size_c(plist_id, size) END SUBROUTINE h5pget_small_data_block_size_f -!****s* H5P/h5pset_hyper_vector_size_f +!****s* H5P/h5pset_hyper_vector_size_f ! NAME -! h5pset_hyper_vector_size_f +! h5pset_hyper_vector_size_f ! ! PURPOSE ! Set the number of "I/O" vectors (vector size) ! ! INPUTS -! +! ! plist_id - dataset transfer property list identifier ! size - vector size ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 7, 2002 +! October 7, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pset_hyper_vector_size_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier INTEGER(SIZE_T), INTENT(IN) :: size ! Vector size INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -3339,35 +3339,35 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: size END FUNCTION h5pset_hyper_vector_size_c END INTERFACE - - hdferr = h5pset_hyper_vector_size_c(plist_id, size) + + hdferr = h5pset_hyper_vector_size_c(plist_id, size) END SUBROUTINE h5pset_hyper_vector_size_f -!****s* H5P/ h5pget_hyper_vector_size_f +!****s* H5P/ h5pget_hyper_vector_size_f ! NAME -! h5pget_hyper_vector_size_f +! h5pget_hyper_vector_size_f ! ! PURPOSE ! Get the number of "I/O" vectors (vector size) ! ! INPUTS -! +! ! plist_id - dataset transfer property list identifier ! OUTPUTS -! +! ! size - vector size -! hdferr - error code +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 7, 2002 +! October 7, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_hyper_vector_size_f(plist_id, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier INTEGER(SIZE_T), INTENT(OUT) :: size ! Vector size INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -3382,42 +3382,42 @@ CONTAINS END FUNCTION h5pget_hyper_vector_size_c END INTERFACE - hdferr = h5pget_hyper_vector_size_c(plist_id, size) + hdferr = h5pget_hyper_vector_size_c(plist_id, size) END SUBROUTINE h5pget_hyper_vector_size_f -!****s* H5P/h5pexist_f +!****s* H5P/h5pexist_f ! NAME -! h5pexist_f +! h5pexist_f ! ! PURPOSE -! Queries whether a property name exists in a property list or class. +! Queries whether a property name exists in a property list or class. ! ! INPUTS -! +! ! prp_id - property list identifier to query ! name - name of property to check for ! OUTPUTS -! +! ! flag - logical flag -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pexist_f(prp_id, name, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify LOGICAL, INTENT(OUT) :: flag ! .TRUE. if exists, .FALSE. otherwise INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** INTEGER :: name_len - + INTERFACE INTEGER FUNCTION h5pexist_c(prp_id, name, name_len) & BIND(C,NAME='h5pexist_c') @@ -3438,43 +3438,43 @@ CONTAINS ENDIF END SUBROUTINE h5pexist_f -!****s* H5P/h5pget_size_f +!****s* H5P/h5pget_size_f ! ! NAME -! h5pget_size_f +! h5pget_size_f ! ! PURPOSE ! Queries the size of a property value in bytes. ! ! INPUTS -! +! ! prp_id - property list identifier to query ! name - name of property to query ! OUTPUTS -! +! ! size - size of property in bytes -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! HISTORY -! -! +! +! ! Fortran90 Interface: SUBROUTINE h5pget_size_f(prp_id, name, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to query INTEGER(SIZE_T), INTENT(OUT) :: size ! Size in bytes INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** INTEGER :: name_len - + INTERFACE INTEGER FUNCTION h5pget_size_c(prp_id, name, name_len, size) & BIND(C,NAME='h5pget_size_c') @@ -3491,31 +3491,31 @@ CONTAINS hdferr = h5pget_size_c(prp_id, name , name_len, size) END SUBROUTINE h5pget_size_f -!****s* H5P/h5pget_npros_f +!****s* H5P/h5pget_npros_f ! NAME -! h5pget_npros_f +! h5pget_npros_f ! ! PURPOSE ! Queries number of properties in property list or class ! ! INPUTS -! +! ! prp_id - iproperty list identifier to query ! OUTPUTS -! +! ! nprops - number of properties in property object -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_nprops_f(prp_id, nprops, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(SIZE_T), INTENT(OUT) :: nprops ! Number of properties INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -3532,18 +3532,18 @@ CONTAINS hdferr = h5pget_nprops_c(prp_id, nprops) END SUBROUTINE h5pget_nprops_f -!****s* H5P/h5pget_class_name_f +!****s* H5P/h5pget_class_name_f ! NAME -! h5pget_class_name_f +! h5pget_class_name_f ! ! PURPOSE ! Queries the name of a class. ! ! INPUTS -! +! ! prp_id - property list identifier to query ! OUTPUTS -! +! ! name - name of a class ! size - Actual length of the class name ! NOTE: If provided buffer "name" is smaller, @@ -3551,26 +3551,26 @@ CONTAINS ! provided user buffer. ! hdferr: - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! HISTORY -! Returned the size of name as an argument -! +! Returned the size of name as an argument +! ! Fortran90 Interface: SUBROUTINE h5pget_class_name_f(prp_id, name, size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer to retireve class name INTEGER, INTENT(OUT) :: size ! Actual length of the class name INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** INTEGER :: name_len - + INTERFACE INTEGER FUNCTION h5pget_class_name_c(prp_id, name, name_len) & BIND(C,NAME='h5pget_class_name_c') @@ -3582,42 +3582,42 @@ CONTAINS INTEGER, INTENT(IN) :: name_len END FUNCTION h5pget_class_name_c END INTERFACE - + name_len = LEN(name) size = h5pget_class_name_c(prp_id, name, name_len) - + hdferr = 0 IF(size.LT.0) hdferr = -1 - + END SUBROUTINE h5pget_class_name_f -!****s* H5P/h5pget_class_parent_f +!****s* H5P/h5pget_class_parent_f ! NAME -! h5pget_class_parent_f +! h5pget_class_parent_f ! ! PURPOSE -! Retrieves the parent class of a genric property class. +! Retrieves the parent class of a genric property class. ! ! INPUTS -! +! ! prp_id - property list identifier to query ! OUTPUTS -! +! ! parent_id - identifier of the parent class -! hdferr: - error code +! hdferr: - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pget_class_parent_f(prp_id, parent_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list - ! identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list + ! identifier INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -3633,32 +3633,32 @@ CONTAINS hdferr = h5pget_class_parent_c(prp_id, parent_id) END SUBROUTINE h5pget_class_parent_f -!****s* H5P/h5pisa_class_f +!****s* H5P/h5pisa_class_f ! NAME -! h5pisa_class_f +! h5pisa_class_f ! ! PURPOSE -! Determines whether a property list is a member of a class. +! Determines whether a property list is a member of a class. ! ! INPUTS -! -! plist - property list identifier +! +! plist - property list identifier ! pclass - identifier of the property class ! OUTPUTS -! +! ! flag - .TRUE. if a member, .FALSE. otherwise -! hdferr: - error code +! hdferr: - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pisa_class_f(plist, pclass, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier INTEGER(HID_T), INTENT(IN) :: pclass ! Class identifier LOGICAL, INTENT(OUT) :: flag ! logical flag INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -3681,40 +3681,40 @@ CONTAINS ENDIF END SUBROUTINE h5pisa_class_f -!****s* H5P/h5pcopy_prop_f +!****s* H5P/h5pcopy_prop_f ! NAME -! h5pcopy_prop_f +! h5pcopy_prop_f ! ! PURPOSE ! Copies a property from one list or class to another. ! ! INPUTS -! +! ! dst_id - Identifier of the destination property list -! src_id - Identifier of the source property list +! src_id - Identifier of the source property list ! name - name of the property to copy ! OUTPUTS -! +! ! hdferr: - error code -! Success: 0 -! Failure: -1 +! Success: 0 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pcopy_prop_f(dst_id, src_id, name, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dst_id ! Destination property list - ! identifier - INTEGER(HID_T), INTENT(IN) :: src_id ! Source property list identifier + INTEGER(HID_T), INTENT(IN) :: dst_id ! Destination property list + ! identifier + INTEGER(HID_T), INTENT(IN) :: src_id ! Source property list identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Property name INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** INTEGER :: name_len - + INTERFACE INTEGER FUNCTION h5pcopy_prop_c(dst_id, src_id, name, name_len) & BIND(C,NAME='h5pcopy_prop_c') @@ -3731,27 +3731,27 @@ CONTAINS hdferr = h5pcopy_prop_c(dst_id, src_id, name , name_len) END SUBROUTINE h5pcopy_prop_f -!****s* H5P/h5premove_f +!****s* H5P/h5premove_f ! NAME -! h5premove_f +! h5premove_f ! ! PURPOSE -! Removes a property from a property list. +! Removes a property from a property list. ! ! INPUTS -! +! ! plid - Property list identofoer ! name - name of the property to remove ! OUTPUTS -! +! ! hdferr: - error code -! Success: 0 -! Failure: -1 +! Success: 0 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! Fortran90 Interface: SUBROUTINE h5premove_f(plid, name, hdferr) @@ -3762,14 +3762,14 @@ CONTAINS ! 0 on success and -1 on failure !***** INTEGER :: name_len - + INTERFACE INTEGER FUNCTION h5premove_c(plid, name, name_len) & BIND(C,NAME='h5premove_c') IMPORT :: C_CHAR IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plid + INTEGER(HID_T), INTENT(IN) :: plid CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER, INTENT(IN) :: name_len END FUNCTION h5premove_c @@ -3778,26 +3778,26 @@ CONTAINS hdferr = h5premove_c(plid, name , name_len) END SUBROUTINE h5premove_f -!****s* H5P/h5punregister_f +!****s* H5P/h5punregister_f ! NAME -! h5punregister_f +! h5punregister_f ! ! PURPOSE -! Removes a property from a property list class. +! Removes a property from a property list class. ! ! INPUTS -! +! ! class - Property list class identifier ! name - name of the property to remove ! OUTPUTS -! +! ! hdferr: - error code -! Success: 0 -! Failure: -1 +! Success: 0 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! Fortran90 Interface: SUBROUTINE h5punregister_f(class, name, hdferr) @@ -3824,25 +3824,25 @@ CONTAINS hdferr = h5punregister_c(class, name , name_len) END SUBROUTINE h5punregister_f -!****s* H5P/h5pclose_class_f +!****s* H5P/h5pclose_class_f ! NAME -! h5pclose_class_f +! h5pclose_class_f ! ! PURPOSE ! Closes an existing property list class. ! ! INPUTS -! +! ! class - Property list class identifier ! OUTPUTS -! -! hdferr - error code -! Success: 0 -! Failure: -1 +! +! hdferr - error code +! Success: 0 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal -! October 9, 2002 +! October 9, 2002 ! ! Fortran90 Interface: SUBROUTINE h5pclose_class_f(class, hdferr) @@ -3862,9 +3862,9 @@ CONTAINS hdferr = h5pclose_class_c(class) END SUBROUTINE h5pclose_class_f -!****s* H5P/h5pset_shuffle_f +!****s* H5P/h5pset_shuffle_f ! NAME -! h5pset_shuffle_f +! h5pset_shuffle_f ! ! PURPOSE ! Sets shuffling filter @@ -3872,9 +3872,9 @@ CONTAINS ! INPUTS ! prp_id - dataset creation property list identifier ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -3883,7 +3883,7 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pset_shuffle_f(prp_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -3896,26 +3896,26 @@ CONTAINS END FUNCTION h5pset_shuffle_c END INTERFACE hdferr = h5pset_shuffle_c(prp_id) - + END SUBROUTINE h5pset_shuffle_f -!****s* H5P/h5pset_edc_check_f +!****s* H5P/h5pset_edc_check_f ! NAME -! h5pset_edc_check_f +! h5pset_edc_check_f ! ! PURPOSE -! Enables/disables error detecting +! Enables/disables error detecting ! ! INPUTS -! +! ! prp_id - dataset creation property list identifier ! flag - EDC flag; possible values: ! H5Z_DISABLE_EDC_F ! H5Z_ENABLE_EDC_F ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -3924,7 +3924,7 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pset_edc_check_f(prp_id, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: flag ! Checksum filter flag INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -3935,27 +3935,27 @@ CONTAINS IMPORT :: HID_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: flag + INTEGER, INTENT(IN) :: flag END FUNCTION h5pset_edc_check_c END INTERFACE hdferr = h5pset_edc_check_c(prp_id, flag) - + END SUBROUTINE h5pset_edc_check_f !****s* H5P/h5pget_edc_check_f ! NAME -! h5pget_edc_check_f +! h5pget_edc_check_f ! ! PURPOSE -! Queries error detecting +! Queries error detecting ! ! INPUTS -! +! ! prp_id - dataset creation property list identifier ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -3964,7 +3964,7 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pget_edc_check_f(prp_id, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset transfer property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset transfer property list identifier INTEGER, INTENT(OUT) :: flag ! Checksum filter flag ! May have one of the following values: ! H5Z_ERROR_EDC_F @@ -3984,24 +3984,24 @@ CONTAINS END FUNCTION h5pget_edc_check_c END INTERFACE hdferr = h5pget_edc_check_c(prp_id, flag) - + END SUBROUTINE h5pget_edc_check_f !****s* H5P/h5pset_fletcher32_f ! NAME -! h5pset_fletcher32_f +! h5pset_fletcher32_f ! ! PURPOSE -! Sets Fletcher32 checksum of EDC for a dataset creation +! Sets Fletcher32 checksum of EDC for a dataset creation ! property list. ! ! INPUTS -! +! ! prp_id - dataset creation property list identifier ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -4010,7 +4010,7 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pset_fletcher32_f(prp_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** @@ -4028,19 +4028,19 @@ CONTAINS !****s* H5P/ h5pset_family_offset_f ! NAME -! h5pset_family_offset_f +! h5pset_family_offset_f ! ! PURPOSE ! Sets offset for family file driver. ! ! INPUTS -! +! ! prp_id - file creation property list identifier ! offset - file offset ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -4049,42 +4049,42 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pset_family_offset_f(prp_id, offset, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HSIZE_T), INTENT(IN) :: offset ! Offset in bytes INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTERFACE INTEGER FUNCTION h5pset_family_offset_c(prp_id, offset) & BIND(C,NAME='h5pset_family_offset_c') IMPORT :: HID_T, HSIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: offset + INTEGER(HSIZE_T), INTENT(IN) :: offset END FUNCTION h5pset_family_offset_c END INTERFACE hdferr = h5pset_family_offset_c(prp_id, offset) - + END SUBROUTINE h5pset_family_offset_f !****s* H5P/h5pset_fapl_multi_l ! NAME -! h5pset_fapl_multi_l +! h5pset_fapl_multi_l ! ! PURPOSE -! Sets up use of the multi-file driver. +! Sets up use of the multi-file driver. ! ! INPUTS -! +! ! prp_id - file creation property list identifier ! mem_map - mapping array ! memb_fapl - property list for each memory usage type ! memb_name - names of member file -! relax - flag +! relax - flag ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -4097,10 +4097,10 @@ CONTAINS INTEGER, DIMENSION(*), INTENT(IN) :: memb_map INTEGER(HID_T), DIMENSION(*), INTENT(IN) :: memb_fapl CHARACTER(LEN=*), DIMENSION(*), INTENT(IN) :: memb_name - REAL, DIMENSION(*), INTENT(IN) :: memb_addr + REAL, DIMENSION(*), INTENT(IN) :: memb_addr LOGICAL, INTENT(IN) :: relax INTEGER, INTENT(OUT) :: hdferr -!***** +!***** INTEGER, DIMENSION(1:H5FD_MEM_NTYPES_F) :: lenm INTEGER :: maxlen INTEGER :: flag = 0 @@ -4113,7 +4113,7 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, DIMENSION(*), INTENT(IN) :: memb_map INTEGER(HID_T), DIMENSION(*), INTENT(IN) :: memb_fapl CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: memb_name @@ -4132,21 +4132,21 @@ CONTAINS hdferr = h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag) END SUBROUTINE h5pset_fapl_multi_l -!****s* H5P/h5pset_fapl_multi_s +!****s* H5P/h5pset_fapl_multi_s ! NAME -! h5pset_fapl_multi_s +! h5pset_fapl_multi_s ! ! PURPOSE -! Sets up use of the multi-file driver. +! Sets up use of the multi-file driver. ! ! INPUTS -! +! ! prp_id - file creation property list identifier -! relax - flag +! relax - flag ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -4155,11 +4155,11 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pset_fapl_multi_s(prp_id, relax, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier LOGICAL, INTENT(IN) :: relax INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTEGER :: flag INTERFACE @@ -4167,37 +4167,37 @@ CONTAINS BIND(C,NAME='h5pset_fapl_multi_sc') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, INTENT(IN) :: flag END FUNCTION h5pset_fapl_multi_sc END INTERFACE flag = 0 IF (relax) flag = 1 - hdferr = h5pset_fapl_multi_sc(prp_id, flag) - + hdferr = h5pset_fapl_multi_sc(prp_id, flag) + END SUBROUTINE h5pset_fapl_multi_s -!****s* H5P/h5pget_fapl_multi_f +!****s* H5P/h5pget_fapl_multi_f ! NAME -! h5pget_fapl_multi_f +! h5pget_fapl_multi_f ! ! PURPOSE -! Sets up use of the multi-file driver. +! Sets up use of the multi-file driver. ! ! INPUTS -! +! ! prp_id - file creation property list identifier ! OUTPUTS -! +! ! mem_map - mapping array ! memb_fapl - property list for each memory usage type ! memb_name - names of member file -! relax - flag -! hdferr - error code +! relax - flag +! hdferr - error code ! Success: 0 ! Failure: -1 ! ! OPTIONAL PARAMETERS -! maxlen_out - maximum length for memb_name array element +! maxlen_out - maximum length for memb_name array element ! ! AUTHOR ! Elena Pourmal @@ -4206,19 +4206,19 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr, maxlen_out) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, DIMENSION(*), INTENT(OUT) :: memb_map INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl CHARACTER(LEN=*), DIMENSION(*), INTENT(OUT) :: memb_name REAL, DIMENSION(*), INTENT(OUT) :: memb_addr - INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out + INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out LOGICAL, INTENT(OUT) :: relax INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTEGER, DIMENSION(1:H5FD_MEM_NTYPES_F) :: lenm INTEGER :: maxlen - INTEGER :: c_maxlen_out + INTEGER :: c_maxlen_out INTEGER :: flag INTEGER :: i ! @@ -4229,14 +4229,14 @@ CONTAINS IMPORT :: C_CHAR IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, DIMENSION(*), INTENT(OUT) :: memb_map INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: memb_name REAL, DIMENSION(*), INTENT(OUT) :: memb_addr INTEGER, DIMENSION(*) :: lenm INTEGER :: maxlen - INTEGER :: c_maxlen_out + INTEGER :: c_maxlen_out INTEGER, INTENT(OUT) :: flag END FUNCTION h5pget_fapl_multi_c END INTERFACE @@ -4246,20 +4246,20 @@ CONTAINS lenm(i) = LEN_TRIM(memb_name(i)) ENDDO hdferr = h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag, c_maxlen_out) - + relax = .TRUE. IF(flag .EQ. 0) relax = .FALSE. IF(PRESENT(maxlen_out)) maxlen_out = c_maxlen_out END SUBROUTINE h5pget_fapl_multi_f -!****s* H5P/h5pset_szip_f +!****s* H5P/h5pset_szip_f ! NAME -! h5pset_szip_f +! h5pset_szip_f ! ! PURPOSE ! Sets up use of szip compression ! ! INPUTS -! +! ! prp_id - dataset creation property list identifier ! options_mask - A bit-mask conveying the desired SZIP options. ! Current valid values in Fortran are: @@ -4267,25 +4267,25 @@ CONTAINS ! H5_SZIP_NN_OM_F ! pixels_per_block - szip parameters ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal ! April 10 2003 ! ! Fortran90 Interface: - SUBROUTINE h5pset_szip_f(prp_id, options_mask, pixels_per_block, hdferr) + SUBROUTINE h5pset_szip_f(prp_id, options_mask, pixels_per_block, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property - ! list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property + ! list identifier INTEGER, INTENT(IN) :: options_mask ! A bit-mask conveying the desired ! SZIP options ! Current valid values in Fortran are: ! H5_SZIP_EC_OM_F ! H5_SZIP_NN_OM_F - INTEGER, INTENT(IN) :: pixels_per_block ! The number of pixels or data elements + INTEGER, INTENT(IN) :: pixels_per_block ! The number of pixels or data elements ! in each data block INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure @@ -4295,33 +4295,33 @@ CONTAINS BIND(C,NAME='h5pset_szip_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier INTEGER, INTENT(IN) :: options_mask INTEGER, INTENT(IN) :: pixels_per_block END FUNCTION h5pset_szip_c END INTERFACE - hdferr = h5pset_szip_c(prp_id, options_mask, pixels_per_block) - + hdferr = h5pset_szip_c(prp_id, options_mask, pixels_per_block) + END SUBROUTINE h5pset_szip_f -!****s* H5P/h5pall_filters_avail_f +!****s* H5P/h5pall_filters_avail_f ! NAME -! h5pall_filters_avail_f +! h5pall_filters_avail_f ! ! PURPOSE ! Checks if all filters set in the dataset creation ! property list are available ! ! INPUTS -! +! ! prp_id - data creation property list identifier ! OUTPUTS -! +! ! flag - .TRUE. if all filters are available ! .FALSE. otherwise -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -4330,13 +4330,13 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pall_filters_avail_f(prp_id, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property - ! list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property + ! list identifier LOGICAL, INTENT(OUT) :: flag ! .TRUE. if all filters are available ! .FALSE. otherwise INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTEGER :: status INTERFACE @@ -4349,24 +4349,24 @@ CONTAINS END FUNCTION h5pall_filters_avail_c END INTERFACE flag = .TRUE. - hdferr = h5pall_filters_avail_c(prp_id, status) + hdferr = h5pall_filters_avail_c(prp_id, status) IF (status .EQ. 0 ) flag = .FALSE. - + END SUBROUTINE h5pall_filters_avail_f !****s* H5P/h5pget_filter_by_id_f ! NAME -! h5pget_filter_by_id_f +! h5pget_filter_by_id_f ! ! PURPOSE ! Returns information about a filter in a pipeline ! ! INPUTS -! -! prp_id - data creation or transfer property list +! +! prp_id - data creation or transfer property list ! identifier ! OUTPUTS -! +! ! filter_id - filter identifier ! flags - bit vector specifying certain general ! properties of the filter @@ -4374,9 +4374,9 @@ CONTAINS ! cd_values - auxiliary data for the filter ! namelen - number of characters in the name buffer ! name - buffer to retrieve filter name -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -4385,7 +4385,7 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts, cd_values, namelen, name, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: filter_id ! Filter identifier INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts ! Number of elements in cd_values. INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter. @@ -4404,29 +4404,29 @@ CONTAINS IMPORT :: HID_T, SIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter_id + INTEGER, INTENT(IN) :: filter_id INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values - INTEGER, INTENT(OUT) :: flags + INTEGER, INTENT(OUT) :: flags INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts INTEGER(SIZE_T), INTENT(IN) :: namelen CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name END FUNCTION h5pget_filter_by_id_c END INTERFACE - - hdferr = h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & + + hdferr = h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & cd_values, namelen, name) END SUBROUTINE h5pget_filter_by_id_f !****s* H5P/h5pmodify_filter_f ! NAME -! h5pmodify_filter_f +! h5pmodify_filter_f ! ! PURPOSE -! Adds a filter to the filter pipeline. +! Adds a filter to the filter pipeline. ! ! INPUTS -! -! prp_id - data creation or transfer property list +! +! prp_id - data creation or transfer property list ! identifier ! filter - filter to be modified ! flags - bit vector specifying certain general @@ -4434,9 +4434,9 @@ CONTAINS ! cd_nelmts - number of elements in cd_values ! cd_values - auxiliary data for the filter ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Elena Pourmal @@ -4445,7 +4445,7 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pmodify_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER, INTENT(IN) :: filter ! Filter to be modified INTEGER, INTENT(IN) :: flags ! Bit vector specifying certain general ! properties of the filter @@ -4459,33 +4459,33 @@ CONTAINS BIND(C,NAME='h5pmodify_filter_c') IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(IN) :: flags - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(IN) :: flags + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values END FUNCTION h5pmodify_filter_c END INTERFACE - + hdferr = h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) END SUBROUTINE h5pmodify_filter_f -!****s* H5P/h5premove_filter_f +!****s* H5P/h5premove_filter_f ! NAME -! h5premove_filter_f +! h5premove_filter_f ! ! PURPOSE -! Delete one or more filters from the filter pipeline. +! Delete one or more filters from the filter pipeline. ! ! INPUTS -! -! prp_id - data creation or transfer property list +! +! prp_id - data creation or transfer property list ! identifier ! filter - filter to be removed ! OUTPUTS -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! Quincey Koziol @@ -4505,39 +4505,39 @@ CONTAINS BIND(C,NAME='h5premove_filter_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter END FUNCTION h5premove_filter_c END INTERFACE - + hdferr = h5premove_filter_c(prp_id, filter) END SUBROUTINE h5premove_filter_f !****s* H5P/H5Pget_attr_phase_change_f ! NAME -! H5Pget_attr_phase_change_f +! H5Pget_attr_phase_change_f ! ! PURPOSE -! Retrieves attribute storage phase change thresholds +! Retrieves attribute storage phase change thresholds ! ! INPUTS -! +! ! ocpl_id - Object (dataset or group) creation property list identifier ! OUTPUTS -! +! ! max_compact - Maximum number of attributes to be stored in compact storage ! (Default: 8) ! min_dense - Minimum number of attributes to be stored in dense storage ! (Default: 6) -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! January, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pget_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier @@ -4563,28 +4563,28 @@ CONTAINS hdferr = h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) END SUBROUTINE h5pget_attr_phase_change_f -!****s* H5P/H5Pset_attr_creation_order_f +!****s* H5P/H5Pset_attr_creation_order_f ! NAME -! H5Pset_attr_creation_order_f +! H5Pset_attr_creation_order_f ! ! PURPOSE ! Sets tracking and indexing of attribute creation order ! ! INPUTS -! +! ! ocpl_id - Object creation property list identifier ! crt_order_flags - Flags specifying whether to track and index attribute creation order ! OUTPUTS ! -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! January, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pset_attr_creation_order_f(ocpl_id, crt_order_flags , hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier @@ -4606,36 +4606,36 @@ CONTAINS hdferr = H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) END SUBROUTINE h5pset_attr_creation_order_f -!****s* H5P/H5Pset_shared_mesg_nindexes_f +!****s* H5P/H5Pset_shared_mesg_nindexes_f ! NAME -! H5Pset_shared_mesg_nindexes_f +! H5Pset_shared_mesg_nindexes_f ! ! PURPOSE -! Sets number of shared object header message indexes +! Sets number of shared object header message indexes ! ! INPUTS -! +! ! plist_id - file creation property list ! nindexes - Number of shared object header message indexes to be available in files created with this property list ! OUTPUTS ! -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! January, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pset_shared_mesg_nindexes_f( plist_id, nindexes, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list - INTEGER, INTENT(IN) :: nindexes ! Number of shared object header message indexes + INTEGER, INTENT(IN) :: nindexes ! Number of shared object header message indexes ! available in files created WITH this property list INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -4662,7 +4662,7 @@ CONTAINS ! Configures the specified shared object header message index ! ! INPUTS -! +! ! fcpl_id - File creation property list identifier. ! index_num - Index being configured. ! mesg_type_flags - Types of messages that should be stored in this index. @@ -4670,15 +4670,15 @@ CONTAINS ! ! OUTPUTS ! -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! January, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pset_shared_mesg_index_f(fcpl_id, index_num, mesg_type_flags, min_mesg_size, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fcpl_id ! file creation property list @@ -4687,7 +4687,7 @@ CONTAINS INTEGER, INTENT(IN) :: min_mesg_size ! Minimum message size. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -4696,7 +4696,7 @@ CONTAINS BIND(C,NAME='h5pset_shared_mesg_index_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fcpl_id + INTEGER(HID_T), INTENT(IN) :: fcpl_id INTEGER, INTENT(IN) :: index_num INTEGER, INTENT(IN) :: mesg_type_flags INTEGER, INTENT(IN) :: min_mesg_size @@ -4721,22 +4721,22 @@ CONTAINS ! OUTPUTS ! ! crt_order_flags - Flags specifying whether to track and index attribute creation order -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! February, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pget_attr_creation_order_f(ocpl_id, crt_order_flags, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (group or dataset) creation property list identifier - INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order + INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (group or dataset) creation property list identifier + INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -4759,7 +4759,7 @@ CONTAINS ! H5Pget_libver_bounds_f ! ! PURPOSE -! Retrieves the lower and upper bounds on the HDF5 library release versions that indirectly +! Retrieves the lower and upper bounds on the HDF5 library release versions that indirectly ! determine the object format versions used when creating objects in the file. ! ! INPUTS @@ -4828,15 +4828,15 @@ CONTAINS ! ! OUTPUTS ! -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! February 18, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pset_libver_bounds_f(fapl_id, low, high, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier @@ -4867,9 +4867,9 @@ CONTAINS END SUBROUTINE h5pset_libver_bounds_f -!****s* H5P/H5Pset_link_creation_order_f +!****s* H5P/H5Pset_link_creation_order_f ! NAME -! H5Pset_link_creation_order_f +! H5Pset_link_creation_order_f ! ! PURPOSE ! Sets creation order tracking and indexing for links in a group. @@ -4881,15 +4881,15 @@ CONTAINS ! ! OUTPUTS ! -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! February 18, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pset_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: gcpl_id ! File access property list identifier @@ -4920,21 +4920,21 @@ CONTAINS ! Queries the settings for conversion between compact and dense groups. ! ! INPUTS -! +! ! gcpl_id - Group creation property list identifier ! OUTPUTS -! +! ! max_compact - Maximum number of attributes to be stored in compact storage ! min_dense - Minimum number of attributes to be stored in dense storage -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! February 20, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pget_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier @@ -4958,37 +4958,37 @@ CONTAINS hdferr = h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) END SUBROUTINE h5pget_link_phase_change_f -!****s* H5P/H5Pget_obj_track_times_f +!****s* H5P/H5Pget_obj_track_times_f ! NAME -! H5Pget_obj_track_times_f +! H5Pget_obj_track_times_f ! ! PURPOSE ! Returns whether times are tracked for an object. ! ! INPUTS -! +! ! plist_id - property list id ! flag - object timestamp setting ! .TRUE.,.FALSE. ! OUTPUTS ! -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! February 22, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pget_obj_track_times_f(plist_id, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property - ! list identifier + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property + ! list identifier LOGICAL, INTENT(OUT) :: flag ! Object timestamp setting INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTEGER :: status ! ! MS FORTRAN needs explicit interface for C functions called here. @@ -4997,7 +4997,7 @@ CONTAINS INTEGER FUNCTION h5pget_obj_track_times_c(plist_id, status) & BIND(C,NAME='h5pget_obj_track_times_c') IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier + INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier INTEGER, INTENT(OUT) :: status END FUNCTION h5pget_obj_track_times_c END INTERFACE @@ -5007,9 +5007,9 @@ CONTAINS END SUBROUTINE h5pget_obj_track_times_f -!****s* H5P/H5Pset_obj_track_times_f +!****s* H5P/H5Pset_obj_track_times_f ! NAME -! H5Pset_obj_track_times_f +! H5Pset_obj_track_times_f ! ! PURPOSE ! Set whether the birth, access, modification & change times for @@ -5029,22 +5029,22 @@ CONTAINS ! epoch) when queried. ! ! INPUTS -! +! ! plist_id - property list id ! flag - object timestamp setting ! .TRUE.,.FALSE. ! OUTPUTS ! -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! February 22, 2008 -! -! -! Fortran90 Interface: +! +! +! Fortran90 Interface: SUBROUTINE h5pset_obj_track_times_f(plist_id, flag, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property @@ -5052,7 +5052,7 @@ CONTAINS LOGICAL, INTENT(IN) :: flag ! Object timestamp setting INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTEGER :: status ! ! MS FORTRAN needs explicit interface for C functions called here. @@ -5062,7 +5062,7 @@ CONTAINS BIND(C,NAME='h5pset_obj_track_times_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier + INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier INTEGER, INTENT(IN) :: status END FUNCTION h5pset_obj_track_times_c END INTERFACE @@ -5082,22 +5082,22 @@ CONTAINS ! Specifies in property list whether to create missing intermediate groups. ! ! INPUTS -! +! ! lcpl_id - Link creation property list identifier -! crt_intermed_group - crt_intermed_group specifying whether -! to create intermediate groups upon the creation +! crt_intermed_group - crt_intermed_group specifying whether +! to create intermediate groups upon the creation ! of an object ! OUTPUTS ! -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! February 22, 2008 ! -! HISTORY +! HISTORY ! The long subroutine name (>31) on older f90 compilers causes problems ! so had to shorten the name ! Fortran90 Interface: @@ -5137,15 +5137,15 @@ CONTAINS ! OUTPUTS ! ! crt_order_flags - Creation order flag(s) -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! March 3, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pget_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier @@ -5183,15 +5183,15 @@ CONTAINS ! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding ! ! OUTPUTS -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! March 3, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pset_char_encoding_f(plist_id, encoding, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier @@ -5232,15 +5232,15 @@ CONTAINS ! encoding - Valid values for encoding are: ! H5T_CSET_ASCII_F -> US ASCII ! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! March 3, 2008 ! -! Fortran90 Interface: +! Fortran90 Interface: SUBROUTINE h5pget_char_encoding_f(plist_id, encoding, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier @@ -5268,20 +5268,20 @@ CONTAINS !****s* H5P/h5pset_copy_object_f ! NAME -! h5pset_copy_object_f +! h5pset_copy_object_f ! ! PURPOSE ! Sets properties to be used when an object is copied. ! ! INPUTS -! +! ! ocp_plist_id - Object copy property list identifier ! copy_options - Copy option(s) to be set ! OUTPUTS -! -! hdferr - error code +! +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld @@ -5289,8 +5289,8 @@ CONTAINS ! ! HISTORY ! -! -! Fortran90 Interface: +! +! Fortran90 Interface: SUBROUTINE h5pset_copy_object_f(ocp_plist_id, copy_options, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier @@ -5317,20 +5317,20 @@ CONTAINS !****s* H5P/h5pget_copy_object_f ! NAME -! h5pget_copy_object_f +! h5pget_copy_object_f ! ! PURPOSE ! Retrieves the properties to be used when an object is copied. ! ! INPUTS -! +! ! ocp_plist_id - Object copy property list identifier ! OUTPUTS -! +! ! copy_options - Copy option(s) to be get -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld @@ -5338,14 +5338,14 @@ CONTAINS ! ! HISTORY ! -! +! ! Fortran90 Interface: SUBROUTINE h5pget_copy_object_f(ocp_plist_id, copy_options, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier INTEGER, INTENT(OUT) :: copy_options ! Valid copy options returned are: ! H5O_COPY_SHALLOW_HIERARCHY_F - ! H5O_COPY_EXPAND_SOFT_LINK_F + ! H5O_COPY_EXPAND_SOFT_LINK_F ! H5O_COPY_EXPAND_EXT_LINK_F ! H5O_COPY_EXPAND_REFERENCE_F ! H5O_COPY_WITHOUT_ATTR_FLAG_F @@ -5364,23 +5364,23 @@ CONTAINS hdferr = h5pget_copy_object_c(ocp_plist_id, copy_options) END SUBROUTINE h5pget_copy_object_f -!****s* H5P/h5pget_data_transform_f +!****s* H5P/h5pget_data_transform_f ! NAME -! h5pget_data_transform_f +! h5pget_data_transform_f ! ! PURPOSE ! Retrieves a data transform expression. ! ! INPUTS -! +! ! plist_id - Identifier of the property list or class ! OUTPUTS -! +! ! expression - buffer to hold transform expression ! hdferr - Error code ! Success: Actual length of the expression -! If provided buffer "expression" is -! smaller, than expression will be +! If provided buffer "expression" is +! smaller, than expression will be ! truncated to fit into ! provided user buffer ! Failure: -1 @@ -5400,7 +5400,7 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size ! Registered size of the transform expression INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTEGER :: expression_len INTEGER(SIZE_T) :: size_default @@ -5410,8 +5410,8 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: expression + INTEGER(HID_T), INTENT(IN) :: plist_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: expression INTEGER(SIZE_T) :: size_default INTEGER :: expression_len END FUNCTION h5pget_data_transform_c @@ -5426,19 +5426,19 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) END SUBROUTINE h5pget_data_transform_f -!****s* H5P/h5pset_data_transform_f +!****s* H5P/h5pset_data_transform_f ! NAME -! h5pset_data_transform_f +! h5pset_data_transform_f ! ! PURPOSE ! Sets a data transform expression. ! ! INPUTS -! -! plist_id - Identifier of the property list or class +! +! plist_id - Identifier of the property list or class ! expression - Buffer to hold transform expression ! OUTPUTS -! +! ! hdferr - error code ! Success: 0 ! Failure: -1 @@ -5454,7 +5454,7 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) CHARACTER(LEN=*), INTENT(IN) :: expression ! Buffer to hold transform expression INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTEGER :: expression_len INTERFACE @@ -5463,7 +5463,7 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) IMPORT :: C_CHAR IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HID_T), INTENT(IN) :: plist_id CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: expression INTEGER :: expression_len END FUNCTION h5pset_data_transform_c @@ -5474,15 +5474,15 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) END SUBROUTINE h5pset_data_transform_f -!****s* H5P/H5Pget_local_heap_size_hint_f +!****s* H5P/H5Pget_local_heap_size_hint_f ! NAME -! H5Pget_local_heap_size_hint_f +! H5Pget_local_heap_size_hint_f ! ! PURPOSE ! Queries the local heap size hint for original-style groups. ! ! INPUTS -! +! ! gcpl_id - Group creation property list identifier ! OUTPUTS ! @@ -5517,18 +5517,18 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) END SUBROUTINE h5pget_local_heap_size_hint_f -!****s* H5P/H5Pget_est_link_info_f +!****s* H5P/H5Pget_est_link_info_f ! NAME -! H5Pget_est_link_info_f +! H5Pget_est_link_info_f ! ! PURPOSE ! Queries data required to estimate required local heap or object header size. ! ! INPUTS -! +! ! gcpl_id - Group creation property list identifier ! OUTPUTS -! +! ! est_num_entries - Estimated number of links to be inserted into group ! est_name_len - Estimated average length of link names ! hdferr - Error code @@ -5541,11 +5541,11 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) ! ! HISTORY ! -! +! ! Fortran90 Interface: SUBROUTINE h5pget_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier INTEGER, INTENT(OUT) :: est_num_entries ! Estimated number of links to be inserted into group INTEGER, INTENT(OUT) :: est_name_len ! Estimated average length of link names INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -5556,7 +5556,7 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) BIND(C,NAME='h5pget_est_link_info_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(OUT) :: est_num_entries INTEGER, INTENT(OUT) :: est_name_len END FUNCTION h5pget_est_link_info_c @@ -5566,15 +5566,15 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) END SUBROUTINE h5pget_est_link_info_f -!****s* H5P/H5Pset_local_heap_size_hint_f +!****s* H5P/H5Pset_local_heap_size_hint_f ! NAME -! H5Pset_local_heap_size_hint_f +! H5Pset_local_heap_size_hint_f ! ! PURPOSE ! Sets the local heap size hint for original-style groups. ! ! INPUTS -! +! ! gcpl_id - Group creation property list identifier ! size_hint - Hint for size of local heap ! OUTPUTS @@ -5598,7 +5598,7 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) INTERFACE INTEGER FUNCTION h5pset_local_heap_size_hint_c(gcpl_id, size_hint) & BIND(C,NAME='h5pset_local_heap_size_hint_c') - IMPORT :: HID_T, SIZE_T + IMPORT :: HID_T, SIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER(SIZE_T), INTENT(IN) :: size_hint @@ -5609,16 +5609,16 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) END SUBROUTINE h5pset_local_heap_size_hint_f -!****s* H5P/h5pset_est_link_info_f +!****s* H5P/h5pset_est_link_info_f ! NAME -! h5pset_est_link_info_f +! h5pset_est_link_info_f ! ! PURPOSE ! Sets estimated number of links and length of link names in a group. ! ! INPUTS -! -! gcpl_id - Group creation property list identifier +! +! gcpl_id - Group creation property list identifier ! est_num_entries - Estimated number of links to be inserted into group ! est_name_len - Estimated average length of link names ! OUTPUTS @@ -5634,7 +5634,7 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) ! Fortran90 Interface: SUBROUTINE h5pset_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier INTEGER, INTENT(IN) :: est_num_entries ! Estimated number of links to be inserted into group INTEGER, INTENT(IN) :: est_name_len ! Estimated average length of link names INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -5645,7 +5645,7 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) BIND(C,NAME='h5pset_est_link_info_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id + INTEGER(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(IN) :: est_num_entries INTEGER, INTENT(IN) :: est_name_len END FUNCTION h5pset_est_link_info_c @@ -5663,15 +5663,15 @@ SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) ! Sets the parameters for conversion between compact and dense groups. ! ! INPUTS -! -! gcpl_id - Group creation property list identifier +! +! gcpl_id - Group creation property list identifier ! max_compact - Maximum number of attributes to be stored in compact storage ! min_dense - Minimum number of attributes to be stored in dense storage ! OUTPUTS ! -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld @@ -5708,16 +5708,16 @@ SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) ! Sets up use of the direct I/O driver. ! ! INPUTS -! +! ! fapl_id - File access property list identifier ! alignment - Required memory alignment boundary ! block_size - File system block size ! cbuf_size - Copy buffer size ! OUTPUTS ! -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld @@ -5725,7 +5725,7 @@ SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) ! ! Fortran90 Interface: SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) - IMPLICIT NONE + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier INTEGER(SIZE_T), INTENT(IN) :: alignment ! Required memory alignment boundary! INTEGER(SIZE_T), INTENT(IN) :: block_size ! File system block size @@ -5738,7 +5738,7 @@ SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdfer BIND(C,NAME='h5pset_fapl_direct_c') IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER(HID_T), INTENT(IN) :: fapl_id INTEGER(SIZE_T), INTENT(IN) :: alignment INTEGER(SIZE_T), INTENT(IN) :: block_size INTEGER(SIZE_T), INTENT(IN) :: cbuf_size @@ -5756,16 +5756,16 @@ SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdfer ! Gets up use of the direct I/O driver. ! ! INPUTS -! +! ! fapl_id - File access property list identifier ! OUTPUTS ! ! alignment - Required memory alignment boundary ! block_size - File system block size ! cbuf_size - Copy buffer size -! hdferr - error code +! hdferr - error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld @@ -5773,7 +5773,7 @@ SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdfer ! ! Fortran90 Interface: SUBROUTINE h5pget_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) - IMPLICIT NONE + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier INTEGER(SIZE_T), INTENT(OUT) :: alignment ! Required memory alignment boundary! INTEGER(SIZE_T), INTENT(OUT) :: block_size ! File system block size @@ -5786,7 +5786,7 @@ SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdfer BIND(C,NAME='h5pget_fapl_direct_c') IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER(HID_T), INTENT(IN) :: fapl_id INTEGER(SIZE_T), INTENT(OUT) :: alignment INTEGER(SIZE_T), INTENT(OUT) :: block_size INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size @@ -5798,23 +5798,23 @@ SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdfer !****s* H5P/H5Pset_attr_phase_change_f ! NAME -! H5Pset_attr_phase_change_f +! H5Pset_attr_phase_change_f ! ! PURPOSE ! Sets attribute storage phase change thresholds. ! ! INPUTS -! +! ! ocpl_id - Object (dataset or group) creation property list identifier ! OUTPUTS -! +! ! max_compact - Maximum number of attributes to be stored in compact storage ! (Default: 8) ! min_dense - Minimum number of attributes to be stored in dense storage ! (Default: 6) -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld @@ -5850,7 +5850,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) !****s* H5P/H5Pset_nbit_f ! NAME -! H5Pset_nbit_f +! H5Pset_nbit_f ! ! PURPOSE ! Sets up the use of the N-Bit filter. @@ -5886,7 +5886,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) !****s* H5P/h5pset_scaleoffset_f ! NAME -! h5pset_scaleoffset_f +! h5pset_scaleoffset_f ! ! PURPOSE ! Sets up the use of the scale-offset filter. @@ -5914,7 +5914,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER , INTENT(IN) :: scale_type INTEGER , INTENT(IN) :: scale_factor INTEGER , INTENT(OUT) :: hdferr -!***** +!***** INTERFACE INTEGER FUNCTION h5pset_scaleoffset_c(plist_id, scale_type, scale_factor) & @@ -5931,15 +5931,15 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) END SUBROUTINE h5pset_scaleoffset_f -!****s* H5P/h5pset_nlinks_f +!****s* H5P/h5pset_nlinks_f ! NAME -! h5pset_nlinks_f +! h5pset_nlinks_f ! ! PURPOSE ! Sets maximum number of soft or user-defined link traversals. ! ! INPUTS -! +! ! lapl_id - File access property list identifier ! nlinks - Maximum number of links to traverse ! @@ -5955,15 +5955,15 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! ! HISTORY ! -! +! ! Fortran90 Interface: SUBROUTINE h5pset_nlinks_f(lapl_id, nlinks, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier INTEGER(SIZE_T), INTENT(IN) :: nlinks ! Maximum number of links to traverse - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTERFACE INTEGER FUNCTION h5pset_nlinks_c(lapl_id, nlinks) & BIND(C,NAME='h5pset_nlinks_c') @@ -5978,15 +5978,15 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) END SUBROUTINE h5pset_nlinks_f -!****s* H5P/h5pget_nlinks_f +!****s* H5P/h5pget_nlinks_f ! NAME -! h5pget_nlinks_f +! h5pget_nlinks_f ! ! PURPOSE ! Gets maximum number of soft or user-defined link traversals. ! ! INPUTS -! +! ! lapl_id - File access property list identifier ! nlinks - Maximum number of links to traverse ! @@ -6011,7 +6011,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTERFACE INTEGER FUNCTION h5pget_nlinks_c(lapl_id, nlinks) & BIND(C,NAME='h5pget_nlinks_c') - IMPORT :: HID_T, SIZE_T + IMPORT :: HID_T, SIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: lapl_id INTEGER(SIZE_T), INTENT(OUT) :: nlinks @@ -6030,22 +6030,22 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! Determines whether property is set to enable creating missing intermediate groups. ! ! INPUTS -! +! ! lcpl_id - Link creation property list identifier -! crt_intermed_group - Specifying whether to create intermediate groups upon +! crt_intermed_group - Specifying whether to create intermediate groups upon ! the creation of an object ! OUTPUTS ! -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld ! April 4, 2008 ! ! HISTORY -! +! ! The long subroutine name (>31) on older f90 compilers causes problems ! so the name was shortened ! Fortran90 Interface: @@ -6056,7 +6056,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! upon creation of an object INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTERFACE INTEGER FUNCTION h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) & BIND(C,NAME='h5pget_create_inter_group_c') @@ -6095,16 +6095,16 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! other chunks. ! ! INPUTS -! +! ! dapl_id - Dataset access property list identifier. ! rdcc_nslots - The number of chunk slots in the raw data chunk cache for this dataset. ! rdcc_nbytes - The total size of the raw data chunk cache for this dataset. ! rdcc_w0 - The chunk preemption policy for this dataset. ! OUTPUTS ! -! hdferr - Error code +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld @@ -6116,19 +6116,19 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) SUBROUTINE h5pset_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots ! The number of chunk slots in the raw data + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots ! The number of chunk slots in the raw data ! chunk cache for this dataset. - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! The total size of the raw data chunk cache + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! The total size of the raw data chunk cache ! for this dataset. REAL, INTENT(IN) :: rdcc_w0 ! The chunk preemption policy for this dataset. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure -!***** +!***** INTERFACE INTEGER FUNCTION h5pset_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) & BIND(C,NAME='h5pset_chunk_cache_c') - IMPORT :: HID_T, SIZE_T + IMPORT :: HID_T, SIZE_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dapl_id INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots @@ -6155,16 +6155,16 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! file access property list are returned. ! ! INPUTS -! +! ! dapl_id - Dataset access property list identifier. ! OUTPUTS -! -! rdcc_nslots - Number of chunk slots in the raw data chunk cache hash table. -! rdcc_nbytes - Total size of the raw data chunk cache, in bytes. -! rdcc_w0 - Preemption policy. -! hdferr - Error code +! +! rdcc_nslots - Number of chunk slots in the raw data chunk cache hash table. +! rdcc_nbytes - Total size of the raw data chunk cache, in bytes. +! rdcc_w0 - Preemption policy. +! hdferr - Error code ! Success: 0 -! Failure: -1 +! Failure: -1 ! ! AUTHOR ! M. Scot Breitenfeld @@ -6177,11 +6177,11 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots ! Number of chunk slots in the raw data chunk cache hash table. - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data chunk cache, in bytes. + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data chunk cache, in bytes. REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy. INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure -!***** +!***** INTERFACE INTEGER FUNCTION h5pget_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) & BIND(C,NAME='h5pget_chunk_cache_c') @@ -6234,7 +6234,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. ! ! Fortran90 Interface: -!! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) !! IMPLICIT NONE !! INTEGER(HID_T), INTENT(IN) :: prp_id !! INTEGER(HID_T), INTENT(IN) :: type_id @@ -6295,7 +6295,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! ! Fortran90 Interface: !! SUBROUTINE h5pget_fill_value_f(prp_id, type_id, fillvalue, hdferr) -!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: prp_id !! INTEGER(HID_T), INTENT(IN) :: type_id !! TYPE(VOID) , INTENT(OUT) :: fillvalue !! INTEGER , INTENT(OUT) :: hdferr @@ -6402,7 +6402,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! ! Fortran2003 Interface: !! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) -!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: prp_id !! INTEGER(HID_T), INTENT(IN) :: type_id !! TYPE(C_PTR) , INTENT(IN) :: fillvalue !! INTEGER , INTENT(OUT) :: hdferr @@ -6458,7 +6458,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! ! Fortran2003 Interface: !! SUBROUTINE h5pget_fill_value_f(prp_id, type_id, fillvalue, hdferr) -!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: prp_id !! INTEGER(HID_T), INTENT(IN) :: type_id !! TYPE(C_PTR) :: fillvalue !! INTEGER , INTENT(OUT) :: hdferr @@ -6750,7 +6750,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) !! CHARACTER(LEN=*), INTENT(IN) :: name !! INTEGER(SIZE_T) , INTENT(IN) :: size !! TYPE , INTENT(IN) :: value -!! INTEGER , INTENT(OUT) :: hdferr +!! INTEGER , INTENT(OUT) :: hdferr !***** SUBROUTINE h5pregister_integer(class, name, size, value, hdferr) IMPLICIT NONE @@ -6832,7 +6832,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) !! CHARACTER(LEN=*), INTENT(IN) :: name !! INTEGER(SIZE_T) , INTENT(IN) :: size !! TYPE(C_PTR) , INTENT(IN) :: value -!! INTEGER , INTENT(OUT) :: hdferr +!! INTEGER , INTENT(OUT) :: hdferr !***** SUBROUTINE h5pregister_ptr(class, name, size, value, hdferr) @@ -6951,7 +6951,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! Outputs: ! hdferr - Returns 0 if successful and -1 if fails ! -! AUTHOR +! AUTHOR ! M. Scot Breitenfeld ! June 24, 2008 ! @@ -7077,7 +7077,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! ! Inputs: ! fapl_id - File access property list identifier -! buf_ptr - Pointer to the initial file image, +! buf_ptr - Pointer to the initial file image, ! or C_NULL_PTR if no initial file image is desired ! buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired ! @@ -7117,7 +7117,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! h5pget_file_image_f ! ! PURPOSE -! Retrieves a copy of the file image designated as the initial content and structure of a file. +! Retrieves a copy of the file image designated as the initial content and structure of a file. ! ! Inputs: ! fapl_id - File access property list identifier. @@ -7149,7 +7149,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) TYPE(C_PTR) , INTENT(OUT), DIMENSION(*) :: buf_ptr INTEGER(SIZE_T), INTENT(OUT) :: buf_len_ptr INTEGER , INTENT(OUT) :: hdferr - + !***** INTERFACE INTEGER FUNCTION h5pget_file_image_c(fapl_id, buf_ptr, buf_len_ptr) & @@ -7205,7 +7205,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) BIND(C,NAME='h5pset_fapl_mpio_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER , INTENT(IN) :: comm INTEGER , INTENT(IN) :: info END FUNCTION h5pset_fapl_mpio_c @@ -7248,7 +7248,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) BIND(C,NAME='h5pget_fapl_mpio_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER , INTENT(OUT) :: comm INTEGER , INTENT(OUT) :: info END FUNCTION h5pget_fapl_mpio_c @@ -7291,7 +7291,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) BIND(C,NAME='h5pset_dxpl_mpio_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER , INTENT(IN) :: data_xfer_mode END FUNCTION h5pset_dxpl_mpio_c END INTERFACE @@ -7333,7 +7333,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) BIND(C,NAME='h5pget_dxpl_mpio_c') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER , INTENT(OUT) :: data_xfer_mode END FUNCTION h5pget_dxpl_mpio_c END INTERFACE @@ -7346,8 +7346,8 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! h5pget_mpio_actual_io_mode_f ! ! PURPOSE -! Retrieves the type of I/O that HDF5 actually performed on the last -! parallel I/O call. This is not necessarily the type of I/O requested. +! Retrieves the type of I/O that HDF5 actually performed on the last +! parallel I/O call. This is not necessarily the type of I/O requested. ! ! INPUTS ! dxpl_id - Dataset transfer property list identifier. @@ -7367,7 +7367,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER(HID_T), INTENT(IN) :: dxpl_id INTEGER , INTENT(OUT) :: actual_io_mode INTEGER , INTENT(OUT) :: hdferr -!***** +!***** INTERFACE INTEGER FUNCTION h5pget_mpio_actual_io_mode_c(dxpl_id, actual_io_mode) & BIND(C,NAME='h5pget_mpio_actual_io_mode_c') @@ -7389,9 +7389,9 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! h5pset_all_coll_metadata_ops_f ! ! PURPOSE -! Sets requirement whether HDF5 metadata read operations using the access property -! list are required to be collective or independent. If collective requirement is -! selected, the HDF5 library will optimize the metadata reads improving performance. +! Sets requirement whether HDF5 metadata read operations using the access property +! list are required to be collective or independent. If collective requirement is +! selected, the HDF5 library will optimize the metadata reads improving performance. ! The default setting is independent (false). ! ! INPUTS @@ -7414,7 +7414,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER, INTENT(OUT) :: hdferr !***** LOGICAL(C_BOOL) :: c_is_collective - + INTERFACE INTEGER FUNCTION h5pset_all_coll_metadata_ops(plist_id, is_collective) BIND(C, NAME='H5Pset_all_coll_metadata_ops') IMPORT :: HID_T, C_BOOL @@ -7426,12 +7426,12 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! Transfer value of Fortran LOGICAL to C c_bool type c_is_collective = is_collective - + hdferr = INT(H5Pset_all_coll_metadata_ops(plist_id, c_is_collective)) - + END SUBROUTINE h5pset_all_coll_metadata_ops_f -!****s* H5P/h5pget_all_coll_metadata_ops_f +!****s* H5P/h5pget_all_coll_metadata_ops_f ! NAME ! h5pget_all_coll_metadata_ops_f ! @@ -7452,14 +7452,14 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! ! SOURCE SUBROUTINE h5pget_all_coll_metadata_ops_f(plist_id, is_collective, hdferr) - + IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: plist_id LOGICAL, INTENT(OUT) :: is_collective INTEGER, INTENT(OUT) :: hdferr !***** LOGICAL(C_BOOL) :: c_is_collective - + INTERFACE INTEGER FUNCTION h5pget_all_coll_metadata_ops(plist_id, is_collective) BIND(C, NAME='H5Pget_all_coll_metadata_ops') IMPORT :: HID_T, C_BOOL @@ -7468,12 +7468,12 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) LOGICAL(C_BOOL), INTENT(OUT) :: is_collective END FUNCTION h5pget_all_coll_metadata_ops END INTERFACE - + hdferr = INT(H5Pget_all_coll_metadata_ops(plist_id, c_is_collective)) - - ! Transfer value of C c_bool type to Fortran LOGICAL + + ! Transfer value of C c_bool type to Fortran LOGICAL is_collective = c_is_collective - + END SUBROUTINE h5pget_all_coll_metadata_ops_f !****s* H5P/h5pset_coll_metadata_write_f @@ -7503,7 +7503,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER, INTENT(OUT) :: hdferr !***** LOGICAL(C_BOOL) :: c_is_collective - + INTERFACE INTEGER FUNCTION h5pset_coll_metadata_write(plist_id, is_collective) BIND(C, NAME='H5Pset_coll_metadata_write') IMPORT :: HID_T, C_BOOL @@ -7512,12 +7512,12 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) LOGICAL(C_BOOL), INTENT(IN), VALUE :: is_collective END FUNCTION h5pset_coll_metadata_write END INTERFACE - + ! Transfer value of Fortran LOGICAL to C c_bool type c_is_collective = is_collective - + hdferr = INT(H5Pset_coll_metadata_write(plist_id, c_is_collective)) - + END SUBROUTINE h5pset_coll_metadata_write_f !****s* H5P/h5pget_coll_metadata_write_f @@ -7541,14 +7541,14 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! ! SOURCE SUBROUTINE h5pget_coll_metadata_write_f(plist_id, is_collective, hdferr) - + IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: plist_id LOGICAL, INTENT(OUT) :: is_collective INTEGER, INTENT(OUT) :: hdferr !***** LOGICAL(C_BOOL) :: c_is_collective - + INTERFACE INTEGER FUNCTION h5pget_coll_metadata_write(plist_id, is_collective) BIND(C, NAME='H5Pget_coll_metadata_write') IMPORT :: HID_T, C_BOOL @@ -7557,14 +7557,14 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) LOGICAL(C_BOOL), INTENT(OUT) :: is_collective END FUNCTION h5pget_coll_metadata_write END INTERFACE - + hdferr = INT(H5Pget_coll_metadata_write(plist_id, c_is_collective)) - - ! Transfer value of C c_bool type to Fortran LOGICAL + + ! Transfer value of C c_bool type to Fortran LOGICAL is_collective = c_is_collective - + END SUBROUTINE h5pget_coll_metadata_write_f - + #endif ! @@ -7584,9 +7584,9 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! Valid values are: ! H5D_VDS_FIRST_MISSING_F ! H5D_VDS_LAST_AVAILABLE_F -! +! ! OUTPUTS -! +! ! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR @@ -7601,7 +7601,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER(HID_T), INTENT(IN) :: dapl_id INTEGER , INTENT(IN) :: view INTEGER , INTENT(OUT) :: hdferr - + !***** INTERFACE INTEGER FUNCTION h5pset_virtual_view(dapl_id, view) BIND(C,NAME='H5Pset_virtual_view') @@ -7613,7 +7613,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) END INTERFACE hdferr = INT( h5pset_virtual_view(dapl_id, INT(view,ENUM_T)) ) - + END SUBROUTINE h5pset_virtual_view_f !****s* H5P/h5pget_virtual_view_f @@ -7621,7 +7621,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! h5pget_virtual_view_f ! ! PURPOSE -! Retrieves the view of a virtual dataset accessed with dapl_id. +! Retrieves the view of a virtual dataset accessed with dapl_id. ! ! INPUTS ! dapl_id - Dataset access property list identifier for the virtual dataset @@ -7657,7 +7657,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) hdferr = INT( h5pget_virtual_view(dapl_id, view_enum) ) view = INT(view_enum) - + END SUBROUTINE h5pget_virtual_view_f !****s* H5P/h5pset_virtual_printf_gap_f @@ -7665,15 +7665,15 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! h5pset_virtual_printf_gap_f ! ! PURPOSE -! Sets the maximum number of missing source files and/or datasets with the printf-style names -! when getting the extent of an unlimited virtual dataset. +! Sets the maximum number of missing source files and/or datasets with the printf-style names +! when getting the extent of an unlimited virtual dataset. ! ! INPUTS ! dapl_id - Dataset access property list identifier for the virtual dataset. -! gap_size - Maximum number of files and/or datasets allowed to be missing for determining +! gap_size - Maximum number of files and/or datasets allowed to be missing for determining ! the extent of an unlimited virtual dataset with printf-style mappings. ! -! OUTPUTS +! OUTPUTS ! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR @@ -7682,7 +7682,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! ! HISTORY ! -! SOURCE +! SOURCE SUBROUTINE h5pset_virtual_printf_gap_f(dapl_id, gap_size, hdferr) IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: dapl_id @@ -7699,7 +7699,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) END INTERFACE hdferr = INT( h5pset_virtual_printf_gap(dapl_id, gap_size) ) - + END SUBROUTINE h5pset_virtual_printf_gap_f !****s* H5P/h5pget_virtual_printf_gap_f @@ -7707,15 +7707,15 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! h5pget_virtual_printf_gap_f ! ! PURPOSE -! Returns the maximum number of missing source files and/or datasets with the +! Returns the maximum number of missing source files and/or datasets with the ! printf-style names when getting the extent for an unlimited virtual dataset. ! ! INPUTS ! dapl_id - Dataset access property list identifier for the virtual dataset ! ! OUTPUTS -! gap_size - Maximum number of the files and/or datasets allowed to be missing for -! determining the extent of an unlimited virtual dataset with printf-style mappings. +! gap_size - Maximum number of the files and/or datasets allowed to be missing for +! determining the extent of an unlimited virtual dataset with printf-style mappings. ! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR @@ -7727,7 +7727,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! SOURCE SUBROUTINE h5pget_virtual_printf_gap_f(dapl_id, gap_size, hdferr) IMPLICIT NONE - + INTEGER(HID_T) , INTENT(IN) :: dapl_id INTEGER(HSIZE_T), INTENT(OUT) :: gap_size INTEGER , INTENT(OUT) :: hdferr @@ -7742,7 +7742,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) END INTERFACE hdferr = INT( h5pget_virtual_printf_gap(dapl_id, gap_size) ) - + END SUBROUTINE h5pget_virtual_printf_gap_f !****s* H5P/h5pset_virtual_f @@ -7753,9 +7753,9 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! Sets the mapping between virtual and source datasets. ! ! INPUTS -! dcpl_id - The identifier of the dataset creation property list that will be +! dcpl_id - The identifier of the dataset creation property list that will be ! used when creating the virtual dataset. -! vspace_id - The dataspace identifier with the selection within the virtual +! vspace_id - The dataspace identifier with the selection within the virtual ! dataset applied, possibly an unlimited selection. ! src_file_name - The name of the HDF5 file where the source dataset is located. ! src_dset_name - The path to the HDF5 dataset in the file specified by src_file_name. @@ -7773,7 +7773,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! SOURCE SUBROUTINE h5pset_virtual_f(dcpl_id, vspace_id, src_file_name, src_dset_name, src_space_id, hdferr) IMPLICIT NONE - + INTEGER(HID_T), INTENT(IN) :: dcpl_id INTEGER(HID_T), INTENT(IN) :: vspace_id CHARACTER(LEN=*), INTENT(IN) :: src_file_name @@ -7813,7 +7813,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! Gets the number of mappings for the virtual dataset. ! ! INPUTS -! dcpl_id - The identifier of the virtual dataset creation property list. +! dcpl_id - The identifier of the virtual dataset creation property list. ! ! OUTPUTS ! count - The number of mappings. @@ -7828,7 +7828,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) SUBROUTINE h5pget_virtual_count_f(dcpl_id, count, hdferr) IMPLICIT NONE - + INTEGER(HID_T), INTENT(IN) :: dcpl_id INTEGER(SIZE_T), INTENT(OUT) :: count INTEGER, INTENT(OUT) :: hdferr @@ -7841,7 +7841,7 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER(SIZE_T), INTENT(OUT) :: count END FUNCTION h5pget_virtual_count END INTERFACE - + hdferr = INT( h5pget_virtual_count(dcpl_id, count)) END SUBROUTINE h5pget_virtual_count_f @@ -7856,10 +7856,10 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) ! INPUTS ! dcpl_id - The identifier of the virtual dataset creation property list. ! index - Mapping index. -! The value of index is 0 (zero) or greater and less than count (0 ≤ index < count), +! The value of index is 0 (zero) or greater and less than count (0 ≤ index < count), ! where count is the number of mappings returned by h5pget_virtual_count. ! -! OUTPUTS +! OUTPUTS ! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR @@ -7886,9 +7886,9 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER(SIZE_T), INTENT(IN), VALUE :: index END FUNCTION h5pget_virtual_vspace END INTERFACE - + ds_id = h5pget_virtual_vspace(dcpl_id, index) - + hdferr = 0 IF(ds_id.LT.0) hdferr = -1 @@ -7904,7 +7904,7 @@ END SUBROUTINE h5pget_virtual_vspace_f ! INPUTS ! dcpl_id - The identifier of the virtual dataset creation property list. ! index - Mapping index. -! The value of index is 0 (zero) or greater and less than count (0 ≤ index < count), +! The value of index is 0 (zero) or greater and less than count (0 ≤ index < count), ! where count is the number of mappings returned by h5pget_virtual_count. ! ! @@ -7936,7 +7936,7 @@ SUBROUTINE h5pget_virtual_srcspace_f(dcpl_id, index, ds_id, hdferr) INTEGER(SIZE_T), INTENT(IN), VALUE :: index END FUNCTION h5pget_virtual_srcspace END INTERFACE - + ds_id = h5pget_virtual_srcspace(dcpl_id, index) hdferr = 0 @@ -7954,9 +7954,9 @@ END SUBROUTINE h5pget_virtual_srcspace_f ! INPUTS ! dcpl_id - The identifier of the virtual dataset creation property list. ! index - Mapping index. -! The value of index is 0 (zero) or greater and less than count (0 ≤ index < count), +! The value of index is 0 (zero) or greater and less than count (0 ≤ index < count), ! where count is the number of mappings returned by h5pget_virtual_count. -! +! ! OUTPUTS ! name - A buffer containing the name of the file containing the source dataset. ! hdferr - Returns 0 if successful and -1 if fails. @@ -7983,7 +7983,7 @@ SUBROUTINE h5pget_virtual_filename_f(dcpl_id, index, name, hdferr, name_len) CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(1:LEN(name)+1), TARGET :: c_name TYPE(C_PTR) :: f_ptr - + INTERFACE INTEGER(SIZE_T) FUNCTION h5pget_virtual_filename(dcpl_id, index, name, size) BIND(C, NAME='H5Pget_virtual_filename') IMPORT :: HID_T, SIZE_T, C_PTR @@ -8022,9 +8022,9 @@ END SUBROUTINE h5pget_virtual_filename_f ! INPUTS ! dcpl_id - The identifier of the virtual dataset creation property list. ! index - Mapping index. -! The value of index is 0 (zero) or greater and less than count (0 ≤ index < count), +! The value of index is 0 (zero) or greater and less than count (0 ≤ index < count), ! where count is the number of mappings returned by h5pget_virtual_count. -! +! ! OUTPUTS ! name - A buffer containing the name of the source dataset. ! hdferr - Returns 0 if successful and -1 if fails. @@ -8051,7 +8051,7 @@ SUBROUTINE h5pget_virtual_dsetname_f(dcpl_id, index, name, hdferr, name_len) CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(1:LEN(name)+1), TARGET :: c_name TYPE(C_PTR) :: f_ptr - + INTERFACE INTEGER(SIZE_T) FUNCTION h5pget_virtual_dsetname(dcpl_id, index, name, size) BIND(C, NAME='H5Pget_virtual_dsetname') IMPORT :: HID_T, SIZE_T, C_PTR @@ -8120,7 +8120,7 @@ END SUBROUTINE h5pget_virtual_dsetname_f hdferr = INT(h5pget_dset_no_attrs_hint_c(dcpl_id, c_minimize)) - ! Transfer value of C C_BOOL type to Fortran LOGICAL + ! Transfer value of C C_BOOL type to Fortran LOGICAL minimize = c_minimize END SUBROUTINE h5pget_dset_no_attrs_hint_f diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 index c911b1a..e5cfb1d 100644 --- a/fortran/src/H5Rff.F90 +++ b/fortran/src/H5Rff.F90 @@ -61,7 +61,7 @@ MODULE H5R PRIVATE h5rcreate_object_f, h5rcreate_region_f, h5rcreate_ptr_f PRIVATE h5rdereference_object_f, h5rdereference_region_f, h5rdereference_ptr_f PRIVATE h5rget_name_object_f, h5rget_name_region_f, h5rget_name_ptr_f - + INTERFACE h5rget_object_type_f MODULE PROCEDURE h5rget_object_type_obj_f diff --git a/fortran/src/H5Sff.F90 b/fortran/src/H5Sff.F90 index e6f8e4c..5199ed6 100644 --- a/fortran/src/H5Sff.F90 +++ b/fortran/src/H5Sff.F90 @@ -49,7 +49,7 @@ CONTAINS ! NAME ! h5screate_simple_f ! -! PURPOSE +! PURPOSE ! Creates a new simple data space and opens it for access . ! ! INPUTS @@ -104,7 +104,7 @@ CONTAINS ENDIF hdferr = h5screate_simple_c(rank, dims, f_maxdims, space_id) DEALLOCATE(f_maxdims) - + END SUBROUTINE h5screate_simple_f ! @@ -142,9 +142,9 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: space_id END FUNCTION h5sclose_c END INTERFACE - + hdferr = h5sclose_c(space_id) - + END SUBROUTINE h5sclose_f ! @@ -193,9 +193,9 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: space_id END FUNCTION h5screate_c END INTERFACE - + hdferr = h5screate_c(classtype, space_id) - + END SUBROUTINE h5screate_f ! @@ -287,7 +287,7 @@ CONTAINS END INTERFACE hdferr = h5sget_select_hyper_nblocks_c (space_id, num_blocks) - + END SUBROUTINE h5sget_select_hyper_nblocks_f ! @@ -319,7 +319,7 @@ CONTAINS SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, & num_blocks, buf, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), INTENT(IN) :: startblock INTEGER(HSIZE_T), INTENT(IN) :: num_blocks INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf @@ -432,7 +432,7 @@ CONTAINS END INTERFACE hdferr = h5sget_select_elem_npoints_c (space_id, num_points) - + END SUBROUTINE h5sget_select_elem_npoints_f ! @@ -481,10 +481,10 @@ CONTAINS INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf END FUNCTION h5sget_select_elem_pointlist_c END INTERFACE - + hdferr = h5sget_select_elem_pointlist_c(space_id, startpoint, & num_points, buf ) - + END SUBROUTINE h5sget_select_elem_pointlist_f ! @@ -500,8 +500,8 @@ CONTAINS ! INPUTS ! space_id - dataspace identifier ! operator - flag, valid values are: -! H5S_SELECT_SET_F -! H5S_SELECT_APPEND_F +! H5S_SELECT_SET_F +! H5S_SELECT_APPEND_F ! H5S_SELECT_PREPEND_F ! rank - number of dataspace dimensions ! num_elements - number of elements to be selected @@ -527,7 +527,7 @@ CONTAINS INTEGER, INTENT(IN) :: rank INTEGER(SIZE_T), INTENT(IN) :: num_elements INTEGER(HSIZE_T), INTENT(IN) , DIMENSION(rank,num_elements) :: coord - INTEGER, INTENT(OUT) :: hdferr + INTEGER, INTENT(OUT) :: hdferr !***** INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:,:) :: c_coord INTEGER :: error, i @@ -595,7 +595,7 @@ CONTAINS SUBROUTINE h5sselect_all_f(space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(OUT) :: hdferr + INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE INTEGER FUNCTION h5sselect_all_c(space_id) BIND(C,NAME='h5sselect_all_c') @@ -604,9 +604,9 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: space_id END FUNCTION h5sselect_all_c END INTERFACE - + hdferr = h5sselect_all_c(space_id) - + END SUBROUTINE h5sselect_all_f ! @@ -646,9 +646,9 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: space_id END FUNCTION h5sselect_none_c END INTERFACE - + hdferr = h5sselect_none_c(space_id) - + END SUBROUTINE h5sselect_none_f ! @@ -665,8 +665,8 @@ CONTAINS ! space_id - identifier for the dataspace for which ! selection is verified ! OUTPUTS -! status - TRUE if the selection is contained within -! the extent, FALSE otherwise. +! status - TRUE if the selection is contained within +! the extent, FALSE otherwise. ! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR @@ -695,11 +695,11 @@ CONTAINS INTEGER :: flag END FUNCTION h5sselect_valid_c END INTERFACE - + hdferr = h5sselect_valid_c(space_id, flag) status = .TRUE. IF (flag .EQ. 0) status = .FALSE. - + END SUBROUTINE h5sselect_valid_f ! @@ -729,7 +729,7 @@ CONTAINS ! SOURCE SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), INTENT(OUT) :: npoints INTEGER, INTENT(OUT) :: hdferr !***** @@ -783,7 +783,7 @@ CONTAINS INTEGER(HSSIZE_T), INTENT(OUT) :: npoints END FUNCTION h5sget_select_npoints_c END INTERFACE - + hdferr = h5sget_select_npoints_c(space_id, npoints) END SUBROUTINE h5sget_select_npoints_f @@ -826,9 +826,9 @@ CONTAINS INTEGER, INTENT(OUT) :: rank END FUNCTION h5sget_simple_extent_ndims_c END INTERFACE - + hdferr = h5sget_simple_extent_ndims_c(space_id, rank) - + END SUBROUTINE h5sget_simple_extent_ndims_f ! !****s* H5S/h5sget_simple_extent_dims_f @@ -873,9 +873,9 @@ CONTAINS INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims END FUNCTION h5sget_simple_extent_dims_c END INTERFACE - + hdferr = h5sget_simple_extent_dims_c(space_id, dims, maxdims) - + END SUBROUTINE h5sget_simple_extent_dims_f ! @@ -920,9 +920,9 @@ CONTAINS INTEGER, INTENT(OUT) :: classtype END FUNCTION h5sget_simple_extent_type_c END INTERFACE - + hdferr = h5sget_simple_extent_type_c(space_id, classtype) - + END SUBROUTINE h5sget_simple_extent_type_f ! !****s* H5S/h5sset_extent_simple_f @@ -970,7 +970,7 @@ CONTAINS INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size END FUNCTION h5sset_extent_simple_c END INTERFACE - + hdferr = h5sset_extent_simple_c(space_id, rank, current_size, & maximum_size) @@ -1016,11 +1016,11 @@ CONTAINS INTEGER :: flag END FUNCTION h5sis_simple_c END INTERFACE - + hdferr = h5sis_simple_c(space_id, flag) status = .TRUE. IF (flag .EQ. 0) status = .FALSE. - + END SUBROUTINE h5sis_simple_f ! @@ -1156,9 +1156,9 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: space_id END FUNCTION h5sset_extent_none_c END INTERFACE - + hdferr = h5sset_extent_none_c(space_id) - + END SUBROUTINE h5sset_extent_none_f ! !****s* H5S/h5sselect_hyperslab_f @@ -1196,7 +1196,7 @@ CONTAINS SUBROUTINE h5sselect_hyperslab_f(space_id, OPERATOR, start, count, & hdferr, stride, BLOCK) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(IN) :: space_id INTEGER, INTENT(IN) :: OPERATOR INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count @@ -1208,7 +1208,7 @@ CONTAINS INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride INTEGER :: rank INTEGER :: error1, error2 - + INTERFACE INTEGER FUNCTION h5sselect_hyperslab_c(space_id, OPERATOR, & start, count, stride, BLOCK) BIND(C,NAME='h5sselect_hyperslab_c') @@ -1248,7 +1248,7 @@ CONTAINS DEALLOCATE(def_block) RETURN ENDIF - + IF (.NOT.PRESENT(stride).AND. PRESENT(BLOCK)) THEN ALLOCATE(def_stride(rank), stat=error2) IF (error2.NE.0) THEN @@ -1273,7 +1273,7 @@ CONTAINS def_stride, def_block) DEALLOCATE(def_block) DEALLOCATE(def_stride) - + END SUBROUTINE h5sselect_hyperslab_f ! !$! ! !$!****s* H5S/h5scombine_hyperslab_f @@ -1618,10 +1618,10 @@ CONTAINS INTEGER, INTENT(OUT) :: TYPE END FUNCTION h5sget_select_type_c END INTERFACE - + hdferr = h5sget_select_type_c(space_id, TYPE) RETURN - + END SUBROUTINE h5sget_select_type_f ! @@ -1779,7 +1779,7 @@ CONTAINS ! January, 28 2016 ! SOURCE SUBROUTINE h5sget_regular_hyperslab_f(space_id, start, stride, count, block, hdferr) - + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), INTENT(OUT), DIMENSION(*), TARGET :: start @@ -1790,7 +1790,7 @@ CONTAINS !***** TYPE(C_PTR) :: start_c, stride_c, count_c, block_c INTEGER :: n - + INTERFACE INTEGER FUNCTION h5sget_regular_hyperslab(space_id, start, stride, count, block) BIND(C,NAME='H5Sget_regular_hyperslab') IMPORT :: HID_T, C_PTR @@ -1809,7 +1809,7 @@ CONTAINS IF(INT(h5sget_regular_hyperslab(space_id, start_c, stride_c, count_c, block_c)).LT.0) hdferr = -1 - ! Reverse the C arrays description values of the hyperslab because + ! Reverse the C arrays description values of the hyperslab because ! the hyperslab was for a C stored hyperslab CALL H5Sget_simple_extent_ndims_f(space_id,n,hdferr) @@ -1848,8 +1848,8 @@ CONTAINS LOGICAL :: IsRegular INTEGER, INTENT(OUT) :: hdferr !***** - INTEGER(C_INT) :: status - + INTEGER(C_INT) :: status + INTERFACE INTEGER(C_INT) FUNCTION H5Sis_regular_hyperslab(space_id) BIND(C,NAME='H5Sis_regular_hyperslab') IMPORT :: HID_T, C_INT diff --git a/fortran/src/H5Tff.F90 b/fortran/src/H5Tff.F90 index 46c8f39..25eb613 100644 --- a/fortran/src/H5Tff.F90 +++ b/fortran/src/H5Tff.F90 @@ -28,7 +28,7 @@ ! **** | | | |\/| | ___/| | | | _ / | | / /\ \ | . ` | | | **** ! **** _| |_| | | | | | |__| | | \ \ | |/ ____ \| |\ | | | **** ! |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| -! +! ! If you add a new function here then you MUST add the function name to the ! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. @@ -41,7 +41,7 @@ MODULE H5T USE H5GLOBAL IMPLICIT NONE - PRIVATE h5tenum_insert_f03, h5tenum_insert_f90 + PRIVATE h5tenum_insert_f03, h5tenum_insert_f90 !****t* H5T/hvl_t ! Fortran2003 Derived Type: @@ -92,7 +92,7 @@ CONTAINS ! SOURCE SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr, tapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(HID_T), INTENT(OUT) :: type_id INTEGER, INTENT(OUT) :: hdferr @@ -231,7 +231,7 @@ CONTAINS ! SOURCE SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(HID_T), INTENT(OUT) :: new_type_id INTEGER, INTENT(OUT) :: hdferr !***** @@ -242,7 +242,7 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: new_type_id END FUNCTION h5tcopy_c END INTERFACE - + hdferr = h5tcopy_c(type_id, new_type_id) END SUBROUTINE h5tcopy_f ! @@ -288,7 +288,7 @@ CONTAINS INTEGER :: c_flag END FUNCTION h5tequal_c END INTERFACE - + flag = .FALSE. hdferr = h5tequal_c(type1_id, type2_id, c_flag) IF(c_flag .GT. 0) flag = .TRUE. @@ -329,7 +329,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: type_id END FUNCTION h5tclose_c END INTERFACE - + hdferr = h5tclose_c(type_id) END SUBROUTINE h5tclose_f ! @@ -356,7 +356,7 @@ CONTAINS ! H5T_REFERENCE_F (7) ! H5T_ENUM_F (8) ! H5T_VLEN_F (9) -! H5T_ARRAY_F (10) +! H5T_ARRAY_F (10) ! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR @@ -372,7 +372,7 @@ CONTAINS SUBROUTINE h5tget_class_f(type_id, class, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: class + INTEGER, INTENT(OUT) :: class INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE @@ -425,7 +425,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: size END FUNCTION h5tget_size_c END INTERFACE - + hdferr = h5tget_size_c(type_id, size) END SUBROUTINE h5tget_size_f @@ -469,7 +469,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: size END FUNCTION h5tset_size_c END INTERFACE - + hdferr = h5tset_size_c(type_id, size) END SUBROUTINE h5tset_size_f @@ -519,7 +519,7 @@ CONTAINS INTEGER, INTENT(OUT) :: order END FUNCTION h5tget_order_c END INTERFACE - + hdferr = h5tget_order_c(type_id, order) END SUBROUTINE h5tget_order_f ! @@ -567,7 +567,7 @@ CONTAINS INTEGER, INTENT(IN) :: order END FUNCTION h5tset_order_c END INTERFACE - + hdferr = h5tset_order_c(type_id, order) END SUBROUTINE h5tset_order_f @@ -600,7 +600,7 @@ CONTAINS IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(OUT) :: precision - INTEGER, INTENT(OUT) :: hdferr + INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE INTEGER FUNCTION h5tget_precision_c(type_id, PRECISION) BIND(C,NAME='h5tget_precision_c') @@ -642,7 +642,7 @@ CONTAINS SUBROUTINE h5tset_precision_f(type_id, PRECISION, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(SIZE_T), INTENT(IN) :: PRECISION + INTEGER(SIZE_T), INTENT(IN) :: PRECISION INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE @@ -653,7 +653,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: PRECISION END FUNCTION h5tset_precision_c END INTERFACE - + hdferr = h5tset_precision_c(type_id, PRECISION) END SUBROUTINE h5tset_precision_f @@ -695,10 +695,10 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: offset END FUNCTION h5tget_offset_c END INTERFACE - + hdferr = h5tget_offset_c(type_id, offset) END SUBROUTINE h5tget_offset_f - + ! !****s* H5T/h5tset_offset_f ! @@ -737,10 +737,10 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: offset END FUNCTION h5tset_offset_c END INTERFACE - + hdferr = h5tset_offset_c(type_id, offset) END SUBROUTINE h5tset_offset_f - + ! !****s* H5T/h5tget_pad_f ! @@ -757,7 +757,7 @@ CONTAINS ! lsbpad - least-significant bit padding type ! msbpad - most-significant bit padding type ! Possible values of padding type are: -! H5T_PAD_ERROR_F +! H5T_PAD_ERROR_F ! H5T_PAD_ZERO_F ! H5T_PAD_ONE_F ! H5T_PAD_BACKGROUND_F @@ -790,7 +790,7 @@ CONTAINS INTEGER, INTENT(OUT) :: msbpad END FUNCTION h5tget_pad_c END INTERFACE - + hdferr = h5tget_pad_c(type_id, lsbpad, msbpad) END SUBROUTINE h5tget_pad_f @@ -841,10 +841,10 @@ CONTAINS INTEGER, INTENT(IN) :: msbpad END FUNCTION h5tset_pad_c END INTERFACE - + hdferr = h5tset_pad_c(type_id, lsbpad, msbpad) END SUBROUTINE h5tset_pad_f - + ! !****s* H5T/h5tget_sign_f ! @@ -859,7 +859,7 @@ CONTAINS ! OUTPUTS ! sign - sign type ! Possible values are: -! - Unsigned integer type +! - Unsigned integer type ! H5T_SGN_NONE_F = 0 ! - Two's complement signed integer type ! H5T_SGN_2_F = 1 @@ -877,7 +877,7 @@ CONTAINS ! SOURCE SUBROUTINE h5tget_sign_f(type_id, sign, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: sign INTEGER, INTENT(OUT) :: hdferr !***** @@ -890,10 +890,10 @@ CONTAINS INTEGER, INTENT(OUT) :: sign END FUNCTION h5tget_sign_c END INTERFACE - + hdferr = h5tget_sign_c(type_id, sign) END SUBROUTINE h5tget_sign_f - + ! !****s* H5T/h5tset_sign_f ! @@ -907,7 +907,7 @@ CONTAINS ! type_id - datatype identifier ! sign - sign type ! Possible values are: -! - Unsigned integer type +! - Unsigned integer type ! H5T_SGN_NONE_F = 0 ! - Two's complement signed integer type ! H5T_SGN_2_F = 1 @@ -938,7 +938,7 @@ CONTAINS INTEGER, INTENT(IN) :: sign END FUNCTION h5tset_sign_c END INTERFACE - + hdferr = h5tset_sign_c(type_id, sign) END SUBROUTINE h5tset_sign_f @@ -994,7 +994,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: msize END FUNCTION h5tget_fields_c END INTERFACE - + hdferr = h5tget_fields_c(type_id, spos, epos, esize, mpos, msize) END SUBROUTINE h5tget_fields_f @@ -1028,7 +1028,7 @@ CONTAINS ! SOURCE SUBROUTINE h5tset_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: type_id INTEGER(SIZE_T), INTENT(IN) :: spos INTEGER(SIZE_T), INTENT(IN) :: epos INTEGER(SIZE_T), INTENT(IN) :: esize @@ -1050,10 +1050,10 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: msize END FUNCTION h5tset_fields_c END INTERFACE - + hdferr = h5tset_fields_c(type_id, spos, epos, esize, mpos, msize) END SUBROUTINE h5tset_fields_f - + ! !****s* H5T/h5tget_ebias_f ! @@ -1084,7 +1084,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: ebias INTEGER, INTENT(OUT) :: hdferr !***** - + INTERFACE INTEGER FUNCTION h5tget_ebias_c(type_id, ebias) BIND(C,NAME='h5tget_ebias_c') IMPORT :: HID_T, SIZE_T @@ -1093,7 +1093,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: ebias END FUNCTION h5tget_ebias_c END INTERFACE - + hdferr = h5tget_ebias_c(type_id, ebias) END SUBROUTINE h5tget_ebias_f @@ -1135,7 +1135,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: ebias END FUNCTION h5tset_ebias_c END INTERFACE - + hdferr = h5tset_ebias_c(type_id, ebias) END SUBROUTINE h5tset_ebias_f @@ -1182,7 +1182,7 @@ CONTAINS INTEGER, INTENT(OUT) :: norm END FUNCTION h5tget_norm_c END INTERFACE - + hdferr = h5tget_norm_c(type_id, norm) END SUBROUTINE h5tget_norm_f @@ -1228,7 +1228,7 @@ CONTAINS INTEGER, INTENT(IN) :: norm END FUNCTION h5tset_norm_c END INTERFACE - + hdferr = h5tset_norm_c(type_id, norm) END SUBROUTINE h5tset_norm_f @@ -1275,7 +1275,7 @@ CONTAINS INTEGER, INTENT(OUT) :: padtype END FUNCTION h5tget_inpad_c END INTERFACE - + hdferr = h5tget_inpad_c(type_id, padtype) END SUBROUTINE h5tget_inpad_f @@ -1321,7 +1321,7 @@ CONTAINS INTEGER, INTENT(IN) :: padtype END FUNCTION h5tset_inpad_c END INTERFACE - + hdferr = h5tset_inpad_c(type_id, padtype) END SUBROUTINE h5tset_inpad_f @@ -1366,7 +1366,7 @@ CONTAINS INTEGER, INTENT(OUT) :: cset END FUNCTION h5tget_cset_c END INTERFACE - + hdferr = h5tget_cset_c(type_id, cset) END SUBROUTINE h5tget_cset_f @@ -1411,7 +1411,7 @@ CONTAINS INTEGER, INTENT(IN) :: cset END FUNCTION h5tset_cset_c END INTERFACE - + hdferr = h5tset_cset_c(type_id, cset) END SUBROUTINE h5tset_cset_f ! @@ -1457,7 +1457,7 @@ CONTAINS INTEGER, INTENT(OUT) :: strpad END FUNCTION h5tget_strpad_c END INTERFACE - + hdferr = h5tget_strpad_c(type_id, strpad) END SUBROUTINE h5tget_strpad_f @@ -1547,7 +1547,7 @@ CONTAINS INTEGER, INTENT(OUT) :: num_members END FUNCTION h5tget_nmembers_c END INTERFACE - + hdferr = h5tget_nmembers_c(type_id, num_members) END SUBROUTINE h5tget_nmembers_f @@ -1596,7 +1596,7 @@ CONTAINS INTEGER, INTENT(OUT) :: namelen END FUNCTION h5tget_member_name_c END INTERFACE - + hdferr = h5tget_member_name_c(type_id, index, member_name, namelen) END SUBROUTINE h5tget_member_name_f @@ -1641,7 +1641,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: offset END FUNCTION h5tget_member_offset_c END INTERFACE - + hdferr = h5tget_member_offset_c(type_id, member_no, offset ) END SUBROUTINE h5tget_member_offset_f ! @@ -1686,11 +1686,11 @@ CONTAINS INTEGER, INTENT(OUT) :: index END FUNCTION h5tget_member_index_c END INTERFACE - + namelen = LEN(name) hdferr = h5tget_member_index_c(type_id, name, namelen, index) END SUBROUTINE h5tget_member_index_f - + ! !$! ! !$!****s* H5T/h5tget_member_dim_f @@ -1774,9 +1774,9 @@ CONTAINS INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) :: dims END FUNCTION h5tget_array_dims_c END INTERFACE - + hdferr = h5tget_array_dims_c(type_id, dims) - + END SUBROUTINE h5tget_array_dims_f ! @@ -1817,9 +1817,9 @@ CONTAINS INTEGER, INTENT(OUT) :: ndims END FUNCTION h5tget_array_ndims_c END INTERFACE - + hdferr = h5tget_array_ndims_c(type_id, ndims) - + END SUBROUTINE h5tget_array_ndims_f ! @@ -1860,9 +1860,9 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: base_type_id END FUNCTION h5tget_super_c END INTERFACE - + hdferr = h5tget_super_c(type_id, base_type_id) - + END SUBROUTINE h5tget_super_f ! @@ -1908,7 +1908,7 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: datatype END FUNCTION h5tget_member_type_c END INTERFACE - + hdferr = h5tget_member_type_c(type_id, field_idx , datatype) END SUBROUTINE h5tget_member_type_f @@ -1992,7 +1992,7 @@ CONTAINS SUBROUTINE h5tinsert_f(type_id, name, offset, field_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER(LEN=*), INTENT(IN) :: name + CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(SIZE_T), INTENT(IN) :: offset INTEGER(HID_T), INTENT(IN) :: field_id INTEGER, INTENT(OUT) :: hdferr @@ -2011,11 +2011,11 @@ CONTAINS INTEGER :: namelen END FUNCTION h5tinsert_c END INTERFACE - + namelen = LEN(name) hdferr = h5tinsert_c(type_id, name, namelen, offset, field_id ) END SUBROUTINE h5tinsert_f - + ! !****s* H5T/h5tpack_f ! @@ -2051,10 +2051,10 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: type_id END FUNCTION h5tpack_c END INTERFACE - + hdferr = h5tpack_c(type_id) END SUBROUTINE h5tpack_f - + ! !$! ! !$!****s* H5T/h5tinsert_array_f ! !$! @@ -2150,9 +2150,9 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: type_id END FUNCTION h5tarray_create_c END INTERFACE - + hdferr = h5tarray_create_c(base_id, rank, dims, type_id) - + END SUBROUTINE h5tarray_create_f ! @@ -2194,7 +2194,7 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: new_type_id END FUNCTION h5tenum_create_c END INTERFACE - + hdferr = h5tenum_create_c(parent_id, new_type_id) END SUBROUTINE h5tenum_create_f ! @@ -2225,9 +2225,9 @@ CONTAINS ! port). March 7, 2001 ! ! NOTE -! According to the standard: Because an INTENT(OUT) variable is considered undefined -! on entry to the procedure, any default initialization specified for its type will -! be applied. So we need to blank out the "name" to be portable and eliminate any +! According to the standard: Because an INTENT(OUT) variable is considered undefined +! on entry to the procedure, any default initialization specified for its type will +! be applied. So we need to blank out the "name" to be portable and eliminate any ! characters the "name' may contain upon entry, depending on compiler implementation. ! SOURCE SUBROUTINE h5tenum_nameof_f(type_id, value, namelen, name, hdferr) @@ -2249,7 +2249,7 @@ CONTAINS INTEGER, INTENT(IN) :: value END FUNCTION h5tenum_nameof_c END INTERFACE - + name(1:LEN(name)) = ' ' hdferr = h5tenum_nameof_c(type_id, value, name, namelen) @@ -2302,7 +2302,7 @@ CONTAINS INTEGER, INTENT(OUT) :: value END FUNCTION h5tenum_valueof_c END INTERFACE - + namelen = LEN(name) hdferr = h5tenum_valueof_c(type_id, name, namelen, value) END SUBROUTINE h5tenum_valueof_f @@ -2349,10 +2349,10 @@ CONTAINS INTEGER, INTENT(OUT) :: value END FUNCTION h5tget_member_value_c END INTERFACE - + hdferr = h5tget_member_value_c(type_id, member_no, value) END SUBROUTINE h5tget_member_value_f - + ! !****s* H5T/h5tset_tag_f ! @@ -2385,7 +2385,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr !***** INTEGER :: taglen - + INTERFACE INTEGER FUNCTION h5tset_tag_c(type_id, tag, taglen) BIND(C,NAME='h5tset_tag_c') IMPORT :: C_CHAR @@ -2396,11 +2396,11 @@ CONTAINS INTEGER :: taglen END FUNCTION h5tset_tag_c END INTERFACE - + taglen = LEN(tag) hdferr = h5tset_tag_c(type_id, tag, taglen) END SUBROUTINE h5tset_tag_f - + ! !****s* H5T/h5tget_tag_f ! @@ -2434,7 +2434,7 @@ CONTAINS INTEGER, INTENT(OUT) :: taglen INTEGER, INTENT(OUT) :: hdferr !***** - INTEGER(SIZE_T):: tag_size ! Declared character length of tab + INTEGER(SIZE_T):: tag_size ! Declared character length of tab INTERFACE INTEGER FUNCTION h5tget_tag_c(type_id, tag, tag_size, taglen) & BIND(C,NAME='h5tget_tag_c') @@ -2447,11 +2447,11 @@ CONTAINS INTEGER, INTENT(OUT) :: taglen END FUNCTION h5tget_tag_c END INTERFACE - + tag_size = LEN(tag) hdferr = h5tget_tag_c(type_id, tag, tag_size, taglen ) END SUBROUTINE h5tget_tag_f - + ! !****s* H5T/h5tvlen_create_f ! @@ -2489,7 +2489,7 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: vltype_id END FUNCTION h5tvlen_create_c END INTERFACE - + hdferr = h5tvlen_create_c(type_id, vltype_id) END SUBROUTINE h5tvlen_create_f @@ -2517,11 +2517,11 @@ CONTAINS SUBROUTINE h5tis_variable_str_f(type_id, status, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id - LOGICAL, INTENT(OUT) :: status + LOGICAL, INTENT(OUT) :: status INTEGER, INTENT(OUT) :: hdferr !***** INTEGER :: flag ! "TRUE/FALSE/ERROR from C" - + INTERFACE INTEGER FUNCTION h5tis_variable_str_c(type_id, flag) & BIND(C,NAME='h5tis_variable_str_c') @@ -2531,13 +2531,13 @@ CONTAINS INTEGER :: flag END FUNCTION h5tis_variable_str_c END INTERFACE - + hdferr = h5tis_variable_str_c(type_id, flag) status = .TRUE. IF (flag .EQ. 0) status = .FALSE. - + END SUBROUTINE h5tis_variable_str_f - + ! !****s* H5T/h5tget_member_class_f ! @@ -2728,7 +2728,7 @@ CONTAINS SUBROUTINE h5tdecode_f(buf, obj_id, hdferr) IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: buf - INTEGER(HID_T), INTENT(OUT) :: obj_id + INTEGER(HID_T), INTENT(OUT) :: obj_id INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE @@ -2811,7 +2811,7 @@ CONTAINS ! SOURCE SUBROUTINE h5tget_create_plist_f(dtype_id, dtpl_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER(HID_T), INTENT(IN) :: dtype_id INTEGER(HID_T), INTENT(OUT) :: dtpl_id INTEGER, INTENT(OUT) :: hdferr !***** @@ -2884,7 +2884,7 @@ CONTAINS ! ! INPUTS ! dtype_id - Datatype identifier for the dataset datatype. -! +! ! direction - Direction of search: ! H5T_DIR_DEFAULT, default direction is inscendent, ! H5T_DIR_ASCEND , in inscendent order, @@ -2901,8 +2901,8 @@ CONTAINS ! SOURCE SUBROUTINE h5tget_native_type_f(dtype_id, direction, native_dtype_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dtype_id - INTEGER, INTENT(IN) :: direction + INTEGER(HID_T), INTENT(IN) :: dtype_id + INTEGER, INTENT(IN) :: direction INTEGER(HID_T), INTENT(OUT) :: native_dtype_id INTEGER, INTENT(OUT) :: hdferr !***** @@ -3025,7 +3025,7 @@ CONTAINS INTEGER :: namelen END FUNCTION h5tenum_insert_c END INTERFACE - + namelen = LEN(name) hdferr = h5tenum_insert_c(type_id, name, namelen, value) END SUBROUTINE h5tenum_insert_f90 @@ -3061,7 +3061,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr !***** INTEGER :: namelen - + INTERFACE INTEGER FUNCTION h5tenum_insert_ptr_c(type_id, name, namelen, value) & BIND(C, NAME='h5tenum_insert_ptr_c') @@ -3074,7 +3074,7 @@ CONTAINS TYPE(C_PTR), VALUE :: value END FUNCTION h5tenum_insert_ptr_c END INTERFACE - + namelen = LEN(name) hdferr = h5tenum_insert_ptr_c(type_id, name, namelen, value) END SUBROUTINE h5tenum_insert_f03 diff --git a/fortran/src/H5VLff.F90 b/fortran/src/H5VLff.F90 index 32dd7d7..ae03cee 100644 --- a/fortran/src/H5VLff.F90 +++ b/fortran/src/H5VLff.F90 @@ -82,7 +82,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN), VALUE :: vipl_id END FUNCTION H5VLregister_connector_by_name END INTERFACE - + vipl_id_default = H5P_DEFAULT_F IF(PRESENT(vipl_id)) vipl_id_default = vipl_id @@ -136,7 +136,7 @@ CONTAINS ! INPUTS ! name - Connector name ! OUTPUTS -! registered - state of VOL class registration +! registered - state of VOL class registration ! hdferr - Returns 0 if successful and -1 if fails ! SOURCE @@ -156,7 +156,7 @@ CONTAINS CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name END FUNCTION H5VLis_connector_registered_by_name END INTERFACE - + c_name = TRIM(name)//C_NULL_CHAR registered_c = H5VLis_connector_registered_by_name(c_name) @@ -180,7 +180,7 @@ CONTAINS ! INPUTS ! value - Connector value ! OUTPUTS -! registered - state of VOL class registration +! registered - state of VOL class registration ! hdferr - Returns 0 if successful and -1 if fails ! SOURCE @@ -278,10 +278,10 @@ CONTAINS CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name END FUNCTION H5VLget_connector_id_by_name END INTERFACE - + c_name = TRIM(name)//C_NULL_CHAR vol_id = H5VLget_connector_id_by_name(c_name) - + hdferr = 0 IF(vol_id.LT.0)THEN hdferr = -1 @@ -367,7 +367,7 @@ CONTAINS END SUBROUTINE H5VLget_connector_name_f -! +! ! !****s* H5VL/H5VLclose_f ! diff --git a/fortran/src/H5Zff.F90 b/fortran/src/H5Zff.F90 index 848f047..6bd7b45 100644 --- a/fortran/src/H5Zff.F90 +++ b/fortran/src/H5Zff.F90 @@ -56,7 +56,7 @@ CONTAINS ! H5Z_FILTER_SCALEOFFSET_F ! H5Z_FILTER_SHUFFLE_F ! H5Z_FILTER_FLETCHER32_F -! +! ! OUTPUTS ! hdferr - Error code ! Success: 0 @@ -147,7 +147,7 @@ CONTAINS ! H5Z_FILTER_SHUFFLE_F ! H5Z_FILTER_FLETCHER32_Ffilter ! OUTPUTS -! config_flags - Flag, indicates if filter has its encoder +! config_flags - Flag, indicates if filter has its encoder ! and/or decoder available, possibly containing the ! following values: ! H5Z_FILTER_ENCODE_ENABLED_F diff --git a/fortran/src/H5_buildiface.F90 b/fortran/src/H5_buildiface.F90 index be53806..e81e1c0 100644 --- a/fortran/src/H5_buildiface.F90 +++ b/fortran/src/H5_buildiface.F90 @@ -13,8 +13,8 @@ ! depending on which of the KIND values are found. ! ! NOTES -! This program uses the Fortran 2008 intrinsic function STORAGE_SIZE or SIZEOF -! depending on availablity.It generates code that makes use of +! This program uses the Fortran 2008 intrinsic function STORAGE_SIZE or SIZEOF +! depending on availablity.It generates code that makes use of ! STORAGE_SIZE/SIZEOF in H5_gen.F90. STORAGE_SIZE is standard ! compliant and should always be chosen over SIZEOF. ! @@ -98,7 +98,7 @@ PROGRAM H5_buildiface ! ! DEVELOPER'S NOTES: ! -! Only interfaces with arrays of rank 7 and less are provided. Even-though, the F2008 +! Only interfaces with arrays of rank 7 and less are provided. Even-though, the F2008 ! standard extended the maximum rank to 15, it was decided that user's should use the ! new APIs to handle those use cases. Handling rank 7 and less is for backward compatibility ! with the Fortran 90/95 APIs codes which could never handle ranks greater than 7. @@ -195,7 +195,7 @@ PROGRAM H5_buildiface DO k = 1, 8 WRITE(11,'(2X,A)') "PRIVATE h5dwrite_ikind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) ENDDO - END DO + END DO DO k = 2, 8 WRITE(11,'(2X,A)') "PRIVATE h5dwrite_ckind_rank"//chr_rank(k) END DO @@ -211,7 +211,7 @@ PROGRAM H5_buildiface WRITE(chr2,'(I2)') j DO k = 1, 8 WRITE(11,'(2X,A)') "PRIVATE h5dread_ikind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) - ENDDO + ENDDO END DO DO k = 2, 8 WRITE(11,'(2X,A)') "PRIVATE h5dread_ckind_rank"//chr_rank(k) @@ -313,7 +313,7 @@ PROGRAM H5_buildiface DO k = 1, 8 WRITE(11,'(5X,A)') "MODULE PROCEDURE h5dwrite_ikind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) ENDDO - END DO + END DO DO k = 2, 8 WRITE(11,'(5X,A)') "MODULE PROCEDURE h5dwrite_ckind_rank"//chr_rank(k) END DO @@ -333,7 +333,7 @@ PROGRAM H5_buildiface WRITE(chr2,'(I2)') j DO k = 1, 8 WRITE(11,'(5X,A)') "MODULE PROCEDURE h5dread_ikind_"//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(k) - ENDDO + ENDDO END DO DO k = 2, 8 WRITE(11,'(5X,A)') "MODULE PROCEDURE h5dread_ckind_rank"//chr_rank(k) @@ -448,7 +448,7 @@ PROGRAM H5_buildiface ! up to 7 dimensions. ! ! Fortran90 Interface: -!! SUBROUTINE H5Awrite_f(attr_id, memtype_id, buf, dims, hdferr) +!! SUBROUTINE H5Awrite_f(attr_id, memtype_id, buf, dims, hdferr) !! INTEGER(HID_T) , INTENT(IN) :: attr_id !! INTEGER(HID_T) , INTENT(IN) :: memtype_id !! TYPE , INTENT(IN) :: buf @@ -476,7 +476,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' - + WRITE(11,'(A)') f_ptr_line(j) WRITE(11,'(A)') ' hdferr = H5Awrite_f_c(attr_id, memtype_id, f_ptr)' WRITE(11,'(A)') ' END SUBROUTINE h5awrite_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) @@ -502,7 +502,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' - + WRITE(11,'(A)') f_ptr_line(j) WRITE(11,'(A)') ' hdferr = H5Awrite_f_c(attr_id, memtype_id, f_ptr)' WRITE(11,'(A)') ' END SUBROUTINE h5awrite_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) @@ -524,7 +524,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' CHARACTER(LEN=*) , INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' - + WRITE(11,'(A)') fchr_ptr_line(j) WRITE(11,'(A)') ' hdferr = H5Awrite_f_c(attr_id, memtype_id, f_ptr)' WRITE(11,'(A)') ' END SUBROUTINE h5awrite_ckind_rank'//chr_rank(j) @@ -574,7 +574,7 @@ PROGRAM H5_buildiface ! REAL, REAL(KIND=C_DOUBLE) and CHARACTER buffers ! up to 7 dimensions. ! Fortran90 Interface: -!! SUBROUTINE H5Aread_f(attr_id, memtype_id, buf, dims, hdferr) +!! SUBROUTINE H5Aread_f(attr_id, memtype_id, buf, dims, hdferr) !! INTEGER(HID_T) , INTENT(IN) :: attr_id !! INTEGER(HID_T) , INTENT(IN) :: memtype_id !! TYPE , INTENT(INOUT) :: buf @@ -599,7 +599,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' - + WRITE(11,'(A)') f_ptr_line(j) WRITE(11,'(A)') ' hdferr = H5Aread_f_c(attr_id, memtype_id, f_ptr)' WRITE(11,'(A)') ' END SUBROUTINE h5aread_rkind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) @@ -623,7 +623,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' - + WRITE(11,'(A)') f_ptr_line(j) WRITE(11,'(A)') ' hdferr = H5Aread_f_c(attr_id, memtype_id, f_ptr)' WRITE(11,'(A)') ' END SUBROUTINE h5aread_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) @@ -643,7 +643,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER , INTENT(OUT) :: hdferr' WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr' - + WRITE(11,'(A)') fchr_ptr_line(j) WRITE(11,'(A)') ' hdferr = H5Aread_f_c(attr_id, memtype_id, f_ptr)' WRITE(11,'(A)') ' END SUBROUTINE h5aread_ckind_rank'//chr_rank(j) @@ -656,7 +656,7 @@ PROGRAM H5_buildiface ! h5dread_f ! -! NAME +! NAME ! h5dread_f ! ! PURPOSE @@ -683,7 +683,7 @@ PROGRAM H5_buildiface ! Elena Pourmal ! August 12, 1999 ! -! HISTORY +! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). February 28, 2001 @@ -693,7 +693,7 @@ PROGRAM H5_buildiface ! the h5dwrite_reference_obj and h5dwrite_reference_dsetreg ! functions. April 2, 2001 ! -! NOTES +! NOTES ! This function is overloaded to read INTEGER, ! REAL, DOUBLE PRECISION and CHARACTER buffers ! up to 7 dimensions, and one dimensional buffers @@ -886,7 +886,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' file_space_id_default, xfer_prp_default, f_ptr)' WRITE(11,'(A)') ' END SUBROUTINE h5dwrite_ikind_'//TRIM(ADJUSTL(chr2))//'_rank'//chr_rank(j) ENDDO - ENDDO + ENDDO DO j = 2, 8 ! DLL definitions for windows WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_DLL)' @@ -938,7 +938,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' IMPLICIT NONE' WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: prp_id' WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN) :: type_id' - WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(IN), TARGET :: fillvalue' + WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'), INTENT(IN), TARGET :: fillvalue' WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr ' WRITE(11,'(A)') ' TYPE(C_PTR) :: f_ptr ' WRITE(11,'(A)') ' f_ptr = C_LOC(fillvalue)' @@ -989,7 +989,7 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' f_ptr = C_LOC(value)' WRITE(11,'(A)') ' name_len = LEN(name)' WRITE(11,'(A)') ' hdferr = h5pget_c(prp_id, name, name_len, f_ptr)' - + WRITE(11,'(A)') ' END SUBROUTINE h5pset_kind_'//TRIM(ADJUSTL(chr2)) ENDDO diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index 7c7c751..2c32277 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -53,7 +53,7 @@ MODULE H5LIB ! INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags - + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags ! @@ -81,7 +81,7 @@ MODULE H5LIB INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags ! - ! H5FD file drivers flags declaration + ! H5FD file drivers flags declaration ! INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags @@ -170,7 +170,7 @@ CONTAINS ! October 13, 2011 ! Fortran90 Interface: SUBROUTINE h5open_f(error) - USE H5F, ONLY : h5fget_obj_count_f, H5OPEN_NUM_OBJ + USE H5F, ONLY : h5fget_obj_count_f, H5OPEN_NUM_OBJ IMPLICIT NONE INTEGER, INTENT(OUT) :: error INTEGER(SIZE_T) :: H5OPEN_NUM_OBJ_LOC = 0 @@ -249,13 +249,13 @@ CONTAINS END FUNCTION h5init1_flags_c END INTERFACE - + error = h5init_types_c(predef_types, floating_types, integer_types) - H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) + H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) H5T_NATIVE_INTEGER = predef_types(6) H5T_NATIVE_REAL = predef_types(7) - H5T_NATIVE_DOUBLE = predef_types(8) + H5T_NATIVE_DOUBLE = predef_types(8) H5T_NATIVE_CHARACTER = predef_types(9) H5T_STD_REF_OBJ = predef_types(10) H5T_STD_REF_DSETREG = predef_types(11) @@ -267,12 +267,12 @@ CONTAINS H5T_NATIVE_B32 = predef_types(17) H5T_NATIVE_B64 = predef_types(18) H5T_NATIVE_FLOAT_128 = predef_types(19) - + H5T_IEEE_F32BE = floating_types(1) H5T_IEEE_F32LE = floating_types(2) H5T_IEEE_F64BE = floating_types(3) - H5T_IEEE_F64LE = floating_types(4) - + H5T_IEEE_F64LE = floating_types(4) + H5T_STD_I8BE = integer_types(1) H5T_STD_I8LE = integer_types(2) H5T_STD_I16BE = integer_types(3) @@ -362,12 +362,12 @@ CONTAINS H5_ITER_DEC_F = H5generic_flags(7) H5_ITER_NATIVE_F = H5generic_flags(8) H5_ITER_N_F = H5generic_flags(9) - + HADDR_UNDEF_F = H5generic_haddr_flags(1) ! ! H5G flags ! - H5G_UNKNOWN_F = H5G_flags(1) + H5G_UNKNOWN_F = H5G_flags(1) H5G_GROUP_F = H5G_flags(2) H5G_DATASET_F = H5G_flags(3) H5G_TYPE_F = H5G_flags(4) @@ -411,7 +411,7 @@ CONTAINS H5D_VDS_FIRST_MISSING_F = H5D_flags(27) H5D_VDS_LAST_AVAILABLE_F = H5D_flags(28) H5D_VIRTUAL_F = H5D_flags(29) - + H5D_CHUNK_CACHE_NSLOTS_DFLT_F = H5D_size_flags(1) H5D_CHUNK_CACHE_NBYTES_DFLT_F = H5D_size_flags(2) ! @@ -420,7 +420,7 @@ CONTAINS H5E_DEFAULT_F = H5E_hid_flags(1) H5E_MAJOR_F = H5E_flags(1) - H5E_MINOR_F = H5E_flags(2) + H5E_MINOR_F = H5E_flags(2) H5E_WALK_UPWARD_F = H5E_flags(3) H5E_WALK_DOWNWARD_F = H5E_flags(4) ! @@ -439,7 +439,7 @@ CONTAINS H5FD_MEM_NTYPES_F = H5FD_flags(11) ! ! H5FD file driver flags - ! + ! H5FD_CORE_F = H5FD_hid_flags(1) H5FD_FAMILY_F = H5FD_hid_flags(2) H5FD_LOG_F = H5FD_hid_flags(3) @@ -469,7 +469,7 @@ CONTAINS H5I_INVALID_HID_F = H5I_flags(17) ! ! H5L flags - ! + ! H5L_TYPE_ERROR_F = H5L_flags(1) H5L_TYPE_HARD_F = H5L_flags(2) H5L_TYPE_SOFT_F = H5L_flags(3) @@ -486,25 +486,25 @@ CONTAINS H5O_COPY_WITHOUT_ATTR_FLAG_F = h5o_flags(5) H5O_COPY_PRESERVE_NULL_FLAG_F = h5o_flags(6) H5O_COPY_ALL_F = h5o_flags(7) - H5O_SHMESG_NONE_FLAG_F = h5o_flags(8) + H5O_SHMESG_NONE_FLAG_F = h5o_flags(8) H5O_SHMESG_SDSPACE_FLAG_F = h5o_flags(9) H5O_SHMESG_DTYPE_FLAG_F = h5o_flags(10) - H5O_SHMESG_FILL_FLAG_F = h5o_flags(11) - H5O_SHMESG_PLINE_FLAG_F = h5o_flags(12) - H5O_SHMESG_ATTR_FLAG_F = h5o_flags(13) - H5O_SHMESG_ALL_FLAG_F = h5o_flags(14) - H5O_HDR_CHUNK0_SIZE_F = h5o_flags(15) - H5O_HDR_ATTR_CRT_ORDER_TRACK_F = h5o_flags(16) - H5O_HDR_ATTR_CRT_ORDER_INDEX_F = h5o_flags(17) - H5O_HDR_ATTR_STORE_PHASE_CHA_F = h5o_flags(18) - H5O_HDR_STORE_TIMES_F = h5o_flags(19) + H5O_SHMESG_FILL_FLAG_F = h5o_flags(11) + H5O_SHMESG_PLINE_FLAG_F = h5o_flags(12) + H5O_SHMESG_ATTR_FLAG_F = h5o_flags(13) + H5O_SHMESG_ALL_FLAG_F = h5o_flags(14) + H5O_HDR_CHUNK0_SIZE_F = h5o_flags(15) + H5O_HDR_ATTR_CRT_ORDER_TRACK_F = h5o_flags(16) + H5O_HDR_ATTR_CRT_ORDER_INDEX_F = h5o_flags(17) + H5O_HDR_ATTR_STORE_PHASE_CHA_F = h5o_flags(18) + H5O_HDR_STORE_TIMES_F = h5o_flags(19) H5O_HDR_ALL_FLAGS_F = h5o_flags(20) - H5O_SHMESG_MAX_NINDEXES_F = h5o_flags(21) - H5O_SHMESG_MAX_LIST_SIZE_F = h5o_flags(22) - H5O_TYPE_UNKNOWN_F = h5o_flags(23) - H5O_TYPE_GROUP_F = h5o_flags(24) - H5O_TYPE_DATASET_F = h5o_flags(25) - H5O_TYPE_NAMED_DATATYPE_F = h5o_flags(26) + H5O_SHMESG_MAX_NINDEXES_F = h5o_flags(21) + H5O_SHMESG_MAX_LIST_SIZE_F = h5o_flags(22) + H5O_TYPE_UNKNOWN_F = h5o_flags(23) + H5O_TYPE_GROUP_F = h5o_flags(24) + H5O_TYPE_DATASET_F = h5o_flags(25) + H5O_TYPE_NAMED_DATATYPE_F = h5o_flags(26) H5O_TYPE_NTYPES_F = h5o_flags(27) H5O_INFO_ALL_F = h5o_flags(28) H5O_INFO_BASIC_F = h5o_flags(29) @@ -514,7 +514,7 @@ CONTAINS H5O_INFO_META_SIZE_F = h5o_flags(33) ! ! H5P flags - ! + ! H5P_FILE_CREATE_F = H5P_flags(1) H5P_FILE_ACCESS_F = H5P_flags(2) H5P_DATASET_CREATE_F = H5P_flags(3) @@ -535,21 +535,21 @@ CONTAINS H5P_LINK_ACCESS_F = H5P_flags(18) ! ! H5P integers flags - ! + ! H5P_CRT_ORDER_INDEXED_F = H5P_flags_int(1) H5P_CRT_ORDER_TRACKED_F = H5P_flags_int(2) ! ! H5R flags - ! + ! H5R_OBJECT_F = H5R_flags(1) H5R_DATASET_REGION_F = H5R_flags(2) ! ! H5S flags - ! + ! H5S_ALL_F = H5S_hid_flags(1) - + H5S_UNLIMITED_F = H5S_hsize_flags(1) - + H5S_SCALAR_F = H5S_flags(1) H5S_SIMPLE_F = H5S_flags(2) H5S_NULL_F = H5S_flags(3) @@ -570,7 +570,7 @@ CONTAINS H5S_SEL_ALL_F = H5S_flags(18) ! ! H5T flags declaration - ! + ! H5T_NO_CLASS_F = H5T_flags(1) H5T_INTEGER_F = H5T_flags(2) H5T_FLOAT_F = H5T_flags(3) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 46759cf..8cf601e 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -49,7 +49,7 @@ MODULE H5GLOBAL ENUMERATOR :: enum_dtype END ENUM INTEGER, PARAMETER :: ENUM_T = KIND(enum_dtype) - + ! Definitions for reference datatypes. ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. @@ -87,7 +87,7 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - + !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE @@ -95,7 +95,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE - !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE @@ -136,14 +136,14 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 !DEC$endif - + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_INTEGER INTEGER(HID_T) :: H5T_NATIVE_REAL INTEGER(HID_T) :: H5T_NATIVE_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER INTEGER(HID_T) :: H5T_STD_REF_OBJ INTEGER(HID_T) :: H5T_STD_REF_DSETREG INTEGER(HID_T) :: H5T_IEEE_F32BE @@ -202,7 +202,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F !DEC$endif - + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -244,7 +244,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_V112_F !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_V114_F !DEC$endif - + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -289,7 +289,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F !DEC$endif - + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -340,7 +340,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F !DEC$endif - + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -369,7 +369,7 @@ MODULE H5GLOBAL ! characters for variable names in Fortran. ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 ! characters for variable names in Fortran. - + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -493,7 +493,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F !DEC$endif - + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -539,7 +539,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5O_INFO_META_SIZE_F ! !DEC$endif - + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -655,7 +655,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F !DEC$endif - + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -831,11 +831,11 @@ CONTAINS f_len = LEN(f_string) ! CASE (1): C string is equal to or larger than Fortran character buffer, - ! so fill the entire Fortran buffer. + ! so fill the entire Fortran buffer. IF(c_len.GE.f_len)THEN ! f_string(1:f_len) = c_string(1:f_len) - ! CASE (2): C string is smaller than Fortran character buffer, + ! CASE (2): C string is smaller than Fortran character buffer, ! so copy C string and blank pad remaining characters. ELSE f_string(1:c_len) = c_string(1:c_len) @@ -902,6 +902,6 @@ CONTAINS !!$ fstring(j:j) = ' ' !!$ end do !!$end subroutine MPIR_Fortran_string_c2f - + END MODULE H5GLOBAL diff --git a/fortran/src/H5fortkit.F90 b/fortran/src/H5fortkit.F90 index f5eba8a..7710a4d 100644 --- a/fortran/src/H5fortkit.F90 +++ b/fortran/src/H5fortkit.F90 @@ -51,8 +51,8 @@ CONTAINS INTEGER :: i INTEGER :: len CHARACTER(LEN=len) :: fstring - CHARACTER(LEN=1), DIMENSION(1:len) :: cstring - + CHARACTER(LEN=1), DIMENSION(1:len) :: cstring + fstring = '' DO i = 1, len IF (cstring(i)(1:1)==CHAR(0)) EXIT diff --git a/fortran/test/H5_test_buildiface.F90 b/fortran/test/H5_test_buildiface.F90 index 636ded4..6cbeb68 100644 --- a/fortran/test/H5_test_buildiface.F90 +++ b/fortran/test/H5_test_buildiface.F90 @@ -13,8 +13,8 @@ ! depending on which of the KIND values are found. ! ! NOTES -! This program uses the Fortran 2008 intrinsic function STORAGE_SIZE or SIZEOF -! depending on availablity.It generates code that makes use of +! This program uses the Fortran 2008 intrinsic function STORAGE_SIZE or SIZEOF +! depending on availablity.It generates code that makes use of ! STORAGE_SIZE/SIZEOF in H5fortran_detect.f90. STORAGE_SIZE is standard ! compliant and should always be chosen over SIZEOF. ! @@ -94,7 +94,7 @@ PROGRAM H5_test_buildiface WRITE(11,'(a)') "MODULE TH5_MISC_gen" WRITE(11,'(A)') ' USE, INTRINSIC :: ISO_C_BINDING' - + ! Interfaces for validating REALs, INTEGERs, CHARACTERs, LOGICALs WRITE(11,'(A)') ' INTERFACE verify' @@ -156,8 +156,8 @@ PROGRAM H5_test_buildiface WRITE(11,'(A)') '!DEC$if defined(BUILD_HDF5_TEST_DLL)' WRITE(11,'(A)') '!DEC$attributes dllexport :: verify_real_kind_'//TRIM(ADJUSTL(chr2)) WRITE(11,'(A)') '!DEC$endif' - -! Subroutine API + +! Subroutine API WRITE(11,'(A)') ' SUBROUTINE verify_real_kind_'//TRIM(ADJUSTL(chr2))//'(string,value,correct_value,total_error)' WRITE(11,'(A)') ' IMPLICIT NONE' WRITE(11,'(A)') ' CHARACTER(LEN=*) :: string' @@ -186,7 +186,7 @@ PROGRAM H5_test_buildiface ! { EXPONENT(x)-DIGITS(x) ! { 2.0 for x /= 0 ! SPACING(x) = { -! { +! { ! { TINY(x) for x == 0 ! ! The ULP optional argument scales the comparison: @@ -228,7 +228,7 @@ PROGRAM H5_test_buildiface WRITE(11,'(A)') '!DEC$attributes dllexport :: verify_character' WRITE(11,'(A)') '!DEC$endif' -! Subroutine API +! Subroutine API WRITE(11,'(A)') ' SUBROUTINE verify_character(string,value,correct_value,total_error)' WRITE(11,'(A)') ' IMPLICIT NONE' WRITE(11,'(A)') ' CHARACTER*(*) :: string' @@ -258,7 +258,7 @@ PROGRAM H5_test_buildiface WRITE(11,'(A)') ' total_error = total_error + 1' WRITE(11,'(A)') ' WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string' WRITE(11,'(A)') ' ENDIF' - + WRITE(11,'(A)') ' END SUBROUTINE verify_logical' WRITE(11,'(A)') "END MODULE TH5_MISC_gen" diff --git a/fortran/test/fflush1.F90 b/fortran/test/fflush1.F90 index bd1f551..0916813 100644 --- a/fortran/test/fflush1.F90 +++ b/fortran/test/fflush1.F90 @@ -6,7 +6,7 @@ ! FUNCTION ! This is the first half of a two-part test that makes sure ! that a file can be read after an application crashes as long -! as the file was flushed first. We simulate by exit the +! as the file was flushed first. We simulate by exit the ! the program using stop statement ! ! COPYRIGHT diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index 8d5b32b..92f9279 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -81,7 +81,7 @@ PROGRAM fortranlibtest CALL file_space("file_space",cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' File free space test', total_error) -! +! ! '=========================================' ! 'Testing DATASET Interface ' ! '=========================================' @@ -97,7 +97,7 @@ PROGRAM fortranlibtest CALL test_userblock_offset(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Dataset offset with user block', total_error) -! +! ! '=========================================' ! 'Testing DATASPACE Interface ' ! '=========================================' @@ -106,7 +106,7 @@ PROGRAM fortranlibtest CALL dataspace_basic_test(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Basic dataspace test', total_error) -! +! ! '=========================================' ! 'Testing REFERENCE Interface ' ! '=========================================' @@ -119,7 +119,7 @@ PROGRAM fortranlibtest CALL refregtest(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Reference to dataset region test', total_error) -! +! ! '=========================================' ! 'Testing selection functionalities ' ! '=========================================' @@ -148,8 +148,8 @@ PROGRAM fortranlibtest ret_total_error = 0 CALL test_select_bounds(ret_total_error) CALL write_test_status(ret_total_error, ' Selection bounds test ', total_error) - -! + +! ! '=========================================' ! 'Testing DATATYPE interface ' ! '=========================================' @@ -169,7 +169,7 @@ PROGRAM fortranlibtest CALL test_derived_flt(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Derived float datatype test', total_error) -! +! ! '=========================================' ! 'Testing PROPERTY interface ' ! '=========================================' @@ -186,7 +186,7 @@ PROGRAM fortranlibtest CALL test_chunk_cache (cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error) -! +! ! '=========================================' ! 'Testing ATTRIBUTE interface ' ! '=========================================' @@ -195,7 +195,7 @@ PROGRAM fortranlibtest CALL attribute_test(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Attribute test', total_error) -! +! ! '=========================================' ! 'Testing IDENTIFIER interface ' ! '=========================================' @@ -217,7 +217,7 @@ PROGRAM fortranlibtest CALL write_test_status(ret_total_error, ' SZIP filter test', total_error) ENDIF -! +! ! '=========================================' ! 'Testing GROUP interface ' ! '=========================================' diff --git a/fortran/test/fortranlib_test_F03.F90 b/fortran/test/fortranlib_test_F03.F90 index 808cb4d..377645d 100644 --- a/fortran/test/fortranlib_test_F03.F90 +++ b/fortran/test/fortranlib_test_F03.F90 @@ -24,7 +24,7 @@ !***** PROGRAM fortranlibtest_F03 - + USE HDF5 USE THDF5_F03 @@ -48,7 +48,7 @@ PROGRAM fortranlibtest_F03 IF(total_error .EQ. 0) THEN WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") WRITE(*, '(I0)', advance="NO") majnum - WRITE(*, '(".")', advance="NO") + WRITE(*, '(".")', advance="NO") WRITE(*, '(I0)', advance="NO") minnum WRITE(*, '(" release ")', advance="NO") WRITE(*, '(I0)') relnum @@ -77,11 +77,11 @@ PROGRAM fortranlibtest_F03 ret_total_error = 0 CALL t_enum(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading enum dataset, using C_LOC', total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading enum dataset, using C_LOC', total_error) ret_total_error = 0 CALL t_enum_conv(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing enumeration conversions', total_error) + CALL write_test_status(ret_total_error, ' Testing enumeration conversions', total_error) ret_total_error = 0 CALL t_bit(ret_total_error) @@ -89,7 +89,7 @@ PROGRAM fortranlibtest_F03 ret_total_error = 0 CALL t_opaque(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading opaque datatypes, using C_LOC', total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading opaque datatypes, using C_LOC', total_error) ret_total_error = 0 CALL t_objref(ret_total_error) @@ -97,7 +97,7 @@ PROGRAM fortranlibtest_F03 ret_total_error = 0 CALL t_regref(ret_total_error) - CALL write_test_status(ret_total_error, ' Testing writing/reading region references, using C_LOC', total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading region references, using C_LOC', total_error) ret_total_error = 0 CALL t_vlen(ret_total_error) @@ -150,7 +150,7 @@ PROGRAM fortranlibtest_F03 ret_total_error = 0 CALL test_h5p_file_image(ret_total_error) CALL write_test_status(ret_total_error, ' Testing h5pset/get file image', total_error) - + ! write(*,*) ! write(*,*) '=========================================' ! write(*,*) 'Testing OBJECT interface ' @@ -188,7 +188,7 @@ PROGRAM fortranlibtest_F03 WRITE(*, fmt = '(i4)', advance='NO') total_error WRITE(*, fmt = '(12a)' ) ' error(s) ! ' WRITE(*,*) ' ============================================ ' - + CALL h5close_f(error) ! if errors detected, exit with non-zero code. diff --git a/fortran/test/tH5A.F90 b/fortran/test/tH5A.F90 index 1e6fdeb..8968f59 100644 --- a/fortran/test/tH5A.F90 +++ b/fortran/test/tH5A.F90 @@ -21,7 +21,7 @@ ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! CONTAINS SUBROUTINES -! attribute_test +! attribute_test ! ! !***** diff --git a/fortran/test/tH5A_1_8.F90 b/fortran/test/tH5A_1_8.F90 index f2f11aa..8e59483 100644 --- a/fortran/test/tH5A_1_8.F90 +++ b/fortran/test/tH5A_1_8.F90 @@ -25,7 +25,7 @@ ! test_attr_create_by_name, test_attr_info_by_idx, attr_info_by_idx_check, ! test_attr_shared_rename, test_attr_delete_by_idx, test_attr_shared_delete, ! test_attr_dense_open, test_attr_dense_verify, test_attr_corder_create_basic, -! test_attr_basic_write, test_attr_many, attr_open_check, +! test_attr_basic_write, test_attr_many, attr_open_check, ! !***** MODULE TH5A_1_8 @@ -157,7 +157,7 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) ' - Testing creating attributes by name', & total_error) - ! More complex tests with both "new format" and "shared" attributes + ! More complex tests with both "new format" and "shared" attributes IF( use_shared(j) ) THEN ret_total_error = 0 CALL test_attr_shared_rename(my_fcpl, my_fapl, ret_total_error) @@ -243,17 +243,17 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) data_dims = 0 ! WRITE(*,*) " - Testing Compact Storage of Attributes with Creation Order Info" - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Create dataset creation property list + ! Create dataset creation property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) CALL check("h5Pcreate_f",error,total_error) CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) CALL check("H5Pset_attr_creation_order",error,total_error) - ! Query the attribute creation properties + ! Query the attribute creation properties CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) @@ -279,7 +279,7 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) my_dataset = dset3 END SELECT DO u = 0, max_compact - 1 - ! Create attribute + ! Create attribute WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 @@ -296,7 +296,7 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) END DO END DO - ! Close Datasets + ! Close Datasets CALL h5dclose_f(dset1, error) CALL check("h5dclose_f",error,total_error) CALL h5dclose_f(dset2, error) @@ -304,15 +304,15 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) CALL h5dclose_f(dset3, error) CALL check("h5dclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Close dataspace + ! Close dataspace CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) - ! Close property list + ! Close property list CALL h5pclose_f(dcpl, error) CALL check("h5pclose_f",error,total_error) @@ -339,34 +339,34 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) DO u = 0,max_compact-1 WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 - ! Retrieve information for attribute + ! Retrieve information for attribute CALL H5Aget_info_by_name_f(my_dataset, ".", attrname, & f_corder_valid, corder, cset, data_size, error, lapl_id = H5P_DEFAULT_F ) !with optional CALL check("H5Aget_info_by_name_f", error, total_error) - ! Verify creation order of attribute + ! Verify creation order of attribute CALL verify("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) CALL verify("H5Aget_info_by_name_f", corder, u, total_error) - ! Retrieve information for attribute + ! Retrieve information for attribute CALL H5Aget_info_by_name_f(my_dataset, ".", attrname, & f_corder_valid, corder, cset, data_size, error) ! without optional CALL check("H5Aget_info_by_name_f", error, total_error) - ! Verify creation order of attribute + ! Verify creation order of attribute CALL verify("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) CALL verify("H5Aget_info_by_name_f", corder, u, total_error) END DO END DO - ! Close Datasets + ! Close Datasets CALL h5dclose_f(dset1, error) CALL check("h5dclose_f",error,total_error) CALL h5dclose_f(dset2, error) @@ -374,7 +374,7 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) CALL h5dclose_f(dset3, error) CALL check("h5dclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) @@ -423,33 +423,33 @@ SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) data_dims = 0 - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Re-open file + ! Re-open file CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error) CALL check("h5open_f",error,total_error) - ! Create dataspace for dataset attributes + ! Create dataspace for dataset attributes CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Create "null" dataspace for attribute + ! Create "null" dataspace for attribute CALL h5screate_f(H5S_NULL_F, null_sid, error) CALL check("h5screate_f",error,total_error) - ! Create a dataset + ! Create a dataset CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error) CALL check("h5dcreate_f",error,total_error) - ! Add attribute with 'null' dataspace + ! Add attribute with 'null' dataspace - ! Create attribute + ! Create attribute CALL h5acreate_f(dataset, "null attr", H5T_NATIVE_INTEGER, null_sid, attr, error) CALL check("h5acreate_f",error,total_error) - ! Try to read data from the attribute - ! (shouldn't fail, but should leave buffer alone) + ! Try to read data from the attribute + ! (shouldn't fail, but should leave buffer alone) value(1) = 103 data_dims(1) = 1 CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) @@ -457,7 +457,7 @@ SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) CALL verify("h5aread_f",value(1),103,total_error) ! Try to read data from the attribute again but -! for a scalar +! for a scalar value_scalar = 104 data_dims(1) = 1 @@ -479,7 +479,7 @@ SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) CALL h5aget_info_f(attr, f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_f", error, total_error) - ! Check the attribute's information + ! Check the attribute's information CALL verify("h5aget_info_f.corder",corder,0,total_error) CALL verify("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) @@ -557,32 +557,32 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) data_dims = 0 - ! Create dataspace for dataset & attributes + ! Create dataspace for dataset & attributes CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Create dataset creation property list + ! Create dataset creation property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) CALL check("h5Pcreate_f",error,total_error) - ! Query the attribute creation properties + ! Query the attribute creation properties CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) - ! Loop over using index for creation order value + ! Loop over using index for creation order value DO i = 1, 2 - ! Print appropriate test message + ! Print appropriate test message IF(use_index(i))THEN WRITE(*,*) " - Testing Creating Attributes By Name w/Creation Order Index" ELSE WRITE(*,*) " - Testing Creating Attributes By Name w/o Creation Order Index" ENDIF - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Set attribute creation order tracking & indexing for object + ! Set attribute creation order tracking & indexing for object IF(new_format)THEN IF(use_index(i))THEN @@ -596,7 +596,7 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) ENDIF - ! Create datasets + ! Create datasets CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl_id=dcpl ) CALL check("h5dcreate_f2",error,total_error) @@ -608,7 +608,7 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) CALL check("h5dcreate_f4",error,total_error) - ! Work on all the datasets + ! Work on all the datasets DO curr_dset = 0,NUM_DSETS-1 SELECT CASE (curr_dset) @@ -626,39 +626,39 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) END SELECT - ! Create attributes, up to limit of compact form + ! Create attributes, up to limit of compact form DO u = 0, max_compact - 1 - ! Create attribute + ! Create attribute WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 CALL H5Acreate_by_name_f(fid, dsetname, attrname, H5T_NATIVE_INTEGER, sid, & attr, error, lapl_id=H5P_DEFAULT_F, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) CALL check("H5Acreate_by_name_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute data_dims(1) = 1 CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Verify information for NEW attribute + ! Verify information for NEW attribute CALL attr_info_by_idx_check(my_dataset, attrname, INT(u,HSIZE_T), use_index(i), total_error) ! CALL check("FAILED IN attr_info_by_idx_check",total_error) ENDDO - ! Test opening attributes stored compactly + ! Test opening attributes stored compactly CALL attr_open_check(fid, dsetname, my_dataset, u, total_error) ENDDO - ! Work on all the datasets + ! Work on all the datasets DO curr_dset = 0,NUM_DSETS-1 SELECT CASE (curr_dset) CASE (0) @@ -672,7 +672,7 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) dsetname = DSET3_NAME END SELECT - ! Create more attributes, to push into dense form + ! Create more attributes, to push into dense form DO u = max_compact, max_compact* 2 - 1 WRITE(chr2,'(I2.2)') u @@ -682,12 +682,12 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) attr, error, lapl_id=H5P_DEFAULT_F) CALL check("H5Acreate_by_name",error,total_error) - ! Write data into the attribute + ! Write data into the attribute data_dims(1) = 1 CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) @@ -695,7 +695,7 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) ENDDO - ! Close Datasets + ! Close Datasets CALL h5dclose_f(dset1, error) CALL check("h5dclose_f",error,total_error) CALL h5dclose_f(dset2, error) @@ -704,16 +704,16 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) CALL check("h5dclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) ENDDO - ! Close property list + ! Close property list CALL h5pclose_f(dcpl, error) CALL check("h5pclose_f",error,total_error) - ! Close dataspace + ! Close dataspace CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) @@ -781,31 +781,31 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) data_dims = 0 - ! Create dataspace for dataset & attributes + ! Create dataspace for dataset & attributes CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Create dataset creation property list + ! Create dataset creation property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) CALL check("h5Pcreate_f",error,total_error) - ! Query the attribute creation properties + ! Query the attribute creation properties CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) - ! Loop over using index for creation order value + ! Loop over using index for creation order value DO i = 1, 2 - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Set attribute creation order tracking & indexing for object + ! Set attribute creation order tracking & indexing for object IF(new_format)THEN IF(use_index(i))THEN Input1 = H5P_CRT_ORDER_INDEXED_F @@ -816,7 +816,7 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) CALL check("H5Pset_attr_creation_order",error,total_error) ENDIF - ! Create datasets + ! Create datasets CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error ) CALL check("h5dcreate_f",error,total_error) @@ -827,7 +827,7 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error ) CALL check("h5dcreate_f",error,total_error) - ! Work on all the datasets + ! Work on all the datasets DO curr_dset = 0,NUM_DSETS-1 @@ -840,7 +840,7 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) my_dataset = dset3 END SELECT - ! Check for query on non-existant attribute + ! Check for query on non-existant attribute n = 0 @@ -870,10 +870,10 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) CALL verify("h5aget_name_by_idx_f",error,minusone,total_error) - ! Create attributes, up to limit of compact form + ! Create attributes, up to limit of compact form DO j = 0, max_compact-1 - ! Create attribute + ! Create attribute WRITE(chr2,'(I2.2)') j attrname = 'attr '//chr2 @@ -881,19 +881,19 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute attr_integer_data(1) = j data_dims(1) = 1 CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Verify information for new attribute + ! Verify information for new attribute !EP CALL attr_info_by_idx_check(my_dataset, attrname, INT(j,HSIZE_T), use_index(i), total_error ) htmp = j @@ -905,7 +905,7 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) ENDDO - ! Close Datasets + ! Close Datasets CALL h5dclose_f(dset1, error) CALL check("h5dclose_f",error,total_error) CALL h5dclose_f(dset2, error) @@ -913,17 +913,17 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) CALL h5dclose_f(dset3, error) CALL check("h5dclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) END DO - ! Close property list + ! Close property list CALL h5pclose_f(dcpl,error) CALL check("h5pclose_f", error, total_error) - ! Close dataspace + ! Close dataspace CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) @@ -950,13 +950,13 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T - ! Verify the information for first attribute, in increasing creation order + ! Verify the information for first attribute, in increasing creation order CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, hzero, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) CALL verify("h5aget_info_by_idx_f",corder,0,total_error) - ! Verify the information for new attribute, in increasing creation order + ! Verify the information for new attribute, in increasing creation order CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, n, & f_corder_valid, corder, cset, data_size, error) @@ -964,7 +964,7 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) CALL check("h5aget_info_by_idx_f",error,total_error) CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - ! Verify the name for new link, in increasing creation order + ! Verify the name for new link, in increasing creation order ! Try with the correct buffer size @@ -981,21 +981,21 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) ! Don't test "native" order if there is no creation order index, since ! * there's not a good way to easily predict the attribute's order in the name ! * index. - ! + ! IF (use_index) THEN - ! Verify the information for first attribute, in native creation order + ! Verify the information for first attribute, in native creation order CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, hzero, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) CALL verify("h5aget_info_by_idx_f",corder,0,total_error) - ! Verify the information for new attribute, in native creation order + ! Verify the information for new attribute, in native creation order CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, n, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) CALL verify("h5aget_info_by_idx_f",corder,INT(n),total_error) - ! Verify the name for new link, in increasing native order + ! Verify the name for new link, in increasing native order CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, & n, tmpname, error) ! check with no optional parameters CALL check("h5aget_name_by_idx_f",error,total_error) @@ -1113,114 +1113,114 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension INTEGER :: arank = 1 ! Attribure rank - ! Initialize "big" attribute data + ! Initialize "big" attribute data - ! Create dataspace for dataset + ! Create dataspace for dataset CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Create "big" dataspace for "large" attributes + ! Create "big" dataspace for "large" attributes CALL h5screate_simple_f(arank, adims2, big_sid, error) CALL check("h5screate_simple_f",error,total_error) - ! Loop over type of shared components + ! Loop over type of shared components DO test_shared = 0, 2 - ! Make copy of file creation property list + ! Make copy of file creation property list CALL H5Pcopy_f(fcpl, my_fcpl, error) CALL check("H5Pcopy",error,total_error) - ! Set up datatype for attributes + ! Set up datatype for attributes CALL H5Tcopy_f(H5T_NATIVE_INTEGER, attr_tid, error) CALL check("H5Tcopy",error,total_error) - ! Special setup for each type of shared components + ! Special setup for each type of shared components IF( test_shared .EQ. 0) THEN - ! Make attributes > 500 bytes shared + ! Make attributes > 500 bytes shared CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) CALL check(" H5Pset_shared_mesg_index_f",error, total_error) ELSE - ! Set up copy of file creation property list + ! Set up copy of file creation property list CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) - ! Make attributes > 500 bytes shared + ! Make attributes > 500 bytes shared CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) - ! Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) + ! Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) ENDIF - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, my_fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Close FCPL copy + ! Close FCPL copy CALL h5pclose_f(my_fcpl, error) CALL check("h5pclose_f", error, total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Re-open file + ! Re-open file CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error,fapl) CALL check("h5open_f",error,total_error) - ! Commit datatype to file + ! Commit datatype to file IF(test_shared.EQ.2) THEN CALL H5Tcommit_f(fid, TYPE1_NAME, attr_tid, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("H5Tcommit",error,total_error) ENDIF - ! Set up to query the object creation properties + ! Set up to query the object creation properties CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) CALL check("h5Pcreate_f",error,total_error) - ! Create datasets + ! Create datasets CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, dcpl_id=dcpl ) CALL check("h5dcreate_f",error,total_error) CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) CALL check("h5dcreate_f",error,total_error) - ! Retrieve limits for compact/dense attribute storage + ! Retrieve limits for compact/dense attribute storage CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) - ! Close property list + ! Close property list CALL h5pclose_f(dcpl,error) CALL check("h5pclose_f", error, total_error) - ! Add attributes to each dataset, until after converting to dense storage + ! Add attributes to each dataset, until after converting to dense storage DO u = 0, (max_compact * 2) - 1 - ! Create attribute name + ! Create attribute name WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 - ! Alternate between creating "small" & "big" attributes + ! Alternate between creating "small" & "big" attributes IF(MOD(u+1,2).EQ.0)THEN - ! Create "small" attribute on first dataset + ! Create "small" attribute on first dataset CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute attr_integer_data(1) = u + 1 data_dims(1) = 1 CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) ELSE - ! Create "big" attribute on first dataset + ! Create "big" attribute on first dataset CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute data_dims(1) = 1 attr_integer_data(1) = u + 1 @@ -1229,19 +1229,19 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) ENDIF - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Alternate between creating "small" & "big" attributes + ! Alternate between creating "small" & "big" attributes IF(MOD(u+1,2).EQ.0)THEN - ! Create "small" attribute on second dataset + ! Create "small" attribute on second dataset CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute attr_integer_data(1) = u + 1 data_dims(1) = 1 @@ -1249,12 +1249,12 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL check("h5awrite_f",error,total_error) ELSE - ! Create "big" attribute on second dataset + ! Create "big" attribute on second dataset CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) -! Write data into the attribute +! Write data into the attribute attr_integer_data(1) = u + 1 @@ -1263,103 +1263,103 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) ! CALL check("h5awrite_f",error,total_error) -! Check refcount for attribute +! Check refcount for attribute ENDIF - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Create new attribute name + ! Create new attribute name WRITE(chr2,'(I2.2)') u attrname2 = 'new attr '//chr2 - ! Change second dataset's attribute's name + ! Change second dataset's attribute's name CALL H5Arename_by_name_f(fid, DSET2_NAME, attrname, attrname2, error, lapl_id=H5P_DEFAULT_F) CALL check("H5Arename_by_name_f",error,total_error) - ! Check refcount on attributes now + ! Check refcount on attributes now - ! Check refcount on renamed attribute + ! Check refcount on renamed attribute CALL H5Aopen_f(dataset2, attrname2, attr, error, aapl_id=H5P_DEFAULT_F) CALL check("H5Aopen_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Check refcount on original attribute + ! Check refcount on original attribute CALL H5Aopen_f(dataset, attrname, attr, error) CALL check("H5Aopen",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Change second dataset's attribute's name back to original + ! Change second dataset's attribute's name back to original CALL H5Arename_by_name_f(fid, DSET2_NAME, attrname2, attrname, error) CALL check("H5Arename_by_name_f",error,total_error) - ! Check refcount on attributes now + ! Check refcount on attributes now - ! Check refcount on renamed attribute + ! Check refcount on renamed attribute CALL H5Aopen_f(dataset2, attrname, attr, error) CALL check("H5Aopen",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Check refcount on original attribute + ! Check refcount on original attribute - ! Check refcount on renamed attribute + ! Check refcount on renamed attribute CALL H5Aopen_f(dataset, attrname, attr, error) CALL check("H5Aopen",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) ENDDO - ! Close attribute's datatype + ! Close attribute's datatype CALL h5tclose_f(attr_tid, error) CALL check("h5tclose_f",error,total_error) - ! Close attribute's datatype + ! Close attribute's datatype CALL h5dclose_f(dataset, error) CALL check("h5dclose_f",error,total_error) CALL h5dclose_f(dataset2, error) CALL check("h5dclose_f",error,total_error) - ! Unlink datasets with attributes + ! Unlink datasets with attributes CALL H5Ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) CALL check("HLdelete",error,total_error) CALL H5Ldelete_f(fid, DSET2_NAME, error) CALL check("HLdelete",error,total_error) - ! Unlink committed datatype + ! Unlink committed datatype IF(test_shared == 2)THEN CALL H5Ldelete_f(fid, TYPE1_NAME, error) CALL check("HLdelete_f",error,total_error) ENDIF - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Check size of file + ! Check size of file !filesize = h5_get_file_size(FILENAME); !verify(filesize, empty_filesize, "h5_get_file_size"); ENDDO - ! Close dataspaces + ! Close dataspaces CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) CALL h5sclose_f(big_sid, error) @@ -1384,9 +1384,9 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) INTEGER(HID_T), INTENT(IN) :: fapl INTEGER, INTENT(INOUT) :: total_error CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid ! HDF5 File ID - INTEGER(HID_T) :: dcpl ! Dataset creation property list ID - INTEGER(HID_T) :: sid ! Dataspace ID + INTEGER(HID_T) :: fid ! HDF5 File ID + INTEGER(HID_T) :: dcpl ! Dataset creation property list ID + INTEGER(HID_T) :: sid ! Dataspace ID CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" @@ -1424,40 +1424,40 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) INTEGER :: idx_type INTEGER :: order - INTEGER :: u ! Local index variable + INTEGER :: u ! Local index variable INTEGER :: Input1 INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T INTEGER :: minusone = -1 data_dims = 0 - ! Create dataspace for dataset & attributes + ! Create dataspace for dataset & attributes CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Create dataset creation property list + ! Create dataset creation property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) CALL check("h5Pcreate_f",error,total_error) - ! Query the attribute creation properties + ! Query the attribute creation properties CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) - ! Loop over operating on different indices on link fields + ! Loop over operating on different indices on link fields DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F - ! Loop over operating in different orders + ! Loop over operating in different orders DO order = H5_ITER_INC_F, H5_ITER_DEC_F - ! Loop over using index for creation order value + ! Loop over using index for creation order value DO i = 1, 2 - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Set attribute creation order tracking & indexing for object + ! Set attribute creation order tracking & indexing for object IF(new_format)THEN IF(use_index(i))THEN @@ -1471,7 +1471,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ENDIF - ! Create datasets + ! Create datasets CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl ) CALL check("h5dcreate_f2",error,total_error) @@ -1482,7 +1482,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl ) CALL check("h5dcreate_f4",error,total_error) - ! Work on all the datasets + ! Work on all the datasets DO curr_dset = 0,NUM_DSETS-1 SELECT CASE (curr_dset) @@ -1497,36 +1497,36 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) END SELECT - ! Check for deleting non-existant attribute + ! Check for deleting non-existant attribute !EP CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, 0_HSIZE_T,error, lapl_id=H5P_DEFAULT_F) CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, hzero,error, lapl_id=H5P_DEFAULT_F) CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) - ! Create attributes, up to limit of compact form + ! Create attributes, up to limit of compact form DO u = 0, max_compact - 1 - ! Create attribute + ! Create attribute WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute attr_integer_data(1) = u data_dims(1) = 1 CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Verify information for new attribute + ! Verify information for new attribute CALL attr_info_by_idx_check(my_dataset, attrname, INT(u,HSIZE_T), use_index(i), total_error ) ENDDO - ! Check for out of bound deletions + ! Check for out of bound deletions CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) @@ -1545,11 +1545,11 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ! CALL HDassert(0.AND."Toomanydatasets!") END SELECT - ! Delete attributes from compact storage + ! Delete attributes from compact storage DO u = 0, max_compact - 2 - ! Delete first attribute in appropriate order + ! Delete first attribute in appropriate order !EP CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, error) @@ -1557,7 +1557,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL check("H5Adelete_by_idx_f",error,total_error) - ! Verify the attribute information for first attribute in appropriate order + ! Verify the attribute information for first attribute in appropriate order ! HDmemset(&ainfo, 0, sizeof(ainfo)); !EP CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, & @@ -1572,7 +1572,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL verify("H5Aget_info_by_idx_f",corder, max_compact-(u + 2),total_error) ENDIF - ! Verify the name for first attribute in appropriate order + ! Verify the name for first attribute in appropriate order size = 7 ! *CHECK* IF NOT THE SAME SIZE CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & @@ -1589,7 +1589,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL verify("h5aget_name_by_idx_f",error,0,total_error) ENDDO - ! Delete last attribute + ! Delete last attribute !EP CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, error) CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, hzero, error) @@ -1597,7 +1597,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ENDDO -! Work on all the datasets +! Work on all the datasets DO curr_dset = 0,NUM_DSETS-1 SELECT CASE (curr_dset) @@ -1611,11 +1611,11 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ! CALL HDassert(0.AND."Toomanydatasets!") END SELECT - ! Create more attributes, to push into dense form + ! Create more attributes, to push into dense form DO u = 0, (max_compact * 2) - 1 - ! Create attribute + ! Create attribute WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 @@ -1623,24 +1623,24 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute attr_integer_data(1) = u data_dims(1) = 1 CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) ENDDO - ! Check for out of bound deletion + ! Check for out of bound deletion CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error) CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) ENDDO - ! Work on all the datasets + ! Work on all the datasets DO curr_dset = 0,NUM_DSETS-1 SELECT CASE (curr_dset) @@ -1652,15 +1652,15 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) my_dataset = dset3 END SELECT - ! Delete attributes from dense storage + ! Delete attributes from dense storage DO u = 0, (max_compact * 2) - 1 - 1 - ! Delete first attribute in appropriate order + ! Delete first attribute in appropriate order CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) CALL check("H5Adelete_by_idx_f",error,total_error) - ! Verify the attribute information for first attribute in appropriate order + ! Verify the attribute information for first attribute in appropriate order CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), & f_corder_valid, corder, cset, data_size, error) @@ -1672,7 +1672,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL verify("H5Aget_info_by_idx_f",corder, ((max_compact * 2) - (u + 2)), total_error) ENDIF - ! Verify the name for first attribute in appropriate order + ! Verify the name for first attribute in appropriate order ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); size = 7 ! *CHECK* if not the correct size @@ -1691,17 +1691,17 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ENDDO - ! Delete last attribute + ! Delete last attribute CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) CALL check("H5Adelete_by_idx_f",error,total_error) - ! Check for deletion on empty attribute storage again + ! Check for deletion on empty attribute storage again CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) CALL verify("H5Adelete_by_idx_f",error,minusone,total_error) ENDDO - ! Close Datasets + ! Close Datasets CALL h5dclose_f(dset1, error) CALL check("h5dclose_f",error,total_error) CALL h5dclose_f(dset2, error) @@ -1709,18 +1709,18 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL h5dclose_f(dset3, error) CALL check("h5dclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) ENDDO ENDDO ENDDO - ! Close property list + ! Close property list CALL h5pclose_f(dcpl,error) CALL check("h5pclose_f", error, total_error) - ! Close dataspace + ! Close dataspace CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) @@ -1775,77 +1775,77 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension INTEGER :: arank = 1 ! Attribure rank - ! Output message about test being performed + ! Output message about test being performed - ! Initialize "big" attribute DATA - ! Create dataspace for dataset + ! Initialize "big" attribute DATA + ! Create dataspace for dataset CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Create "big" dataspace for "large" attributes + ! Create "big" dataspace for "large" attributes CALL h5screate_simple_f(arank, adims2, big_sid, error) CALL check("h5screate_simple_f",error,total_error) - ! Loop over type of shared components + ! Loop over type of shared components DO test_shared = 0, 2 - ! Make copy of file creation property list + ! Make copy of file creation property list CALL H5Pcopy_f(fcpl, my_fcpl, error) CALL check("H5Pcopy",error,total_error) - ! Set up datatype for attributes + ! Set up datatype for attributes CALL H5Tcopy_f(H5T_NATIVE_INTEGER, attr_tid, error) CALL check("H5Tcopy",error,total_error) - ! Special setup for each type of shared components + ! Special setup for each type of shared components IF( test_shared .EQ. 0) THEN - ! Make attributes > 500 bytes shared + ! Make attributes > 500 bytes shared CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) CALL check(" H5Pset_shared_mesg_index_f",error, total_error) ELSE - ! Set up copy of file creation property list + ! Set up copy of file creation property list CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) - ! Make attributes > 500 bytes shared + ! Make attributes > 500 bytes shared CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) - ! Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) + ! Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) ENDIF - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, my_fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Close FCPL copy + ! Close FCPL copy CALL h5pclose_f(my_fcpl, error) CALL check("h5pclose_f", error, total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Re-open file + ! Re-open file CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error,fapl) CALL check("h5open_f",error,total_error) - ! Commit datatype to file + ! Commit datatype to file IF(test_shared.EQ.2) THEN CALL H5Tcommit_f(fid, TYPE1_NAME, attr_tid, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("H5Tcommit",error,total_error) ENDIF - ! Set up to query the object creation properties + ! Set up to query the object creation properties CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) CALL check("h5Pcreate_f",error,total_error) - ! Create datasets + ! Create datasets CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, dcpl_id=dcpl ) CALL check("h5dcreate_f",error,total_error) @@ -1853,42 +1853,42 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) CALL check("h5dcreate_f",error,total_error) - ! Retrieve limits for compact/dense attribute storage + ! Retrieve limits for compact/dense attribute storage CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) - ! Close property list + ! Close property list CALL h5pclose_f(dcpl,error) CALL check("h5pclose_f", error, total_error) - ! Add attributes to each dataset, until after converting to dense storage + ! Add attributes to each dataset, until after converting to dense storage DO u = 0, (max_compact * 2) - 1 - ! Create attribute name + ! Create attribute name WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 - ! Alternate between creating "small" & "big" attributes + ! Alternate between creating "small" & "big" attributes IF(MOD(u+1,2).EQ.0)THEN - ! Create "small" attribute on first dataset + ! Create "small" attribute on first dataset CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute attr_integer_data(1) = u + 1 data_dims(1) = 1 CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) ELSE - ! Create "big" attribute on first dataset + ! Create "big" attribute on first dataset CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute attr_integer_data(1) = u + 1 data_dims(1) = 1 @@ -1897,31 +1897,31 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) ENDIF - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Alternate between creating "small" & "big" attributes + ! Alternate between creating "small" & "big" attributes IF(MOD(u+1,2).EQ.0)THEN - ! Create "small" attribute on second dataset + ! Create "small" attribute on second dataset CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute attr_integer_data(1) = u + 1 data_dims(1) = 1 CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) ELSE - ! Create "big" attribute on second dataset + ! Create "big" attribute on second dataset CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) -! Write data into the attribute +! Write data into the attribute attr_integer_data(1) = u + 1 @@ -1930,21 +1930,21 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL check("h5awrite_f",error,total_error) ENDIF - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) ENDDO - ! Delete attributes from second dataset + ! Delete attributes from second dataset DO u = 0, max_compact*2-1 - ! Create attribute name + ! Create attribute name WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 - ! Delete second dataset's attribute + ! Delete second dataset's attribute CALL H5Adelete_by_name_f(fid, DSET2_NAME, attrname,error,lapl_id=H5P_DEFAULT_F) CALL check("H5Adelete_by_name", error, total_error) @@ -1952,31 +1952,31 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL check("h5aopen_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) ENDDO - ! Close attribute's datatype + ! Close attribute's datatype CALL h5tclose_f(attr_tid, error) CALL check("h5tclose_f",error,total_error) - ! Close Datasets + ! Close Datasets CALL h5dclose_f(dataset, error) CALL check("h5dclose_f",error,total_error) CALL h5dclose_f(dataset2, error) CALL check("h5dclose_f",error,total_error) - ! Unlink datasets WITH attributes + ! Unlink datasets WITH attributes CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) CALL check("H5Ldelete_f", error, total_error) CALL h5ldelete_f(fid, DSET2_NAME, error) CALL check("H5Ldelete_f", error, total_error) - ! Unlink committed datatype + ! Unlink committed datatype IF( test_shared == 2) THEN CALL h5ldelete_f(fid, TYPE1_NAME, error) @@ -1984,13 +1984,13 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) ENDIF - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) ENDDO - ! Close dataspaces + ! Close dataspaces CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) CALL h5sclose_f(big_sid, error) @@ -2040,73 +2040,73 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) data_dims = 0 - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Re-open file + ! Re-open file CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) CALL check("h5open_f",error,total_error) - ! Create dataspace for dataset + ! Create dataspace for dataset CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Query the group creation properties + ! Query the group creation properties CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) CALL check("h5Pcreate_f",error,total_error) - ! Enable creation order tracking on attributes, so creation order tests work + ! Enable creation order tracking on attributes, so creation order tests work CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_TRACKED_F, error) CALL check("H5Pset_attr_creation_order",error,total_error) - ! Create a dataset + ! Create a dataset CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, & lcpl_id=H5P_DEFAULT_F, dcpl_id=dcpl, dapl_id=H5P_DEFAULT_F) CALL check("h5dcreate_f",error,total_error) - ! Retrieve limits for compact/dense attribute storage + ! Retrieve limits for compact/dense attribute storage CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) - ! Close property list + ! Close property list CALL h5pclose_f(dcpl, error) CALL check("h5pclose_f",error,total_error) - ! Add attributes, until just before converting to dense storage + ! Add attributes, until just before converting to dense storage DO u = 0, max_compact - 1 - ! Create attribute + ! Create attribute WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute data_dims(1) = 1 CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Verify attributes written so far + ! Verify attributes written so far CALL test_attr_dense_verify(dataset, u, total_error) ENDDO ! -! Add one more attribute, to push into "dense" storage -! Create attribute +! Add one more attribute, to push into "dense" storage +! Create attribute WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 @@ -2114,36 +2114,36 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write data into the attribute + ! Write data into the attribute data_dims(1) = 1 CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Close dataspace + ! Close dataspace CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) - ! Verify all the attributes written + ! Verify all the attributes written ! ret = test_attr_dense_verify(dataset, (u + 1)); ! CHECK(ret, FAIL, "test_attr_dense_verify"); - ! CLOSE Dataset + ! CLOSE Dataset CALL h5dclose_f(dataset, error) CALL check("h5dclose_f",error,total_error) - ! Unlink dataset with attributes + ! Unlink dataset with attributes CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) CALL check("H5Ldelete_f", error, total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Check size of file + ! Check size of file ! filesize = h5_get_file_size(FILENAME); ! verify(filesize, empty_filesize, "h5_get_file_size") @@ -2179,21 +2179,21 @@ SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) data_dims = 0 - ! Retrieve the current # of reported errors + ! Retrieve the current # of reported errors ! old_nerrs = GetTestNumErrs(); - ! Re-open all the attributes by name and verify the data + ! Re-open all the attributes by name and verify the data DO u = 0, max_attr -1 - ! Open attribute + ! Open attribute WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 CALL h5aopen_f(loc_id, attrname, attr, error) CALL check("h5aopen_f",error,total_error) - ! Read data from the attribute + ! Read data from the attribute ! value = 103 data_dims(1) = 1 @@ -2202,22 +2202,22 @@ SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) CALL CHECK("H5Aread_F", error, total_error) CALL verify("H5Aread_F", value, u, total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) ENDDO - ! Re-open all the attributes by index and verify the data + ! Re-open all the attributes by index and verify the data DO u=0, max_attr-1 - ! Open attribute + ! Open attribute CALL H5Aopen_by_idx_f(loc_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(u,HSIZE_T), & attr, error, aapl_id=H5P_DEFAULT_F) - ! Verify Name + ! Verify Name WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 @@ -2228,14 +2228,14 @@ SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) WRITE(*,*) 'ERROR: attribute name different: attr_name = ',check_name, ', should be ', attrname total_error = total_error + 1 ENDIF - ! Read data from the attribute + ! Read data from the attribute data_dims(1) = 1 CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) CALL CHECK("H5Aread_f", error, total_error) CALL verify("H5Aread_f", value, u, total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) ENDDO @@ -2270,30 +2270,30 @@ SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) INTEGER :: crt_order_flags INTEGER :: minusone = -1 - ! Output message about test being performed + ! Output message about test being performed ! WRITE(*,*) " - Testing Basic Code for Attributes with Creation Order Info" - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Create dataset creation property list + ! Create dataset creation property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) CALL check("h5Pcreate_f",error,total_error) - ! Get creation order indexing on object + ! Get creation order indexing on object CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) CALL check("H5Pget_attr_creation_order_f",error,total_error) CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) - ! Setting invalid combination of a attribute order creation order indexing on should fail + ! Setting invalid combination of a attribute order creation order indexing on should fail CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_INDEXED_F, error) CALL verify("H5Pset_attr_creation_order_f",error , minusone, total_error) CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) CALL check("H5Pget_attr_creation_order_f",error,total_error) CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) - ! Set attribute creation order tracking & indexing for object + ! Set attribute creation order tracking & indexing for object CALL h5pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) CALL check("H5Pset_attr_creation_order_f",error,total_error) @@ -2302,60 +2302,60 @@ SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , & IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error) - ! Create dataspace for dataset + ! Create dataspace for dataset CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Create a dataset + ! Create a dataset CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, & lcpl_id=H5P_DEFAULT_F, dapl_id=H5P_DEFAULT_F, dcpl_id=dcpl) CALL check("h5dcreate_f",error,total_error) - ! Close dataspace + ! Close dataspace CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) - ! Close Dataset + ! Close Dataset CALL h5dclose_f(dataset, error) CALL check("h5dclose_f",error,total_error) - ! Close property list + ! Close property list CALL h5pclose_f(dcpl, error) CALL check("h5pclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Re-open file + ! Re-open file CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) CALL check("h5open_f",error,total_error) - ! Open dataset created + ! Open dataset created CALL h5dopen_f(fid, DSET1_NAME, dataset, error, H5P_DEFAULT_F ) CALL check("h5dopen_f",error,total_error) - ! Retrieve dataset creation property list for group + ! Retrieve dataset creation property list for group CALL H5Dget_create_plist_f(dataset, dcpl, error) CALL check("H5Dget_create_plist_f",error,total_error) - ! Query the attribute creation properties + ! Query the attribute creation properties CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) CALL check("H5Pget_attr_creation_order_f",error,total_error) CALL verify("H5Pget_attr_creation_order_f",crt_order_flags , & IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error ) - ! Close property list + ! Close property list CALL h5pclose_f(dcpl, error) CALL check("h5pclose_f",error,total_error) - ! Close Dataset + ! Close Dataset CALL h5dclose_f(dataset, error) CALL check("h5dclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) @@ -2418,97 +2418,97 @@ SUBROUTINE test_attr_basic_write(fapl, total_error) attr_data1a(3) = -99890 - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid1, error, H5P_DEFAULT_F, fapl) CALL check("h5fcreate_f",error,total_error) - ! Create dataspace for dataset + ! Create dataspace for dataset CALL h5screate_simple_f(rank1, dims1, sid1, error, maxdims1) CALL check("h5screate_simple_f",error,total_error) - ! Create a dataset + ! Create a dataset CALL h5dcreate_f(fid1, DSET1_NAME, H5T_NATIVE_CHARACTER, sid1, dataset, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F ) CALL check("h5dcreate_f",error,total_error) - ! Create dataspace for attribute + ! Create dataspace for attribute CALL h5screate_simple_f(ATTR1_RANK, dimsa, sid2, error) CALL check("h5screate_simple_f",error,total_error) - ! Try to create an attribute on the file (should create an attribute on root group) + ! Try to create an attribute on the file (should create an attribute on root group) CALL h5acreate_f(fid1, ATTR1_NAME, H5T_NATIVE_INTEGER, sid2, attr, error, aapl_id=H5P_DEFAULT_F, acpl_id=H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Open the root group + ! Open the root group CALL H5Gopen_f(fid1, "/", group, error, H5P_DEFAULT_F) CALL check("H5Gopen_f",error,total_error) - ! Open attribute again + ! Open attribute again CALL h5aopen_f(group, ATTR1_NAME, attr, error) CALL check("h5aopen_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Close root group + ! Close root group CALL H5Gclose_f(group, error) CALL check("h5gclose_f",error,total_error) - ! Create an attribute for the dataset + ! Create an attribute for the dataset CALL h5acreate_f(dataset, ATTR1_NAME, H5T_NATIVE_INTEGER, sid2, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write attribute information + ! Write attribute information CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_data1, dimsa, error) CALL check("h5awrite_f",error,total_error) - ! Create an another attribute for the dataset + ! Create an another attribute for the dataset CALL h5acreate_f(dataset, ATTR1A_NAME, H5T_NATIVE_INTEGER, sid2, attr2, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Write attribute information + ! Write attribute information CALL h5awrite_f(attr2, H5T_NATIVE_INTEGER, attr_data1a, dimsa, error) CALL check("h5awrite_f",error,total_error) - ! Check storage size for attribute + ! Check storage size for attribute CALL h5aget_storage_size_f(attr, attr_size, error) CALL check("h5aget_storage_size_f",error,total_error) !EP CALL verify("h5aget_storage_size_f", INT(attr_size), 2*HSIZE_T, total_error) - ! Read attribute information immediately, without closing attribute + ! Read attribute information immediately, without closing attribute CALL h5aread_f(attr, H5T_NATIVE_INTEGER, read_data1, dimsa, error) CALL check("h5aread_f",error,total_error) - ! Verify values read in + ! Verify values read in DO i = 1, ATTR1_DIM1 CALL verify('h5aread_f',attr_data1(i),read_data1(i), total_error) ENDDO - ! CLOSE attribute + ! CLOSE attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr2, error) CALL check("h5aclose_f",error,total_error) - ! change attribute name + ! change attribute name CALL H5Arename_f(dataset, ATTR1_NAME, ATTR_TMP_NAME, error) CALL check("H5Arename_f", error, total_error) - ! Open attribute again + ! Open attribute again CALL h5aopen_f(dataset, ATTR_TMP_NAME, attr, error) CALL check("h5aopen_f",error,total_error) - ! Verify new attribute name + ! Verify new attribute name ! Set a deliberately small size check_name = ' ' ! need to initialize or does not pass test @@ -2539,7 +2539,7 @@ SUBROUTINE test_attr_basic_write(fapl, total_error) CALL check('H5Aget_name_f',error,total_error) CALL verify('H5Aget_name_f',chr_exact_size,ATTR_TMP_NAME, total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) @@ -2547,11 +2547,11 @@ SUBROUTINE test_attr_basic_write(fapl, total_error) CALL check("h5sclose_f",error,total_error) CALL h5sclose_f(sid2, error) CALL check("h5sclose_f",error,total_error) - ! Close Dataset + ! Close Dataset CALL h5dclose_f(dataset, error) CALL check("h5dclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid1, error) CALL check("h5fclose_f",error,total_error) @@ -2594,20 +2594,20 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) data_dims = 0 - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) - ! Create dataspace for attribute + ! Create dataspace for attribute CALL h5screate_f(H5S_SCALAR_F, sid, error) CALL check("h5screate_f",error,total_error) - ! Create group for attributes + ! Create group for attributes CALL H5Gcreate_f(fid, GROUP1_NAME, gid, error) CALL check("H5Gcreate_f", error, total_error) - ! Create many attributes + ! Create many attributes IF(new_format)THEN nattr = 250 @@ -2651,15 +2651,15 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) ENDDO - ! Close group + ! Close group CALL H5Gclose_f(gid, error) CALL check("h5gclose_f",error,total_error) - ! Close file + ! Close file CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Close dataspaces + ! Close dataspaces CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) @@ -2677,7 +2677,7 @@ END SUBROUTINE test_attr_many ! * March 21, 2008 ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) @@ -2699,10 +2699,10 @@ SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) INTEGER(HSIZE_T) :: storage_size ! attributes storage requirements CHARACTER(LEN=2) :: chr2 INTEGER(HID_T) attr_id - ! Open each attribute on object by index and check that it's the correct one + ! Open each attribute on object by index and check that it's the correct one DO u = 0, max_attrs-1 - ! Open the attribute + ! Open the attribute WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 @@ -2712,12 +2712,12 @@ SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) CALL check("h5aopen_f",error,total_error) - ! Get the attribute's information + ! Get the attribute's information CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_f",error,total_error) - ! Check that the object's attributes are correct + ! Check that the object's attributes are correct CALL verify("h5aget_info_f.corder",corder,u,total_error) CALL verify("h5aget_info_f.corder_valid",f_corder_valid,.TRUE.,total_error) CALL verify("h5aget_info_f.cset", cset, H5T_CSET_ASCII_F, total_error) @@ -2727,18 +2727,18 @@ SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) CALL verify("h5aget_info_f.data_size", INT(data_size), INT(storage_size), total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr_id, error) CALL check("h5aclose_f",error,total_error) - ! Open the attribute + ! Open the attribute CALL H5Aopen_by_name_f(obj_id, ".", attrname, attr_id, error, lapl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) CALL check("H5Aopen_by_name_f", error, total_error) CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_f",error,total_error) - ! Check the attribute's information + ! Check the attribute's information CALL verify("h5aget_info_f",corder,u,total_error) CALL verify("h5aget_info_f",f_corder_valid,.TRUE.,total_error) CALL verify("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) @@ -2746,21 +2746,21 @@ SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) CALL check("h5aget_storage_size_f",error,total_error) CALL verify("h5aget_info_f", INT(data_size), INT(storage_size), total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr_id, error) CALL check("h5aclose_f",error,total_error) - ! Open the attribute + ! Open the attribute CALL H5Aopen_by_name_f(fid, dsetname, attrname, attr_id, error) CALL check("H5Aopen_by_name_f", error, total_error) - ! Get the attribute's information + ! Get the attribute's information CALL h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_f",error,total_error) - ! Check the attribute's information + ! Check the attribute's information CALL verify("h5aget_info_f",corder,u,total_error) CALL verify("h5aget_info_f",f_corder_valid,.TRUE.,total_error) CALL verify("h5aget_info_f", cset, H5T_CSET_ASCII_F, total_error) @@ -2768,7 +2768,7 @@ SUBROUTINE attr_open_check(fid, dsetname, obj_id, max_attrs, total_error ) CALL check("h5aget_storage_size_f",error,total_error) CALL verify("h5aget_info_f", INT(data_size), INT(storage_size), total_error) - ! Close attribute + ! Close attribute CALL h5aclose_f(attr_id, error) CALL check("h5aclose_f",error,total_error) ENDDO diff --git a/fortran/test/tH5D.F90 b/fortran/test/tH5D.F90 index 7001b98..7f8a988 100644 --- a/fortran/test/tH5D.F90 +++ b/fortran/test/tH5D.F90 @@ -44,31 +44,31 @@ CONTAINS IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error - + CHARACTER(LEN=5), PARAMETER :: filename = "dsetf" ! File name CHARACTER(LEN=80) :: fix_filename CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name CHARACTER(LEN=9), PARAMETER :: null_dsetname = "null_dset" ! Dataset name - + INTEGER(HID_T) :: file_id ! File identifier INTEGER(HID_T) :: dset_id ! Dataset identifier INTEGER(HID_T) :: null_dset ! Null dataset identifier INTEGER(HID_T) :: dspace_id ! Dataspace identifier INTEGER(HID_T) :: null_dspace ! Null dataspace identifier INTEGER(HID_T) :: dtype_id ! Datatype identifier - + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions INTEGER :: rank = 2 ! Dataset rank - + INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers INTEGER :: error ! Error flag - + INTEGER :: i, j !general purpose integers INTEGER(HSIZE_T), DIMENSION(2) :: data_dims INTEGER(HSIZE_T), DIMENSION(1) :: null_data_dim INTEGER :: null_dset_data = 1 ! null data INTEGER :: flag ! Space allocation status - + ! ! Initialize the dset_data array. ! @@ -157,10 +157,10 @@ CONTAINS CALL h5dget_space_status_f(dset_id, flag, error) CALL check("h5dget_space_status_f",error, total_error) CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_ALLOCATED_F, total_error) - + CALL h5dget_space_status_f(null_dset, flag, error) CALL check("h5dget_space_status_f",error, total_error) - CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_NOT_ALLOCATED_F, total_error) + CALL VERIFY("h5dget_space_status_f", flag, H5D_SPACE_STS_NOT_ALLOCATED_F, total_error) ! ! Get the dataset type. ! @@ -210,7 +210,7 @@ CONTAINS ! CALL h5sclose_f(dspace_id, error) CALL check("h5sclose_f", error, total_error) - + ! ! Terminate access to the data type. ! @@ -223,86 +223,86 @@ CONTAINS CALL check("h5fclose_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) - + RETURN END SUBROUTINE datasettest - + ! !the following subroutine tests h5dextend_f functionality ! SUBROUTINE extenddsettest(cleanup, total_error) - + IMPLICIT NONE - + LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error - + ! !the dataset is stored in file "extf.h5" ! CHARACTER(LEN=4), PARAMETER :: filename = "extf" CHARACTER(LEN=80) :: fix_filename - + ! !dataset name is "ExtendibleArray" ! CHARACTER(LEN=15), PARAMETER :: dsetname = "ExtendibleArray" - + ! !dataset rank is 2 ! INTEGER :: RANK = 2 - + INTEGER(HID_T) :: file_id ! File identifier INTEGER(HID_T) :: dset_id ! Dataset identifier INTEGER(HID_T) :: dataspace ! Dataspace identifier INTEGER(HID_T) :: memspace ! memory Dataspace identifier INTEGER(HID_T) :: crp_list ! dataset creatation property identifier - + ! !dataset dimensions at creation time ! INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/3,3/) - + ! !data dimensions ! INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/10,3/) - + ! !Maximum dimensions ! INTEGER(HSIZE_T), DIMENSION(2) :: maxdims - + ! !data arrays for reading and writing ! INTEGER, DIMENSION(10,3) :: data_in, data_out - + ! !Size of data in the file ! INTEGER(HSIZE_T), DIMENSION(2) :: size - + ! !general purpose integer ! INTEGER :: i, j INTEGER(HSIZE_T) :: ih, jh - + ! !flag to check operation success ! INTEGER :: error - + ! !Variables used in reading data back ! INTEGER(HSIZE_T), DIMENSION(2) :: dimsr, maxdimsr INTEGER :: rankr INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - + ! !data initialization ! @@ -311,7 +311,7 @@ CONTAINS data_in(i,j) = 2 END DO END DO - + ! !Initialize FORTRAN predifined datatypes ! @@ -328,24 +328,24 @@ CONTAINS ENDIF CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) CALL check("h5fcreate_f",error,total_error) - + ! !Create the data space with unlimited dimensions. ! maxdims = (/H5S_UNLIMITED_F, H5S_UNLIMITED_F/) - + CALL h5screate_simple_f(RANK, dims, dataspace, error, maxdims) CALL check("h5screate_simple_f",error,total_error) - + ! !Modify dataset creation properties, i.e. enable chunking ! CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) CALL check("h5pcreate_f",error,total_error) - + CALL h5pset_chunk_f(crp_list, RANK, dims1, error) CALL check("h5pset_chunk_f",error,total_error) - + ! !Create a dataset with 3X3 dimensions using cparms creation propertie . ! @@ -359,8 +359,8 @@ CONTAINS SIZE(2) = 3 CALL h5dextend_f(dset_id, size, error) CALL check("h5dextend_f",error,total_error) - - + + ! !Extend the dataset. Dataset becomes 10 x 3. ! @@ -368,7 +368,7 @@ CONTAINS SIZE(2) = 3; CALL h5dextend_f(dset_id, size, error) CALL check("h5dextend_f",error,total_error) - + ! !Write the data of size 10X3 to the extended dataset. ! @@ -376,13 +376,13 @@ CONTAINS data_dims(2) = 3 CALL H5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data_in, data_dims, error) CALL check("h5dwrite_f",error,total_error) - + ! !Close the dataspace for the dataset. ! CALL h5sclose_f(dataspace, error) CALL check("h5sclose_f",error,total_error) - + ! !Close the property list. ! @@ -393,13 +393,13 @@ CONTAINS ! CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f",error,total_error) - + ! !Close the file. ! CALL h5fclose_f(file_id, error) CALL check("h5fclose_f",error,total_error) - + ! !read the data back ! @@ -407,19 +407,19 @@ CONTAINS ! CALL h5fopen_f (fix_filename, H5F_ACC_RDONLY_F, file_id, error) CALL check("hfopen_f",error,total_error) - + ! !Open the dataset. ! CALL h5dopen_f(file_id, dsetname, dset_id, error) CALL check("h5dopen_f",error,total_error) - + ! !Get dataset's dataspace handle. ! CALL h5dget_space_f(dset_id, dataspace, error) CALL check("h5dget_space_f",error,total_error) - + ! !Get dataspace's rank. ! @@ -429,7 +429,7 @@ CONTAINS WRITE(*,*) "dataset rank error occured" STOP END IF - + ! !Get dataspace's dimensinons. ! @@ -439,27 +439,27 @@ CONTAINS WRITE(*,*) "dataset dimensions error occured" STOP END IF - + ! !Get creation property list. ! CALL h5dget_create_plist_f(dset_id, crp_list, error) CALL check("h5dget_create_plist_f",error,total_error) - + ! !create memory dataspace. ! CALL h5screate_simple_f(rankr, dimsr, memspace, error) CALL check("h5screate_simple_f",error,total_error) - + ! !Read data ! CALL H5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, memspace, dataspace) CALL check("h5dread_f",error,total_error) - + ! !Compare the data. ! @@ -471,31 +471,31 @@ CONTAINS END IF END DO END DO - + ! !Close the dataspace for the dataset. ! CALL h5sclose_f(dataspace, error) CALL check("h5sclose_f",error,total_error) - + ! !Close the memspace for the dataset. ! CALL h5sclose_f(memspace, error) CALL check("h5sclose_f",error,total_error) - + ! !Close the property list. ! CALL h5pclose_f(crp_list, error) CALL check("h5pclose_f",error,total_error) - + ! !Close the dataset. ! CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f",error,total_error) - + ! !Close the file. ! @@ -503,7 +503,7 @@ CONTAINS CALL check("h5fclose_f",error,total_error) IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) - + RETURN END SUBROUTINE extenddsettest @@ -549,7 +549,7 @@ CONTAINS DO i = 1, dset_dim1 DO j = 1, dset_dim2 n = n + 1 - data_in(i,j) = n + data_in(i,j) = n END DO END DO CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file, error, fcpl) @@ -557,7 +557,7 @@ CONTAINS ! Create the data space dims(1:2) = (/dset_dim1,dset_dim2/) - + CALL h5screate_simple_f(2, dims, space, error) CALL check("h5screate_simple_f",error,total_error) @@ -596,7 +596,7 @@ CONTAINS total_error = total_error + 1 RETURN ENDIF - ! The pos= specifier illustrates that positions are in bytes, + ! The pos= specifier illustrates that positions are in bytes, ! starting from byte 1 (as opposed to C, where they start from byte 0) READ(10, POS=offset+1, IOSTAT=ios) rdata IF(ios.NE.0)THEN @@ -625,7 +625,7 @@ CONTAINS CALL check("h5_cleanup_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) - + END SUBROUTINE test_userblock_offset END MODULE TH5D diff --git a/fortran/test/tH5E_F03.F90 b/fortran/test/tH5E_F03.F90 index 1878966..a8ca103 100644 --- a/fortran/test/tH5E_F03.F90 +++ b/fortran/test/tH5E_F03.F90 @@ -5,7 +5,7 @@ ! ! FUNCTION ! Test FORTRAN HDF5 H5E APIs which are dependent on FORTRAN 2003 -! features. +! features. ! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -168,10 +168,10 @@ SUBROUTINE test_error(total_error) !!$#ifdef H5_USE_16_API !!$ if (old_func != (H5E_auto_t)H5Eprint) !!$ TEST_ERROR; -!!$#else H5_USE_16_API +!!$#else H5_USE_16_API !!$ if (old_func != (H5E_auto2_t)H5Eprint2) !!$ TEST_ERROR; -!!$#endif H5_USE_16_API +!!$#endif H5_USE_16_API ! set the customized error handling routine diff --git a/fortran/test/tH5F.F90 b/fortran/test/tH5F.F90 index b898c21..16464dd 100644 --- a/fortran/test/tH5F.F90 +++ b/fortran/test/tH5F.F90 @@ -25,10 +25,10 @@ ! !***** ! -! In the mountingtest subroutine we create one file with a group in it, +! In the mountingtest subroutine we create one file with a group in it, ! and another file with a dataset. Mounting is used to -! access the dataset from the second file as a member of a group -! in the first file. +! access the dataset from the second file as a member of a group +! in the first file. MODULE TH5F @@ -148,7 +148,7 @@ CONTAINS CALL check(" h5tcopy_f",error,total_error) CALL h5tcopy_f(H5T_NATIVE_CHARACTER, t4, error) CALL check(" h5tcopy_f",error,total_error) - + CALL h5fget_obj_count_f(INT(H5F_OBJ_ALL_F,HID_T), H5F_OBJ_ALL_F, obj_count, error) CALL check(" h5fget_obj_count_f",error,total_error) @@ -280,7 +280,7 @@ CONTAINS IF(obj_count.NE.1)THEN total_error = total_error + 1 - ENDIF + ENDIF CALL h5fopen_f (fix_filename2, H5F_ACC_RDWR_F, file2_id, error) CALL check("h5fopen_f",error,total_error) @@ -290,7 +290,7 @@ CONTAINS IF(obj_count.NE.2)THEN total_error = total_error + 1 - ENDIF + ENDIF ! !Check file numbers diff --git a/fortran/test/tH5F_F03.F90 b/fortran/test/tH5F_F03.F90 index 8cc6b83..f938565 100644 --- a/fortran/test/tH5F_F03.F90 +++ b/fortran/test/tH5F_F03.F90 @@ -5,7 +5,7 @@ ! ! FUNCTION ! Test FORTRAN HDF5 H5F APIs which are dependent on FORTRAN 2003 -! features. +! features. ! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -37,8 +37,8 @@ MODULE TH5F_F03 USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN + USE TH5_MISC + USE TH5_MISC_GEN USE ISO_C_BINDING CONTAINS @@ -79,21 +79,21 @@ SUBROUTINE test_get_file_image(total_error) CALL h5fcreate_f("tget_file_image.h5", H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) CALL check("h5fcreate_f", error, total_error) - ! Set up data space for new data set + ! Set up data space for new data set dims(1:2) = (/10,10/) - + CALL h5screate_simple_f(2, dims, space_id, error) CALL check("h5screate_simple_f", error, total_error) - ! Create a dataset + ! Create a dataset CALL h5dcreate_f(file_id, "dset 0", H5T_NATIVE_INTEGER, space_id, dset_id, error) CALL check("h5dcreate_f", error, total_error) - ! Write some data to the data set + ! Write some data to the data set DO i = 1, 100 data(i) = INT(i) ENDDO - + f_ptr = C_LOC(data(1)) CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, error) CALL check("h5dwrite_f",error, total_error) @@ -102,7 +102,7 @@ SUBROUTINE test_get_file_image(total_error) CALL h5fflush_f(file_id, H5F_SCOPE_GLOBAL_F, error) CALL check("h5fflush_f",error, total_error) - ! Open the test file using standard I/O calls + ! Open the test file using standard I/O calls OPEN(UNIT=10,FILE='tget_file_image.h5', ACCESS='STREAM') ! Get the size of the test file ! @@ -110,8 +110,8 @@ SUBROUTINE test_get_file_image(total_error) ! may be larger. This is OK, as long as (in this specialized instance) ! the remainder of the file is all '\0's. ! - ! With latest mods to truncate call in core file drive, - ! file size should match image size; get the file size + ! With latest mods to truncate call in core file drive, + ! file size should match image size; get the file size INQUIRE(UNIT=10, SIZE=file_sz) CLOSE(UNIT=10) @@ -131,7 +131,7 @@ SUBROUTINE test_get_file_image(total_error) CALL verify("h5fget_file_image_f", INT(itmp_a), 1, total_error) ! Routine should not change the value CALL verify("h5fget_file_image_f", file_sz, INT(image_size), total_error) - ! Allocate a buffer of the appropriate size + ! Allocate a buffer of the appropriate size ALLOCATE(image_ptr(1:image_size)) ! Load the image of the file into the buffer @@ -139,7 +139,7 @@ SUBROUTINE test_get_file_image(total_error) CALL h5fget_file_image_f(file_id, f_ptr, image_size, error) CALL check("h5fget_file_image_f",error, total_error) - ! Close dset and space + ! Close dset and space CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f", error, total_error) CALL h5sclose_f(space_id, error) @@ -151,7 +151,7 @@ SUBROUTINE test_get_file_image(total_error) ! Allocate a buffer for the test file image ALLOCATE(file_image_ptr(1:image_size)) - ! Open the test file using standard I/O calls + ! Open the test file using standard I/O calls OPEN(UNIT=10,FILE='tget_file_image.h5', FORM='UNFORMATTED', ACCESS='STREAM') ! Read the test file from disk into the buffer diff --git a/fortran/test/tH5G_1_8.F90 b/fortran/test/tH5G_1_8.F90 index 58431a1..c35edad 100644 --- a/fortran/test/tH5G_1_8.F90 +++ b/fortran/test/tH5G_1_8.F90 @@ -22,7 +22,7 @@ ! ! CONTAINS SUBROUTINES ! group_test, group_info, timestamps, mklinks, test_move_preserves, lifecycle -! cklinks, delete_by_idx, link_info_by_idx_check, test_lcpl, objcopy, +! cklinks, delete_by_idx, link_info_by_idx_check, test_lcpl, objcopy, ! lapl_nlinks ! !***** @@ -41,7 +41,7 @@ SUBROUTINE group_test(cleanup, total_error) LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T) :: fapl, fapl2, my_fapl ! File access property lists + INTEGER(HID_T) :: fapl, fapl2, my_fapl ! File access property lists INTEGER :: error, ret_total_error @@ -49,15 +49,15 @@ SUBROUTINE group_test(cleanup, total_error) CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("H5Pcreate_f",error, total_error) - ! Copy the file access property list + ! Copy the file access property list CALL H5Pcopy_f(fapl, fapl2, error) CALL check("H5Pcopy_f",error, total_error) - ! Set the "use the latest version of the format" bounds for creating objects in the file + ! Set the "use the latest version of the format" bounds for creating objects in the file CALL H5Pset_libver_bounds_f(fapl2, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) CALL check("H5Pset_libver_bounds_f",error, total_error) - ! Check for FAPL to USE + ! Check for FAPL to USE my_fapl = fapl2 ret_total_error = 0 @@ -135,7 +135,7 @@ END SUBROUTINE group_test ! * February 18, 2008 ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE group_info(cleanup, fapl, total_error) @@ -143,21 +143,21 @@ SUBROUTINE group_info(cleanup, fapl, total_error) INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER(HID_T) :: gcpl_id ! Group creation property list ID + INTEGER(HID_T) :: gcpl_id ! Group creation property list ID - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" - INTEGER :: idx_type ! Type of index to operate on - INTEGER :: order, iorder ! Order within in the index - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) ! Use index on creation order values + INTEGER :: idx_type ! Type of index to operate on + INTEGER :: order, iorder ! Order within in the index + LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) ! Use index on creation order values CHARACTER(LEN=6), PARAMETER :: prefix = 'links0' - CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! File name + CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! File name INTEGER :: Input1 - INTEGER(HID_T) :: group_id ! Group ID - INTEGER(HID_T) :: soft_group_id ! Group ID for soft links + INTEGER(HID_T) :: group_id ! Group ID + INTEGER(HID_T) :: soft_group_id ! Group ID for soft links - INTEGER :: i ! Local index variables + INTEGER :: i ! Local index variables INTEGER :: storage_type ! Type of storage for links in group: ! H5G_STORAGE_TYPE_COMPACT: Compact storage ! H5G_STORAGE_TYPE_DENSE: Indexed storage @@ -165,34 +165,34 @@ SUBROUTINE group_info(cleanup, fapl, total_error) INTEGER :: nlinks ! Number of links in group INTEGER :: max_corder ! Current maximum creation order value for group - INTEGER :: u,v ! Local index variables + INTEGER :: u,v ! Local index variables CHARACTER(LEN=2) :: chr2 - INTEGER(HID_T) :: group_id2, group_id3 ! Group IDs - CHARACTER(LEN=7) :: objname ! Object name - CHARACTER(LEN=7) :: objname2 ! Object name - CHARACTER(LEN=19) :: valname ! Link value + INTEGER(HID_T) :: group_id2, group_id3 ! Group IDs + CHARACTER(LEN=7) :: objname ! Object name + CHARACTER(LEN=7) :: objname2 ! Object name + CHARACTER(LEN=19) :: valname ! Link value CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" CHARACTER(LEN=17), PARAMETER :: CORDER_SOFT_GROUP_NAME = "corder_soft_group" - INTEGER(HID_T) :: file_id ! File ID - INTEGER :: error ! Generic return value + INTEGER(HID_T) :: file_id ! File ID + INTEGER :: error ! Generic return value LOGICAL :: mounted LOGICAL :: cleanup - ! Create group creation property list + ! Create group creation property list CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) CALL check("H5Pcreate_f", error, total_error) - ! Query the group creation properties + ! Query the group creation properties CALL H5Pget_link_phase_change_f(gcpl_id, max_compact, min_dense, error) CALL check("H5Pget_link_phase_change_f", error, total_error) - ! Loop over operating on different indices on link fields + ! Loop over operating on different indices on link fields DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F - ! Loop over operating in different orders + ! Loop over operating in different orders DO iorder = H5_ITER_INC_F, H5_ITER_NATIVE_F - ! Loop over using index for creation order value + ! Loop over using index for creation order value DO i = 1, 2 - ! Print appropriate test message + ! Print appropriate test message IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN IF(iorder == H5_ITER_INC_F)THEN order = H5_ITER_INC_F @@ -241,11 +241,11 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ENDIF END IF - ! Create file + ! Create file CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) CALL check("H5Fcreate_f", error, total_error) - ! Set creation order tracking & indexing on group + ! Set creation order tracking & indexing on group IF(use_index(i))THEN Input1 = H5P_CRT_ORDER_INDEXED_F ELSE @@ -254,103 +254,103 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) CALL check("H5Pset_link_creation_order_f", error, total_error) - ! Create group with creation order tracking on + ! Create group with creation order tracking on CALL H5Gcreate_f(file_id, CORDER_GROUP_NAME, group_id, error, gcpl_id=gcpl_id) CALL check("H5Gcreate_f", error, total_error) - ! Create group with creation order tracking on for soft links + ! Create group with creation order tracking on for soft links CALL H5Gcreate_f(file_id, CORDER_SOFT_GROUP_NAME, soft_group_id, error, & OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id) CALL check("H5Gcreate_f", error, total_error) - ! Check for out of bound query by index on empty group, should fail + ! Check for out of bound query by index on empty group, should fail CALL H5Gget_info_by_idx_f(group_id, ".", H5_INDEX_NAME_F, order, INT(0,HSIZE_T), & storage_type, nlinks, max_corder, error) CALL verify("H5Gget_info_by_idx_f", error, -1, total_error) - ! Create several links, up to limit of compact form + ! Create several links, up to limit of compact form DO u = 0, max_compact-1 - ! Make name for link + ! Make name for link WRITE(chr2,'(I2.2)') u objname = 'fill '//chr2 - ! Create hard link, with group object + ! Create hard link, with group object CALL H5Gcreate_f(group_id, objname, group_id2, error, OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id) CALL check("H5Gcreate_f", error, total_error) - ! Retrieve group's information + ! Retrieve group's information CALL H5Gget_info_f(group_id2, storage_type, nlinks, max_corder, error, mounted) CALL check("H5Gget_info_f", error, total_error) - ! Check (new/empty) group's information + ! Check (new/empty) group's information CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_f", max_corder, 0, total_error) CALL verify("H5Gget_info_f", nlinks, 0, total_error) CALL verify("H5Gget_info_f.mounted", mounted,.FALSE.,total_error) - ! Retrieve group's information + ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error, mounted=mounted) CALL check("H5Gget_info_by_name_f", error, total_error) - ! Check (new/empty) group's information + ! Check (new/empty) group's information CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) CALL verify("H5Gget_info_by_name_f.mounted", mounted,.FALSE.,total_error) - ! Retrieve group's information + ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name", error, total_error) - ! Check (new/empty) group's information + ! Check (new/empty) group's information CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) - ! Create objects in new group created + ! Create objects in new group created DO v = 0, u - ! Make name for link + ! Make name for link WRITE(chr2,'(I2.2)') v objname2 = 'fill '//chr2 - ! Create hard link, with group object + ! Create hard link, with group object CALL H5Gcreate_f(group_id2, objname2, group_id3, error ) CALL check("H5Gcreate_f", error, total_error) - ! Close group created + ! Close group created CALL H5Gclose_f(group_id3, error) CALL check("H5Gclose_f", error, total_error) ENDDO - ! Retrieve group's information + ! Retrieve group's information CALL H5Gget_info_f(group_id2, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_f", error, total_error) - ! Check (new) group's information + ! Check (new) group's information CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_f", nlinks, u+1, total_error) - ! Retrieve group's information + ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) - ! Check (new) group's information + ! Check (new) group's information CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_by_name_f",max_corder, u+1, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) - ! Retrieve group's information + ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) - ! Check (new) group's information + ! Check (new) group's information CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) - ! Retrieve group's information + ! Retrieve group's information IF(order.NE.H5_ITER_NATIVE_F)THEN IF(order.EQ.H5_ITER_INC_F) THEN CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(u,HSIZE_T), & @@ -363,72 +363,72 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) CALL check("H5Gget_info_by_idx_f", error, total_error) ENDIF - ! Check (new) group's information + ! Check (new) group's information CALL verify("H5Gget_info_by_idx_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_by_idx_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_by_idx_f", nlinks, u+1, total_error) ENDIF - ! Close group created + ! Close group created CALL H5Gclose_f(group_id2, error) CALL check("H5Gclose_f", error, total_error) - ! Retrieve main group's information + ! Retrieve main group's information CALL H5Gget_info_f(group_id, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_f", error, total_error) - ! Check main group's information + ! Check main group's information CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_f", nlinks, u+1, total_error) - ! Retrieve main group's information, by name + ! Retrieve main group's information, by name CALL H5Gget_info_by_name_f(file_id, CORDER_GROUP_NAME, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) - ! Check main group's information + ! Check main group's information CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) - ! Retrieve main group's information, by name + ! Retrieve main group's information, by name CALL H5Gget_info_by_name_f(group_id, ".", storage_type, nlinks, max_corder, error, H5P_DEFAULT_F) CALL check("H5Gget_info_by_name_f", error, total_error) - ! Check main group's information + ! Check main group's information CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) - ! Create soft link in another group, to objects in main group + ! Create soft link in another group, to objects in main group valname = CORDER_GROUP_NAME//objname CALL H5Lcreate_soft_f(valname, soft_group_id, objname, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - ! Retrieve soft link group's information, by name + ! Retrieve soft link group's information, by name CALL H5Gget_info_f(soft_group_id, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_f", error, total_error) - ! Check soft link group's information + ! Check soft link group's information CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_f", nlinks, u+1, total_error) ENDDO - ! Close the groups + ! Close the groups CALL H5Gclose_f(group_id, error) CALL check("H5Gclose_f", error, total_error) CALL H5Gclose_f(soft_group_id, error) CALL check("H5Gclose_f", error, total_error) - ! Close the file + ! Close the file CALL H5Fclose_f(file_id, error) CALL check("H5Fclose_f", error, total_error) ENDDO ENDDO ENDDO - ! Free resources + ! Free resources CALL H5Pclose_f(gcpl_id, error) CALL check("H5Pclose_f", error, total_error) @@ -449,7 +449,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! * February 20, 2008 ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE timestamps(cleanup, fapl, total_error) @@ -457,15 +457,15 @@ SUBROUTINE group_info(cleanup, fapl, total_error) INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER(HID_T) :: file_id ! File ID - INTEGER(HID_T) :: group_id ! Group ID - INTEGER(HID_T) :: group_id2 ! Group ID - INTEGER(HID_T) :: gcpl_id ! Group creation property list ID - INTEGER(HID_T) :: gcpl_id2 ! Group creation property list ID + INTEGER(HID_T) :: file_id ! File ID + INTEGER(HID_T) :: group_id ! Group ID + INTEGER(HID_T) :: group_id2 ! Group ID + INTEGER(HID_T) :: gcpl_id ! Group creation property list ID + INTEGER(HID_T) :: gcpl_id2 ! Group creation property list ID CHARACTER(LEN=6), PARAMETER :: prefix = 'links9' - CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! File name - ! Timestamp macros + CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! File name + ! Timestamp macros CHARACTER(LEN=10), PARAMETER :: TIMESTAMP_GROUP_1="timestamp1" CHARACTER(LEN=10), PARAMETER :: TIMESTAMP_GROUP_2="timestamp2" LOGICAL :: track_times @@ -473,58 +473,58 @@ SUBROUTINE group_info(cleanup, fapl, total_error) INTEGER :: error - ! Print test message + ! Print test message ! WRITE(*,*) "timestamps on objects" - ! Create group creation property list + ! Create group creation property list CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) CALL check("H5Pcreate_f", error, total_error) - ! Query the object timestamp setting + ! Query the object timestamp setting CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) CALL check("H5Pget_obj_track_times_f", error, total_error) - ! Check default timestamp information + ! Check default timestamp information CALL verify("H5Pget_obj_track_times",track_times,.TRUE.,total_error) - ! Set a non-default object timestamp setting + ! Set a non-default object timestamp setting CALL H5Pset_obj_track_times_f(gcpl_id, .FALSE., error) CALL check("H5Pset_obj_track_times_f", error, total_error) - ! Query the object timestamp setting + ! Query the object timestamp setting CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) CALL check("H5Pget_obj_track_times_f", error, total_error) - ! Check default timestamp information + ! Check default timestamp information CALL verify("H5Pget_obj_track_times",track_times,.FALSE.,total_error) - ! Create file + ! Create file !h5_fixname(FILENAME[0], fapl, filename, sizeof filename); CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) CALL check("h5fcreate_f",error,total_error) - ! Create group with non-default object timestamp setting + ! Create group with non-default object timestamp setting CALL h5gcreate_f(file_id, TIMESTAMP_GROUP_1, group_id, error, & OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id, H5P_DEFAULT_F) CALL check("h5fcreate_f",error,total_error) - ! Close the group creation property list + ! Close the group creation property list CALL H5Pclose_f(gcpl_id, error) CALL check("H5Pclose_f", error, total_error) - ! Create group with default object timestamp setting + ! Create group with default object timestamp setting CALL h5gcreate_f(file_id, TIMESTAMP_GROUP_2, group_id2, error, & OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5fcreate_f",error,total_error) - ! Retrieve the new groups' creation properties + ! Retrieve the new groups' creation properties CALL H5Gget_create_plist_f(group_id, gcpl_id, error) CALL check("H5Gget_create_plist", error, total_error) CALL H5Gget_create_plist_f(group_id2, gcpl_id2, error) CALL check("H5Gget_create_plist", error, total_error) - ! Query & verify the object timestamp settings + ! Query & verify the object timestamp settings CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) CALL check("H5Pget_obj_track_times_f", error, total_error) CALL verify("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) @@ -532,11 +532,11 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Pget_obj_track_times_f", error, total_error) CALL verify("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) -! Query the object information for each group +! Query the object information for each group ! if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR ! if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR -!!$ Sanity check object information for each group +!!$ Sanity check object information for each group !!$ if(oinfo.atime != 0) TEST_ERROR !!$ if(oinfo.mtime != 0) TEST_ERROR !!$ if(oinfo.ctime != 0) TEST_ERROR @@ -550,40 +550,40 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR !!$ if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR - ! Close the property lists + ! Close the property lists CALL H5Pclose_f(gcpl_id, error) CALL check("H5Pclose_f", error, total_error) CALL H5Pclose_f(gcpl_id2, error) CALL check("H5Pclose_f", error, total_error) - ! Close the groups + ! Close the groups CALL H5Gclose_f(group_id, error) CALL check("H5Gclose_f", error, total_error) CALL H5Gclose_f(group_id2, error) CALL check("H5Gclose_f", error, total_error) - ! Close the file + ! Close the file CALL H5Fclose_f(file_id, error) CALL check("H5Fclose_f", error, total_error) - ! Re-open the file + ! Re-open the file CALL h5fopen_f(FileName, H5F_ACC_RDONLY_F, file_id, error, H5P_DEFAULT_F) CALL check("h5fopen_f",error,total_error) - ! Open groups + ! Open groups CALL H5Gopen_f(file_id, TIMESTAMP_GROUP_1, group_id, error) ! with no optional param. CALL check("H5Gopen_f", error, total_error) CALL H5Gopen_f(file_id, TIMESTAMP_GROUP_2, group_id2, error, H5P_DEFAULT_F) ! with optional param. CALL check("H5Gopen_f", error, total_error) - ! Retrieve the new groups' creation properties + ! Retrieve the new groups' creation properties CALL H5Gget_create_plist_f(group_id, gcpl_id, error) CALL check("H5Gget_create_plist", error, total_error) CALL H5Gget_create_plist_f(group_id2, gcpl_id2, error) CALL check("H5Gget_create_plist", error, total_error) - ! Query & verify the object timestamp settings + ! Query & verify the object timestamp settings CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) CALL check("H5Pget_obj_track_times_f", error, total_error) @@ -592,11 +592,11 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Pget_obj_track_times_f", error, total_error) CALL verify("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) !!$ -!!$ Query the object information for each group +!!$ Query the object information for each group !!$ if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR !!$ if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR !!$ -!!$ Sanity check object information for each group +!!$ Sanity check object information for each group !!$ if(oinfo.atime != 0) TEST_ERROR !!$ if(oinfo.mtime != 0) TEST_ERROR !!$ if(oinfo.ctime != 0) TEST_ERROR @@ -610,19 +610,19 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR !!$ if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR - ! Close the property lists + ! Close the property lists CALL H5Pclose_f(gcpl_id, error) CALL check("H5Pclose_f", error, total_error) CALL H5Pclose_f(gcpl_id2, error) CALL check("H5Pclose_f", error, total_error) - ! Close the groups + ! Close the groups CALL H5Gclose_f(group_id, error) CALL check("H5Gclose_f", error, total_error) CALL H5Gclose_f(group_id2, error) CALL check("H5Gclose_f", error, total_error) - ! Close the file + ! Close the file CALL H5Fclose_f(file_id, error) CALL check("H5Fclose_f", error, total_error) @@ -643,7 +643,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! * Modifications: ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE mklinks(fapl, total_error) @@ -671,29 +671,29 @@ SUBROUTINE group_info(cleanup, fapl, total_error) WRITE(*,*) "link creation (w/new group format)" - ! Create a file + ! Create a file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) CALL check("mklinks.h5fcreate_f",error,total_error) CALL h5screate_simple_f(arank, adims2, scalar, error) CALL check("mklinks.h5screate_simple_f",error,total_error) - ! Create a group + ! Create a group CALL H5Gcreate_f(file, "grp1", grp, error) CALL check("H5Gcreate_f", error, total_error) CALL H5Gclose_f(grp, error) CALL check("h5gclose_f",error,total_error) - ! Create a dataset + ! Create a dataset CALL h5dcreate_f(file, "d1", H5T_NATIVE_INTEGER, scalar, d1, error) CALL check("h5dcreate_f",error,total_error) CALL h5dclose_f(d1, error) CALL check("h5dclose_f",error,total_error) - ! Create a hard link + ! Create a hard link CALL H5Lcreate_hard_f(file, "d1", INT(H5L_SAME_LOC_F,HID_T), "grp1/hard", error) CALL check("H5Lcreate_hard_f", error, total_error) - ! Create a symbolic link + ! Create a symbolic link CALL H5Lcreate_soft_f("/d1", file, "grp1/soft",error) CALL check("H5Lcreate_soft_f", error, total_error) @@ -709,14 +709,14 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! should be '/d1' + NULL character = 4 CALL verify("H5Lget_info_by_idx_f", INT(val_size), 4, total_error) - ! Create a symbolic link to something that doesn't exist + ! Create a symbolic link to something that doesn't exist CALL H5Lcreate_soft_f("foobar", file, "grp1/dangle",error) - ! Create a recursive symbolic link + ! Create a recursive symbolic link CALL H5Lcreate_soft_f("/grp1/recursive", file, "/grp1/recursive",error) - ! Close + ! Close CALL h5sclose_f(scalar, error) CALL check("h5sclose_f",error,total_error) CALL h5fclose_f(file, error) @@ -736,7 +736,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! * Modifications: ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE test_move_preserves(fapl_id, total_error) @@ -746,20 +746,20 @@ SUBROUTINE group_info(cleanup, fapl, total_error) INTEGER(HID_T):: file_id INTEGER(HID_T):: group_id - INTEGER(HID_T):: fcpl_id ! Group creation property list ID + INTEGER(HID_T):: fcpl_id ! Group creation property list ID INTEGER(HID_T):: lcpl_id !H5O_info_t oinfo; !H5L_info_t linfo; INTEGER :: old_cset INTEGER :: old_corder !H5T_cset_t old_cset; - !int64_t old_corder; Creation order value of link + !int64_t old_corder; Creation order value of link !time_t old_modification_time; !time_t curr_time; - !unsigned crt_order_flags; Status of creation order info for GCPL + !unsigned crt_order_flags; Status of creation order info for GCPL !char filename[1024]; - INTEGER :: crt_order_flags ! Status of creation order info for GCPL + INTEGER :: crt_order_flags ! Status of creation order info for GCPL CHARACTER(LEN=12), PARAMETER :: filename = 'TestLinks.h5' INTEGER :: cset ! Indicates the character set used for the link’s name. @@ -779,7 +779,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! Create a file creation property list with creation order stored for links ! * in the root group - ! + ! CALL H5Pcreate_f(H5P_FILE_CREATE_F, fcpl_id, error) CALL check("H5Pcreate_f",error, total_error) @@ -795,26 +795,26 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Pget_link_creation_order_f",error, total_error) CALL verify("H5Pget_link_creation_order_f",crt_order_flags, H5P_CRT_ORDER_TRACKED_F, total_error) - ! Create file - ! (with creation order tracking for the root group) + ! Create file + ! (with creation order tracking for the root group) CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file_id, error, fcpl_id, fapl_id) CALL check("h5fcreate_f",error,total_error) - ! Create a link creation property list with the UTF-8 character encoding + ! Create a link creation property list with the UTF-8 character encoding CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) CALL check("H5Pcreate_f",error, total_error) CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) CALL check("H5Pset_char_encoding_f",error, total_error) - ! Create a group with that lcpl + ! Create a group with that lcpl CALL H5Gcreate_f(file_id, "group", group_id, error,lcpl_id=lcpl_id, gcpl_id=H5P_DEFAULT_F, gapl_id=H5P_DEFAULT_F) CALL check("H5Gcreate_f", error, total_error) CALL H5Gclose_f(group_id, error) CALL check("H5Gclose_f", error, total_error) - ! Get the group's link's information + ! Get the group's link's information CALL H5Lget_info_f(file_id, "group", & cset, corder, f_corder_valid, link_type, token, val_size, & error, H5P_DEFAULT_F) @@ -830,18 +830,18 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! old_modification_time = oinfo.mtime; -! If this test happens too quickly, the times will all be the same. Make sure the time changes. +! If this test happens too quickly, the times will all be the same. Make sure the time changes. ! curr_time = HDtime(NULL); ! while(HDtime(NULL) <= curr_time) ! ; -! Close the file and reopen it +! Close the file and reopen it CALL H5Fclose_f(file_id, error) CALL check("H5Fclose_f", error, total_error) !!$ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR !!$ -!!$ Get the link's character set & modification time . They should be unchanged +!!$ Get the link's character set & modification time . They should be unchanged !!$ if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(old_modification_time != oinfo.mtime) TEST_ERROR @@ -849,7 +849,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ if(linfo.corder_valid != TRUE) TEST_ERROR !!$ if(old_corder != linfo.corder) TEST_ERROR !!$ -!!$ Create a new link to the group. It should have a different creation order value but the same modification time +!!$ Create a new link to the group. It should have a different creation order value but the same modification time !!$ if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(H5Oget_info_by_name(file_id, "group2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(old_modification_time != oinfo.mtime) TEST_ERROR @@ -862,7 +862,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ Copy the first link to a UTF-8 name. !!$ * Its creation order value should be different, but modification time !!$ * should not change. -!!$ +!!$ !!$ if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(H5Oget_info_by_name(file_id, "group_copied", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(old_modification_time != oinfo.mtime) TEST_ERROR @@ -870,10 +870,10 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ if(linfo.corder_valid != TRUE) TEST_ERROR !!$ if(linfo.corder != 2) TEST_ERROR !!$ -!!$ Check that its character encoding is UTF-8 +!!$ Check that its character encoding is UTF-8 !!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR !!$ -!!$ Move the link with the default property list. +!!$ Move the link with the default property list. !!$ if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(H5Oget_info_by_name(file_id, "group_copied2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(old_modification_time != oinfo.mtime) TEST_ERROR @@ -881,10 +881,10 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ if(linfo.corder_valid != TRUE) TEST_ERROR !!$ if(linfo.corder != 3) TEST_ERROR !!$ -!!$ Check that its character encoding is not UTF-8 +!!$ Check that its character encoding is not UTF-8 !!$ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR !!$ -!!$ Check that the original link is unchanged +!!$ Check that the original link is unchanged !!$ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(old_modification_time != oinfo.mtime) TEST_ERROR !!$ if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR @@ -894,7 +894,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ !!$ Move the first link to a UTF-8 name. !!$ * Its creation order value will change, but modification time should not -!!$ * change. +!!$ * change. !!$ if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(H5Oget_info_by_name(file_id, "group_moved", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(old_modification_time != oinfo.mtime) TEST_ERROR @@ -902,10 +902,10 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ if(linfo.corder_valid != TRUE) TEST_ERROR !!$ if(linfo.corder != 4) TEST_ERROR !!$ -!!$ Check that its character encoding is UTF-8 +!!$ Check that its character encoding is UTF-8 !!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR !!$ -!!$ Move the link again using the default property list. +!!$ Move the link again using the default property list. !!$ if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(H5Oget_info_by_name(file_id, "group_moved_again", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR !!$ if(old_modification_time != oinfo.mtime) TEST_ERROR @@ -913,10 +913,10 @@ SUBROUTINE group_info(cleanup, fapl, total_error) !!$ if(linfo.corder_valid != TRUE) TEST_ERROR !!$ if(linfo.corder != 5) TEST_ERROR !!$ -!!$ Check that its character encoding is not UTF-8 +!!$ Check that its character encoding is not UTF-8 !!$ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR - ! Close open IDs + ! Close open IDs CALL H5Pclose_f(fcpl_id, error) CALL check("H5Pclose_f", error, total_error) CALL H5Pclose_f(lcpl_id, error) @@ -941,7 +941,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! * Monday, October 17, 2005 ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE lifecycle(cleanup, fapl2, total_error) IMPLICIT NONE @@ -951,14 +951,14 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) INTEGER, PARAMETER :: NAME_BUF_SIZE =7 - INTEGER(HID_T) :: fid ! File ID - INTEGER(HID_T) :: gid ! Group ID - INTEGER(HID_T) :: gcpl ! Group creation property list ID - INTEGER(size_t) :: lheap_size_hint ! Local heap size hint - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - INTEGER :: est_num_entries ! Estimated # of entries in group - INTEGER :: est_name_len ! Estimated length of entry name + INTEGER(HID_T) :: fid ! File ID + INTEGER(HID_T) :: gid ! Group ID + INTEGER(HID_T) :: gcpl ! Group creation property list ID + INTEGER(size_t) :: lheap_size_hint ! Local heap size hint + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + INTEGER :: est_num_entries ! Estimated # of entries in group + INTEGER :: est_name_len ! Estimated length of entry name CHARACTER(LEN=NAME_BUF_SIZE) :: filename = 'fixx.h5' INTEGER(SIZE_T) :: LIFECYCLE_LOCAL_HEAP_SIZE_HINT = 256 INTEGER :: LIFECYCLE_MAX_COMPACT = 4 @@ -975,29 +975,29 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) ! WRITE(*,*) 'group lifecycle' - ! Create file + ! Create file CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl2) CALL check("H5Fcreate_f",error,total_error) - ! Close file + ! Close file CALL H5Fclose_f(fid,error) CALL check("H5Fclose_f",error,total_error) - ! Get size of file as empty + ! Get size of file as empty ! if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR - ! Re-open file + ! Re-open file CALL H5Fopen_f(filename, H5F_ACC_RDWR_F, fid, error,access_prp=fapl2) CALL check("H5Fopen_f",error,total_error) - ! Set up group creation property list + ! Set up group creation property list CALL H5Pcreate_f(H5P_GROUP_CREATE_F,gcpl,error) CALL check("H5Pcreate_f",error,total_error) - ! Query default group creation property settings + ! Query default group creation property settings CALL H5Pget_local_heap_size_hint_f(gcpl, lheap_size_hint, error) CALL check("H5Pget_local_heap_size_hint_f",error,total_error) CALL verify("H5Pget_local_heap_size_hint_f", INT(lheap_size_hint),0,total_error) @@ -1014,7 +1014,7 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL verify("H5Pget_est_link_info_f", est_name_len, H5G_CRT_GINFO_EST_NAME_LEN,total_error) - ! Set GCPL parameters + ! Set GCPL parameters CALL H5Pset_local_heap_size_hint_f(gcpl, LIFECYCLE_LOCAL_HEAP_SIZE_HINT, error) CALL check("H5Pset_local_heap_size_hint_f", error, total_error) @@ -1023,12 +1023,12 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL H5Pset_est_link_info_f(gcpl, LIFECYCLE_EST_NUM_ENTRIES, LIFECYCLE_EST_NAME_LEN, error) CALL check("H5Pset_est_link_info_f", error, total_error) - ! Create group for testing lifecycle + ! Create group for testing lifecycle CALL H5Gcreate_f(fid, LIFECYCLE_TOP_GROUP, gid, error, gcpl_id=gcpl) CALL check("H5Gcreate_f", error, total_error) - ! Query group creation property settings + ! Query group creation property settings CALL H5Pget_local_heap_size_hint_f(gcpl, lheap_size_hint, error) CALL check("H5Pget_local_heap_size_hint_f",error,total_error) @@ -1046,20 +1046,20 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) - ! Close top group + ! Close top group CALL H5Gclose_f(gid, error) CALL check("H5Gclose_f", error, total_error) - ! Unlink top group + ! Unlink top group CALL H5Ldelete_f(fid, LIFECYCLE_TOP_GROUP, error) CALL check("H5Ldelete_f", error, total_error) - ! Close GCPL + ! Close GCPL CALL H5Pclose_f(gcpl, error) CALL check("H5Pclose_f", error, total_error) - ! Close file + ! Close file CALL H5Fclose_f(fid,error) CALL check("H5Fclose_f",error,total_error) @@ -1084,7 +1084,7 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) ! * Modifications: Modified original C code ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE cklinks(fapl, total_error) @@ -1104,25 +1104,25 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) LOGICAL :: Lexists - ! Open the file + ! Open the file CALL H5Fopen_f(filename, H5F_ACC_RDONLY_F, file, error,access_prp=fapl) CALL check("H5Fopen_f",error,total_error) - ! Hard link + ! Hard link !!$ IF(H5Oget_info_by_name(file, "d1", &oinfo1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR !!$ IF(H5Oget_info_by_name(file, "grp1/hard", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR !!$ IF(H5O_TYPE_DATASET != oinfo2.type) { !!$ H5_FAILED(); !!$ printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); !!$ TEST_ERROR -!!$ } end if +!!$ } end if !!$ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { !!$ H5_FAILED(); !!$ puts(" Hard link test failed. Link seems not to point to the "); !!$ puts(" expected file location."); !!$ TEST_ERROR -!!$ } end if +!!$ } end if CALL H5Lexists_f(file,"d1",Lexists, error) @@ -1131,7 +1131,7 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL H5Lexists_f(file,"grp1/hard",Lexists, error) CALL verify("H5Lexists", Lexists,.TRUE.,total_error) - ! Cleanup + ! Cleanup CALL H5Fclose_f(file,error) CALL check("H5Fclose_f",error,total_error) @@ -1153,25 +1153,25 @@ END SUBROUTINE cklinks ! * March 3, 2008 ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE delete_by_idx(cleanup, fapl, total_error) IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER(HID_T) :: file_id ! File ID - INTEGER(HID_T) :: group_id ! Group ID - INTEGER(HID_T) :: gcpl_id ! Group creation property list ID + INTEGER(HID_T) :: file_id ! File ID + INTEGER(HID_T) :: group_id ! Group ID + INTEGER(HID_T) :: gcpl_id ! Group creation property list ID - INTEGER :: idx_type ! Type of index to operate on + INTEGER :: idx_type ! Type of index to operate on LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - ! Use index on creation order values - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" + ! Use index on creation order values + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" - CHARACTER(LEN=7) :: objname ! Object name - CHARACTER(LEN=8) :: filename = 'file0.h5' ! File name + CHARACTER(LEN=7) :: objname ! Object name + CHARACTER(LEN=8) :: filename = 'file0.h5' ! File name CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" LOGICAL :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute @@ -1181,11 +1181,11 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) INTEGER :: link_type TYPE(H5O_TOKEN_T_F) :: token - INTEGER :: u ! Local index variable + INTEGER :: u ! Local index variable INTEGER :: Input1, i INTEGER(HID_T) :: group_id2 INTEGER(HID_T) :: grp - INTEGER :: iorder ! Order within in the index + INTEGER :: iorder ! Order within in the index CHARACTER(LEN=2) :: chr2 INTEGER :: error INTEGER :: id_type @@ -1203,13 +1203,13 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) fix_filename2(i:i) = " " ENDDO - ! Loop over operating on different indices on link fields + ! Loop over operating on different indices on link fields DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F - ! Loop over operating in different orders + ! Loop over operating in different orders DO iorder = H5_ITER_INC_F, H5_ITER_DEC_F - ! Loop over using index for creation order value + ! Loop over using index for creation order value DO i = 1, 2 - ! Print appropriate test message + ! Print appropriate test message !!$ IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN !!$ IF(iorder == H5_ITER_INC_F)THEN !!$ IF(use_index(i))THEN @@ -1240,15 +1240,15 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) !!$ ENDIF !!$ ENDIF - ! Create file + ! Create file CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, access_prp=fapl) CALL check("delete_by_idx.H5Fcreate_f", error, total_error) - ! Create group creation property list + ! Create group creation property list CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) CALL check("delete_by_idx.H5Pcreate_f", error, total_error) - ! Set creation order tracking & indexing on group + ! Set creation order tracking & indexing on group IF(use_index(i))THEN Input1 = H5P_CRT_ORDER_INDEXED_F ELSE @@ -1258,54 +1258,54 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) CALL check("delete_by_idx.H5Pset_link_creation_order_f", error, total_error) - ! Create group with creation order tracking on + ! Create group with creation order tracking on CALL H5Gcreate_f(file_id, CORDER_GROUP_NAME, group_id, error, gcpl_id=gcpl_id) CALL check("delete_by_idx.H5Gcreate_f", error, total_error) - ! Query the group creation properties + ! Query the group creation properties CALL H5Pget_link_phase_change_f(gcpl_id, max_compact, min_dense, error) CALL check("delete_by_idx.H5Pget_link_phase_change_f", error, total_error) - ! Delete links from one end + ! Delete links from one end - ! Check for deletion on empty group + ! Check for deletion on empty group CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) CALL verify("delete_by_idx.H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) - ! Create several links, up to limit of compact form + ! Create several links, up to limit of compact form DO u = 0, max_compact-1 - ! Make name for link + ! Make name for link WRITE(chr2,'(I2.2)') u objname = 'fill '//chr2 - ! Create hard link, with group object + ! Create hard link, with group object CALL H5Gcreate_f(group_id, objname, group_id2, error) CALL check("delete_by_idx.H5Gcreate_f", error, total_error) CALL H5Gclose_f(group_id2, error) CALL check("delete_by_idx.H5Gclose_f", error, total_error) - ! Verify link information for new link + ! Verify link information for new link CALL link_info_by_idx_check(group_id, objname, u, & .TRUE., use_index(i), total_error) ENDDO - ! Verify state of group (compact) + ! Verify state of group (compact) ! IF(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR - ! Check for out of bound deletion + ! Check for out of bound deletion htmp =9 !EP CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(u,HSIZE_T), error) CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, htmp, error) CALL verify("H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) - ! Delete links from compact group + ! Delete links from compact group DO u = 0, (max_compact - 1) -1 - ! Delete first link in appropriate order + ! Delete first link in appropriate order CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) CALL check("H5Ldelete_by_idx_f", error, total_error) - ! Verify the link information for first link in appropriate order + ! Verify the link information for first link in appropriate order ! HDmemset(&linfo, 0, sizeof(linfo)); CALL H5Lget_info_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), & @@ -1335,7 +1335,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) - ! Verify the name for first link in appropriate order + ! Verify the name for first link in appropriate order ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); !!$ size_tmp = 20 !!$ CALL H5Lget_name_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), size_tmp, tmpname, error) @@ -1351,15 +1351,15 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) !!$ CALL verify("delete_by_idx.H5Lget_name_by_idx_f", objname, tmpname, total_error) ENDDO - ! Close the group + ! Close the group CALL H5Gclose_f(group_id, error) CALL check("delete_by_idx.H5Gclose_f", error, total_error) - ! Close the group creation property list + ! Close the group creation property list CALL H5Pclose_f(gcpl_id, error) CALL check("delete_by_idx.H5Pclose_f", error, total_error) - ! Close the file + ! Close the file CALL H5Fclose_f(file_id, error) CALL check("delete_by_idx.H5Fclose_f", error, total_error) @@ -1391,7 +1391,7 @@ END SUBROUTINE delete_by_idx ! * Tuesday, November 7, 2006 ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & hard_link, use_index, total_error) @@ -1410,35 +1410,35 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & TYPE(H5O_TOKEN_T_F) :: token INTEGER(SIZE_T) :: val_size ! Indicates the size, in the number of characters, of the attribute - CHARACTER(LEN=7) :: tmpname ! Temporary link name - CHARACTER(LEN=3) :: tmpname_small ! to small temporary link name - CHARACTER(LEN=10) :: tmpname_big ! to big temporary link name + CHARACTER(LEN=7) :: tmpname ! Temporary link name + CHARACTER(LEN=3) :: tmpname_small ! to small temporary link name + CHARACTER(LEN=10) :: tmpname_big ! to big temporary link name - CHARACTER(LEN=7) :: valname ! Link value name + CHARACTER(LEN=7) :: valname ! Link value name CHARACTER(LEN=2) :: chr2 INTEGER(SIZE_T) :: size_tmp INTEGER :: error - ! Make link value for increasing/native order queries + ! Make link value for increasing/native order queries WRITE(chr2,'(I2.2)') n valname = 'valn.'//chr2 - ! Verify the link information for first link, in increasing creation order + ! Verify the link information for first link, in increasing creation order ! HDmemset(&linfo, 0, sizeof(linfo)); CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,HSIZE_T), & link_type, f_corder_valid, corder, cset, token, val_size, error) CALL check("H5Lget_info_by_idx_f", error, total_error) CALL verify("H5Lget_info_by_idx_f", corder, 0, total_error) - ! Verify the link information for new link, in increasing creation order + ! Verify the link information for new link, in increasing creation order ! HDmemset(&linfo, 0, sizeof(linfo)); CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), & link_type, f_corder_valid, corder, cset, token, val_size, error) CALL check("H5Lget_info_by_idx_f", error, total_error) CALL verify("H5Lget_info_by_idx_f", corder, n, total_error) - ! Verify value for new soft link, in increasing creation order + ! Verify value for new soft link, in increasing creation order !!$ IF(hard_link)THEN !!$ ! HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); !!$ @@ -1448,7 +1448,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & !!$! IF(HDstrcmp(valname, tmpval)) TEST_ERROR !!$ ENDIF - ! Verify the name for new link, in increasing creation order + ! Verify the name for new link, in increasing creation order ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ! The actual size of tmpname should be 7 @@ -1492,7 +1492,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! * Modifications: ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE test_lcpl(cleanup, fapl, total_error) @@ -1537,34 +1537,34 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! Actually, intermediate group creation is tested elsewhere (tmisc). - ! * Here we only need to test the character encoding property + ! * Here we only need to test the character encoding property - ! Create file + ! Create file ! h5_fixname(FILENAME[0], fapl, filename, sizeof filename); CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) CALL check("H5Fcreate_f", error, total_error) - ! Create and link a group with the default LCPL + ! Create and link a group with the default LCPL CALL H5Gcreate_f(file_id, "/group", group_id, error) CALL check("H5Gcreate_f", error, total_error) - ! Check that its character encoding is the default + ! Check that its character encoding is the default CALL H5Lget_info_f(file_id, "group", & cset, corder, f_corder_valid, link_type, token, val_size, & error, H5P_DEFAULT_F) ! File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. +! * creation property list and is always ASCII. !#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - ! Create and commit a datatype with the default LCPL + ! Create and commit a datatype with the default LCPL CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) CALL check("h5tcopy_f",error,total_error) CALL h5tcommit_f(file_id, "/type", type_id, error) @@ -1573,19 +1573,19 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL check("h5tclose_f", error, total_error) - ! Check that its character encoding is the default + ! Check that its character encoding is the default CALL H5Lget_info_f(file_id, "type", & cset, corder, f_corder_valid, link_type, token, val_size, & error) CALL check("h5tclose_f", error, total_error) ! File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. +! * creation property list and is always ASCII. !#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - ! Create a dataspace + ! Create a dataspace CALL h5screate_simple_f(2, dims, space_id, error) CALL check("h5screate_simple_f",error,total_error) CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) @@ -1595,7 +1595,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) CALL h5pset_chunk_f(crp_list, 2, dims, error) - ! Create a dataset using the default LCPL + ! Create a dataset using the default LCPL CALL h5dcreate_f(file_id, "/dataset", H5T_NATIVE_INTEGER, space_id, dset_id, error, crp_list) CALL check("h5dcreate_f", error, total_error) @@ -1607,10 +1607,10 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL H5Dopen_f(file_id, "/dataset", dset_id, error) CALL check("h5dopen_f", error, total_error) - ! Extend the dataset + ! Extend the dataset CALL H5Dset_extent_f(dset_id, extend_dim, error) CALL check("H5Dset_extent_f", error, total_error) - ! Verify the dataspaces + ! Verify the dataspaces ! !Get dataset's dataspace handle. ! @@ -1629,37 +1629,37 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL verify("H5Sget_simple_extent_dims", tmp1, tmp2, total_error) ENDDO - ! close data set + ! close data set CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f", error, total_error) - ! Check that its character encoding is the default + ! Check that its character encoding is the default CALL H5Lget_info_f(file_id, "dataset", & cset, corder, f_corder_valid, link_type, token, val_size, & error) CALL check("H5Lget_info_f", error, total_error) ! File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. +! * creation property list and is always ASCII. !#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- CALL verify("h5tclose_f",cset, H5T_CSET_ASCII_F,total_error) - ! Create a link creation property list with the UTF-8 character encoding + ! Create a link creation property list with the UTF-8 character encoding CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) CALL check("h5Pcreate_f",error,total_error) CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) CALL check("H5Pset_char_encoding_f",error, total_error) - ! Create and link a group with the new LCPL + ! Create and link a group with the new LCPL CALL H5Gcreate_f(file_id, "/group2", group_id, error,lcpl_id=lcpl_id) CALL check("H5Gcreate_f", error, total_error) CALL H5Gclose_f(group_id, error) CALL check("H5Gclose_f", error, total_error) - ! Check that its character encoding is UTF-8 + ! Check that its character encoding is UTF-8 CALL H5Lget_info_f(file_id, "group2", & cset, corder, f_corder_valid, link_type, token, val_size, & error) @@ -1667,7 +1667,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - ! Create and commit a datatype with the new LCPL + ! Create and commit a datatype with the new LCPL CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) CALL check("h5tcopy_f",error,total_error) @@ -1677,14 +1677,14 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL check("h5tclose_f", error, total_error) - ! Check that its character encoding is UTF-8 + ! Check that its character encoding is UTF-8 CALL H5Lget_info_f(file_id, "type2", & cset, corder, f_corder_valid, link_type, token, val_size, & error) CALL check("H5Lget_info_f", error, total_error) CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - ! Create a dataset using the new LCPL + ! Create a dataset using the new LCPL CALL h5dcreate_f(file_id, "/dataset2", H5T_NATIVE_INTEGER, space_id, dset_id, error,lcpl_id=lcpl_id) CALL check("h5dcreate_f", error, total_error) @@ -1695,14 +1695,14 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL check("H5Pget_char_encoding_f", error, total_error) CALL verify("H5Pget_char_encoding_f", encoding, H5T_CSET_UTF8_F, total_error) - ! Check that its character encoding is UTF-8 + ! Check that its character encoding is UTF-8 CALL H5Lget_info_f(file_id, "dataset2", & cset, corder, f_corder_valid, link_type, token, val_size, & error) CALL check("H5Lget_info_f", error, total_error) CALL verify("H5Lget_info_f2",cset, H5T_CSET_UTF8_F,total_error) - ! Create a new link to the dataset with a different character encoding. + ! Create a new link to the dataset with a different character encoding. CALL H5Pclose_f(lcpl_id, error) CALL check("H5Pclose_f", error, total_error) @@ -1717,14 +1717,14 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL check("H5Lexists",error, total_error) CALL verify("H5Lexists", Lexists,.TRUE.,total_error) - ! Check that its character encoding is ASCII + ! Check that its character encoding is ASCII CALL H5Lget_info_f(file_id, "/dataset2_link", & cset, corder, f_corder_valid, link_type, token, val_size, & error) CALL check("H5Lget_info_f", error, total_error) CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - ! Check that the first link's encoding hasn't changed + ! Check that the first link's encoding hasn't changed CALL H5Lget_info_f(file_id, "/dataset2", & cset, corder, f_corder_valid, link_type, token, val_size, & @@ -1733,8 +1733,8 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL verify("H5Lget_info_f3",cset, H5T_CSET_UTF8_F,total_error) - ! Make sure that LCPLs work properly for other API calls: - ! H5Lcreate_soft + ! Make sure that LCPLs work properly for other API calls: + ! H5Lcreate_soft CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) CALL check("H5Pset_char_encoding_f",error, total_error) @@ -1748,7 +1748,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - ! H5Lmove + ! H5Lmove CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) CALL check("H5Pset_char_encoding_f",error, total_error) @@ -1762,7 +1762,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - ! H5Lcopy + ! H5Lcopy CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) CALL check("H5Pset_char_encoding_f",error, total_error) @@ -1776,7 +1776,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - ! H5Lcreate_external + ! H5Lcreate_external CALL H5Lcreate_external_f("filename", "path", file_id, "extlink", error, lcpl_id) CALL check("H5Lcreate_external_f", error, total_error) @@ -1788,7 +1788,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - ! Close open IDs + ! Close open IDs CALL H5Pclose_f(lcpl_id, error) CALL check("H5Pclose_f", error, total_error) @@ -1817,22 +1817,22 @@ SUBROUTINE objcopy(fapl, total_error) flag = H5O_COPY_SHALLOW_HIERARCHY_F -! Copy the file access property list +! Copy the file access property list CALL H5Pcopy_f(fapl, fapl2, error) CALL check("H5Pcopy_f", error, total_error) -! Set the "use the latest version of the format" bounds for creating objects in the file +! Set the "use the latest version of the format" bounds for creating objects in the file CALL H5Pset_libver_bounds_f(fapl2, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - ! create property to pass copy options + ! create property to pass copy options CALL h5pcreate_f(H5P_OBJECT_COPY_F, pid, error) CALL check("h5pcreate_f",error, total_error) - ! set options for object copy + ! set options for object copy CALL H5Pset_copy_object_f(pid, flag, error) CALL check("H5Pset_copy_object_f",error, total_error) - ! Verify object copy flags + ! Verify object copy flags CALL H5Pget_copy_object_f(pid, cpy_flags, error) CALL check("H5Pget_copy_object_f",error, total_error) CALL verify("H5Pget_copy_object_f", cpy_flags, flag, total_error) @@ -1862,7 +1862,7 @@ END SUBROUTINE objcopy ! * Modifications: ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE lapl_nlinks( fapl, total_error) @@ -1872,30 +1872,30 @@ SUBROUTINE lapl_nlinks( fapl, total_error) INTEGER :: error - INTEGER(HID_T) :: fid = (-1) ! File ID - INTEGER(HID_T) :: gid = (-1), gid2 = (-1) ! Group IDs - INTEGER(HID_T) :: plist = (-1) ! lapl ID - INTEGER(HID_T) :: tid = (-1) ! Other IDs - INTEGER(HID_T) :: gapl = (-1), dapl = (-1), tapl = (-1) ! Other property lists + INTEGER(HID_T) :: fid = (-1) ! File ID + INTEGER(HID_T) :: gid = (-1), gid2 = (-1) ! Group IDs + INTEGER(HID_T) :: plist = (-1) ! lapl ID + INTEGER(HID_T) :: tid = (-1) ! Other IDs + INTEGER(HID_T) :: gapl = (-1), dapl = (-1), tapl = (-1) ! Other property lists - CHARACTER(LEN=7) :: objname ! Object name - INTEGER(size_t) :: name_len ! Length of object name + CHARACTER(LEN=7) :: objname ! Object name + INTEGER(size_t) :: name_len ! Length of object name CHARACTER(LEN=12) :: filename = 'TestLinks.h5' - INTEGER(size_t) :: nlinks ! nlinks for H5Pset_nlinks + INTEGER(size_t) :: nlinks ! nlinks for H5Pset_nlinks INTEGER(size_t) :: buf_size = 7 ! WRITE(*,*) "adjusting nlinks with LAPL (w/new group format)" - ! Create file + ! Create file CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) CALL check(" lapl_nlinks.h5fcreate_f",error,total_error) - ! Create group with short name in file (used as target for links) + ! Create group with short name in file (used as target for links) CALL H5Gcreate_f(fid, "final", gid, error) CALL check(" lapl_nlinks.H5Gcreate_f", error, total_error) - ! Create chain of soft links to existing object (limited) + ! Create chain of soft links to existing object (limited) CALL H5Lcreate_soft_f("final", fid, "soft1", error) CALL H5Lcreate_soft_f("soft1", fid, "soft2", error) CALL H5Lcreate_soft_f("soft2", fid, "soft3", error) @@ -1914,26 +1914,26 @@ SUBROUTINE lapl_nlinks( fapl, total_error) CALL H5Lcreate_soft_f("soft15", fid, "soft16", error) CALL H5Lcreate_soft_f("soft16", fid, "soft17", error) - ! Close objects + ! Close objects CALL H5Gclose_f(gid, error) CALL check("h5gclose_f",error,total_error) CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Open file + ! Open file CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) CALL check("h5open_f",error,total_error) - ! Create LAPL with higher-than-usual nlinks value - ! Create a non-default lapl with udata set to point to the first group + ! Create LAPL with higher-than-usual nlinks value + ! Create a non-default lapl with udata set to point to the first group CALL H5Pcreate_f(H5P_LINK_ACCESS_F,plist,error) CALL check("h5Pcreate_f",error,total_error) nlinks = 20 CALL H5Pset_nlinks_f(plist, nlinks, error) CALL check("H5Pset_nlinks_f",error,total_error) - ! Ensure that nlinks was set successfully + ! Ensure that nlinks was set successfully nlinks = 0 CALL H5Pget_nlinks_f(plist, nlinks, error) CALL check("H5Pset_nlinks_f",error,total_error) @@ -1941,71 +1941,71 @@ SUBROUTINE lapl_nlinks( fapl, total_error) ! Open object through what is normally too many soft links using - ! * new property list + ! * new property list CALL H5Oopen_f(fid,"soft17",gid,error,plist) CALL check("H5Oopen_f",error,total_error) - ! Check name + ! Check name CALL h5iget_name_f(gid, objname, buf_size, name_len, error) CALL check("h5iget_name_f",error,total_error) CALL verify("h5iget_name_f", TRIM(objname),"/soft17", total_error) - ! Create group using soft link + ! Create group using soft link CALL H5Gcreate_f(gid, "new_soft", gid2, error) CALL check("H5Gcreate_f", error, total_error) - ! Close groups + ! Close groups CALL H5Gclose_f(gid2, error) CALL check("H5Gclose_f", error, total_error) CALL H5Gclose_f(gid, error) CALL check("H5Gclose_f", error, total_error) - ! Set nlinks to a smaller number + ! Set nlinks to a smaller number nlinks = 4 CALL H5Pset_nlinks_f(plist, nlinks, error) CALL check("H5Pset_nlinks_f", error, total_error) - ! Ensure that nlinks was set successfully + ! Ensure that nlinks was set successfully nlinks = 0 CALL H5Pget_nlinks_f(plist, nlinks, error) CALL check("H5Pget_nlinks_f",error,total_error) CALL verify("H5Pget_nlinks_f", INT(nlinks), 4, total_error) - ! Try opening through what is now too many soft links + ! Try opening through what is now too many soft links CALL H5Oopen_f(fid,"soft5",gid,error,plist) CALL verify("H5Oopen_f", error, -1, total_error) ! should fail - ! Open object through lesser soft link + ! Open object through lesser soft link CALL H5Oopen_f(fid,"soft4",gid,error,plist) CALL check("H5Oopen_",error,total_error) - ! Check name + ! Check name CALL h5iget_name_f(gid, objname, buf_size, name_len, error) CALL check("h5iget_name_f",error,total_error) CALL verify("h5iget_name_f", TRIM(objname),"/soft4", total_error) - ! Test other functions that should use a LAPL + ! Test other functions that should use a LAPL nlinks = 20 CALL H5Pset_nlinks_f(plist, nlinks, error) CALL check("H5Pset_nlinks_f", error, total_error) ! Try copying and moving when both src and dst contain many soft links ! * using a non-default LAPL - ! + ! CALL H5Lcopy_f(fid, "soft17", fid, "soft17/newer_soft", error, H5P_DEFAULT_F, plist) CALL check("H5Lcopy_f",error,total_error) CALL H5Lmove_f(fid, "soft17/newer_soft", fid, "soft17/newest_soft", error, lapl_id=plist) CALL check("H5Lmove_f",error, total_error) - ! H5Olink + ! H5Olink CALL H5Olink_f(gid, fid, "soft17/link_to_group", error, H5P_DEFAULT_F, plist) CALL check("H5Olink_f", error, total_error) - ! H5Lcreate_hard and H5Lcreate_soft + ! H5Lcreate_hard and H5Lcreate_soft CALL H5Lcreate_hard_f(fid, "soft17", fid, "soft17/link2_to_group", error, H5P_DEFAULT_F, plist) CALL check("H5Lcreate_hard_f", error, total_error) @@ -2013,27 +2013,27 @@ SUBROUTINE lapl_nlinks( fapl, total_error) CALL H5Lcreate_soft_f("/soft4", fid, "soft17/soft_link",error, H5P_DEFAULT_F, plist) CALL check("H5Lcreate_soft_f", error, total_error) - ! H5Ldelete + ! H5Ldelete CALL h5ldelete_f(fid, "soft17/soft_link", error, plist) CALL check("H5Ldelete_f", error, total_error) -!!$ H5Lget_val and H5Lget_info +!!$ H5Lget_val and H5Lget_info !!$ if(H5Lget_val(fid, "soft17", NULL, (size_t)0, plist) < 0) TEST_ERROR !!$ if(H5Lget_info(fid, "soft17", NULL, plist) < 0) TEST_ERROR !!$ - ! H5Lcreate_external and H5Lcreate_ud + ! H5Lcreate_external and H5Lcreate_ud CALL H5Lcreate_external_f("filename", "path", fid, "soft17/extlink", error, H5P_DEFAULT_F, plist) CALL check("H5Lcreate_external_f", error, total_error) !!$ if(H5Lregister(UD_rereg_class) < 0) TEST_ERROR !!$ if(H5Lcreate_ud(fid, "soft17/udlink", UD_HARD_TYPE, NULL, (size_t)0, H5P_DEFAULT, plist) < 0) TEST_ERROR !!$ - ! Close plist + ! Close plist CALL h5pclose_f(plist, error) CALL check("h5pclose_f", error, total_error) - ! Create a datatype and dataset as targets inside the group + ! Create a datatype and dataset as targets inside the group CALL h5tcopy_f(H5T_NATIVE_INTEGER, tid, error) CALL check("h5tcopy_f",error,total_error) CALL h5tcommit_f(gid, "datatype", tid, error) @@ -2048,12 +2048,12 @@ SUBROUTINE lapl_nlinks( fapl, total_error) !!$ if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR !!$ if(H5Dclose(did) < 0) TEST_ERROR !!$ - ! Close group + ! Close group CALL h5gclose_f(gid, error) CALL check("h5gclose_f",error,total_error) !!$ -!!$ Try to open the objects using too many symlinks with default *APLs +!!$ Try to open the objects using too many symlinks with default *APLs !!$ H5E_BEGIN_TRY { !!$ if((gid = H5Gopen2(fid, "soft17", H5P_DEFAULT)) >= 0) !!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") @@ -2063,7 +2063,7 @@ SUBROUTINE lapl_nlinks( fapl, total_error) !!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") !!$ } H5E_END_TRY !!$ - ! Create property lists with nlinks set + ! Create property lists with nlinks set CALL H5Pcreate_f(H5P_GROUP_ACCESS_F,gapl,error) CALL check("h5Pcreate_f",error,total_error) @@ -2083,7 +2083,7 @@ SUBROUTINE lapl_nlinks( fapl, total_error) ! We should now be able to use these property lists to open each kind ! * of object. - ! + ! CALL H5Gopen_f(fid, "soft17", gid, error, gapl) CALL check("H5Gopen_f",error,total_error) @@ -2093,7 +2093,7 @@ SUBROUTINE lapl_nlinks( fapl, total_error) !!$ if((did = H5Dopen2(fid, "soft17/dataset", dapl)) < 0) TEST_ERROR - ! Close objects + ! Close objects CALL h5gclose_f(gid, error) CALL check("h5gclose_f",error,total_error) @@ -2102,7 +2102,7 @@ SUBROUTINE lapl_nlinks( fapl, total_error) !!$ if(H5Dclose(did) < 0) TEST_ERROR !!$ - ! Close plists + ! Close plists CALL h5pclose_f(gapl, error) CALL check("h5pclose_f", error, total_error) @@ -2111,11 +2111,11 @@ SUBROUTINE lapl_nlinks( fapl, total_error) !!$ if(H5Pclose(dapl) < 0) TEST_ERROR !!$ -!!$ Unregister UD hard link class +!!$ Unregister UD hard link class !!$ if(H5Lunregister(UD_HARD_TYPE) < 0) TEST_ERROR !!$ - ! Close file + ! Close file CALL H5Fclose_f(fid, error) CALL check("H5Fclose_f", error, total_error) diff --git a/fortran/test/tH5I.F90 b/fortran/test/tH5I.F90 index 5ce37fd..1934acf 100644 --- a/fortran/test/tH5I.F90 +++ b/fortran/test/tH5I.F90 @@ -25,8 +25,8 @@ ! !***** MODULE TH5I - - USE HDF5 ! This module contains all necessary modules + + USE HDF5 ! This module contains all necessary modules USE TH5_MISC USE TH5_MISC_GEN @@ -87,21 +87,21 @@ CONTAINS ! check that the ID is not valid dtype = -1 CALL H5Iis_valid_f(dtype, tri_ret, error) - CALL check("H5Iis_valid_f", error, total_error) + CALL check("H5Iis_valid_f", error, total_error) CALL verify("H5Iis_valid_f", tri_ret, .FALSE., total_error) - + ! Create a datatype id CALL H5Tcopy_f(H5T_NATIVE_INTEGER,dtype,error) - CALL check("H5Tcopy_f", error, total_error) - + CALL check("H5Tcopy_f", error, total_error) + ! Check that the ID is valid CALL H5Iis_valid_f(dtype, tri_ret, error) - CALL check("H5Iis_valid_f", error, total_error) + CALL check("H5Iis_valid_f", error, total_error) CALL verify("H5Tequal_f", tri_ret, .TRUE., total_error) - + CALL H5Tclose_f(dtype, error) - CALL check("H5Tclose_f", error, total_error) - + CALL check("H5Tclose_f", error, total_error) + ! ! Create a new file using default properties. ! diff --git a/fortran/test/tH5L_F03.F90 b/fortran/test/tH5L_F03.F90 index bdb5c55..a8a8c65 100644 --- a/fortran/test/tH5L_F03.F90 +++ b/fortran/test/tH5L_F03.F90 @@ -5,7 +5,7 @@ ! ! FUNCTION ! Test FORTRAN HDF5 H5L APIs which are dependent on FORTRAN 2003 -! features. +! features. ! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -30,8 +30,8 @@ !***** MODULE liter_cb_mod - USE HDF5 - USE TH5_MISC + USE HDF5 + USE TH5_MISC USE TH5_MISC_GEN USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE @@ -43,11 +43,11 @@ MODULE liter_cb_mod INTEGER RET_CHANGE2 END TYPE iter_enum - ! Custom group iteration callback data + ! Custom group iteration callback data TYPE, bind(c) :: iter_info - CHARACTER(KIND=C_CHAR), DIMENSION(1:10) :: name ! The name of the object - INTEGER(c_int) :: TYPE ! The TYPE of the object - INTEGER(c_int) :: command ! The TYPE of RETURN value + CHARACTER(KIND=C_CHAR), DIMENSION(1:10) :: name ! The name of the object + INTEGER(c_int) :: TYPE ! The TYPE of the object + INTEGER(c_int) :: command ! The TYPE of RETURN value END TYPE iter_info CONTAINS @@ -73,7 +73,7 @@ CONTAINS INTEGER, SAVE :: count INTEGER, SAVE :: count2 -!!$ +!!$ !!$ iter_info *info = (iter_info *)op_data; !!$ static int count = 0; !!$ static int count2 = 0; @@ -126,17 +126,17 @@ SUBROUTINE test_iter_group(total_error) INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T) :: fapl - INTEGER(HID_T) :: file ! File ID - INTEGER(hid_t) :: dataset ! Dataset ID - INTEGER(hid_t) :: datatype ! Common datatype ID - INTEGER(hid_t) :: filespace ! Common dataspace ID - INTEGER(hid_t) :: grp ! Group ID - INTEGER i,j ! counting variable - INTEGER(hsize_t) idx ! Index in the group + INTEGER(HID_T) :: file ! File ID + INTEGER(hid_t) :: dataset ! Dataset ID + INTEGER(hid_t) :: datatype ! Common datatype ID + INTEGER(hid_t) :: filespace ! Common dataspace ID + INTEGER(hid_t) :: grp ! Group ID + INTEGER i,j ! counting variable + INTEGER(hsize_t) idx ! Index in the group CHARACTER(LEN=11) :: DATAFILE = "titerate.h5" INTEGER, PARAMETER :: ndatasets = 50 - CHARACTER(LEN=10) :: name ! temporary name buffer - CHARACTER(LEN=10), DIMENSION(1:ndatasets+2) :: lnames ! Names of the links created + CHARACTER(LEN=10) :: name ! temporary name buffer + CHARACTER(LEN=10), DIMENSION(1:ndatasets+2) :: lnames ! Names of the links created TYPE(iter_info), TARGET :: info @@ -147,15 +147,15 @@ SUBROUTINE test_iter_group(total_error) CHARACTER(LEN=2) :: ichr2 CHARACTER(LEN=10) :: ichr10 - ! Get the default FAPL + ! Get the default FAPL CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("h5pcreate_f", error, total_error) - ! Set the "use the latest version of the format" bounds for creating objects in the file + ! Set the "use the latest version of the format" bounds for creating objects in the file CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) CALL check("H5Pset_libver_bounds_f",error, total_error) - ! Create the test file with the datasets + ! Create the test file with the datasets CALL h5fcreate_f(DATAFILE, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) CALL check("h5fcreate_f", error, total_error) @@ -190,12 +190,12 @@ SUBROUTINE test_iter_group(total_error) ENDDO - ! Create a group and named datatype under root group for testing + ! Create a group and named datatype under root group for testing CALL H5Gcreate_f(file, "grp0000000", grp, error) CALL check("H5Gcreate_f", error, total_error) - lnames(ndatasets+2) = "grp0000000" + lnames(ndatasets+2) = "grp0000000" !!$ !!$ lnames[NDATASETS] = HDstrdup("grp"); @@ -205,9 +205,9 @@ SUBROUTINE test_iter_group(total_error) CALL H5Tcommit_f(file, "dtype00000", datatype, error) CALL check("H5Tcommit_f", error, total_error) - lnames(ndatasets+1) = "dtype00000" + lnames(ndatasets+1) = "dtype00000" - ! Close everything up + ! Close everything up CALL H5Tclose_f(datatype, error) CALL check("H5Tclose_f", error, total_error) @@ -221,11 +221,11 @@ SUBROUTINE test_iter_group(total_error) CALL H5Fclose_f(file, error) CALL check("H5Fclose_f", error, total_error) - ! Iterate through the datasets in the root group in various ways + ! Iterate through the datasets in the root group in various ways CALL H5Fopen_f(DATAFILE, H5F_ACC_RDONLY_F, file, error, access_prp=fapl) CALL check("h5fopen_f", error, total_error) - ! Test all objects in group, when callback always returns 0 + ! Test all objects in group, when callback always returns 0 info%command = 0 idx = 0 CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) @@ -234,28 +234,28 @@ SUBROUTINE test_iter_group(total_error) CALL verify("H5Literate_f", error, -1, total_error) ENDIF - ! Test all objects in group, when callback always returns 1 - ! This also tests the "restarting" ability, because the index changes + ! Test all objects in group, when callback always returns 1 + ! This also tests the "restarting" ability, because the index changes info%command = 2 idx = 0 i = 0 f1 = C_FUNLOC(liter_cb) f2 = C_LOC(info) - DO + DO CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) IF(error.LT.0) EXIT - ! Verify return value from iterator gets propagated correctly + ! Verify return value from iterator gets propagated correctly CALL verify("H5Literate", ret_value, 2, total_error) - ! Increment the number of times "2" is returned + ! Increment the number of times "2" is returned i = i + 1 - ! Verify that the index is the correct value + ! Verify that the index is the correct value CALL verify("H5Literate", INT(idx), INT(i), total_error) IF(idx .GT.ndatasets+2)THEN PRINT*,"ERROR: Group iteration function walked too far!" ENDIF - ! Verify the correct name is retrieved + ! Verify the correct name is retrieved DO j = 1, 10 ichr10(j:j) = info%name(j)(1:1) ENDDO @@ -270,8 +270,8 @@ SUBROUTINE test_iter_group(total_error) PRINT*,"ERROR: Group iteration function didn't perform multiple iterations correctly" ENDIF - ! Test all objects in group, when callback changes return value - ! This also tests the "restarting" ability, because the index changes + ! Test all objects in group, when callback changes return value + ! This also tests the "restarting" ability, because the index changes info%command = 3 idx = 0 @@ -285,10 +285,10 @@ SUBROUTINE test_iter_group(total_error) IF(error.LT.0) EXIT CALL verify("H5Literate_f", ret_value, 1, total_error) - ! Increment the number of times "1" is returned + ! Increment the number of times "1" is returned i = i + 1 - ! Verify that the index is the correct value + ! Verify that the index is the correct value CALL verify("H5Literate_f", INT(idx), INT(i+10), total_error) IF(idx .GT.ndatasets+2)THEN @@ -298,7 +298,7 @@ SUBROUTINE test_iter_group(total_error) DO j = 1, 10 ichr10(j:j) = info%name(j)(1:1) ENDDO - ! Verify that the correct name is retrieved + ! Verify that the correct name is retrieved CALL verify("H5Literate_f", ichr10, lnames(INT(idx)), total_error) IF(i.EQ.42)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIX- scot ENDDO diff --git a/fortran/test/tH5MISC_1_8.F90 b/fortran/test/tH5MISC_1_8.F90 index b8c777c..bad77d0 100644 --- a/fortran/test/tH5MISC_1_8.F90 +++ b/fortran/test/tH5MISC_1_8.F90 @@ -95,18 +95,18 @@ SUBROUTINE test_genprop_basic_class(total_error) IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T) :: cid1 ! Generic Property class ID - INTEGER(HID_T) :: cid2 ! Generic Property class ID + INTEGER(HID_T) :: cid1 ! Generic Property class ID + INTEGER(HID_T) :: cid2 ! Generic Property class ID CHARACTER(LEN=7) :: CLASS1_NAME = "Class 1" - CHARACTER(LEN=7) :: name ! Name of class - CHARACTER(LEN=10) :: name_big ! Name of class bigger buffer + CHARACTER(LEN=7) :: name ! Name of class + CHARACTER(LEN=10) :: name_big ! Name of class bigger buffer CHARACTER(LEN=4) :: name_small ! Name of class smaller buffer INTEGER :: error INTEGER :: size LOGICAL :: flag - ! Output message about test being performed + ! Output message about test being performed !WRITE(*,*) "Testing Basic Generic Property List Class Creation Functionality" @@ -116,11 +116,11 @@ SUBROUTINE test_genprop_basic_class(total_error) CALL H5Pget_class_name_f(cid1, name, size, error) CALL verify("H5Pget_class_name", error, -1, error) - ! Create a new generic class, derived from the root of the class hierarchy + ! Create a new generic class, derived from the root of the class hierarchy CALL H5Pcreate_class_f(H5P_ROOT_F, CLASS1_NAME, cid1, error) CALL check("H5Pcreate_class", error, total_error) - ! Check class name + ! Check class name CALL H5Pget_class_name_f(cid1, name, size, error) CALL check("H5Pget_class_name", error, total_error) CALL verify("H5Pget_class_name", size,7,error) @@ -150,27 +150,27 @@ SUBROUTINE test_genprop_basic_class(total_error) total_error = total_error + 1 ENDIF - ! Check class parent + ! Check class parent CALL H5Pget_class_parent_f(cid1, cid2, error) CALL check("H5Pget_class_parent_f", error, total_error) - ! Verify class parent correct + ! Verify class parent correct CALL H5Pequal_f(cid2, H5P_ROOT_F, flag, error) CALL check("H5Pequal_f", error, total_error) CALL verify("H5Pequal_f", flag, .TRUE., total_error) - ! Make certain false postives aren't being returned + ! Make certain false postives aren't being returned CALL H5Pequal_f(cid2, H5P_FILE_CREATE_F, flag, error) CALL check("H5Pequal_f", error, total_error) CALL verify("H5Pequal_f", flag, .FALSE., total_error) - ! Close parent class + ! Close parent class CALL H5Pclose_class_f(cid2, error) CALL check("H5Pclose_class_f", error, total_error) - ! Close class + ! Close class CALL H5Pclose_class_f(cid1, error) CALL check("H5Pclose_class_f", error, total_error) @@ -187,17 +187,17 @@ SUBROUTINE test_h5s_encode(total_error) IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error - INTEGER(hid_t) :: sid1, sid3! Dataspace ID + INTEGER(hid_t) :: sid1, sid3! Dataspace ID INTEGER(hid_t) :: decoded_sid1, decoded_sid3 INTEGER(hid_t) :: fapl ! File access property - INTEGER :: rank ! LOGICAL rank of dataspace + INTEGER :: rank ! LOGICAL rank of dataspace INTEGER(size_t) :: new_size = 0, old_size = 0, orig_size=0, scalar_size=0 ! Make sure the size is large CHARACTER(LEN=288) :: sbuf CHARACTER(LEN=288) :: scalar_buf - INTEGER(hsize_t) :: n ! Number of dataspace elements + INTEGER(hsize_t) :: n ! Number of dataspace elements INTEGER(hsize_t), DIMENSION(1:3) :: start = (/0, 0, 0/) INTEGER(hsize_t), DIMENSION(1:3) :: stride = (/2, 5, 3/) @@ -217,7 +217,7 @@ SUBROUTINE test_h5s_encode(total_error) !------------------------------------------------------------------------- ! * Test encoding and decoding of simple dataspace and hyperslab selection. ! *------------------------------------------------------------------------- - ! + ! CALL H5Screate_simple_f(SPACE1_RANK, dims1, sid1, error) CALL check("H5Screate_simple", error, total_error) @@ -227,13 +227,13 @@ SUBROUTINE test_h5s_encode(total_error) CALL check("h5sselect_hyperslab_f", error, total_error) - ! Encode simple data space in a buffer + ! Encode simple data space in a buffer ! Find the buffer size without fapl CALL H5Sencode_f(sid1, sbuf, orig_size, error) CALL check("H5Sencode_f", error, total_error) CALL verify("H5Sencode_f", INT(orig_size), 279, total_error) - + ! Create file access property list CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("h5pcreate_f", error, total_error) @@ -252,7 +252,7 @@ SUBROUTINE test_h5s_encode(total_error) CALL check("H5Sencode_f", error, total_error) CALL verify("H5Sencode_f", INT(new_size), 101, total_error) - ! Try decoding bogus buffer + ! Try decoding bogus buffer CALL H5Sdecode_f(sbuf, decoded_sid1, error) CALL verify("H5Sdecode", error, -1, total_error) @@ -260,12 +260,12 @@ SUBROUTINE test_h5s_encode(total_error) CALL H5Sencode_f(sid1, sbuf, new_size, error, fapl) CALL check("H5Sencode_f", error, total_error) - ! Decode from the dataspace buffer and return an object handle + ! Decode from the dataspace buffer and return an object handle CALL H5Sdecode_f(sbuf, decoded_sid1, error) CALL check("H5Sdecode", error, total_error) - ! Verify the decoded dataspace + ! Verify the decoded dataspace CALL h5sget_simple_extent_npoints_f(decoded_sid1, n, error) CALL check("h5sget_simple_extent_npoints_f", error, total_error) CALL verify("h5sget_simple_extent_npoints_f", INT(n), INT(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3), & @@ -283,13 +283,13 @@ SUBROUTINE test_h5s_encode(total_error) ! ------------------------------------------------------------------------- ! * Test encoding and decoding of scalar dataspace. ! *------------------------------------------------------------------------- - ! - ! Create scalar dataspace + ! + ! Create scalar dataspace CALL H5Screate_f(H5S_SCALAR_F, sid3, error) CALL check("H5Screate_f",error, total_error) - ! Encode scalar data space in a buffer + ! Encode scalar data space in a buffer ! First find the buffer size CALL H5Sencode_f(sid3, scalar_buf, scalar_size, error) @@ -301,19 +301,19 @@ SUBROUTINE test_h5s_encode(total_error) CALL check("H5Sencode_f", error, total_error) - ! Decode from the dataspace buffer and return an object handle + ! Decode from the dataspace buffer and return an object handle CALL H5Sdecode_f(scalar_buf, decoded_sid3, error) CALL check("H5Sdecode_f", error, total_error) - ! Verify extent type + ! Verify extent type CALL H5Sget_simple_extent_type_f(decoded_sid3, space_type, error) CALL check("H5Sget_simple_extent_type_f", error, total_error) CALL verify("H5Sget_simple_extent_type_f", space_type, H5S_SCALAR_F, total_error) - ! Verify decoded dataspace + ! Verify decoded dataspace CALL h5sget_simple_extent_npoints_f(decoded_sid3, n, error) CALL check("h5sget_simple_extent_npoints_f", error, total_error) CALL verify("h5sget_simple_extent_npoints_f", INT(n), 1, total_error) @@ -359,7 +359,7 @@ SUBROUTINE test_scaleoffset(cleanup, total_error ) INTEGER(hsize_t), DIMENSION(1:2) :: chunk_dim = (/2, 5/) INTEGER, DIMENSION(1:2,1:5) :: orig_data INTEGER, DIMENSION(1:2,1:5) :: new_data - INTEGER(hsize_t), DIMENSION(1:2) :: start ! Start of hyperslab + INTEGER(hsize_t), DIMENSION(1:2) :: start ! Start of hyperslab INTEGER(hsize_t), DIMENSION(1:2) :: stride ! Stride of hyperslab INTEGER(hsize_t), DIMENSION(1:2) :: count ! BLOCK count INTEGER(hsize_t), DIMENSION(1:2) :: BLOCK ! BLOCK sizes @@ -390,11 +390,11 @@ SUBROUTINE test_scaleoffset(cleanup, total_error ) CALL H5Screate_simple_f(2, dims, space, error) CALL CHECK(" H5Screate_simple_f", error, total_error) - ! Create the dataset property list + ! Create the dataset property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dc, error) CALL CHECK(" H5Pcreate_f", error, total_error) - ! Set fill value + ! Set fill value fillval = 10000 CALL H5Pset_fill_value_f(dc, H5T_NATIVE_INTEGER, fillval, error) CALL CHECK(" H5Pset_fill_value_f", error, total_error) @@ -402,10 +402,10 @@ SUBROUTINE test_scaleoffset(cleanup, total_error ) ! Set up to use scaleoffset filter, let library calculate minbits CALL H5Pset_chunk_f(dc, 2, chunk_dim, error) CALL CHECK(" H5Pset_chunk_f", error, total_error) - + CALL H5Pset_scaleoffset_f(dc, H5Z_SO_INT_F, H5Z_SO_INT_MINBITS_DEFAULT_F, error) CALL CHECK(" H5Pset_scaleoffset_f", error, total_error) - + ! Create the dataset CALL H5Dcreate_f(file, "scaleoffset_int", datatype, & space, dataset, error, dc) @@ -417,7 +417,7 @@ SUBROUTINE test_scaleoffset(cleanup, total_error ) ! Select hyperslab for data to write, using 1x5 blocks, ! (1,1) stride and (1,1) count starting at the position (0,0) - + start(1:2) = (/0,0/) stride(1:2) = (/1,1/) COUNT(1:2) = (/1,1/) @@ -441,21 +441,21 @@ SUBROUTINE test_scaleoffset(cleanup, total_error ) ! STEP 1: Test scaleoffset by setting up a chunked dataset and writing ! to it. !---------------------------------------------------------------------- - - ! Only data in the hyperslab will be written, other value should be fill value + + ! Only data in the hyperslab will be written, other value should be fill value CALL H5Dwrite_f(dataset, H5T_NATIVE_INTEGER, orig_data, dims, error, mspace, mspace, H5P_DEFAULT_F) CALL CHECK(" H5Dwrite_f", error, total_error) !---------------------------------------------------------------------- ! STEP 2: Try to read the data we just wrote. !---------------------------------------------------------------------- - + ! Read the dataset back - + CALL H5Dread_f(dataset, H5T_NATIVE_INTEGER, new_data, dims, error, mspace, mspace, H5P_DEFAULT_F) CALL CHECK(" H5Dread_f", error, total_error) - ! Check that the values read are the same as the values written + ! Check that the values read are the same as the values written DO j = 1, INT(dims(2)) IF(new_data(1,j) .NE. orig_data(1,j))THEN total_error = total_error + 1 diff --git a/fortran/test/tH5O.F90 b/fortran/test/tH5O.F90 index fa3787e..e8a226e 100644 --- a/fortran/test/tH5O.F90 +++ b/fortran/test/tH5O.F90 @@ -77,22 +77,22 @@ SUBROUTINE test_h5o_link(total_error) INTEGER, PARAMETER :: TRUE = 1 - LOGICAL :: committed ! Whether the named datatype is committed + LOGICAL :: committed ! Whether the named datatype is committed INTEGER :: i, j - INTEGER :: error ! Value returned from API calls + INTEGER :: error ! Value returned from API calls CHARACTER(LEN=14) :: NAME_DATATYPE_SIMPLE="H5T_NATIVE_INT" CHARACTER(LEN=16) :: NAME_DATATYPE_SIMPLE2="H5T_NATIVE_INT-2" INTEGER(HID_T) :: tid, tid2 LOGICAL :: flag - + ! Data for tested h5ocopy_f CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" INTEGER , PARAMETER :: dim0 = 4 INTEGER(HSIZE_T), DIMENSION(1:1) :: dims2 = (/dim0/) ! size read/write buffer - INTEGER , DIMENSION(1:dim0) :: wdata2 ! Write buffer + INTEGER , DIMENSION(1:dim0) :: wdata2 ! Write buffer LOGICAL :: link_exists CHARACTER(LEN=8) :: chr_exact CHARACTER(LEN=10) :: chr_lg @@ -107,45 +107,45 @@ SUBROUTINE test_h5o_link(total_error) INTEGER(HSSIZE_T) :: comment_size INTEGER(SIZE_T) :: comment_size2 - ! Initialize the raw data + ! Initialize the raw data DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 wdata(i,j) = i*j ENDDO ENDDO - ! Create the dataspace + ! Create the dataspace CALL h5screate_simple_f(2, dims, space_id, error) CALL check("h5screate_simple_f",error,total_error) - ! Create LCPL with intermediate group creation flag set + ! Create LCPL with intermediate group creation flag set CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) CALL check("h5Pcreate_f",error,total_error) CALL H5Pset_create_inter_group_f(lcpl_id, TRUE, error) CALL check("H5Pset_create_inter_group_f",error,total_error) - ! Loop over using new group format + ! Loop over using new group format ! for(new_format = FALSE; new_format <= TRUE; new_format++) { - ! Make a FAPL that uses the "use the latest version of the format" bounds + ! Make a FAPL that uses the "use the latest version of the format" bounds CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl_id,error) CALL check("h5Pcreate_f",error,total_error) - ! Set the "use the latest version of the format" bounds for creating objects in the file + ! Set the "use the latest version of the format" bounds for creating objects in the file CALL H5Pset_libver_bounds_f(fapl_id, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) CALL check("H5Pset_libver_bounds_f",error, total_error) - ! Create a new HDF5 file + ! Create a new HDF5 file CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl_id) CALL check("H5Fcreate_f", error, total_error) - ! Close the FAPL + ! Close the FAPL CALL h5pclose_f(fapl_id, error) CALL check("h5pclose_f",error,total_error) - ! Create and commit a datatype with no name + ! Create and commit a datatype with no name CALL H5Tcopy_f( H5T_NATIVE_INTEGER, type_id, error) CALL check("H5Tcopy_F",error,total_error) @@ -160,22 +160,22 @@ SUBROUTINE test_h5o_link(total_error) CALL H5Dcreate_anon_f(file_id, type_id, space_id, dset_id, error ) ! using no optional parameters CALL check("H5Dcreate_anon_f",error,total_error) ! - ! Verify that we can write to and read from the dataset + ! Verify that we can write to and read from the dataset ! - ! Write the data to the dataset + ! Write the data to the dataset !EP CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error, & !EP mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error) CALL check("h5dwrite_f", error, total_error) - ! Read the data back + ! Read the data back !EP CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & !EP mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error) CALL check("h5dread_f", error, total_error) - ! Verify the data + ! Verify the data DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 CALL verify("H5Dread_f",wdata(i,j),rdata(i,j),total_error) @@ -188,21 +188,21 @@ SUBROUTINE test_h5o_link(total_error) CALL H5Gcreate_anon_f(file_id, group_id, error) CALL check("H5Gcreate_anon", error, total_error) - ! Link nameless datatype into nameless group + ! Link nameless datatype into nameless group CALL H5Olink_f(type_id, group_id, "datatype", error, H5P_DEFAULT_F) CALL check("H5Olink_f", error, total_error) - ! Link nameless dataset into nameless group with intermediate group + ! Link nameless dataset into nameless group with intermediate group CALL H5Olink_f(dset_id, group_id, "inter_group/dataset", error, lcpl_id, H5P_DEFAULT_F) CALL check("H5Olink_f", error, total_error) - ! Close IDs for dataset and datatype + ! Close IDs for dataset and datatype CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f", error, total_error) CALL h5tclose_f(type_id, error) CALL check("h5tclose_f", error, total_error) - ! Re-open datatype using new link + ! Re-open datatype using new link CALL H5Topen_f(group_id, "datatype", type_id, error) CALL check("h5topen_f", error, total_error) @@ -213,30 +213,30 @@ SUBROUTINE test_h5o_link(total_error) CALL h5gclose_f(group_id, error) CALL check("h5gclose_f",error,total_error) - ! Open dataset through root group and verify its data + ! Open dataset through root group and verify its data CALL H5Dopen_f(file_id, "/group/inter_group/dataset", dset_id, error) CALL check("test_lcpl.h5dopen_f", error, total_error) - ! Read data from dataset + ! Read data from dataset !EP CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & !EP H5S_ALL_F, H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error) CALL check("h5dread_f", error, total_error) - ! Verify the data + ! Verify the data DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 CALL verify("H5Dread",wdata(i,j),rdata(i,j),total_error) ENDDO ENDDO - ! Close open IDs + ! Close open IDs CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f",error,total_error) CALL h5tclose_f(type_id, error) CALL check("h5tclose_f",error,total_error) - ! Close remaining IDs + ! Close remaining IDs CALL h5sclose_f(space_id, error) CALL check("h5sclose_f",error,total_error) CALL h5pclose_f(lcpl_id,error) @@ -270,7 +270,7 @@ SUBROUTINE test_h5o_link(total_error) comment_lg = ' ' - CALL h5oget_comment_by_name_f(file_id, "/G1/G2/G3", comment_lg, error) + CALL h5oget_comment_by_name_f(file_id, "/G1/G2/G3", comment_lg, error) CALL check("h5oget_comment_by_name_f", error, total_error) IF(comment_lg(1:13).NE.grp_comment)THEN @@ -287,7 +287,7 @@ SUBROUTINE test_h5o_link(total_error) comment_lg = ' ' - CALL h5oget_comment_by_name_f(file_id, "/G1/G2/G3"//' ', comment_lg, error) + CALL h5oget_comment_by_name_f(file_id, "/G1/G2/G3"//' ', comment_lg, error) CALL check("h5oget_comment_by_name_f", error, total_error) IF(comment_lg(1:13).NE.grp_comment)THEN @@ -309,7 +309,7 @@ SUBROUTINE test_h5o_link(total_error) ! Try reading into a buffer that is the correct size - CALL h5oget_comment_f(dset_id, comment, error) + CALL h5oget_comment_f(dset_id, comment, error) CALL check("h5oget_comment_f", error, total_error) IF(comment(1:15).NE.dset_comment(1:15))THEN @@ -318,18 +318,18 @@ SUBROUTINE test_h5o_link(total_error) ! Try reading into a buffer that is to small - CALL h5oget_comment_f(dset_id, comment_sm, error) + CALL h5oget_comment_f(dset_id, comment_sm, error) CALL check("h5oget_comment_f", error, total_error) IF(comment_sm(1:10).NE.dset_comment(1:10))THEN CALL check("h5oget_comment_f", -1, total_error) - ENDIF + ENDIF ! Try reading into a buffer that is larger then needed comment_lg = ' ' - CALL h5oget_comment_f(dset_id, comment_lg, error) + CALL h5oget_comment_f(dset_id, comment_lg, error) CALL check("h5oget_comment_f", error, total_error) IF(comment_lg(1:15).NE.dset_comment)THEN @@ -341,7 +341,7 @@ SUBROUTINE test_h5o_link(total_error) ! ! Check optional parameter ! - CALL h5oget_comment_f(dset_id, comment_lg, error, comment_size) + CALL h5oget_comment_f(dset_id, comment_lg, error, comment_size) CALL check("h5oget_comment_f", error, total_error) IF( comment_size.NE.15)THEN @@ -352,7 +352,7 @@ SUBROUTINE test_h5o_link(total_error) ! Try reading into a buffer that is the correct size - CALL h5oget_comment_by_name_f(dset_id, ".", comment, error) + CALL h5oget_comment_by_name_f(dset_id, ".", comment, error) CALL check("h5oget_comment_by_name_f", error, total_error) IF(comment(1:15).NE.dset_comment(1:15))THEN @@ -361,7 +361,7 @@ SUBROUTINE test_h5o_link(total_error) ! Try with trailing blanks in the name - CALL h5oget_comment_by_name_f(dset_id, ". ", comment, error) + CALL h5oget_comment_by_name_f(dset_id, ". ", comment, error) CALL check("h5oget_comment_by_name_f", error, total_error) IF(comment(1:15).NE.dset_comment(1:15))THEN @@ -371,7 +371,7 @@ SUBROUTINE test_h5o_link(total_error) ! ! Check optional parameter ! - CALL h5oget_comment_by_name_f(dset_id, ". ", comment_lg, error, comment_size2) + CALL h5oget_comment_by_name_f(dset_id, ". ", comment_lg, error, comment_size2) CALL check("h5oget_comment_by_name_f", error, total_error) IF( comment_size2.NE.15)THEN @@ -481,7 +481,7 @@ SUBROUTINE test_h5o_link(total_error) CALL h5gclose_f(group_id, error) CALL check("h5gclose_f", error, total_error) - ! Test opening an object by index, note + ! Test opening an object by index, note CALL h5oopen_by_idx_f(file_id, "/G1/G2/G3", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_hsize_t, group_id, error) CALL check("h5oopen_by_idx_f", error, total_error) @@ -508,13 +508,13 @@ SUBROUTINE test_h5o_link(total_error) CALL h5pcreate_f(H5P_OBJECT_COPY_F, ocpypl_id, error) CALL check("h5Pcreate_f",error,total_error) - CALL h5pset_copy_object_f(ocpypl_id, H5O_COPY_SHALLOW_HIERARCHY_F, error) + CALL h5pset_copy_object_f(ocpypl_id, H5O_COPY_SHALLOW_HIERARCHY_F, error) CALL check("H5Pset_copy_object_f",error,total_error) - CALL h5ocopy_f(file_id, "/G1/G2", file_id, "/G1/G_cp2", error, ocpypl_id=ocpypl_id) + CALL h5ocopy_f(file_id, "/G1/G2", file_id, "/G1/G_cp2", error, ocpypl_id=ocpypl_id) CALL check("h5ocopy_f",error,total_error) - ! Makes sure the "DS1" dataset was not copied since we set a + ! Makes sure the "DS1" dataset was not copied since we set a ! flag to copy only immediate members of a group. ! Therefore, this should fail. CALL h5dopen_f(file_id, "/G1/G_cp2/DS1", dset_id, error) @@ -578,31 +578,31 @@ SUBROUTINE test_h5o_plist(total_error) IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error - INTEGER(hid_t) :: fid ! HDF5 File ID - INTEGER(hid_t) :: grp, dset, dtype, dspace ! Object identifiers - INTEGER(hid_t) :: fapl ! File access property list - INTEGER(hid_t) :: gcpl, dcpl, tcpl ! Object creation properties - INTEGER :: def_max_compact, def_min_dense ! Default phase change parameters - INTEGER :: max_compact, min_dense ! Actual phase change parameters - INTEGER :: error ! Value returned from API calls + INTEGER(hid_t) :: fid ! HDF5 File ID + INTEGER(hid_t) :: grp, dset, dtype, dspace ! Object identifiers + INTEGER(hid_t) :: fapl ! File access property list + INTEGER(hid_t) :: gcpl, dcpl, tcpl ! Object creation properties + INTEGER :: def_max_compact, def_min_dense ! Default phase change parameters + INTEGER :: max_compact, min_dense ! Actual phase change parameters + INTEGER :: error ! Value returned from API calls CHARACTER(LEN=7), PARAMETER :: TEST_FILENAME = 'test.h5' ! PRINT*,'Testing object creation properties' - ! Make a FAPL that uses the "use the latest version of the format" flag + ! Make a FAPL that uses the "use the latest version of the format" flag CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("H5Pcreate_f", error, total_error) - ! Set the "use the latest version of the format" bounds for creating objects in the file + ! Set the "use the latest version of the format" bounds for creating objects in the file CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) CALL check("H5Pcreate_f", error, total_error) - ! Create a new HDF5 file + ! Create a new HDF5 file CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) CALL check("H5Fcreate_f", error, total_error) - ! Create group, dataset & named datatype creation property lists + ! Create group, dataset & named datatype creation property lists CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl, error) CALL check("H5Pcreate_f", error, total_error) CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) @@ -610,11 +610,11 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Pcreate_f(H5P_DATATYPE_CREATE_F, tcpl, error) CALL check("H5Pcreate_f", error, total_error) - ! Retrieve default attribute phase change values + ! Retrieve default attribute phase change values CALL H5Pget_attr_phase_change_f(gcpl, def_max_compact, def_min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - ! Set non-default attribute phase change values on each creation property list + ! Set non-default attribute phase change values on each creation property list CALL H5Pset_attr_phase_change_f(gcpl, def_max_compact+1, def_min_dense-1, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) CALL H5Pset_attr_phase_change_f(dcpl, def_max_compact+1, def_min_dense-1, error) @@ -622,7 +622,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Pset_attr_phase_change_f(tcpl, def_max_compact+1, def_min_dense-1, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - ! Retrieve attribute phase change values on each creation property list and verify + ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) @@ -640,16 +640,16 @@ SUBROUTINE test_h5o_plist(total_error) ! Create a group, dataset, and committed datatype within the file, ! using the respective type of creation property lists. - ! + ! - ! Create the group anonymously and link it in + ! Create the group anonymously and link it in CALL H5Gcreate_anon_f(fid, grp, error, gcpl_id=gcpl) CALL check("H5Gcreate_anon_f", error, total_error) CALL H5Olink_f(grp, fid, "group", error) CALL check("H5Olink_f", error, total_error) - ! Commit the type inside the group anonymously and link it in + ! Commit the type inside the group anonymously and link it in CALL h5tcopy_f(H5T_NATIVE_INTEGER, dtype, error) CALL check("h5tcopy_f", error, total_error) @@ -659,11 +659,11 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Olink_f(dtype, fid, "datatype", error) CALL check("H5Olink_f", error, total_error) - ! Create the dataspace for the dataset. + ! Create the dataspace for the dataset. CALL h5screate_f(H5S_SCALAR_F, dspace, error) CALL check("h5screate_f",error,total_error) - ! Create the dataset anonymously and link it in + ! Create the dataset anonymously and link it in CALL H5Dcreate_anon_f(fid, H5T_NATIVE_INTEGER, dspace, dset, error, dcpl ) CALL check("H5Dcreate_anon_f",error,total_error) @@ -673,7 +673,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL h5sclose_f(dspace, error) CALL check("h5sclose_f",error,total_error) - ! Close current creation property lists + ! Close current creation property lists CALL h5pclose_f(gcpl,error) CALL check("h5pclose_f", error, total_error) CALL h5pclose_f(dcpl,error) @@ -681,7 +681,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL h5pclose_f(tcpl,error) CALL check("h5pclose_f", error, total_error) - ! Retrieve each object's creation property list + ! Retrieve each object's creation property list CALL H5Gget_create_plist_f(grp, gcpl, error) CALL check("H5Gget_create_plist", error, total_error) @@ -691,7 +691,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Dget_create_plist_f(dset, dcpl, error) CALL check("H5Dget_create_plist_f", error, total_error) - ! Retrieve attribute phase change values on each creation property list and verify + ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) @@ -707,7 +707,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - ! Close current objects + ! Close current objects CALL h5pclose_f(gcpl,error) CALL check("h5pclose_f", error, total_error) CALL h5pclose_f(dcpl,error) @@ -724,11 +724,11 @@ SUBROUTINE test_h5o_plist(total_error) CALL check("h5dclose_f",error,total_error) CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Re-open the file and check that the object creation properties persist + ! Re-open the file and check that the object creation properties persist CALL h5fopen_f(TEST_FILENAME, H5F_ACC_RDONLY_F, fid, error, access_prp=fapl) CALL check("H5fopen_f",error,total_error) - ! Re-open objects + ! Re-open objects CALL H5Gopen_f(fid, "group", grp, error) CALL check("h5gopen_f", error, total_error) @@ -738,7 +738,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Dopen_f(fid, "dataset", dset, error) CALL check("h5dopen_f", error, total_error) - ! Retrieve each object's creation property list + ! Retrieve each object's creation property list CALL H5Gget_create_plist_f(grp, gcpl, error) CALL check("H5Gget_create_plist", error, total_error) @@ -748,7 +748,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Dget_create_plist_f(dset, dcpl, error) CALL check("H5Dget_create_plist_f", error, total_error) - ! Retrieve attribute phase change values on each creation property list and verify + ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) @@ -764,7 +764,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL verify("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) CALL verify("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - ! Close current objects + ! Close current objects CALL h5pclose_f(gcpl,error) CALL check("h5pclose_f", error, total_error) CALL h5pclose_f(dcpl,error) @@ -782,7 +782,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! Close the FAPL + ! Close the FAPL CALL H5Pclose_f(fapl, error) CALL check("H5Pclose_f", error, total_error) diff --git a/fortran/test/tH5O_F03.F90 b/fortran/test/tH5O_F03.F90 index c9ecccc..cb6273e 100644 --- a/fortran/test/tH5O_F03.F90 +++ b/fortran/test/tH5O_F03.F90 @@ -5,7 +5,7 @@ ! ! FUNCTION ! Test FORTRAN HDF5 H5O APIs which are dependent on FORTRAN 2003 -! features. +! features. ! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -28,9 +28,9 @@ ! ***************************************** MODULE visit_cb - USE HDF5 + USE HDF5 USE, INTRINSIC :: ISO_C_BINDING - + IMPLICIT NONE INTEGER, PARAMETER :: info_size = 9 @@ -283,7 +283,7 @@ CONTAINS SUBROUTINE test_h5o_refcount(total_error) - USE HDF5 + USE HDF5 USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -301,7 +301,7 @@ SUBROUTINE test_h5o_refcount(total_error) ! Create a new HDF5 file CALL h5fcreate_f(FILENAME,H5F_ACC_TRUNC_F,fid,error) - CALL check("h5fcreate_f", error, total_error) + CALL check("h5fcreate_f", error, total_error) ! Create a group, dataset, and committed datatype within the file ! Create the group @@ -567,13 +567,13 @@ SUBROUTINE test_obj_info(total_error) INTEGER, INTENT(INOUT) :: total_error - INTEGER(hid_t) :: fid = -1 ! File ID - INTEGER(hid_t) :: gid = -1, gid2 = -1 ! Group IDs - INTEGER(hid_t) :: did ! Dataset ID - INTEGER(hid_t) :: sid ! Dataspace ID - TYPE(hobj_ref_t_f), TARGET :: wref ! Reference to write + INTEGER(hid_t) :: fid = -1 ! File ID + INTEGER(hid_t) :: gid = -1, gid2 = -1 ! Group IDs + INTEGER(hid_t) :: did ! Dataset ID + INTEGER(hid_t) :: sid ! Dataspace ID + TYPE(hobj_ref_t_f), TARGET :: wref ! Reference to write TYPE(hobj_ref_t_f), TARGET :: rref ! Reference to read - TYPE(H5O_info_t) :: oinfo ! Object info struct + TYPE(H5O_info_t) :: oinfo ! Object info struct INTEGER :: error TYPE(C_PTR) :: f_ptr @@ -595,7 +595,7 @@ SUBROUTINE test_obj_info(total_error) CALL h5gcreate_f(fid, GROUPNAME, gid, error) CALL check("h5gcreate_f",error,total_error) - ! Create nested groups + ! Create nested groups CALL h5gcreate_f(gid, GROUPNAME2, gid2, error) CALL check("h5gcreate_f",error,total_error) CALL h5gclose_f(gid2, error) @@ -630,7 +630,7 @@ SUBROUTINE test_obj_info(total_error) CALL h5dwrite_f(did, H5T_STD_REF_OBJ, f_ptr, error) CALL check("h5dwrite_f",error, total_error) - ! Close objects + ! Close objects CALL h5dclose_f(did, error) CALL check("h5dclose_f", error, total_error) CALL h5sclose_f(sid, error) @@ -718,7 +718,7 @@ SUBROUTINE build_visit_file(fid) USE TH5_MISC IMPLICIT NONE - INTEGER(hid_t) :: fid ! File ID + INTEGER(hid_t) :: fid ! File ID INTEGER(hid_t) :: gid = -1, gid2 = -1 ! Group IDs INTEGER(hid_t) :: sid = -1 ! Dataspace ID INTEGER(hid_t) :: did = -1 ! Dataset ID @@ -726,7 +726,7 @@ SUBROUTINE build_visit_file(fid) INTEGER(hid_t) :: aid = -1, aid2 = -1, aid3 = -1 ! Attribute ID CHARACTER(LEN=20) :: filename = 'visit.h5' INTEGER :: error - + ! Create file for visiting CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, fid, error) diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90 index c42dd7e..7fe3971 100644 --- a/fortran/test/tH5P.F90 +++ b/fortran/test/tH5P.F90 @@ -25,7 +25,7 @@ ! !***** MODULE TH5P - USE HDF5 ! This module contains all necessary modules + USE HDF5 ! This module contains all necessary modules USE TH5_MISC USE TH5_MISC_GEN @@ -37,11 +37,11 @@ SUBROUTINE external_test(cleanup, total_error) ! h5pset_external_f, h5pget_external_count_f, ! h5pget_external_f - + IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error - + CHARACTER(LEN=8), PARAMETER :: filename = "external" CHARACTER(LEN=80) :: fix_filename INTEGER(HID_T) :: file_id @@ -75,7 +75,7 @@ SUBROUTINE external_test(cleanup, total_error) ENDIF CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) CALL check("h5fcreate_f",error,total_error) - + CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) CALL check("h5pcreate_f", error, total_error) CALL h5pset_buffer_f(plist_id, buf_size, error) @@ -88,7 +88,7 @@ SUBROUTINE external_test(cleanup, total_error) ENDIF CALL h5pclose_f(plist_id, error) CALL check("h5pclose_f", error, total_error) - + CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) CALL check("h5pcreate_f",error,total_error) cur_size(1) =100 @@ -103,7 +103,7 @@ SUBROUTINE external_test(cleanup, total_error) CALL h5dcreate_f(file_id, "dset1", H5T_NATIVE_INTEGER, space_id, & dataset_id, error, plist_id) CALL check("h5dcreate_f", error, total_error) - + CALL h5dclose_f(dataset_id, error) CALL check("h5dclose_f", error, total_error) CALL h5pclose_f(plist_id, error) @@ -111,11 +111,11 @@ SUBROUTINE external_test(cleanup, total_error) CALL h5sclose_f(space_id, error) CALL check("h5sclose_f", error, total_error) CALL h5fclose_f(file_id, error) - + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) CALL h5dopen_f(file_id, "dset1", dataset_id, error) CALL check("h5dopen_f",error,total_error) - + ! Read dataset creation information CALL h5dget_create_plist_f(dataset_id, plist_id, error) CALL check("h5dget_create_plist_f",error,total_error) @@ -138,7 +138,7 @@ SUBROUTINE external_test(cleanup, total_error) WRITE (*,*) "got external file size is not correct" total_error = total_error + 1 END IF - + CALL h5dclose_f(dataset_id, error) CALL check("h5dclose_f", error, total_error) CALL h5pclose_f(plist_id, error) @@ -152,15 +152,15 @@ SUBROUTINE external_test(cleanup, total_error) END SUBROUTINE external_test SUBROUTINE multi_file_test(cleanup, total_error) - + IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error - + CHARACTER(LEN=9), PARAMETER :: filename = "multidset" ! File name CHARACTER(LEN=80) :: fix_filename CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name - + INTEGER(HID_T) :: file_id ! File identifier INTEGER(HID_T) :: dset_id ! Dataset identifier INTEGER(HID_T) :: dspace_id ! Dataspace identifier @@ -173,10 +173,10 @@ SUBROUTINE multi_file_test(cleanup, total_error) !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F) :: memb_addr LOGICAL :: relax = .TRUE. LOGICAL :: relax_out = .TRUE. - + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions INTEGER :: rank = 2 ! Dataset rank - + INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers INTEGER :: error ! Error flag INTEGER(HID_T) :: driver @@ -201,7 +201,7 @@ SUBROUTINE multi_file_test(cleanup, total_error) memb_addr(H5FD_MEM_LHEAP_F) = 0.3 memb_map(H5FD_MEM_OHDR_F) = H5FD_MEM_OHDR_F memb_addr(H5FD_MEM_OHDR_F) = 0.4 - + memb_name = ' ' memb_name(H5FD_MEM_SUPER_F) = '%s-s.h5' memb_name(H5FD_MEM_BTREE_F) = '%s-b.h5' @@ -218,7 +218,7 @@ SUBROUTINE multi_file_test(cleanup, total_error) dset_data(i,j) = (i-1)*6 + j END DO END DO - + ! ! Create a new file using default properties. ! @@ -244,8 +244,8 @@ SUBROUTINE multi_file_test(cleanup, total_error) ! CALL h5pget_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & rdcc_w0, error) - CALL check("h5pget_cache_f", error, total_error) - + CALL check("h5pget_cache_f", error, total_error) + ! ! Set cache to some number ! @@ -284,13 +284,13 @@ SUBROUTINE multi_file_test(cleanup, total_error) ! CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f", error, total_error) - + ! ! Terminate access to the data space. ! CALL h5sclose_f(dspace_id, error) CALL check("h5sclose_f", error, total_error) - + ! ! Close the file. ! @@ -318,31 +318,31 @@ SUBROUTINE multi_file_test(cleanup, total_error) ! write(*,*) memb_name_out ! write(*,*) memb_addr_out ! CALL check("h5pget_fapl_multi_f", error, total_error) - + ! ! Open the existing dataset. ! CALL h5dopen_f(file_id, dsetname, dset_id, error) CALL check("h5dopen_f", error, total_error) - + ! ! Get the dataset type. ! CALL h5dget_type_f(dset_id, dtype_id, error) CALL check("h5dget_type_f", error, total_error) - + ! ! Get the data space. ! CALL h5dget_space_f(dset_id, dspace_id, error) CALL check("h5dget_space_f", error, total_error) - + ! ! Read the dataset. ! CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) CALL check("h5dread_f", error, total_error) - + ! !Compare the data. ! @@ -354,19 +354,19 @@ SUBROUTINE multi_file_test(cleanup, total_error) END IF END DO END DO - + ! ! End access to the dataset and release resources used by it. ! CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f", error, total_error) - + ! ! Terminate access to the data space. ! CALL h5sclose_f(dspace_id, error) CALL check("h5sclose_f", error, total_error) - + ! ! Terminate access to the data type. ! @@ -383,7 +383,7 @@ SUBROUTINE multi_file_test(cleanup, total_error) CALL check("h5pclose_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) - + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error) @@ -396,7 +396,7 @@ SUBROUTINE multi_file_test(cleanup, total_error) CALL check("h5_cleanup_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) - + RETURN END SUBROUTINE multi_file_test @@ -419,27 +419,27 @@ END SUBROUTINE multi_file_test !------------------------------------------------------------------------- ! SUBROUTINE test_chunk_cache(cleanup, total_error) - + IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error - + CHARACTER(LEN=14), PARAMETER :: filename="chunk_cache" CHARACTER(LEN=80) :: fix_filename - INTEGER(hid_t) :: fid = -1 ! File ID - INTEGER(hid_t) :: fapl_local = -1 ! Local fapl - INTEGER(hid_t) :: fapl_def = -1 ! Default fapl - INTEGER(hid_t) :: dcpl = -1 ! Dataset creation property list ID - INTEGER(hid_t) :: dapl1 = -1 ! Dataset access property list ID - INTEGER(hid_t) :: dapl2 = -1 ! Dataset access property list ID - INTEGER(hid_t) :: sid = -1 ! Dataspace ID - INTEGER(hid_t) :: dsid = -1 ! Dataset ID - INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) ! Dataset and chunk dimensions - INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 ! rdcc number of elements - INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 ! rdcc number of bytes + INTEGER(hid_t) :: fid = -1 ! File ID + INTEGER(hid_t) :: fapl_local = -1 ! Local fapl + INTEGER(hid_t) :: fapl_def = -1 ! Default fapl + INTEGER(hid_t) :: dcpl = -1 ! Dataset creation property list ID + INTEGER(hid_t) :: dapl1 = -1 ! Dataset access property list ID + INTEGER(hid_t) :: dapl2 = -1 ! Dataset access property list ID + INTEGER(hid_t) :: sid = -1 ! Dataspace ID + INTEGER(hid_t) :: dsid = -1 ! Dataset ID + INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) ! Dataset and chunk dimensions + INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 ! rdcc number of elements + INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 ! rdcc number of bytes INTEGER :: mdc_nelmts - INTEGER(size_t) ::nlinks ! Number of link traversals - REAL :: w0_1, w0_2, w0_3, w0_4 ! rdcc preemption policy + INTEGER(size_t) ::nlinks ! Number of link traversals + REAL :: w0_1, w0_2, w0_3, w0_4 ! rdcc preemption policy INTEGER :: error INTEGER(size_t) rdcc_nelmts INTEGER(size_t) rdcc_nbytes @@ -452,7 +452,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) STOP ENDIF - ! Create a default fapl and dapl + ! Create a default fapl and dapl CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_def, error) CALL check("H5Pcreate_f", error, total_error) CALL H5Pcreate_f(H5P_DATASET_ACCESS_F, dapl1, error) @@ -460,7 +460,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) ! Verify that H5Pget_chunk_cache(dapl) returns the same values as are in ! the default fapl. - ! + ! CALL H5Pget_cache_f(fapl_def, mdc_nelmts, nslots_1, nbytes_1, w0_1, error) CALL check("H5Pget_cache_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl1, nslots_4, nbytes_4, w0_4, error) @@ -469,7 +469,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL verify("H5Pget_chunk_cache_f", nbytes_1, nbytes_4, total_error) CALL verify("H5Pget_chunk_cache_f", w0_1, w0_4, total_error) - ! Set a lapl property on dapl1 (to verify inheritance) + ! Set a lapl property on dapl1 (to verify inheritance) CALL H5Pset_nlinks_f(dapl1, 134_size_t , error) CALL check("H5Pset_nlinks_f", error, total_error) CALL H5Pget_nlinks_f(dapl1, nlinks, error) @@ -494,29 +494,29 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pset_cache_f(fapl_local, 0, nslots_2, nbytes_2, w0_2, error) CALL check("H5Pset_cache_f", error, total_error) - ! Create file + ! Create file CALL H5Fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl_local) CALL check("H5Fcreate_f", error, total_error) - ! Create dataset creation property list + ! Create dataset creation property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) CALL check("H5Pcreate_f", error, total_error) - ! Set chunking + ! Set chunking chunk_dim(1) = 10 CALL H5Pset_chunk_f(dcpl, 1, chunk_dim, error) CALL check("H5Pset_chunk_f", error, total_error) - ! Create 1-D dataspace + ! Create 1-D dataspace ndim(1) = 100 CALL H5Screate_simple_f(1, ndim, sid, error) CALL check("H5Pcreate_f", error, total_error) - ! Create dataset with default dapl + ! Create dataset with default dapl CALL H5Dcreate_f(fid, "dset", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, dapl1) CALL check("H5Pcreate_f", error, total_error) - - ! Retrieve dapl from dataset, verify cache values are the same as on fapl_local + + ! Retrieve dapl from dataset, verify cache values are the same as on fapl_local CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) @@ -524,9 +524,9 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) - CALL H5Pclose_f(dapl2,error) + CALL H5Pclose_f(dapl2,error) CALL check("H5Pclose_f", error, total_error) - + ! Set new values on dapl1. nbytes will be set to default, so the file ! property will override this setting @@ -537,7 +537,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pset_chunk_cache_f(dapl1, nslots_3, nbytes_3, w0_3, error) CALL check("H5Pset_chunk_cache_f", error, total_error) - ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen + ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen CALL H5Dclose_f(dsid, error) CALL H5Oopen_f(fid, "dset", dsid, error, dapl1) @@ -572,11 +572,11 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL verify("H5Pget_chunk_cache_f", INT(nslots_2), INT(nslots_4), total_error) CALL verify("H5Pget_chunk_cache_f", INT(nbytes_2), INT(nbytes_4), total_error) CALL verify("H5Pget_chunk_cache_f", w0_2, w0_4, total_error) - CALL H5Pclose_f(dapl2,error) + CALL H5Pclose_f(dapl2,error) CALL check("H5Pclose_f", error, total_error) ! Similary, test use of H5Dcreate2 with H5P_DEFAULT - CALL H5Dclose_f(dsid, error) + CALL H5Dclose_f(dsid, error) CALL check("H5Dclose_f", error, total_error) CALL H5Dcreate_f(fid, "dset2", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, H5P_DEFAULT_F) @@ -599,7 +599,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL check("H5Pset_cache_f", error, total_error) ! Close and reopen file with new fapl_local - + CALL H5Dclose_f(dsid, error) CALL check("H5Dclose_f", error, total_error) CALL H5Fclose_f(fid,error) @@ -611,13 +611,13 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) ! Verify that dapl2 retrieved earlier (using values from the old fapl) ! sets its values in the new file (test use of H5Dopen2 with a dapl) ! - + CALL h5dopen_f (fid, "dset", dsid, error, dapl2) CALL check("h5dopen_f", error, total_error) - + CALL H5Pclose_f(dapl2,error) CALL check("H5Pclose_f", error, total_error) ! Close dapl2, to avoid id leak - + CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) @@ -707,15 +707,15 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Sclose_f(sid,error) CALL check("H5Sclose_f", error, total_error) CALL H5Pclose_f(fapl_local,error) - CALL check("H5Pclose_f", error, total_error) + CALL check("H5Pclose_f", error, total_error) CALL H5Pclose_f(fapl_def,error) - CALL check("H5Pclose_f", error, total_error) + CALL check("H5Pclose_f", error, total_error) CALL H5Pclose_f(dapl1,error) - CALL check("H5Pclose_f", error, total_error) + CALL check("H5Pclose_f", error, total_error) CALL H5Pclose_f(dapl2,error) - CALL check("H5Pclose_f", error, total_error) + CALL check("H5Pclose_f", error, total_error) CALL H5Pclose_f(dcpl,error) - CALL check("H5Pclose_f", error, total_error) + CALL check("H5Pclose_f", error, total_error) CALL H5Fclose_f(fid,error) CALL check("H5Fclose_f", error, total_error) diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 index 083c312..3e7c552 100644 --- a/fortran/test/tH5P_F03.F90 +++ b/fortran/test/tH5P_F03.F90 @@ -5,7 +5,7 @@ ! ! FUNCTION ! Test FORTRAN HDF5 H5P APIs which are dependent on FORTRAN 2003 -! features. +! features. ! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -40,35 +40,35 @@ MODULE test_genprop_cls_cb1_mod USE HDF5 USE ISO_C_BINDING IMPLICIT NONE - - TYPE, BIND(C) :: cop_cb_struct_ ! Struct for iterations + + TYPE, BIND(C) :: cop_cb_struct_ ! Struct for iterations INTEGER :: count INTEGER(HID_T) :: id END TYPE cop_cb_struct_ CONTAINS - + INTEGER FUNCTION test_genprop_cls_cb1_f(list_id, create_data ) bind(C) - + IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: list_id - + TYPE(cop_cb_struct_) :: create_data create_data%count = create_data%count + 1 create_data%id = list_id test_genprop_cls_cb1_f = 0 - + END FUNCTION test_genprop_cls_cb1_f END MODULE test_genprop_cls_cb1_mod MODULE TH5P_F03 - USE HDF5 - USE TH5_MISC + USE HDF5 + USE TH5_MISC USE TH5_MISC_GEN USE ISO_C_BINDING @@ -89,7 +89,7 @@ CONTAINS ! * Modifications: ! * ! *------------------------------------------------------------------------- -! +! SUBROUTINE test_create(total_error) @@ -116,9 +116,9 @@ SUBROUTINE test_create(total_error) ! ! * Create a file. - ! + ! CALL h5fcreate_f(filename,H5F_ACC_TRUNC_F,file,error) - CALL check("h5fcreate_f", error, total_error) + CALL check("h5fcreate_f", error, total_error) CALL h5screate_simple_f(5, cur_size, space, error, cur_size) CALL check("h5screate_simple_f", error, total_error) @@ -129,7 +129,7 @@ SUBROUTINE test_create(total_error) CALL h5pset_chunk_f(dcpl, 5, ch_size, error) CALL check("h5pset_chunk_f",error, total_error) - ! Create a compound datatype + ! Create a compound datatype CALL h5tcreate_f(H5T_COMPOUND_F, H5_SIZEOF(fill_ctype), comp_type_id, error) CALL check("h5tcreate_f", error, total_error) h5off = H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%a)) @@ -150,7 +150,7 @@ SUBROUTINE test_create(total_error) CALL H5Pset_fill_time_f(dcpl, H5D_FILL_TIME_ALLOC_F, error) CALL check("H5Pset_fill_time_f",error, total_error) - ! Compound datatype test + ! Compound datatype test f_ptr = C_LOC(fill_ctype) @@ -205,7 +205,7 @@ SUBROUTINE test_create(total_error) CALL h5fclose_f(file,error) CALL check("h5fclose_f", error, total_error) - ! Open the file and get the dataset fill value from each dataset + ! Open the file and get the dataset fill value from each dataset CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("h5pcreate_f",error, total_error) @@ -252,7 +252,7 @@ SUBROUTINE test_create(total_error) CALL h5fopen_f (FILENAME, H5F_ACC_RDONLY_F, file, error, fapl) CALL check("h5fopen_f", error, total_error) - ! Compound datatype test + ! Compound datatype test CALL h5dopen_f(file, "dset9", dset9, error) CALL check("h5dopen_f", error, total_error) @@ -306,9 +306,9 @@ SUBROUTINE test_genprop_class_callback(total_error) INTEGER, INTENT(INOUT) :: total_error - INTEGER(hid_t) :: cid1, cid2 ! Generic Property class ID - INTEGER(hid_t) :: lid1, lid2 ! Generic Property list ID - INTEGER(size_t) :: nprops ! Number of properties in class + INTEGER(hid_t) :: cid1, cid2 ! Generic Property class ID + INTEGER(hid_t) :: lid1, lid2 ! Generic Property list ID + INTEGER(size_t) :: nprops ! Number of properties in class TYPE(cop_cb_struct_), TARGET :: crt_cb_struct, cls_cb_struct INTEGER :: CLASS1_NAME_SIZE = 7 ! length of class string @@ -329,7 +329,7 @@ SUBROUTINE test_genprop_class_callback(total_error) INTEGER :: PROP3_DEF_VALUE = 10 INTEGER :: PROP4_DEF_VALUE = 10 - INTEGER :: error ! Generic RETURN value + INTEGER :: error ! Generic RETURN value LOGICAL :: flag ! for tests f1 = C_FUNLOC(test_genprop_cls_cb1_f) @@ -338,45 +338,45 @@ SUBROUTINE test_genprop_class_callback(total_error) f2 = C_LOC(crt_cb_struct) f6 = C_LOC(cls_cb_struct) - ! Create a new generic class, derived from the root of the class hierarchy + ! Create a new generic class, derived from the root of the class hierarchy CALL h5pcreate_class_f(h5p_ROOT_F, CLASS1_NAME, cid1, error, f1, f2, c_null_funptr, c_null_ptr, f5, f6) CALL check("h5pcreate_class_f", error, total_error) - ! Insert first property into class (with no callbacks) + ! Insert first property into class (with no callbacks) CALL h5pregister_f(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, error) CALL check("h5pregister_f", error, total_error) - ! Insert second property into class (with no callbacks) + ! Insert second property into class (with no callbacks) CALL h5pregister_f(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, error) CALL check("h5pregister_f", error, total_error) - ! Insert third property into class (with no callbacks) + ! Insert third property into class (with no callbacks) CALL h5pregister_f(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, error) CALL check("h5pregister_f", error, total_error) - ! Insert fourth property into class (with no callbacks) + ! Insert fourth property into class (with no callbacks) CALL h5pregister_f(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, error) CALL check("h5pregister_f", error, total_error) - ! Check the number of properties in class + ! Check the number of properties in class CALL h5pget_nprops_f(cid1, nprops, error) CALL check("h5pget_nprops_f", error, total_error) CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) - ! Initialize class callback structs + ! Initialize class callback structs crt_cb_struct%count = 0 crt_cb_struct%id = -1 cls_cb_struct%count = 0 cls_cb_struct%id = -1 - ! Create a property list from the class + ! Create a property list from the class CALL h5pcreate_f(cid1, lid1, error) CALL check("h5pcreate_f", error, total_error) - ! Get the list's class + ! Get the list's class CALL H5Pget_class_f(lid1, cid2, error) CALL check("H5Pget_class_f", error, total_error) - ! Check that the list's class is correct + ! Check that the list's class is correct CALL H5Pequal_f(cid2, cid1, flag, error) CALL check("H5Pequal_f", error, total_error) CALL verify("H5Pequal_f", flag, .TRUE., total_error) @@ -389,41 +389,41 @@ SUBROUTINE test_genprop_class_callback(total_error) WRITE(*,*) 'Class names do not match! name=',CLASS1_NAME_BUF, 'CLASS1_NAME=',CLASS1_NAME total_error = total_error + 1 ENDIF - ! Close class + ! Close class CALL h5pclose_class_f(cid2, error) CALL check("h5pclose_class_f", error, total_error) - ! Verify that the creation callback occurred + ! Verify that the creation callback occurred CALL verify("h5pcreate_f", crt_cb_struct%count, 1, total_error) CALL verify("h5pcreate_f", crt_cb_struct%id, lid1, total_error) - ! Check the number of properties in list + ! Check the number of properties in list CALL h5pget_nprops_f(lid1,nprops, error) CALL check("h5pget_nprops_f", error, total_error) CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) - ! Create another property list from the class + ! Create another property list from the class CALL h5pcreate_f(cid1, lid2, error) CALL check("h5pcreate_f", error, total_error) - ! Verify that the creation callback occurred + ! Verify that the creation callback occurred CALL verify("h5pcreate_f", crt_cb_struct%count, 2, total_error) CALL verify("h5pcreate_f", crt_cb_struct%id, lid2, total_error) - ! Check the number of properties in list + ! Check the number of properties in list CALL h5pget_nprops_f(lid2,nprops, error) CALL check("h5pget_nprops_f", error, total_error) CALL verify("h5pget_nprops_f", INT(nprops), 4, total_error) - ! Close first list + ! Close first list CALL h5pclose_f(lid1, error); CALL check("h5pclose_f", error, total_error) - ! Verify that the close callback occurred + ! Verify that the close callback occurred CALL verify("h5pcreate_f", cls_cb_struct%count, 1, total_error) CALL verify("h5pcreate_f", cls_cb_struct%id, lid1, total_error) - ! Close second list + ! Close second list CALL h5pclose_f(lid2, error); CALL check("h5pclose_f", error, total_error) @@ -431,7 +431,7 @@ SUBROUTINE test_genprop_class_callback(total_error) CALL verify("h5pcreate_f", cls_cb_struct%count, 2, total_error) CALL verify("h5pcreate_f", cls_cb_struct%id, lid2, total_error) - ! Close class + ! Close class CALL h5pclose_class_f(cid1, error) CALL check("h5pclose_class_f", error, total_error) @@ -459,7 +459,7 @@ SUBROUTINE test_h5p_file_image(total_error) INTEGER, PARAMETER :: count = 10 INTEGER, DIMENSION(1:count), TARGET :: buffer INTEGER, DIMENSION(1:count), TARGET :: temp - INTEGER :: i + INTEGER :: i INTEGER(size_t) :: size INTEGER(size_t) :: temp_size INTEGER :: error ! error return value @@ -489,7 +489,7 @@ SUBROUTINE test_h5p_file_image(total_error) CALL h5pset_file_image_f(fapl_1, f_ptr, size, error) CALL check("h5pset_file_image_f", error, total_error) - + ! Get the same data back DO i = 1, count f_ptr1(i) = C_LOC(temp(i)) @@ -501,7 +501,7 @@ SUBROUTINE test_h5p_file_image(total_error) ! Check that sizes are the same, and that the buffers are identical but separate CALL verify("h5pget_file_image_f", INT(temp_size), INT(size), total_error) - + ! Verify the image data is correct DO i = 1, count CALL verify("h5pget_file_image_f", temp(i), buffer(i), total_error) @@ -529,18 +529,18 @@ SUBROUTINE external_test_offset(cleanup,total_error) LOGICAL, INTENT(IN) :: cleanup INTEGER(hid_t) :: fapl=-1 ! file access property list - INTEGER(hid_t) :: file=-1 ! file to write to - INTEGER(hid_t) :: dcpl=-1 ! dataset creation properties - INTEGER(hid_t) :: space=-1 ! data space - INTEGER(hid_t) :: dset=-1 ! dataset + INTEGER(hid_t) :: file=-1 ! file to write to + INTEGER(hid_t) :: dcpl=-1 ! dataset creation properties + INTEGER(hid_t) :: space=-1 ! data space + INTEGER(hid_t) :: dset=-1 ! dataset INTEGER(hid_t) :: grp=-1 ! group to emit diagnostics - INTEGER(size_t) :: i, j ! miscellaneous counters + INTEGER(size_t) :: i, j ! miscellaneous counters CHARACTER(LEN=180) :: filename ! file names INTEGER, DIMENSION(1:25) :: part - INTEGER, DIMENSION(1:100), TARGET :: whole ! raw data buffers - INTEGER(hsize_t), DIMENSION(1:1) :: cur_size ! current data space size - INTEGER(hid_t) :: hs_space ! hyperslab data space - INTEGER(hsize_t), DIMENSION(1:1) :: hs_start = (/30/) ! hyperslab starting offset + INTEGER, DIMENSION(1:100), TARGET :: whole ! raw data buffers + INTEGER(hsize_t), DIMENSION(1:1) :: cur_size ! current data space size + INTEGER(hid_t) :: hs_space ! hyperslab data space + INTEGER(hsize_t), DIMENSION(1:1) :: hs_start = (/30/) ! hyperslab starting offset INTEGER(hsize_t), DIMENSION(1:1) :: hs_count = (/25/) ! hyperslab size CHARACTER(LEN=1) :: ichr1 ! character conversion holder INTEGER :: error ! error status @@ -559,23 +559,23 @@ SUBROUTINE external_test_offset(cleanup,total_error) WRITE(ichr1,'(I1.1)') i filename = "extern_"//ichr1//"a.raw" OPEN(10, FILE=filename, ACCESS='STREAM', form='UNFORMATTED') - + WRITE(10) temparray(1:(i-1)*10) WRITE(10) part CLOSE(10) ENDDO ! - ! Create the file and an initial group. + ! Create the file and an initial group. CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL h5fcreate_f('extren_raw.h5', H5F_ACC_TRUNC_F, file, error, access_prp=fapl) CALL check("h5fcreate_f",error,total_error) - + CALL h5gcreate_f(file, "emit-diagnostics", grp, error) CALL check("h5gcreate_f",error, total_error) - + ! Create the dataset - sizeof_part = INT(H5_SIZEOF(part(1))*25, hsize_t) + sizeof_part = INT(H5_SIZEOF(part(1))*25, hsize_t) CALL h5pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) CALL check("h5pcreate_f", error, total_error) @@ -587,7 +587,7 @@ SUBROUTINE external_test_offset(cleanup,total_error) CALL check("h5pset_external_f",error,total_error) CALL h5pset_external_f(dcpl, "extern_4a.raw", INT(30,off_t), sizeof_part, error) CALL check("h5pset_external_f",error,total_error) - + cur_size(1) = 100 CALL h5screate_simple_f(1, cur_size, space, error) CALL check("h5screate_simple_f", error, total_error) @@ -629,7 +629,7 @@ SUBROUTINE external_test_offset(cleanup,total_error) EXIT ENDIF ENDDO - + CALL h5dclose_f(dset, error) CALL check("h5dclose_f", error, total_error) CALL h5pclose_f(dcpl, error) @@ -678,12 +678,12 @@ SUBROUTINE test_vds(total_error) CHARACTER(LEN=3), PARAMETER :: DATASET="VDS" INTEGER(hsize_t) :: VDSDIM0 INTEGER(hsize_t), PARAMETER :: VDSDIM1 = 10 - INTEGER(hsize_t), PARAMETER :: VDSDIM2 = 15 + INTEGER(hsize_t), PARAMETER :: VDSDIM2 = 15 INTEGER(hsize_t) :: DIM0 INTEGER, PARAMETER :: DIM0_1= 4 ! Initial size of the source datasets - INTEGER, PARAMETER :: DIM1 = 10 - INTEGER, PARAMETER :: DIM2 = 15 + INTEGER, PARAMETER :: DIM1 = 10 + INTEGER, PARAMETER :: DIM2 = 15 INTEGER, PARAMETER :: RANK = 3 INTEGER(hsize_t), PARAMETER :: PLANE_STRIDE = 4 @@ -709,15 +709,15 @@ SUBROUTINE test_vds(total_error) src_count, block INTEGER(hsize_t), DIMENSION(1:2,1:3) :: vdsdims_out_correct - INTEGER(hsize_t), DIMENSION(1:3) :: start_out, & !Hyperslab PARAMETER out + INTEGER(hsize_t), DIMENSION(1:3) :: start_out, & !Hyperslab PARAMETER out stride_out, count_out, block_out INTEGER(hsize_t), DIMENSION(1:3,1:PLANE_STRIDE) :: start_correct INTEGER :: i, j - INTEGER(size_t) :: i_sz + INTEGER(size_t) :: i_sz INTEGER :: layout ! Storage layout - INTEGER(size_t) :: num_map ! Number of mappings - INTEGER(size_t) :: len ! Length of the string also a RETURN value + INTEGER(size_t) :: num_map ! Number of mappings + INTEGER(size_t) :: len ! Length of the string also a RETURN value ! Different sized character buffers CHARACTER(len=LEN(SRC_FILE(1))-3) :: SRC_FILE_LEN_TINY CHARACTER(len=LEN(SRC_FILE(1))-1) :: SRC_FILE_LEN_SMALL @@ -726,7 +726,7 @@ SUBROUTINE test_vds(total_error) CHARACTER(len=LEN(SRC_FILE(1))+10) :: SRC_FILE_LEN_HUGE CHARACTER(len=LEN(SRC_DATASET(1))) :: SRC_DATASET_LEN_EXACT - INTEGER(HID_T) :: space_out + INTEGER(HID_T) :: space_out INTEGER :: s_type, virtual_view INTEGER :: type1, type2 @@ -735,13 +735,13 @@ SUBROUTINE test_vds(total_error) TYPE(C_PTR) :: f_ptr INTEGER(SIZE_T) :: nsize LOGICAL :: IsRegular - INTEGER(HSIZE_T) :: gap_size + INTEGER(HSIZE_T) :: gap_size ! For testing against vdsdims_out_correct(1,1) = DIM0_1*5 vdsdims_out_correct(2,1) = DIM0_1*8 - vdsdims_out_correct(1:2,2) = VDSDIM1 - vdsdims_out_correct(1:2,3) = VDSDIM2 + vdsdims_out_correct(1:2,2) = VDSDIM1 + vdsdims_out_correct(1:2,3) = VDSDIM2 VDSDIM0 = H5S_UNLIMITED_F DIM0 = H5S_UNLIMITED_F @@ -749,7 +749,7 @@ SUBROUTINE test_vds(total_error) dims_max = (/INT(DIM0,hsize_t), INT(DIM1,hsize_t), INT(DIM2,hsize_t)/) ! - ! Create source files and datasets. + ! Create source files and datasets. ! DO i = 1, PLANE_STRIDE ! @@ -758,7 +758,7 @@ SUBROUTINE test_vds(total_error) wdata(j) = i ENDDO ! - ! Create the source files and datasets. Write data to each dataset and + ! Create the source files and datasets. Write data to each dataset and ! close all resources. CALL h5fcreate_f(SRC_FILE(i), H5F_ACC_TRUNC_F, file, error) CALL check("h5fcreate_f", error, total_error) @@ -769,7 +769,7 @@ SUBROUTINE test_vds(total_error) CALL check("h5pcreate_f", error, total_error) CALL h5pset_chunk_f(dcpl, RANK, chunk_dims, error) CALL check("h5pset_chunk_f",error, total_error) - + CALL h5dcreate_f(file, SRC_DATASET(i), H5T_NATIVE_INTEGER, src_space, dset, error, dcpl, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5dcreate_f",error, total_error) f_ptr = C_LOC(wdata(1)) @@ -795,20 +795,20 @@ SUBROUTINE test_vds(total_error) ! Create dataspaces for the source dataset. CALL H5Screate_simple_f(RANK, dims, src_space, error, dims_max) CALL check("H5Screate_simple_f", error, total_error) - + ! Create VDS creation property CALL H5Pcreate_f (H5P_DATASET_CREATE_F, dcpl, error) CALL check("H5Pcreate_f", error, total_error) - - ! Initialize hyperslab values + + ! Initialize hyperslab values start(1:3) = 0 - stride(1:3) = (/PLANE_STRIDE,1_hsize_t,1_hsize_t/) ! we will select every fifth plane in VDS + stride(1:3) = (/PLANE_STRIDE,1_hsize_t,1_hsize_t/) ! we will select every fifth plane in VDS count(1:3) = (/H5S_UNLIMITED_F,1_hsize_t,1_hsize_t/) src_count(1:3) = (/H5S_UNLIMITED_F,1_hsize_t,1_hsize_t/) block(1:3) = (/1, DIM1, DIM2/) - - ! - ! Build the mappings + + ! + ! Build the mappings ! start_correct = 0 CALL H5Sselect_hyperslab_f(src_space, H5S_SELECT_SET_F, start, src_count, error, block=block) @@ -827,10 +827,10 @@ SUBROUTINE test_vds(total_error) start(1) = start(1) + 1 ENDDO - CALL H5Sselect_none_f(vspace, error) + CALL H5Sselect_none_f(vspace, error) CALL check("H5Sselect_none_f", error, total_error) - ! Create a virtual dataset + ! Create a virtual dataset CALL H5Dcreate_f(vfile, DATASET, H5T_NATIVE_INTEGER, vspace, vdset, error, dcpl, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("H5Dcreate_f", error, total_error) CALL H5Sclose_f(vspace, error) @@ -840,9 +840,9 @@ SUBROUTINE test_vds(total_error) CALL H5Pclose_f(dcpl, error) CALL check("H5Pclose_f", error, total_error) - ! Let's add data to the source datasets and check new dimensions for VDS + ! Let's add data to the source datasets and check new dimensions for VDS ! We will add only one plane to the first source dataset, two planes to the - ! second one, three to the third, and four to the forth. + ! second one, three to the third, and four to the forth. DO i = 1, PLANE_STRIDE ! @@ -852,15 +852,15 @@ SUBROUTINE test_vds(total_error) ENDDO ! - ! Open the source files and datasets. Append data to each dataset and + ! Open the source files and datasets. Append data to each dataset and ! close all resources. CALL H5Fopen_f (SRC_FILE(i), H5F_ACC_RDWR_F, file, error) CALL check("H5Fopen_f", error, total_error) CALL H5Dopen_f (file, SRC_DATASET(i), dset, error) CALL check("H5Dopen_f", error, total_error) extdims(1) = DIM0_1+i - CALL H5Dset_extent_f(dset, extdims, error) - CALL check("H5Dset_extent_f", error, total_error) + CALL H5Dset_extent_f(dset, extdims, error) + CALL check("H5Dset_extent_f", error, total_error) CALL H5Dget_space_f(dset, src_space, error) CALL check("H5Dget_space_f", error, total_error) @@ -870,13 +870,13 @@ SUBROUTINE test_vds(total_error) memdims(1) = i - CALL H5Screate_simple_f(RANK, memdims, mem_space, error) + CALL H5Screate_simple_f(RANK, memdims, mem_space, error) CALL check("H5Screate_simple_f", error, total_error) - CALL H5Sselect_hyperslab_f(src_space, H5S_SELECT_SET_F, start,count, error,block=block) + CALL H5Sselect_hyperslab_f(src_space, H5S_SELECT_SET_F, start,count, error,block=block) CALL check("H5Sselect_hyperslab_f", error, total_error) f_ptr = C_LOC(wdata(1)) - CALL H5Dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space, src_space, H5P_DEFAULT_F) + CALL H5Dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space, src_space, H5P_DEFAULT_F) CALL check("H5Dwrite_f", error, total_error) CALL H5Sclose_f(src_space, error) CALL check("H5Sclose_f", error, total_error) @@ -888,38 +888,38 @@ SUBROUTINE test_vds(total_error) call H5Dclose_f(vdset, error) CALL check("H5Dclose_f", error, total_error) - call H5Fclose_f(vfile, error) + call H5Fclose_f(vfile, error) CALL check("H5Fclose_f", error, total_error) - + ! ! begin the read section ! ! Open file and dataset using the default properties. CALL H5Fopen_f(VFILENAME, H5F_ACC_RDONLY_F, vfile, error) - CALL check("H5Fopen_f", error, total_error) - - ! + CALL check("H5Fopen_f", error, total_error) + + ! ! Open VDS using different access properties to use max or ! min extents depending on the sizes of the underlying datasets CALL H5Pcreate_f(H5P_DATASET_ACCESS_F, dapl, error) - CALL check("H5Pcreate_f", error, total_error) + CALL check("H5Pcreate_f", error, total_error) DO i = 1, 2 IF(i.NE.1)THEN CALL H5Pset_virtual_view_f(dapl, H5D_VDS_LAST_AVAILABLE_F, error) - CALL check("H5Pset_virtual_view_f", error, total_error) + CALL check("H5Pset_virtual_view_f", error, total_error) ELSE CALL H5Pset_virtual_view_f(dapl, H5D_VDS_FIRST_MISSING_F, error) - CALL check("H5Pset_virtual_view_f", error, total_error) + CALL check("H5Pset_virtual_view_f", error, total_error) ENDIF - + CALL H5Dopen_f(vfile, DATASET, vdset, error, dapl) - CALL check("H5Dopen_f", error, total_error) + CALL check("H5Dopen_f", error, total_error) ! Let's get space of the VDS and its dimension we should get 32(or 20)x10x10 CALL H5Dget_space_f(vdset, vspace, error) - CALL check("H5Dget_space_f", error, total_error) + CALL check("H5Dget_space_f", error, total_error) CALL H5Sget_simple_extent_dims_f(vspace, vdsdims_out, vdsdims_max_out, error) CALL check("H5Sget_simple_extent_dims_f", error, total_error) @@ -927,12 +927,12 @@ SUBROUTINE test_vds(total_error) DO j = 1, RANK IF(vdsdims_out(j).NE.vdsdims_out_correct(i,j))THEN total_error = total_error + 1 - EXIT + EXIT ENDIF ENDDO CALL H5Pget_virtual_view_f(dapl, virtual_view, error) - CALL check("h5pget_virtual_view_f", error, total_error) + CALL check("h5pget_virtual_view_f", error, total_error) IF(i.EQ.1)THEN IF(virtual_view .NE. H5D_VDS_FIRST_MISSING_F)THEN @@ -942,10 +942,10 @@ SUBROUTINE test_vds(total_error) IF(virtual_view .NE. H5D_VDS_LAST_AVAILABLE_F)THEN total_error = total_error + 1 ENDIF - + ENDIF - ! Close + ! Close CALL H5Dclose_f(vdset, error) CALL check("H5Dclose_f", error, total_error) CALL H5Sclose_f(vspace, error) @@ -957,7 +957,7 @@ SUBROUTINE test_vds(total_error) ! ! Get creation property list and mapping properties. - ! + ! CALL H5Dget_create_plist_f (vdset, dcpl, error) CALL check("H5Dget_create_plist_f", error, total_error) @@ -973,7 +973,7 @@ SUBROUTINE test_vds(total_error) ! ! Find number of mappings. - + CALL H5Pget_virtual_count_f(dcpl, num_map, error) CALL check("H5Pget_virtual_count_f", error, total_error) @@ -981,7 +981,7 @@ SUBROUTINE test_vds(total_error) PRINT*,"Number of mappings is incorrect" total_error = total_error + 1 ENDIF - ! + ! ! Get mapping parameters for each mapping. ! DO i_sz = 1, num_map @@ -1105,7 +1105,7 @@ SUBROUTINE test_vds(total_error) PRINT*,"gapsize is incorrect" total_error = total_error + 1 ENDIF - + CALL H5Dclose_f(vdset, error) CALL check("H5Dclose_f", error, total_error) CALL H5Sclose_f(vspace, error) @@ -1114,7 +1114,7 @@ SUBROUTINE test_vds(total_error) CALL check("H5Pclose_f", error, total_error) CALL H5Fclose_f(vfile, error) CALL check("H5Fclose_f", error, total_error) - + END SUBROUTINE test_vds diff --git a/fortran/test/tH5R.F90 b/fortran/test/tH5R.F90 index f7cccfa..708d290 100644 --- a/fortran/test/tH5R.F90 +++ b/fortran/test/tH5R.F90 @@ -21,7 +21,7 @@ ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES -! Tests h5rcreate_f, h5rdereference_f, h5rget_name_f +! Tests h5rcreate_f, h5rdereference_f, h5rget_name_f ! and H5Rget_object_type functions ! ! CONTAINS SUBROUTINES @@ -262,20 +262,20 @@ SUBROUTINE refregtest(cleanup, total_error) INTEGER(HID_T) :: dsetv_id ! Dataset identifier INTEGER(HID_T) :: dsetr_id ! Dataset identifier INTEGER :: error -! TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2), TARGET :: ref - TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref +! TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2), TARGET :: ref + TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref_out INTEGER(HSIZE_T), DIMENSION(2) :: ref_dim = (/0,0/) INTEGER(HSIZE_T), DIMENSION(2) :: data_dims ! = (/0,0/) INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions - INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! + INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! INTEGER(HSIZE_T), DIMENSION(2) :: start ! = (/0,0/) INTEGER(HSIZE_T), DIMENSION(2) :: count ! = (/0,0/) INTEGER :: rankr = 1 INTEGER :: rank = 2 -! INTEGER , DIMENSION(2,9), TARGET :: DATA - INTEGER , DIMENSION(2,9) :: DATA +! INTEGER , DIMENSION(2,9), TARGET :: DATA + INTEGER , DIMENSION(2,9) :: DATA INTEGER , DIMENSION(2,9) :: data_out = 0 INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points @@ -353,7 +353,7 @@ SUBROUTINE refregtest(cleanup, total_error) CALL check("h5sselect_hyperslab_f", error, total_error) ref(1)%ref(:) = 0 ! f_ptr = C_LOC(ref(1)) -! CALL h5rcreate_f(file_id, dsetnamev, 1, space_id, f_ptr, error) +! CALL h5rcreate_f(file_id, dsetnamev, 1, space_id, f_ptr, error) CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(1), error) CALL check("h5rcreate_f", error, total_error) diff --git a/fortran/test/tH5S.F90 b/fortran/test/tH5S.F90 index a4f5f4a..a839d8b 100644 --- a/fortran/test/tH5S.F90 +++ b/fortran/test/tH5S.F90 @@ -176,14 +176,14 @@ CONTAINS CALL check("h5sget_simple_extent_type_f", error, total_error) IF (classtype .NE. 1) write(*,*)"class type not H5S_SIMPLE_f" - ! + ! !set the copied space to none before extend the dimensions. ! CALL h5sset_extent_none_f(space2_id, error) CALL check("h5sset_extent_none_f", error, total_error) ! - !set the copied space to dim2 size. + !set the copied space to dim2 size. ! CALL h5sset_extent_simple_f(space2_id, rank2, dims2, maxdims2, error) CALL check("h5sset_extent_simple_f", error, total_error) diff --git a/fortran/test/tH5Sselect.F90 b/fortran/test/tH5Sselect.F90 index 8415bce..5f7ece7 100644 --- a/fortran/test/tH5Sselect.F90 +++ b/fortran/test/tH5Sselect.F90 @@ -26,12 +26,12 @@ ! h5sselect_none_f, h5sselect_valid_f, h5sselect_hyperslab_f, ! h5sget_select_bounds_f, h5sget_select_elem_pointlist_f, ! h5sget_select_elem_npoints_f, h5sget_select_hyper_blocklist_f, -! h5sget_select_hyper_nblocks_f, h5sget_select_npoints_f +! h5sget_select_hyper_nblocks_f, h5sget_select_npoints_f ! ! CONTAINS SUBROUTINES ! test_select_hyperslab, test_select_element, test_basic_select, ! test_select_point, test_select_combine, test_select_bounds -! +! ! !***** MODULE TH5SSELECT @@ -1033,12 +1033,12 @@ CONTAINS !*************************************************************** SUBROUTINE test_select_point(cleanup, total_error) - + IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error INTEGER(HID_T) :: xfer_plist - + INTEGER, PARAMETER :: SPACE1_DIM1=3 INTEGER, PARAMETER :: SPACE1_DIM2=15 INTEGER, PARAMETER :: SPACE1_DIM3=13 @@ -1046,36 +1046,36 @@ SUBROUTINE test_select_point(cleanup, total_error) INTEGER, PARAMETER :: SPACE2_DIM2=26 INTEGER, PARAMETER :: SPACE3_DIM1=15 INTEGER, PARAMETER :: SPACE3_DIM2=26 - + INTEGER, PARAMETER :: SPACE1_RANK=3 INTEGER, PARAMETER :: SPACE2_RANK=2 INTEGER, PARAMETER :: SPACE3_RANK=2 - - ! Element selection information + + ! Element selection information INTEGER, PARAMETER :: POINT1_NPOINTS=10 - INTEGER(hid_t) ::fid1 ! HDF5 File IDs - INTEGER(hid_t) ::dataset ! Dataset ID - INTEGER(hid_t) ::sid1,sid2 ! Dataspace ID + INTEGER(hid_t) ::fid1 ! HDF5 File IDs + INTEGER(hid_t) ::dataset ! Dataset ID + INTEGER(hid_t) ::sid1,sid2 ! Dataspace ID INTEGER(hsize_t), DIMENSION(1:3) :: dims1 = (/SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3/) INTEGER(hsize_t), DIMENSION(1:2) :: dims2 = (/SPACE2_DIM1, SPACE2_DIM2/) INTEGER(hsize_t), DIMENSION(1:2) :: dims3 = (/SPACE3_DIM1, SPACE3_DIM2/) - - INTEGER(hsize_t), DIMENSION(1:SPACE1_RANK,1:POINT1_NPOINTS) :: coord1 ! Coordinates for point selection - INTEGER(hsize_t), DIMENSION(1:SPACE1_RANK,1:POINT1_NPOINTS) :: temp_coord1 ! Coordinates for point selection - INTEGER(hsize_t), DIMENSION(1:SPACE2_RANK,1:POINT1_NPOINTS) :: coord2 ! Coordinates for point selection - INTEGER(hsize_t), DIMENSION(1:SPACE2_RANK,1:POINT1_NPOINTS) :: temp_coord2 ! Coordinates for point selection - INTEGER(hsize_t), DIMENSION(1:SPACE3_RANK,1:POINT1_NPOINTS) :: coord3 ! Coordinates for point selection - INTEGER(hsize_t), DIMENSION(1:SPACE3_RANK,1:POINT1_NPOINTS) :: temp_coord3 ! Coordinates for point selection + + INTEGER(hsize_t), DIMENSION(1:SPACE1_RANK,1:POINT1_NPOINTS) :: coord1 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE1_RANK,1:POINT1_NPOINTS) :: temp_coord1 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE2_RANK,1:POINT1_NPOINTS) :: coord2 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE2_RANK,1:POINT1_NPOINTS) :: temp_coord2 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE3_RANK,1:POINT1_NPOINTS) :: coord3 ! Coordinates for point selection + INTEGER(hsize_t), DIMENSION(1:SPACE3_RANK,1:POINT1_NPOINTS) :: temp_coord3 ! Coordinates for point selection INTEGER(hssize_t) :: npoints -!!$ uint8_t *wbuf, buffer to write to disk -!!$ *rbuf, buffer read from disk -!!$ *tbuf; temporary buffer pointer - INTEGER :: i,j; ! Counters -! struct pnt_iter pi; Custom Pointer iterator struct - INTEGER :: error ! Generic return value +!!$ uint8_t *wbuf, buffer to write to disk +!!$ *rbuf, buffer read from disk +!!$ *tbuf; temporary buffer pointer + INTEGER :: i,j; ! Counters +! struct pnt_iter pi; Custom Pointer iterator struct + INTEGER :: error ! Generic return value CHARACTER(LEN=9) :: filename = 'h5s_hyper' - CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=80) :: fix_filename CHARACTER(LEN=1), DIMENSION(1:SPACE2_DIM1,1:SPACE2_DIM2) :: wbuf CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) @@ -1086,11 +1086,11 @@ SUBROUTINE test_select_point(cleanup, total_error) xfer_plist = H5P_DEFAULT_F ! MESSAGE(5, ("Testing Element Selection Functions\n")); - ! Allocate write & read buffers + ! Allocate write & read buffers !!$ wbuf = HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); !!$ rbuf = HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); !!$ - ! Initialize WRITE buffer + ! Initialize WRITE buffer DO i = 1, SPACE2_DIM1 DO j = 1, SPACE2_DIM2 @@ -1101,20 +1101,20 @@ SUBROUTINE test_select_point(cleanup, total_error) !!$ for(i=0, tbuf=wbuf; i Date: Wed, 27 May 2020 17:41:59 -0700 Subject: Minor tweaks to testhdf5 code after normalization with 1.10. --- test/trefer.c | 12 ++++----- test/tselect.c | 78 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/test/trefer.c b/test/trefer.c index 15f9d64..12651c7 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -247,9 +247,9 @@ test_reference_params(void) /* Test parameters to H5Ropen_object */ dset2 = H5Ropen_object(&rbuf[0], H5I_INVALID_HID, H5I_INVALID_HID); - VERIFY(dset2, FAIL, "H5Ropen_object oapl_id"); + VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object oapl_id"); dset2 = H5Ropen_object(NULL, H5P_DEFAULT, dapl_id); - VERIFY(dset2, FAIL, "H5Ropen_object ref"); + VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object ref"); /* Test parameters to H5Ropen_region */ ret_id = H5Ropen_region(NULL, H5I_INVALID_HID, H5I_INVALID_HID); @@ -2258,7 +2258,7 @@ test_reference_compat_conv(void) /* Create a dataset with region reference datatype */ dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dcreate2"); + CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); /* Select 6x6 hyperslab for first reference */ start[0] = 2; @@ -2316,11 +2316,11 @@ test_reference_compat_conv(void) /* Re-open the file */ fid1 = H5Fopen(FILE_REF_COMPAT, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(fid1, FAIL, "H5Fopen"); + CHECK(fid1, H5I_INVALID_HID, "H5Fopen"); /* Open the object reference dataset */ dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT); - CHECK(dataset, FAIL, "H5Dopen2"); + CHECK(dataset, H5I_INVALID_HID, "H5Dopen2"); /* Read selection from disk */ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_obj); @@ -2376,7 +2376,7 @@ test_reference_compat_conv(void) /* Open the dataset region reference dataset */ dataset = H5Dopen2(fid1, "/Dataset4", H5P_DEFAULT); - CHECK(ret, H5I_INVALID_HID, "H5Dopen2"); + CHECK(dataset, H5I_INVALID_HID, "H5Dopen2"); /* Read selection from disk */ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_reg); diff --git a/test/tselect.c b/test/tselect.c index 492a917..45806ae 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -1666,10 +1666,10 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, /**************************************************************** ** ** test_select_hyper_contig_dr__run_test(): Test H5S (dataspace) -** selection code with contiguous source and target having -** different ranks but the same shape. We have already -** tested H5Sselect_shape_same in isolation, so now we try to do -** I/O. +** selection code with contiguous source and target having +** different ranks but the same shape. We have already +** tested H5Sselect_shape_same in isolation, so now we try to do +** I/O. ** ****************************************************************/ static void @@ -6118,8 +6118,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) */ tmpdata = data; for (j = 0; j < X; j++) - for (i = 0; i < Y; i++) - for (k = 0; k < Z; k++) + for (i = 0; i < Y; i++) + for (k = 0; k < Z; k++) *tmpdata++ = (short)((k+1)%256); /* @@ -6281,8 +6281,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) tmpdata = data; tmpdata_out = data_out; for (j = 0; j < X; j++) - for (i = 0; i < Y; i++) - for (k = 0; k < Z; k++,tmpdata++,tmpdata_out++) { + for (i = 0; i < Y; i++) + for (k = 0; k < Z; k++,tmpdata++,tmpdata_out++) { if(*tmpdata!=*tmpdata_out) TestErrPrintf("Line %d: Error! j=%d, i=%d, k=%d, *tmpdata=%x, *tmpdata_out=%x\n",__LINE__,j,i,k,(unsigned)*tmpdata,(unsigned)*tmpdata_out); } /* end for */ @@ -6350,7 +6350,7 @@ test_select_point_chunk(void) */ tmpdata = data; for (i = 0; i < SPACE7_DIM1; i++) - for (j = 0; j < SPACE7_DIM1; j++) + for (j = 0; j < SPACE7_DIM1; j++) *tmpdata++ = ((i*SPACE7_DIM2)+j)%256; /* @@ -12026,16 +12026,16 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ rebuild_check = H5Sselect_shape_same(sid_reg1, sid_reg_ori1); CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); - } /* end if */ + } /* For irregular hyperslab */ sid_irreg1 = H5Screate_simple(SPACERE1_RANK,dims1,NULL); @@ -12062,11 +12062,11 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } /* No need to do shape comparision */ @@ -12114,7 +12114,7 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); @@ -12123,7 +12123,7 @@ test_space_rebuild(void) /* In this case, rebuild_check should be TRUE. */ rebuild_check = H5Sselect_shape_same(sid_reg2, sid_reg_ori2); CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); - } /* end if */ + } /* 2-D irregular case */ sid_irreg2 = H5Screate_simple(SPACERE2_RANK,dims2,NULL); @@ -12155,11 +12155,11 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } /* No need to do shape comparision */ MESSAGE(7, ("Testing functionality to rebuild 3-D hyperslab selection\n")); @@ -12212,16 +12212,16 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ rebuild_check = H5Sselect_shape_same(sid_reg3, sid_reg_ori3); CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); - } /* end if */ + } sid_irreg3 = H5Screate_simple(SPACERE3_RANK,dims3,NULL); @@ -12258,11 +12258,11 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } /* No need to do shape comparision */ MESSAGE(7, ("Testing functionality to rebuild 4-D hyperslab selection\n")); @@ -12323,16 +12323,16 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ rebuild_check = H5Sselect_shape_same(sid_reg4, sid_reg_ori4); CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); - } /* end if */ + } /* Testing irregular selection */ sid_irreg4 = H5Screate_simple(SPACERE4_RANK,dims4,NULL); @@ -12380,11 +12380,11 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } /* No need to do shape comparision */ MESSAGE(7, ("Testing functionality to rebuild 5-D hyperslab selection\n")); @@ -12449,16 +12449,16 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ rebuild_check = H5Sselect_shape_same(sid_reg5, sid_reg_ori5); CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); - } /* end if */ + } sid_irreg5 = H5Screate_simple(SPACERE5_RANK,dims5,NULL); @@ -12511,11 +12511,11 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } /* No need to do shape comparision */ /* We use 5-D to test a special case with @@ -12558,11 +12558,11 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } /* No need to do shape comparision */ /* Adding some selections to make it real irregular */ @@ -12586,11 +12586,11 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } /* No need to do shape comparision */ /* Add more selections to make it regular again */ @@ -12614,11 +12614,11 @@ test_space_rebuild(void) if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); - } /* end if */ + } /* No need to do shape comparision */ H5Sclose(sid_reg1); -- cgit v0.12 From 6462c67b6578e48c1ef6d847be59c0b5e3598a50 Mon Sep 17 00:00:00 2001 From: Jacob Smith Date: Fri, 29 May 2020 14:27:14 -0500 Subject: Patch a few holes in the Splitter VFD implementation. * Missing logfile close on driver-open failure. * Initialize empty string in test/vfd (logfile path in W/O compat check). --- src/H5FDsplitter.c | 3 +++ test/vfd.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 13816a5..4ed3c4a 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -818,6 +818,9 @@ done: if (file_ptr->wo_file) { H5FD_close(file_ptr->wo_file); } + if (file_ptr->logfp) { + HDfclose(file_ptr->logfp); + } H5FL_FREE(H5FD_splitter_t, file_ptr); } } /* end if error */ diff --git a/test/vfd.c b/test/vfd.c index 97995d2..d94aec6 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -2490,7 +2490,7 @@ driver_is_splitter_compatible(hid_t fapl_id) { H5FD_splitter_vfd_config_t vfd_config; hid_t split_fapl_id = H5I_INVALID_HID; - herr_t ret; + herr_t ret = SUCCEED; int ret_value = 0; split_fapl_id = H5Pcreate(H5P_FILE_ACCESS); @@ -2503,6 +2503,7 @@ driver_is_splitter_compatible(hid_t fapl_id) vfd_config.rw_fapl_id = H5P_DEFAULT; vfd_config.wo_fapl_id = fapl_id; HDstrncpy(vfd_config.wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX); + *vfd_config.log_file_path = '\0'; H5E_BEGIN_TRY { ret = H5Pset_fapl_splitter(split_fapl_id, &vfd_config); -- cgit v0.12 From 5f0eed3fdc4fff9b714b5aa3d0d43114a95c0f29 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 1 Jun 2020 11:37:52 -0700 Subject: Normalization with hdf5_1_10 --- src/H5AC.c | 283 +++++++++++++++++++++++++++--------------------------- src/H5CX.c | 7 +- src/H5Dchunk.c | 17 ++-- src/H5Dfarray.c | 206 +++++++++++++++++++-------------------- src/H5Dnone.c | 42 ++++---- src/H5Dvirtual.c | 2 +- src/H5EA.c | 9 +- src/H5FA.c | 5 - src/H5FAhdr.c | 2 +- src/H5FD.c | 22 ++--- src/H5FDmpio.c | 2 +- src/H5Fint.c | 16 +-- src/H5Fquery.c | 1 + src/H5HLcache.c | 2 +- src/H5L.c | 42 ++++---- src/H5Lexternal.c | 2 +- src/H5Lprivate.h | 2 +- src/H5PB.c | 164 +++++++++++++++---------------- src/H5Pacpl.c | 1 - src/H5Pint.c | 2 +- src/H5Plapl.c | 4 +- src/H5Plcpl.c | 2 +- src/H5Ptest.c | 10 +- src/H5Shyper.c | 94 +++++++++--------- 24 files changed, 466 insertions(+), 473 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 1756107..f8805b3 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -136,14 +136,14 @@ static const H5AC_class_t *const H5AC_class_s[] = { /*------------------------------------------------------------------------- - * Function: H5AC_init + * Function: H5AC_init * - * Purpose: Initialize the interface from some other layer. + * Purpose: Initialize the interface from some other layer. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 18, 2003 * *------------------------------------------------------------------------- @@ -162,13 +162,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5AC__init_package + * Function H5AC__init_package * - * Purpose: Initialize interface-specific information + * Purpose: Initialize interface-specific information * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 18, 2002 * *------------------------------------------------------------------------- @@ -198,15 +198,15 @@ H5AC__init_package(void) /*------------------------------------------------------------------------- - * Function: H5AC_term_package + * Function: H5AC_term_package * - * Purpose: Terminate this interface. + * Purpose: Terminate this interface. * - * Return: Success: Positive if anything was done that might - * affect other interfaces; zero otherwise. - * Failure: Negative. + * Return: Success: Positive if anything was done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 18, 2002 * *------------------------------------------------------------------------- @@ -284,7 +284,7 @@ herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_config_t * image_config_ptr) { #ifdef H5_HAVE_PARALLEL - char prefix[H5C__PREFIX_LEN] = ""; + char prefix[H5C__PREFIX_LEN] = ""; H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ struct H5C_cache_image_ctl_t int_ci_config = H5C__DEFAULT_CACHE_IMAGE_CTL; @@ -309,9 +309,9 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { - MPI_Comm mpi_comm; - int mpi_rank; - int mpi_size; + MPI_Comm mpi_comm; + int mpi_rank; + int mpi_size; if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(f))) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator") @@ -400,7 +400,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co #endif /* H5_HAVE_PARALLEL */ if(NULL == f->shared->cache) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") #ifdef H5_HAVE_PARALLEL if(aux_ptr != NULL) @@ -561,12 +561,12 @@ done: * Function: H5AC_evict * * Purpose: Evict all entries except the pinned entries - * in the cache. + * in the cache. * * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi - * Dec 2013 + * Dec 2013 * *------------------------------------------------------------------------- */ @@ -600,9 +600,9 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_expunge_entry * - * Purpose: Expunge the target entry from the cache without writing it - * to disk even if it is dirty. The entry must not be either - * pinned or protected. + * Purpose: Expunge the target entry from the cache without writing it + * to disk even if it is dirty. The entry must not be either + * pinned or protected. * * Return: Non-negative on success/Negative on failure * @@ -643,13 +643,13 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_flush * - * Purpose: Flush (and possibly destroy) the metadata cache associated - * with the specified file. + * Purpose: Flush (and possibly destroy) the metadata cache associated + * with the specified file. * - * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the - * function returns failure. + * If the cache contains protected entries, the function will + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the + * function returns failure. * * Return: Non-negative on success/Negative on failure if there was a * request to flush all items and something was protected. @@ -701,15 +701,15 @@ done: * Function: H5AC_get_entry_status * * Purpose: Given a file address, determine whether the metadata - * cache contains an entry at that location. If it does, - * also determine whether the entry is dirty, protected, - * pinned, etc. and return that information to the caller - * in *status. + * cache contains an entry at that location. If it does, + * also determine whether the entry is dirty, protected, + * pinned, etc. and return that information to the caller + * in *status. * - * If the specified entry doesn't exist, set *status_ptr - * to zero. + * If the specified entry doesn't exist, set *status_ptr + * to zero. * - * On error, the value of *status is undefined. + * On error, the value of *status is undefined. * * Return: Non-negative on success/Negative on failure * @@ -721,14 +721,14 @@ done: herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) { - hbool_t in_cache; /* Entry @ addr is in the cache */ - hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */ - hbool_t is_protected; /* Entry @ addr is in the cache and protected */ - hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */ - hbool_t is_corked; - hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */ - hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */ - hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */ + hbool_t in_cache; /* Entry @ addr is in the cache */ + hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */ + hbool_t is_protected; /* Entry @ addr is in the cache and protected */ + hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */ + hbool_t is_corked; + hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */ + hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */ + hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -741,21 +741,21 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed") if(in_cache) { - *status |= H5AC_ES__IN_CACHE; - if(is_dirty) - *status |= H5AC_ES__IS_DIRTY; - if(is_protected) - *status |= H5AC_ES__IS_PROTECTED; - if(is_pinned) - *status |= H5AC_ES__IS_PINNED; - if(is_corked) - *status |= H5AC_ES__IS_CORKED; - if(is_flush_dep_parent) - *status |= H5AC_ES__IS_FLUSH_DEP_PARENT; - if(is_flush_dep_child) - *status |= H5AC_ES__IS_FLUSH_DEP_CHILD; - if(image_is_up_to_date) - *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE; + *status |= H5AC_ES__IN_CACHE; + if(is_dirty) + *status |= H5AC_ES__IS_DIRTY; + if(is_protected) + *status |= H5AC_ES__IS_PROTECTED; + if(is_pinned) + *status |= H5AC_ES__IS_PINNED; + if(is_corked) + *status |= H5AC_ES__IS_CORKED; + if(is_flush_dep_parent) + *status |= H5AC_ES__IS_FLUSH_DEP_PARENT; + if(is_flush_dep_child) + *status |= H5AC_ES__IS_FLUSH_DEP_CHILD; + if(image_is_up_to_date) + *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE; } /* end if */ else *status = 0; @@ -875,8 +875,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_dirty * - * Purpose: Mark a pinned or protected entry as dirty. The target - * entry MUST be either pinned, protected, or both. + * Purpose: Mark a pinned or protected entry as dirty. The target + * entry MUST be either pinned, protected, or both. * * Return: Non-negative on success/Negative on failure * @@ -929,8 +929,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_clean * - * Purpose: Mark a pinned entry as clean. The target - * entry MUST be pinned. + * Purpose: Mark a pinned entry as clean. The target + * entry MUST be pinned. * * Return: Non-negative on success/Negative on failure * @@ -982,8 +982,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_unserialized * - * Purpose: Mark a pinned or protected entry as unserialized. The target - * entry MUST be either pinned, protected, or both. + * Purpose: Mark a pinned or protected entry as unserialized. The target + * entry MUST be either pinned, protected, or both. * * Return: Non-negative on success/Negative on failure * @@ -1024,8 +1024,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_serialized * - * Purpose: Mark a pinned entry as serialized. The target - * entry MUST be pinned. + * Purpose: Mark a pinned entry as serialized. The target + * entry MUST be pinned. * * Return: Non-negative on success/Negative on failure * @@ -1124,7 +1124,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_pin_protected_entry() * - * Purpose: Pin a protected cache entry. The entry must be protected + * Purpose: Pin a protected cache entry. The entry must be protected * at the time of call, and must be unpinned. * * Return: Non-negative on success/Negative on failure @@ -1205,7 +1205,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_create_flush_dependency() * - * Purpose: Create a flush dependency between two entries in the metadata + * Purpose: Create a flush dependency between two entries in the metadata * cache. * * Return: Non-negative on success/Negative on failure @@ -1250,16 +1250,16 @@ done: * Function: H5AC_protect * * Purpose: If the target entry is not in the cache, load it. If - * necessary, attempt to evict one or more entries to keep - * the cache within its maximum size. + * necessary, attempt to evict one or more entries to keep + * the cache within its maximum size. * - * Mark the target entry as protected, and return its address - * to the caller. The caller must call H5AC_unprotect() when - * finished with the entry. + * Mark the target entry as protected, and return its address + * to the caller. The caller must call H5AC_unprotect() when + * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to - * H5AC_protect. Any attempt to do so will result in a failure. + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to + * H5AC_protect. Any attempt to do so will result in a failure. * * Return: Success: Ptr to the object. * Failure: NULL @@ -1301,7 +1301,7 @@ H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata, /* Check for invalid access request */ if((0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) && (0 == (flags & H5C__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file") #if H5AC_DO_TAGGING_SANITY_CHECKS if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0) @@ -1331,7 +1331,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_resize_entry * - * Purpose: Resize a pinned or protected entry. + * Purpose: Resize a pinned or protected entry. * * Return: Non-negative on success/Negative on failure * @@ -1384,8 +1384,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_unpin_entry() * - * Purpose: Unpin a cache entry. The entry must be unprotected at - * the time of call, and must be pinned. + * Purpose: Unpin a cache entry. The entry must be unprotected at + * the time of call, and must be pinned. * * Return: Non-negative on success/Negative on failure * @@ -1427,7 +1427,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_destroy_flush_dependency() * - * Purpose: Destroy a flush dependency between two entries. + * Purpose: Destroy a flush dependency between two entries. * * Return: Non-negative on success/Negative on failure * @@ -1470,27 +1470,27 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_unprotect * - * Purpose: Undo an H5AC_protect() call -- specifically, mark the - * entry as unprotected, remove it from the protected list, - * and give it back to the replacement policy. + * Purpose: Undo an H5AC_protect() call -- specifically, mark the + * entry as unprotected, remove it from the protected list, + * and give it back to the replacement policy. * - * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5AC_protect() and the THING - * argument must be the value returned by that call to - * H5AC_protect(). + * The TYPE and ADDR arguments must be the same as those in + * the corresponding call to H5AC_protect() and the THING + * argument must be the value returned by that call to + * H5AC_protect(). * - * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to - * disk. + * If the deleted flag is TRUE, simply remove the target entry + * from the cache, clear it, and free it without writing it to + * disk. * - * This version of the function is a complete re-write to - * use the new metadata cache. While there isn't all that - * much difference between the old and new Purpose sections, - * the original version is given below. + * This version of the function is a complete re-write to + * use the new metadata cache. While there isn't all that + * much difference between the old and new Purpose sections, + * the original version is given below. * - * Original purpose section: + * Original purpose section: * - * This function should be called to undo the effect of + * This function should be called to undo the effect of * H5AC_protect(). The TYPE and ADDR arguments should be the * same as the corresponding call to H5AC_protect() and the * THING argument should be the value returned by H5AC_protect(). @@ -1509,8 +1509,8 @@ herr_t H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags) { - hbool_t dirtied; - hbool_t deleted; + hbool_t dirtied; + hbool_t deleted; #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ @@ -1531,14 +1531,14 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, HDassert( ((H5AC_info_t *)thing)->type == type ); dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || - (((H5AC_info_t *)thing)->dirtied)); + (((H5AC_info_t *)thing)->dirtied)); deleted = (hbool_t)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG); /* Check if the size changed out from underneath us, if we're not deleting * the entry. */ if(dirtied && !deleted) { - size_t curr_size = 0; + size_t curr_size = 0; if((type->image_len)(thing, &curr_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") @@ -1625,7 +1625,7 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, if(internal_config.rpt_fcn == NULL) config_ptr->rpt_fcn_enabled = FALSE; else - config_ptr->rpt_fcn_enabled = TRUE; + config_ptr->rpt_fcn_enabled = TRUE; config_ptr->open_trace_file = FALSE; config_ptr->close_trace_file = FALSE; config_ptr->trace_file_name[0] = '\0'; @@ -1658,12 +1658,12 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, if(NULL != (aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr))) { config_ptr->dirty_bytes_threshold = aux_ptr->dirty_bytes_threshold; - config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy; + config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy; } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ config_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD; - config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; + config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; #ifdef H5_HAVE_PARALLEL } /* end else */ } @@ -1800,7 +1800,7 @@ herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr) { H5C_auto_size_ctl_t internal_config; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1880,16 +1880,16 @@ done: * Function: H5AC_validate_config() * * Purpose: Run a sanity check on the contents of the supplied - * instance of H5AC_cache_config_t. + * instance of H5AC_cache_config_t. * * Do nothing and return SUCCEED if no errors are detected, * and flag an error and return FAIL otherwise. * - * At present, this function operates by packing the data - * from the instance of H5AC_cache_config_t into an instance - * of H5C_auto_size_ctl_t, and then calling - * H5C_validate_resize_config(). As H5AC_cache_config_t and - * H5C_auto_size_ctl_t diverge, we may have to change this. + * At present, this function operates by packing the data + * from the instance of H5AC_cache_config_t into an instance + * of H5C_auto_size_ctl_t, and then calling + * H5C_validate_resize_config(). As H5AC_cache_config_t and + * H5C_auto_size_ctl_t diverge, we may have to change this. * * Return: Non-negative on success/Negative on failure * @@ -1914,7 +1914,7 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr) /* don't bother to test trace_file_name unless open_trace_file is TRUE */ if(config_ptr->open_trace_file) { - size_t name_len; + size_t name_len; /* Can't really test the trace_file_name field without trying to * open the file, so we will content ourselves with a couple of @@ -1957,17 +1957,17 @@ done: * Function: H5AC_validate_cache_image_config() * * Purpose: Run a sanity check on the contents of the supplied - * instance of H5AC_cache_image_config_t. + * instance of H5AC_cache_image_config_t. * * Do nothing and return SUCCEED if no errors are detected, * and flag an error and return FAIL otherwise. * - * At present, this function operates by packing the data - * from the instance of H5AC_cache_image_config_t into an - * instance of H5C_cache_image_ctl_t, and then calling - * H5C_validate_cache_image_config(). If and when + * At present, this function operates by packing the data + * from the instance of H5AC_cache_image_config_t into an + * instance of H5C_cache_image_ctl_t, and then calling + * H5C_validate_cache_image_config(). If and when * H5AC_cache_image_config_t and H5C_cache_image_ctl_t - * diverge, we may have to change this. + * diverge, we may have to change this. * * Return: Non-negative on success/Negative on failure * @@ -2013,13 +2013,13 @@ done: * Function: H5AC__check_if_write_permitted * * Purpose: Determine if a write is permitted under the current - * circumstances, and set *write_permitted_ptr accordingly. - * As a general rule it is, but when we are running in parallel - * mode with collective I/O, we must ensure that a read cannot - * cause a write. + * circumstances, and set *write_permitted_ptr accordingly. + * As a general rule it is, but when we are running in parallel + * mode with collective I/O, we must ensure that a read cannot + * cause a write. * - * In the event of failure, the value of *write_permitted_ptr - * is undefined. + * In the event of failure, the value of *write_permitted_ptr + * is undefined. * * Return: Non-negative on success/Negative on failure. * @@ -2035,9 +2035,9 @@ H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr) { #ifdef H5_HAVE_PARALLEL - H5AC_aux_t * aux_ptr = NULL; + H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ - hbool_t write_permitted = TRUE; + hbool_t write_permitted = TRUE; FUNC_ENTER_STATIC_NOERR @@ -2051,9 +2051,9 @@ H5_ATTR_UNUSED HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); if((aux_ptr->mpi_rank == 0) || (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)) - write_permitted = aux_ptr->write_permitted; + write_permitted = aux_ptr->write_permitted; else - write_permitted = FALSE; + write_permitted = FALSE; } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -2067,12 +2067,12 @@ H5_ATTR_UNUSED * Function: H5AC__ext_config_2_int_config() * * Purpose: Utility function to translate an instance of - * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t. + * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t. * - * Places translation in *int_conf_ptr and returns SUCCEED - * if successful. Returns FAIL on failure. + * Places translation in *int_conf_ptr and returns SUCCEED + * if successful. Returns FAIL on failure. * - * Does only minimal sanity checking. + * Does only minimal sanity checking. * * Return: Non-negative on success/Negative on failure * @@ -2453,7 +2453,7 @@ done: * Purpose: Given a file address, retrieve the ring for an entry at that * address. * - * On error, the value of *ring is not modified. + * On error, the value of *ring is not modified. * * Return: Non-negative on success/Negative on failure * @@ -2531,11 +2531,11 @@ H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring) * are in the process of a file shutdown, post an error * message, and return FAIL. * - * Note that this function simply passes the call on to - * the metadata cache proper, and returns the result. + * Note that this function simply passes the call on to + * the metadata cache proper, and returns the result. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * September 17, 2016 @@ -2608,7 +2608,7 @@ done: * Function: H5AC_remove_entry() * * Purpose: Remove an entry from the cache. Must be not protected, pinned, - * dirty, involved in flush dependencies, etc. + * dirty, involved in flush dependencies, etc. * * Return: Non-negative on success/Negative on failure * @@ -2669,3 +2669,4 @@ H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_l done: FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_get_mdc_image_info() */ + diff --git a/src/H5CX.c b/src/H5CX.c index df335ea..6f4caa8 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -295,8 +295,8 @@ typedef struct H5CX_t { hbool_t nlinks_valid; /* Whether number of soft / UD links to traverse is valid */ /* Cached DCPL properties */ - hbool_t do_min_dset_ohdr; /* Whether to minimize dataset object header */ - hbool_t do_min_dset_ohdr_valid; /* Whether minimize dataset object header flag is valid */ + hbool_t do_min_dset_ohdr; /* Whether to minimize dataset object header */ + hbool_t do_min_dset_ohdr_valid; /* Whether minimize dataset object header flag is valid */ uint8_t ohdr_flags; /* Object header flags */ hbool_t ohdr_flags_valid; /* Whether the object headers flags are valid */ @@ -581,7 +581,6 @@ H5CX__init_package(void) if(H5P_get(la_plist, H5L_ACS_NLINKS_NAME, &H5CX_def_lapl_cache.nlinks) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve number of soft / UD links to traverse") - /* Reset the "default DCPL cache" information */ HDmemset(&H5CX_def_dcpl_cache, 0, sizeof(H5CX_dcpl_cache_t)); @@ -1171,6 +1170,7 @@ H5CX_set_dcpl(hid_t dcpl_id) FUNC_LEAVE_NOAPI_VOID } /* end H5CX_set_dcpl() */ + /*------------------------------------------------------------------------- * Function: H5CX_set_libver_bounds * @@ -2593,6 +2593,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_get_nlinks() */ + /*------------------------------------------------------------------------- * Function: H5CX_get_libver_bounds * diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index e760f63..90516c6 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -216,6 +216,7 @@ typedef struct H5D_chunk_readvv_ud_t { const H5D_t *dset; /* Dataset to operate on */ } H5D_chunk_readvv_ud_t; +/* Typedef for chunk info iterator callback */ typedef struct H5D_chunk_info_iter_ud_t { hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Logical offset of the chunk */ hsize_t ndims; /* Number of dimensions in the dataset */ @@ -433,7 +434,7 @@ H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset, /* Allocate storage */ if(H5D__alloc_storage(&io_info, H5D_ALLOC_WRITE, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") - } /* end if */ + } /* Calculate the index of this chunk */ H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled); @@ -4852,7 +4853,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) /* Check if the dataspace expanded enough to cause the old edge chunks * in this dimension to become full */ - if((space_dim[op_dim]/chunk_dim[op_dim]) >= (old_edge_chunk_sc[op_dim] + 1)) + if((space_dim[op_dim]/chunk_dim[op_dim]) >= (old_edge_chunk_sc[op_dim] + 1)) new_full_dim[op_dim] = TRUE; } /* end for */ @@ -7306,9 +7307,9 @@ H5D__get_chunk_info(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_ idx_info.storage = &dset->shared->layout.storage.u.chunk; /* Set addr & size for when dset is not written or queried chunk is not found */ - if(addr) + if (addr) *addr = HADDR_UNDEF; - if(size) + if (size) *size = 0; /* If the chunk is written, get its info, otherwise, return without error */ @@ -7374,12 +7375,12 @@ H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(chunk_info); /* Going through the scaled, stop when a mismatch is found */ - for(ii = 0; ii < chunk_info->ndims && !different; ii++) - if(chunk_info->scaled[ii] != chunk_rec->scaled[ii]) + for (ii = 0; ii < chunk_info->ndims && !different; ii++) + if (chunk_info->scaled[ii] != chunk_rec->scaled[ii]) different = TRUE; /* Same scaled coords means the chunk is found, copy the chunk info */ - if(!different) { + if (!different) { chunk_info->nbytes = chunk_rec->nbytes; chunk_info->filter_mask = chunk_rec->filter_mask; chunk_info->chunk_addr = chunk_rec->chunk_addr; @@ -7387,7 +7388,7 @@ H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Stop iterating */ ret_value = H5_ITER_STOP; - } /* end if */ + } FUNC_LEAVE_NOAPI(ret_value) } /* H5D__get_chunk_info_by_coord_cb() */ diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index cbaa52d..4eedf04 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -11,12 +11,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Vailin Choi - * Thursday, April 30, 2009 +/* Programmer: Vailin Choi + * Thursday, April 30, 2009 * - * Purpose: Fixed array indexed (chunked) I/O functions. - * The chunk coordinate is mapped as an index into an array of - * disk addresses for the chunks. + * Purpose: Fixed array indexed (chunked) I/O functions. + * The chunk coordinate is mapped as an index into an array of + * disk addresses for the chunks. * */ @@ -30,13 +30,13 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Dpkg.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FAprivate.h" /* Fixed arrays */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5MFprivate.h" /* File space management */ -#include "H5VMprivate.h" /* Vector functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FAprivate.h" /* Fixed arrays */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5MFprivate.h" /* File space management */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ @@ -212,14 +212,14 @@ H5FL_DEFINE_STATIC(H5D_farray_ctx_ud_t); /*------------------------------------------------------------------------- - * Function: H5D__farray_crt_context + * Function: H5D__farray_crt_context * - * Purpose: Create context for callbacks + * Purpose: Create context for callbacks * - * Return: Success: non-NULL - * Failure: NULL + * Return: Success: non-NULL + * Failure: NULL * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -534,7 +534,7 @@ done: static herr_t H5D__farray_dst_dbg_context(void *_dbg_ctx) { - H5D_farray_ctx_ud_t *dbg_ctx = (H5D_farray_ctx_ud_t *)_dbg_ctx; /* Context for fixed array callback */ + H5D_farray_ctx_ud_t *dbg_ctx = (H5D_farray_ctx_ud_t *)_dbg_ctx; /* Context for fixed array callback */ FUNC_ENTER_STATIC_NOERR @@ -612,7 +612,7 @@ H5D__farray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx /* Encode element */ /* (advances 'raw' pointer) */ H5F_addr_encode_len(ctx->file_addr_len, &raw, elmt->addr); - UINT64ENCODE_VAR(raw, elmt->nbytes, ctx->chunk_size_len); + UINT64ENCODE_VAR(raw, elmt->nbytes, ctx->chunk_size_len); UINT32ENCODE(raw, elmt->filter_mask); /* Advance native element pointer */ @@ -658,7 +658,7 @@ H5D__farray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx /* Decode element */ /* (advances 'raw' pointer) */ H5F_addr_decode_len(ctx->file_addr_len, &raw, &elmt->addr); - UINT64DECODE_VAR(raw, elmt->nbytes, ctx->chunk_size_len); + UINT64DECODE_VAR(raw, elmt->nbytes, ctx->chunk_size_len); UINT32DECODE(raw, elmt->filter_mask); /* Advance native element pointer */ @@ -836,7 +836,7 @@ H5D__farray_idx_open(const H5D_chk_idx_info_t *idx_info) /* Open the fixed array for the chunk index */ if(NULL == (idx_info->storage->u.farray.fa = H5FA_open(idx_info->f, idx_info->storage->idx_addr, &udata))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open fixed array") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open fixed array") /* Check for SWMR writes to the file */ if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) @@ -887,7 +887,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* General parameters */ if(idx_info->pline->nused > 0) { - unsigned chunk_size_len; /* Size of encoded chunk size */ + unsigned chunk_size_len; /* Size of encoded chunk size */ /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. @@ -913,11 +913,11 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Create the fixed array for the chunk index */ if(NULL == (idx_info->storage->u.farray.fa = H5FA_create(idx_info->f, &cparam, &udata))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array") /* Get the address of the fixed array in file */ if(H5FA_get_addr(idx_info->storage->u.farray.fa, &(idx_info->storage->idx_addr)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array address") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array address") /* Check for SWMR writes to the file */ if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) @@ -988,7 +988,7 @@ H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata if(H5D__farray_idx_open(idx_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array") } else /* Patch the top level file pointer contained in fa if needed */ - H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f); + H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f); /* Set convenience pointer to fixed array structure */ fa = idx_info->storage->u.farray.fa; @@ -1002,13 +1002,13 @@ H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata if(idx_info->pline->nused > 0) { H5D_farray_filt_elmt_t elmt; /* Fixed array element */ - elmt.addr = udata->chunk_block.offset; + elmt.addr = udata->chunk_block.offset; H5_CHECKED_ASSIGN(elmt.nbytes, uint32_t, udata->chunk_block.length, hsize_t); elmt.filter_mask = udata->filter_mask; /* Set the info for the chunk */ if(H5FA_set(fa, udata->chunk_idx, &elmt) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info") } /* end if */ else { /* Set the address for the chunk */ @@ -1022,15 +1022,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_get_addr + * Function: H5D__farray_idx_get_addr * - * Purpose: Get the file address of a chunk if file space has been - * assigned. Save the retrieved information in the udata - * supplied. + * Purpose: Get the file address of a chunk if file space has been + * assigned. Save the retrieved information in the udata + * supplied. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1038,9 +1038,9 @@ done: static herr_t H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) { - H5FA_t *fa; /* Pointer to fixed array structure */ - hsize_t idx; /* Array index of chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FA_t *fa; /* Pointer to fixed array structure */ + hsize_t idx; /* Array index of chunk */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1059,7 +1059,7 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda if(H5D__farray_idx_open(idx_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array") } else /* Patch the top level file pointer contained in fa if needed */ - H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f); + H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f); /* Set convenience pointer to fixed array structure */ fa = idx_info->storage->u.farray.fa; @@ -1088,12 +1088,12 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Update the other (constant) information for the chunk */ - udata->chunk_block.length = idx_info->layout->size; + udata->chunk_block.length = idx_info->layout->size; udata->filter_mask = 0; } /* end else */ if(!H5F_addr_defined(udata->chunk_block.offset)) - udata->chunk_block.length = 0; + udata->chunk_block.length = 0; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1101,13 +1101,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_iterate_cb + * Function: H5D__farray_idx_iterate_cb * - * Purpose: Callback routine for fixed array element iteration. + * Purpose: Callback routine for fixed array element iteration. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1135,8 +1135,8 @@ H5D__farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void * /* Make "generic chunk" callback */ if(H5F_addr_defined(udata->chunk_rec.chunk_addr)) - if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0) - HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback"); + if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0) + HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback"); /* Update coordinates of chunk in dataset */ ndims = udata->common.layout->ndims - 1; @@ -1161,14 +1161,14 @@ H5D__farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void * /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_iterate + * Function: H5D__farray_idx_iterate * - * Purpose: Iterate over the chunks in an index, making a callback + * Purpose: Iterate over the chunks in an index, making a callback * for each one. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1199,35 +1199,35 @@ H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, if(H5D__farray_idx_open(idx_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array") } else /* Patch the top level file pointer contained in fa if needed */ - H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f); + H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f); /* Set convenience pointer to fixed array structure */ fa = idx_info->storage->u.farray.fa; /* Get the fixed array statistics */ if(H5FA_get_stats(fa, &fa_stat) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array statistics") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array statistics") /* Check if there are any array elements */ if(fa_stat.nelmts > 0) { H5D_farray_it_ud_t udata; /* User data for iteration callback */ - /* Initialize userdata */ - HDmemset(&udata, 0, sizeof udata); - udata.common.layout = idx_info->layout; - udata.common.storage = idx_info->storage; + /* Initialize userdata */ + HDmemset(&udata, 0, sizeof udata); + udata.common.layout = idx_info->layout; + udata.common.storage = idx_info->storage; HDmemset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec)); udata.filtered = (idx_info->pline->nused > 0); if(!udata.filtered) { udata.chunk_rec.nbytes = idx_info->layout->size; udata.chunk_rec.filter_mask = 0; } /* end if */ - udata.cb = chunk_cb; - udata.udata = chunk_udata; + udata.cb = chunk_cb; + udata.udata = chunk_udata; /* Iterate over the fixed array elements */ - if((ret_value = H5FA_iterate(fa, H5D__farray_idx_iterate_cb, &udata)) < 0) - HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); + if((ret_value = H5FA_iterate(fa, H5D__farray_idx_iterate_cb, &udata)) < 0) + HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); } /* end if */ done: @@ -1236,13 +1236,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_remove + * Function: H5D__farray_idx_remove * - * Purpose: Remove chunk from index. + * Purpose: Remove chunk from index. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1250,9 +1250,9 @@ done: static herr_t H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata) { - H5FA_t *fa; /* Pointer to fixed array structure */ - hsize_t idx; /* Array index of chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FA_t *fa; /* Pointer to fixed array structure */ + hsize_t idx; /* Array index of chunk */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1271,7 +1271,7 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t if(H5D__farray_idx_open(idx_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array") } else /* Patch the top level file pointer contained in fa if needed */ - if(H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f) < 0) + if(H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch fixed array file pointer") /* Set convenience pointer to fixed array structure */ @@ -1330,14 +1330,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_delete_cb + * Function: H5D__farray_idx_delete_cb * - * Purpose: Delete space for chunk in file + * Purpose: Delete space for chunk in file * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1367,15 +1367,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_delete + * Function: H5D__farray_idx_delete * - * Purpose: Delete index and raw data storage for entire dataset + * Purpose: Delete index and raw data storage for entire dataset * (i.e. all chunks) * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1398,7 +1398,7 @@ H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info) if(H5F_addr_defined(idx_info->storage->idx_addr)) { H5D_farray_ctx_ud_t ctx_udata; /* User data for fixed array open call */ - /* Iterate over the chunk addresses in the fixed array, deleting each chunk */ + /* Iterate over the chunk addresses in the fixed array, deleting each chunk */ if(H5D__farray_idx_iterate(idx_info, H5D__farray_idx_delete_cb, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk addresses") @@ -1425,13 +1425,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_copy_setup + * Function: H5D__farray_idx_copy_setup * - * Purpose: Set up any necessary information for copying chunks + * Purpose: Set up any necessary information for copying chunks * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1480,13 +1480,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_copy_shutdown + * Function: H5D__farray_idx_copy_shutdown * - * Purpose: Shutdown any information from copying chunks + * Purpose: Shutdown any information from copying chunks * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1526,7 +1526,7 @@ done: * Return: Success: Non-negative * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1558,7 +1558,7 @@ H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) /* Get the fixed array statistics */ if(H5FA_get_stats(fa, &fa_stat) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array statistics") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query fixed array statistics") *index_size = fa_stat.hdr_size; *index_size += fa_stat.dblk_size; @@ -1575,13 +1575,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_reset + * Function: H5D__farray_idx_reset * - * Purpose: Reset indexing information. + * Purpose: Reset indexing information. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1596,7 +1596,7 @@ H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /* Reset index info */ if(reset_addr) - storage->idx_addr = HADDR_UNDEF; + storage->idx_addr = HADDR_UNDEF; storage->u.farray.fa = NULL; FUNC_LEAVE_NOAPI(SUCCEED) @@ -1604,13 +1604,13 @@ H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_dump + * Function: H5D__farray_idx_dump * - * Purpose: Dump indexing information to a stream. + * Purpose: Dump indexing information to a stream. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1631,13 +1631,13 @@ H5D__farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_dest + * Function: H5D__farray_idx_dest * - * Purpose: Release indexing information in memory. + * Purpose: Release indexing information in memory. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -1657,8 +1657,8 @@ H5D__farray_idx_dest(const H5D_chk_idx_info_t *idx_info) /* Check if the fixed array is open */ if(idx_info->storage->u.farray.fa) { - /* Patch the top level file pointer contained in fa if needed */ - if(H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f) < 0) + /* Patch the top level file pointer contained in fa if needed */ + if(H5FA_patch_file(idx_info->storage->u.farray.fa, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch fixed array file pointer") /* Close fixed array */ diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 5ba3f5b..40ddcb8 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -267,31 +267,31 @@ H5D__none_idx_iterate(const H5D_chk_idx_info_t *idx_info, /* Iterate over all the chunks in the dataset's dataspace */ for(u = 0; u < idx_info->layout->nchunks && ret_value == H5_ITER_CONT; u++) { - /* Calculate the index of this chunk */ - idx = H5VM_array_offset_pre(ndims, idx_info->layout->max_down_chunks, chunk_rec.scaled); + /* Calculate the index of this chunk */ + idx = H5VM_array_offset_pre(ndims, idx_info->layout->max_down_chunks, chunk_rec.scaled); - /* Calculate the address of the chunk */ - chunk_rec.chunk_addr = idx_info->storage->idx_addr + idx * idx_info->layout->size; + /* Calculate the address of the chunk */ + chunk_rec.chunk_addr = idx_info->storage->idx_addr + idx * idx_info->layout->size; - /* Make "generic chunk" callback */ - if((ret_value = (*chunk_cb)(&chunk_rec, chunk_udata)) < 0) + /* Make "generic chunk" callback */ + if((ret_value = (*chunk_cb)(&chunk_rec, chunk_udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, H5_ITER_ERROR, "failure in generic chunk iterator callback") - /* Update coordinates of chunk in dataset */ - curr_dim = (int)(ndims - 1); - while(curr_dim >= 0) { - /* Increment coordinate in current dimension */ - chunk_rec.scaled[curr_dim]++; - - /* Check if we went off the end of the current dimension */ - if(chunk_rec.scaled[curr_dim] >= idx_info->layout->chunks[curr_dim]) { - /* Reset coordinate & move to next faster dimension */ - chunk_rec.scaled[curr_dim] = 0; - curr_dim--; - } /* end if */ - else - break; - } /* end while */ + /* Update coordinates of chunk in dataset */ + curr_dim = (int)(ndims - 1); + while(curr_dim >= 0) { + /* Increment coordinate in current dimension */ + chunk_rec.scaled[curr_dim]++; + + /* Check if we went off the end of the current dimension */ + if(chunk_rec.scaled[curr_dim] >= idx_info->layout->chunks[curr_dim]) { + /* Reset coordinate & move to next faster dimension */ + chunk_rec.scaled[curr_dim] = 0; + curr_dim--; + } /* end if */ + else + break; + } /* end while */ } /* end for */ done: diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 877aadb..e07f538 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -1120,7 +1120,7 @@ H5D__virtual_str_append(const char *src, size_t src_len, char **p, char **buf, /* Copy string to *p. Note that since src in not NULL terminated, we must * use memcpy */ - (void)H5MM_memcpy(*p, src, src_len); + H5MM_memcpy(*p, src, src_len); /* Advance *p */ *p += src_len; diff --git a/src/H5EA.c b/src/H5EA.c index 96eee12..56663dc 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -991,11 +991,6 @@ END_FUNC(PRIV) /* end H5EA_delete() */ * * Programmer: Vailin Choi; Feb 2015 * - * Modification: - * Prototype changed (HDFFV-10661) - * - herr_t to int - * - SUCCEED/FAIL to H5_ITER_CONT/H5_ITER_ERROR - * June 6, 2019 -BMR *------------------------------------------------------------------------- */ BEGIN_FUNC(PRIV, ERR, @@ -1007,9 +1002,7 @@ H5EA_iterate(H5EA_t *ea, H5EA_operator_t op, void *udata)) hsize_t u; int cb_ret = H5_ITER_CONT; /* Return value from callback */ - /* - * Check arguments. - */ + /* Check arguments */ HDassert(ea); HDassert(op); HDassert(udata); diff --git a/src/H5FA.c b/src/H5FA.c index df53f27..f8bb094 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -691,11 +691,6 @@ END_FUNC(PRIV) /* end H5FA_delete() */ * Programmer: Vailin Choi * Thursday, April 30, 2009 * - * Modification: - * Prototype changed (HDFFV-10661) - * - herr_t to int - * - SUCCEED/FAIL to H5_ITER_CONT/H5_ITER_ERROR - * June 6, 2019 -BMR *------------------------------------------------------------------------- */ BEGIN_FUNC(PRIV, ERR, diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 8f29b83..506c767 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -39,7 +39,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/src/H5FD.c b/src/H5FD.c index 63112bd..2e80c7f 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -789,7 +789,7 @@ done: * will be all zero during the driver close callback like during * the 'open' callback. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -1088,7 +1088,7 @@ done: * doesn't map to a free list then either the application 'free' * callback is invoked (if defined) or the memory is leaked. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -1382,11 +1382,11 @@ done: * be the constant H5P_DEFAULT). The result is written into the * buffer BUF. * - * Return: Success: SUCCEED + * Return: Success: Non-negative * The read result is written into the BUF buffer * which should be allocated by the caller. * - * Failure: FAIL + * Failure: Negative * The contents of BUF are undefined. * *------------------------------------------------------------------------- @@ -1436,7 +1436,7 @@ done: * constant H5P_DEFAULT). The bytes to be written come from the * buffer BUF. * - * Return: SUCCEED/FAIL + * Return: SNon-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -1483,7 +1483,7 @@ done: * Purpose: Notify driver to flush all cached data. If the driver has no * flush method then nothing happens. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failureL * *------------------------------------------------------------------------- */ @@ -1553,7 +1553,7 @@ done: * * Purpose: Notify driver to truncate the file back to the allocated size. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -1622,7 +1622,7 @@ done: * * Purpose: Set a file lock * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -1684,7 +1684,7 @@ done: * * Purpose: Remove a file lock * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -1773,7 +1773,7 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) * Purpose: Returns a pointer to the file handle of low-level virtual * file driver. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * *-------------------------------------------------------------------------- */ @@ -1919,7 +1919,7 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged) * can't use the file to get the driver, the driver ID is passed * in as a parameter. * -* Return: SUCCEED/FAIL +* Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 8c7e91a..3d2e0cf 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -15,7 +15,7 @@ * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Purpose: This is the MPI-2 I/O driver. + * Purpose: This is the MPI-2 I/O driver. * */ diff --git a/src/H5Fint.c b/src/H5Fint.c index e4c8229..d50baad 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -391,7 +391,7 @@ H5F__get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id if(H5I_iterate(H5I_DATASET, H5F__get_objects_cb, &olist, app_ref) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(2)") } /* end if */ - } /* end if */ + } /* If the caller just wants to count the number of objects (OLIST.MAX_NOBJS is zero), * or the caller wants to get the list of IDs and the list isn't full, @@ -402,8 +402,8 @@ H5F__get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id olist.obj_type = H5I_GROUP; if(H5I_iterate(H5I_GROUP, H5F__get_objects_cb, &olist, app_ref) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(3)") - } /* end if */ - } /* end if */ + } + } /* If the caller just wants to count the number of objects (OLIST.MAX_NOBJS is zero), * or the caller wants to get the list of IDs and the list isn't full, @@ -415,7 +415,7 @@ H5F__get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id if(H5I_iterate(H5I_DATATYPE, H5F__get_objects_cb, &olist, app_ref) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(4)") } /* end if */ - } /* end if */ + } /* If the caller just wants to count the number of objects (OLIST.MAX_NOBJS is zero), * or the caller wants to get the list of IDs and the list isn't full, @@ -427,7 +427,7 @@ H5F__get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id if(H5I_iterate(H5I_ATTR, H5F__get_objects_cb, &olist, app_ref) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(5)") } /* end if */ - } /* end if */ + } /* Set the number of objects currently open */ *obj_id_count_ptr = obj_id_count; @@ -1066,12 +1066,12 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F f->shared->feature_flags &= ~(unsigned)H5FD_FEAT_ACCUMULATE_METADATA; if(H5FD_set_feature_flags(f->shared->lf, f->shared->feature_flags) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, NULL, "can't set feature_flags in VFD") - } /* end if */ + } else { /* If no value for read attempts has been set, use the default */ if(!f->shared->read_attempts) f->shared->read_attempts = H5F_METADATA_READ_ATTEMPTS; - } /* end else */ + } /* Determine the # of bins for metdata read retries */ if(H5F_set_retries(f) < 0) @@ -2298,7 +2298,7 @@ H5F_get_id(H5F_t *file) if((ret_value = H5VL_wrap_register(H5I_FILE, file, FALSE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group") file->id_exists = TRUE; - } /* end if */ + } else { /* Increment reference count on existing ID */ if(H5I_inc_ref(ret_value, FALSE) < 0) diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 68ad8e5..db01dac 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -1259,6 +1259,7 @@ H5F_get_point_of_no_return(const H5F_t *f) FUNC_LEAVE_NOAPI(f->shared->point_of_no_return) } /* end H5F_get_point_of_no_return() */ + /*------------------------------------------------------------------------- * Function: H5F_get_null_fsm_addr * diff --git a/src/H5HLcache.c b/src/H5HLcache.c index cff3942..734ec5c 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -36,7 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5HLpkg.h" /* Local Heaps */ #include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5L.c b/src/H5L.c index 15f2b7d..4ef045d 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -264,7 +264,7 @@ H5L_term_package(void) * are interpreted relative to SRC_LOC_ID and DST_LOC_ID, * which are either file IDs or group ID. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: James Laird * Wednesday, March 29, 2006 @@ -308,13 +308,13 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Set location paramter for source object */ + /* Set location parameter for source object */ loc_params1.type = H5VL_OBJECT_BY_NAME; loc_params1.loc_data.loc_by_name.name = src_name; loc_params1.loc_data.loc_by_name.lapl_id = lapl_id; loc_params1.obj_type = H5I_get_type(src_loc_id); - /* Set location paramter for destination object */ + /* Set location parameter for destination object */ loc_params2.type = H5VL_OBJECT_BY_NAME; loc_params2.loc_data.loc_by_name.name = dst_name; loc_params2.loc_data.loc_by_name.lapl_id = lapl_id; @@ -354,7 +354,7 @@ done: * time and target. The new link can have a different name * and be in a different location than the original. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: James Laird * Wednesday, March 29, 2006 @@ -398,13 +398,13 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Set location paramter for source object */ + /* Set location parameter for source object */ loc_params1.type = H5VL_OBJECT_BY_NAME; loc_params1.loc_data.loc_by_name.name = src_name; loc_params1.loc_data.loc_by_name.lapl_id = lapl_id; loc_params1.obj_type = H5I_get_type(src_loc_id); - /* Set location paramter for destination object */ + /* Set location parameter for destination object */ loc_params2.type = H5VL_OBJECT_BY_NAME; loc_params2.loc_data.loc_by_name.name = dst_name; loc_params2.loc_data.loc_by_name.lapl_id = lapl_id; @@ -448,7 +448,7 @@ done: * LINK_NAME is `./x/y/bar' and a request is made for `./x/y/bar' * then the actual object looked up is `./x/y/./foo'. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Monday, April 6, 1998 @@ -519,7 +519,7 @@ done: * NEW_NAME are interpreted relative to CUR_LOC_ID and * NEW_LOC_ID, which are either file IDs or group IDs. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Monday, April 6, 1998 @@ -621,7 +621,7 @@ done: * The link class of the new link must already be registered * with the library. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: James Laird * Tuesday, December 13, 2005 @@ -687,7 +687,7 @@ done: * object is open, then the reclamation of the file space is * delayed until all handles to the object are closed). * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Monday, April 6, 1998 @@ -966,11 +966,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Lget_info2 + * Function: H5Lget_info2 * - * Purpose: Gets metadata for a link. + * Purpose: Gets metadata for a link. * - * Return: Success: Non-negative with information in LINFO + * Return: Success: Non-negative with information in LINFO * Failure: Negative * * Programmer: James Laird @@ -1016,13 +1016,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Lget_info_by_idx2 + * Function: H5Lget_info_by_idx2 * - * Purpose: Gets metadata for a link, according to the order within an + * Purpose: Gets metadata for a link, according to the order within an * index. * - * Return: Success: Non-negative with information in LINFO - * Failure: Negative + * Return: Success: Non-negative with information in LINFO + * Failure: Negative * * Programmer: Quincey Koziol * Monday, November 6, 2006 @@ -1221,7 +1221,7 @@ done: * Return: Success: Non-negative length of name, with information * in NAME buffer * - * Failure: -1 + * Failure: -1 * * Programmer: Quincey Koziol * Saturday, November 11, 2006 @@ -3178,11 +3178,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_info + * Function: H5L_get_info * - * Purpose: Returns metadata about a link. + * Purpose: Returns metadata about a link. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: James Laird * Monday, April 17 2006 diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 1b007b6..8a3e3e1 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -125,7 +125,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, size_t fname_len; /* Length of external link file name */ unsigned intent; /* File access permissions */ H5L_elink_cb_t cb_info; /* Callback info struct */ - hid_t fapl_id = -1; /* File access property list for external link's file */ + hid_t fapl_id = H5I_INVALID_HID; /* File access property list for external link's file */ void *ext_obj = NULL; /* External link's object */ hid_t ext_obj_id = H5I_INVALID_HID; /* ID for external link's object */ H5I_type_t opened_type; /* ID type of external link's object */ diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index ab68b84..0487557 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -68,7 +68,7 @@ typedef struct { hsize_t n; /* Offset of link within index */ /* Out */ - H5L_info2_t *linfo; /* Buffer to return to user */ + H5L_info2_t *linfo; /* Buffer to return to user */ } H5L_trav_gibi_t; /* User data for path traversal routine for getting name by index */ diff --git a/src/H5PB.c b/src/H5PB.c index 45f24e3..8ac863e 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -24,21 +24,21 @@ /* Module Setup */ /****************/ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /* Suppress error about including H5Fpkg */ #include "H5PBmodule.h" /* This source code file is part of the H5PB module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* Files */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5PBpkg.h" /* File access */ -#include "H5SLprivate.h" /* Skip List */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* Files */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5PBpkg.h" /* File access */ +#include "H5SLprivate.h" /* Skip List */ /****************/ @@ -153,7 +153,7 @@ H5FL_DEFINE_STATIC(H5PB_entry_t); /*------------------------------------------------------------------------- - * Function: H5PB_reset_stats + * Function: H5PB_reset_stats * * Purpose: This function was created without documentation. * What follows is my best understanding of Mohamad's intent. @@ -162,7 +162,7 @@ H5FL_DEFINE_STATIC(H5PB_entry_t); * * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -190,7 +190,7 @@ H5PB_reset_stats(H5PB_t *page_buf) /*------------------------------------------------------------------------- - * Function: H5PB_get_stats + * Function: H5PB_get_stats * * Purpose: This function was created without documentation. * What follows is my best understanding of Mohamad's intent. @@ -202,9 +202,9 @@ H5PB_reset_stats(H5PB_t *page_buf) * --evictions: the number of metadata and raw data evictions from the page buffer layer * --bypasses: the number of metadata and raw data accesses that bypass the page buffer layer * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -233,16 +233,16 @@ H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2], unsigned hits[2], /*------------------------------------------------------------------------- - * Function: H5PB_print_stats() + * Function: H5PB_print_stats() * * Purpose: This function was created without documentation. * What follows is my best understanding of Mohamad's intent. * * Print out statistics collected for the page buffer layer. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -278,13 +278,13 @@ H5PB_print_stats(const H5PB_t *page_buf) /*------------------------------------------------------------------------- - * Function: H5PB_create + * Function: H5PB_create * - * Purpose: Create and setup the PB on the file. + * Purpose: Create and setup the PB on the file. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -355,13 +355,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB__flush_cb + * Function: H5PB__flush_cb * - * Purpose: Callback to flush PB skiplist entries. + * Purpose: Callback to flush PB skiplist entries. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -389,13 +389,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB_flush + * Function: H5PB_flush * - * Purpose: Flush/Free all the PB entries to the file. + * Purpose: Flush/Free all the PB entries to the file. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -424,13 +424,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB__dest_cb + * Function: H5PB__dest_cb * - * Purpose: Callback to free PB skiplist entries. + * Purpose: Callback to free PB skiplist entries. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -461,13 +461,13 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) /*------------------------------------------------------------------------- - * Function: H5PB_dest + * Function: H5PB_dest * - * Purpose: Flush and destroy the PB on the file if it exists. + * Purpose: Flush and destroy the PB on the file if it exists. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -515,16 +515,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB_add_new_page + * Function: H5PB_add_new_page * - * Purpose: Add a new page to the new page skip list. This is called + * Purpose: Add a new page to the new page skip list. This is called * from the MF layer when a new page is allocated to * indicate to the page buffer layer that a read of the page * from the file is not necessary since it's an empty page. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -575,16 +575,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB_update_entry + * Function: H5PB_update_entry * - * Purpose: In PHDF5, entries that are written by other processes and just + * Purpose: In PHDF5, entries that are written by other processes and just * marked clean by this process have to have their corresponding * pages updated if they exist in the page buffer. * This routine checks and update the pages. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -675,14 +675,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB_read + * Function: H5PB_read * - * Purpose: Reads in the data from the page containing it if it exists + * Purpose: Reads in the data from the page containing it if it exists * in the PB cache; otherwise reads in the page through the VFD. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -971,15 +971,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB_write + * Function: H5PB_write * - * Purpose: Write data into the Page Buffer. If the page exists in the - * cache, update it; otherwise read it from disk, update it, and - * insert into cache. + * Purpose: Write data into the Page Buffer. If the page exists in the + * cache, update it; otherwise read it from disk, update it, and + * insert into cache. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -1311,26 +1311,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB__insert_entry() - * - * Purpose: ??? + * Function: H5PB__insert_entry() * - * This function was created without documentation. - * What follows is my best understanding of Mohamad's intent. + * Purpose: This function was created without documentation. + * What follows is my best understanding of Mohamad's intent. * - * Insert the supplied page into the page buffer, both the - * skip list and the LRU. + * Insert the supplied page into the page buffer, both the + * skip list and the LRU. * - * As best I can tell, this function imposes no limit on the - * number of entries in the page buffer beyond an assertion - * failure it the page count exceeds the limit. + * As best I can tell, this function imposes no limit on the + * number of entries in the page buffer beyond an assertion + * failure it the page count exceeds the limit. * * JRM -- 12/22/16 * * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -1361,16 +1359,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB__make_space() + * Function: H5PB__make_space() * - * Purpose: If necessary and if possible, evict a page from the page - * buffer to make space for the supplied page. Depending on - * the page buffer configuration and contents, and the page - * supplied this may or may not be possible. + * Purpose: This function was created without documentation. + * What follows is my best understanding of Mohamad's intent. * - * Return: Non-negative on success/Negative on failure + * If necessary and if possible, evict a page from the page + * buffer to make space for the supplied page. Depending on + * the page buffer configuration and contents, and the page + * supplied this may or may not be possible. * - * Programmer: Mohamad Chaarawi + * JRM -- 12/22/16 + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ @@ -1459,17 +1462,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5PB__write_entry() - * - * Purpose: ??? + * Function: H5PB__write_entry() * - * This function was created without documentation. - * What follows is my best understanding of Mohamad's intent. + * Purpose: ??? * + * This function was created without documentation. + * What follows is my best understanding of Mohamad's intent. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Mohamad Chaarawi + * Programmer: Mohamad Chaarawi * *------------------------------------------------------------------------- */ diff --git a/src/H5Pacpl.c b/src/H5Pacpl.c index 53e68fa..166a35f 100644 --- a/src/H5Pacpl.c +++ b/src/H5Pacpl.c @@ -33,7 +33,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Ppkg.h" /* Property lists */ -#include "H5VLprivate.h" /* Virtual Object Layer */ /****************/ diff --git a/src/H5Pint.c b/src/H5Pint.c index 3cefb64..2e463b2 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -1481,7 +1481,7 @@ H5P__free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED NAME H5P__access_class PURPOSE - Internal routine to increment or decrement list & class dependancies on a + Internal routine to increment or decrement list & class dependencies on a property list class USAGE herr_t H5P__access_class(pclass,mod) diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 3d00c12..8fdcc8b 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -344,7 +344,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) uint8_t **pp = (uint8_t **)_pp; H5P_genplist_t *fapl_plist; /* Pointer to property list */ hbool_t non_default_fapl = FALSE; /* Whether the FAPL is non-default */ - size_t fapl_size = 0; /* FAPL's encoded size */ + size_t fapl_size = 0; /* FAPL's encoded size */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -595,7 +595,7 @@ static herr_t H5P__lacc_elink_fapl_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { hid_t l_fapl_id; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index fc1a3b9..9c32552 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -119,7 +119,7 @@ static const unsigned H5L_def_intmd_group_g = H5L_CRT_INTERMEDIATE_GROUP_DEF; herr_t H5P_lcrt_reg_prop(H5P_genclass_t *pclass) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Ptest.c b/src/H5Ptest.c index 114b37b..303fbf7 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -82,7 +82,7 @@ done: PURPOSE Routine to open a [copy of] a class with its full path name USAGE - hid_t H5P__open_class_name_test(path) + hid_t H5P__open_class_path_test(path) const char *path; IN: Full path name of class to open [copy of] RETURNS Success: ID of generic property class @@ -105,19 +105,19 @@ H5P__open_class_path_test(const char *path) FUNC_ENTER_PACKAGE /* Check arguments. */ - if(NULL == path || *path=='\0') + if (NULL == path || *path=='\0') HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid class path"); /* Open the property list class */ - if(NULL == (pclass = H5P__open_class_path(path))) + if (NULL == (pclass = H5P__open_class_path(path))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to find class with full path"); /* Get an atom for the class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class"); done: - if(H5I_INVALID_HID == ret_value && pclass) + if (H5I_INVALID_HID == ret_value && pclass) H5P__close_class(pclass); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Shyper.c b/src/H5Shyper.c index dc97ea2..b352374 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -6059,7 +6059,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_add_span_element_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S_hyper_add_span_element @@ -6169,7 +6169,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_add_span_element() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_intersect_block_helper @@ -6259,7 +6259,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_intersect_block_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_intersect_block @@ -6391,7 +6391,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_intersect_block() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_adjust_u_helper @@ -6458,7 +6458,7 @@ H5S__hyper_adjust_u_helper(H5S_hyper_span_info_t *spans, unsigned rank, FUNC_LEAVE_NOAPI_VOID } /* end H5S__hyper_adjust_u_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_adjust_u @@ -6529,7 +6529,7 @@ H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_adjust_u() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_project_scalar * @@ -6605,7 +6605,7 @@ H5S__hyper_project_scalar(const H5S_t *space, hsize_t *offset) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_project_scalar() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_project_simple_lower * @@ -6652,7 +6652,7 @@ H5S__hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_project_simple_lower() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_project_simple_higher * @@ -6752,7 +6752,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_project_simple_higher() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_project_simple * @@ -6926,7 +6926,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_project_simple() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_adjust_s_helper @@ -6993,7 +6993,7 @@ H5S__hyper_adjust_s_helper(H5S_hyper_span_info_t *spans, unsigned rank, FUNC_LEAVE_NOAPI_VOID } /* end H5S__hyper_adjust_s_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_adjust_s @@ -7066,7 +7066,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_adjust_s() */ - + /*-------------------------------------------------------------------------- NAME H5S_hyper_normalize_offset @@ -7124,7 +7124,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_normalize_offset() */ - + /*-------------------------------------------------------------------------- NAME H5S_hyper_denormalize_offset @@ -7168,7 +7168,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_denormalize_offset() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_append_span @@ -7199,7 +7199,7 @@ H5S__hyper_append_span(H5S_hyper_span_info_t **span_tree, unsigned ndims, FUNC_ENTER_STATIC - /* Sanity check */ + /* Sanity checks */ HDassert(span_tree); /* Check for adding first node to merged spans */ @@ -7306,7 +7306,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_append_span() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_clip_spans @@ -7902,7 +7902,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_clip_spans() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_merge_spans_helper @@ -8218,7 +8218,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_merge_spans_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_merge_spans @@ -8273,7 +8273,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_merge_spans() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_spans_nelem_helper @@ -8346,7 +8346,7 @@ H5S__hyper_spans_nelem_helper(H5S_hyper_span_info_t *spans, unsigned op_info_i, FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_spans_nelem_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_spans_nelem @@ -8435,7 +8435,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_add_disjoint_spans */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_make_spans @@ -8802,7 +8802,7 @@ H5S__hyper_update_diminfo(H5S_t *space, H5S_seloper_t op, FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_update_diminfo() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_rebuild_helper @@ -8911,7 +8911,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_rebuild_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_rebuild @@ -8961,7 +8961,7 @@ H5S__hyper_rebuild(H5S_t *space) FUNC_LEAVE_NOAPI_VOID } /* end H5S__hyper_rebuild() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_generate_spans @@ -9101,7 +9101,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__check_spans_overlap() */ - + /*-------------------------------------------------------------------------- NAME H5S__fill_in_new_space @@ -9400,7 +9400,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__fill_in_new_space() */ - + /*------------------------------------------------------------------------- * Function: H5S__generate_hyperlab * @@ -9490,7 +9490,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__generate_hyperslab() */ - + /*------------------------------------------------------------------------- * Function: H5S__set_regular_hyperslab * @@ -9820,7 +9820,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_regular_and_single_block() */ - + /*------------------------------------------------------------------------- * Function: H5S_select_hyperslab * @@ -10138,7 +10138,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_hyperslab() */ - + /*-------------------------------------------------------------------------- NAME H5Sselect_hyperslab @@ -10202,7 +10202,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sselect_hyperslab() */ - + /*-------------------------------------------------------------------------- NAME H5S_combine_hyperslab @@ -10408,7 +10408,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_combine_hyperslab() */ - + /*------------------------------------------------------------------------- * Function: H5S__fill_in_select * @@ -10461,7 +10461,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__fill_in_select() */ - + /*-------------------------------------------------------------------------- NAME H5Scombine_hyperslab @@ -10525,7 +10525,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Scombine_hyperslab() */ - + /*------------------------------------------------------------------------- * Function: H5S__combine_select * @@ -10593,7 +10593,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__combine_select() */ - + /*-------------------------------------------------------------------------- NAME H5Scombine_select @@ -10728,7 +10728,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__modify_select() */ - + /*-------------------------------------------------------------------------- NAME H5Smodify_select @@ -10810,7 +10810,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Smodify_select() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_proj_int_build_proj @@ -11204,7 +11204,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_proj_int_build_proj() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_proj_int_iterate @@ -11455,7 +11455,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_proj_int_iterate() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_project_intersection @@ -11645,7 +11645,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_project_intersection() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_get_clip_diminfo @@ -11700,7 +11700,7 @@ H5S__hyper_get_clip_diminfo(hsize_t start, hsize_t stride, hsize_t *count, FUNC_LEAVE_NOAPI_VOID } /* end H5S__hyper_get_clip_diminfo() */ - + /*-------------------------------------------------------------------------- NAME H5S_hyper_clip_unlim @@ -11826,7 +11826,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_clip_unlim() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_get_clip_extent_real @@ -11908,7 +11908,7 @@ H5S__hyper_get_clip_extent_real(const H5S_t *clip_space, hsize_t num_slices, FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_get_clip_extent_real() */ - + /*-------------------------------------------------------------------------- NAME H5S_hyper_get_clip_extent @@ -11971,7 +11971,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_get_clip_extent() */ - + /*-------------------------------------------------------------------------- NAME H5S_hyper_get_clip_extent_match @@ -12061,7 +12061,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_get_clip_extent_match() */ - + /*-------------------------------------------------------------------------- NAME H5S_hyper_get_unlim_block @@ -12144,7 +12144,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_get_unlim_block */ - + /*-------------------------------------------------------------------------- NAME H5S_hyper_get_first_inc_block @@ -12212,7 +12212,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_get_first_inc_block */ - + /*-------------------------------------------------------------------------- NAME H5Sis_regular_hyperslab @@ -12254,7 +12254,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sis_regular_hyperslab() */ - + /*-------------------------------------------------------------------------- NAME H5Sget_regular_hyperslab -- cgit v0.12 From cc15d1039af86deb77c9dc9188412ce361599b17 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 2 Jun 2020 07:33:00 -0700 Subject: Normalizations with 1.10 branch. --- src/H5CX.c | 4 ++-- src/H5Dint.c | 29 ++++++++++++++++------------- src/H5FS.c | 2 +- test/freespace.c | 8 ++++---- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index 6f4caa8..b78d9ec 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -33,11 +33,11 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ +#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ +#include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 574bc0d..c063bb9 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -78,7 +78,7 @@ typedef struct { /********************/ /* General stuff */ -static H5D_shared_t *H5D__new(hid_t dcpl_id, hid_t dapl, hbool_t creating, hbool_t vl_type); +static H5D_shared_t *H5D__new(hid_t dcpl_id, hid_t dapl_id, hbool_t creating, hbool_t vl_type); static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type); static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); @@ -743,7 +743,7 @@ H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC HDassert(file); HDassert(minimize); @@ -784,7 +784,7 @@ H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr) size_t get_value = 0; size_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC HDassert(file); HDassert(dset); @@ -902,7 +902,7 @@ H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc) size_t ohdr_size = 0; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC HDassert(file); HDassert(dset); @@ -947,7 +947,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) hbool_t fill_changed = FALSE; /* Flag indicating the fill value was changed */ hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ hbool_t use_at_least_v18; /* Flag indicating to use at least v18 format versions */ - hbool_t minimize_header = FALSE; + hbool_t use_minimized_header = FALSE; /* Flag to use minimized dataset object headers */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1016,10 +1016,10 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value info") } /* end if */ - if(H5D__use_minimized_dset_headers(file, &minimize_header) == FAIL) + if(H5D__use_minimized_dset_headers(file, &use_minimized_header) == FAIL) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get minimize settings") - if(TRUE == minimize_header) { + if(TRUE == use_minimized_header) { if(H5D__prepare_minimized_oh(file, dset, oloc) == FAIL) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create minimized dataset object header") } else { @@ -1032,7 +1032,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) /* Create an object header for the dataset */ if(H5O_create(file, ohdr_size, (size_t)1, dset->shared->dcpl_id, oloc/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset object header") - } /* If use minimum/standard object header space */ + } /* if using default/minimized object headers */ HDassert(file == dset->oloc.file); @@ -1165,17 +1165,19 @@ H5D__build_file_prefix(const H5D_t *dset, H5F_prefix_open_t prefix_type, char ** if(H5F_PREFIX_VDS == prefix_type) { prefix = H5D_prefix_vds_env; - if(prefix == NULL || *prefix == '\0') + if(prefix == NULL || *prefix == '\0') { if(H5CX_get_vds_prefix(&prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get the prefix for vds file") - } /* end if */ + } + } else if(H5F_PREFIX_EFILE == prefix_type) { prefix = H5D_prefix_ext_env; - if(prefix == NULL || *prefix == '\0') + if(prefix == NULL || *prefix == '\0') { if(H5CX_get_ext_file_prefix(&prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get the prefix for the external file") - } /* end else-if */ + } + } else HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "prefix name is not sensible") @@ -1281,6 +1283,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Initialize the shared dataset space */ if(NULL == (new_dset->shared = H5D__new(dcpl_id, dapl_id, TRUE, has_vl_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* Copy & initialize datatype for dataset */ if(H5D__init_type(file, new_dset, type_id, type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't copy datatype") @@ -2033,7 +2036,7 @@ H5D_close(H5D_t *dataset) if(H5AC_cork(dataset->oloc.file, dataset->oloc.addr, H5AC__UNCORK, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNCORK, FAIL, "unable to uncork an object") - /* Release datatype, dataspace and creation and access property lists -- there isn't + /* Release datatype, dataspace, and creation and access property lists -- there isn't * much we can do if one of these fails, so we just continue. */ free_failed |= (H5I_dec_ref(dataset->shared->type_id) < 0) || diff --git a/src/H5FS.c b/src/H5FS.c index 4fe0927..6d574c0 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -36,7 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/test/freespace.c b/test/freespace.c index f9f1932..124ae3e 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -880,7 +880,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - /* Close the file and dxpl */ + /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -1249,7 +1249,7 @@ test_fs_sect_find(hid_t fapl) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - /* Close the file and dxpl */ + /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2737,7 +2737,7 @@ test_fs_sect_extend(hid_t fapl) PASSED(); - /* Close the file and dxpl */ + /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2839,7 +2839,7 @@ test_fs_sect_iterate(hid_t fapl) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - /* Close the file and dxpl */ + /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR -- cgit v0.12 From c6b836527f31a731e022083ebe1b9b18f8cdd29a Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 2 Jun 2020 14:34:00 -0500 Subject: Eliminate unneccesary creation of DXPL --- hl/src/H5DO.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 0fbdab3..66997cb 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -106,7 +106,6 @@ herr_t H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t memtype, const void *buf) { - hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */ hsize_t size[H5S_MAX_RANK]; /* The new size (after extension */ hsize_t old_size = 0; /* The size of the dimension to be extended */ int sndims; /* Number of dimensions in dataspace (signed) */ @@ -135,14 +134,10 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, if(H5I_DATASET != H5Iget_type(dset_id)) goto done; - /* If the user passed in a default DXPL, create one to pass to H5Dwrite() */ - if(H5P_DEFAULT == dxpl_id) { - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + /* If the user passed in a default DXPL, sanity check it */ + if(H5P_DEFAULT != dxpl_id) + if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) goto done; - created_dxpl = TRUE; - } /* end if */ - else if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) - goto done; /* Get the dataspace of the dataset */ if(FAIL == (space_id = H5Dget_space(dset_id))) @@ -240,12 +235,6 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, ret_value = SUCCEED; done: - /* Close dxpl if we created it vs. one was passed in */ - if(created_dxpl) { - if(H5Pclose(dxpl_id) < 0) - ret_value = FAIL; - } /* end if */ - /* Close old dataspace */ if(space_id != FAIL && H5Sclose(space_id) < 0) ret_value = FAIL; -- cgit v0.12 From f7bc306c19a3bd8f9a31a78d81a7bb5160bbbaf8 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 2 Jun 2020 15:53:58 -0500 Subject: Add files for adding warning flags for clang compilers in autotools configure. --- config/apple | 3 + config/clang-cxxflags | 218 +++++++++++++++++++++++++++++ config/clang-flags | 218 +++++++++++++++++++++++++++++ config/clang-warnings/cxx-error-general | 32 +++++ config/clang-warnings/cxx-general | 31 ++++ config/clang-warnings/no-developer-general | 2 +- config/linux-gnulibc1 | 21 +++ configure.ac | 52 +++++++ 8 files changed, 576 insertions(+), 1 deletion(-) create mode 100644 config/clang-cxxflags create mode 100644 config/clang-flags create mode 100644 config/clang-warnings/cxx-error-general create mode 100644 config/clang-warnings/cxx-general diff --git a/config/apple b/config/apple index 0b15dfe..aba48d1 100644 --- a/config/apple +++ b/config/apple @@ -49,6 +49,7 @@ fi # Figure out compiler flags . $srcdir/config/gnu-flags +. $srcdir/config/clang-flags # temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not # use -O option as it causes failures in test/dt_arith. case "$host_os" in @@ -155,11 +156,13 @@ esac # get c++ version info case $CXX in clang++) + . $srcdir/config/clang-cxxflags cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ grep 'Apple' | sed 's/(.*//'` ;; *g++*) + . $srcdir/config/gnu-cxxflags cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'` ;; diff --git a/config/clang-cxxflags b/config/clang-cxxflags new file mode 100644 index 0000000..c6b84c4 --- /dev/null +++ b/config/clang-cxxflags @@ -0,0 +1,218 @@ +# -*- shell-script -*- +# +# 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 COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. + + +# This file should be sourced into configure if the compiler is the +# Clang clang++ compiler or a derivative. It is careful not to do anything +# if the compiler is not Clang; otherwise 'cxx_flags_set' is set to 'yes' +# + +# +# For now, do not promote any warnings to errors. +# +PROMOTE_ERRORS_DFLT=no + +# +# This filter rewrites -Werror= as -W, in that way demoting warnings +# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# +demote_errors() +{ + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi +} + +# +# Prepend `$srcdir/config/clang-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_clang_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/clang-warnings/${arg} + done) + IFS=' ' echo "$*" +} +# Get the compiler version in a way that works for clang++ +# unless a compiler version is already known +# +# cxx_vendor: The compiler name: clang++ +# cxx_version: Version number: 6.0.0, 7.3.0, ... 10.0.1 +# +if test "X-" = "X-$cxx_flags_set"; then + # clang++ -v will return version number following "clang" on Linux machines, + # but on Macs the version number will follow "Apple LLVM version" + cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + if test -n "$cxx_version"; then + cxx_vendor="clang" + else + cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 |\ + grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`" + cxx_vendor="Apple LLVM" + fi + if test "X-" != "X-$cxx_version"; then + echo "compiler '$CXX' is $cxx_vendor-$cxx_version" + + # Get the compiler version numbers + cxx_vers_major=`echo $cxx_version | cut -f1 -d.` + cxx_vers_minor=`echo $cxx_version | cut -f2 -d.` + cxx_vers_patch=`echo $cxx_version | cut -f3 -d.` + test -n "$cxx_vers_major" || cxx_vers_major=0 + test -n "$cxx_vers_minor" || cxx_vers_minor=0 + test -n "$cxx_vers_patch" || cxx_vers_patch=0 + fi +fi + +if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then + echo "compiler '$CXX' is $cxx_vendor-$cxx_version" + ############################### + # Architecture-specific flags # + ############################### + + arch= + case "$host_os-$host_cpu" in + # FreeBSD sets the information from "uname -m" to the general machine + # architecture, not the specific CPU for the machine, so even our + # Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD + # machine, use the "sysctl" command to get the CPU hardware model. + freebsd*-i386) + host_cpu_model=`sysctl -n hw.model` + case "$host_cpu_model" in + # Hmm.. this might not catch Celerons, but it won't hurt them either... + *Pro*|*II*|*III*|*IV*|*Athlon*) + # architecture-specific optimizations cause problems + # for some users who build binaries to be used on + # multiple architectures. + # arch="-march=i686" + ;; + esac + ;; + + *-i686) + # architecture-specific optimizations cause problems + # for some users who build binaries to be used on + # multiple architectures. + # arch="-march=i686" + ;; + esac + + case "$host_os-$host_cpu" in + # cygwin needs the "-std=c99" flag removed, so make + # a specific case for Cygwin without the flag and a default + # case to add the flag everywhere else + cygwin-*) + ;; + + *) + H5_CXXFLAGS="$H5_CXXFLAGS -std=c++11" + ;; + esac + + H5_CXXFLAGS="$H5_CXXFLAGS $arch" + + ############## + # Production # + ############## + + # NDEBUG is handled explicitly by the configure script + if test $cxx_vers_major -le 4; then + PROD_CXXFLAGS= + else + PROD_CXXFLAGS="-fstdarg-opt" + fi + + ######### + # Debug # + ######### + + # NDEBUG is handled explicitly by the configure script + # -g is handled by the symbols flags + if test $cxx_vers_major -le 4; then + DEBUG_CXXFLAGS= + else + DEBUG_CXXFLAGS="-ftrapv -fno-common -fsanitize=address" + fi + + ########### + # Symbols # + ########### + + NO_SYMBOLS_CXXFLAGS="-s" + SYMBOLS_CXXFLAGS="-g -fno-omit-frame-pointer" + + ############# + # Profiling # + ############# + + PROFILE_CXXFLAGS="-pg" + + ################ + # Optimization # + ################ + + if test $cxx_vers_major -le 4; then + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS= + else + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS="-g" + fi + NO_OPT_CXXFLAGS="-O0" + + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -gt 4; then + H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" + fi +# if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -gt 4; then +# H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" +# fi + +echo "H5_CXXFLAGS: $H5_CXXFLAGS" + + ###################### + # Developer warnings # + ###################### + + NO_DEVELOPER_WARNING_CXXFLAGS=$(load_clang_arguments no-developer-general) + DEVELOPER_WARNING_CXXFLAGS=$(load_clang_arguments developer-general) + + ############################# + # Version-specific warnings # + ############################# + + + ################# + # Flags are set # + ################# + cxx_flags_set=yes +fi + +# Clear cxx info if no flags set +if test "X$cxx_flags_set" = "X"; then + cxx_vendor= + cxx_version= +fi + diff --git a/config/clang-flags b/config/clang-flags new file mode 100644 index 0000000..32c29d4 --- /dev/null +++ b/config/clang-flags @@ -0,0 +1,218 @@ +# -*- shell-script -*- +# +# 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 COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. + + +# This file should be sourced into configure if the compiler is the +# Clang compiler or a derivative. It is careful not to do anything +# if the compiler is not Clang; otherwise 'cc_flags_set' is set to 'yes' +# + +# +# For now, do not promote any warnings to errors. +# +PROMOTE_ERRORS_DFLT=no + +# +# This filter rewrites -Werror= as -W, in that way demoting warnings +# promoted to errors back to warnings, if PROMOTE_ERRORS is no. +# +demote_errors() +{ + if [ ${PROMOTE_ERRORS:-${PROMOTE_ERRORS_DFLT}} = no ]; then + sed 's,-Werror=,-W,g' + else + cat + fi +} + +# +# Prepend `$srcdir/config/clang-warnings/` to the filename suffix(es) given as +# subroutine argument(s), remove comments starting with # and ending +# at EOL, replace spans of whitespace (including newlines) with spaces, +# and re-emit the file(s) thus filtered on the standard output stream. +# +load_clang_arguments() +{ + set -- $(for arg; do + sed 's,#.*$,,' $srcdir/config/clang-warnings/${arg} + done) + IFS=' ' echo "$*" +} +# Get the compiler version in a way that works for clang +# unless a compiler version is already known +# +# cc_vendor: The compiler name: clang +# cc_version: Version number: 6.0.0, 7.3.0, ... 10.0.1 +# +if test "X-" = "X-$cc_flags_set"; then + # clang -v will return version number following "clang" on Linux machines, + # but on Macs the version number will follow "Apple LLVM version" + cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + if test -n "$cc_version"; then + cc_vendor="clang" + else + cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ + grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`" + cc_vendor="Apple LLVM" + fi + if test "X-" != "X-$cc_version"; then + echo "compiler '$CC' is $cc_vendor-$cc_version" + + # Get the compiler version numbers + cc_vers_major=`echo $cc_version | cut -f1 -d.` + cc_vers_minor=`echo $cc_version | cut -f2 -d.` + cc_vers_patch=`echo $cc_version | cut -f3 -d.` + test -n "$cc_vers_major" || cc_vers_major=0 + test -n "$cc_vers_minor" || cc_vers_minor=0 + test -n "$cc_vers_patch" || cc_vers_patch=0 + fi +fi + +if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then + echo "compiler '$CC' is $cc_vendor-$cc_version" + ############################### + # Architecture-specific flags # + ############################### + + arch= + case "$host_os-$host_cpu" in + # FreeBSD sets the information from "uname -m" to the general machine + # architecture, not the specific CPU for the machine, so even our + # Pentium II Xeon server is set to "i386". Once we know we are on a FreeBSD + # machine, use the "sysctl" command to get the CPU hardware model. + freebsd*-i386) + host_cpu_model=`sysctl -n hw.model` + case "$host_cpu_model" in + # Hmm.. this might not catch Celerons, but it won't hurt them either... + *Pro*|*II*|*III*|*IV*|*Athlon*) + # architecture-specific optimizations cause problems + # for some users who build binaries to be used on + # multiple architectures. + # arch="-march=i686" + ;; + esac + ;; + + *-i686) + # architecture-specific optimizations cause problems + # for some users who build binaries to be used on + # multiple architectures. + # arch="-march=i686" + ;; + esac + + case "$host_os-$host_cpu" in + # cygwin needs the "-std=c99" flag removed, so make + # a specific case for Cygwin without the flag and a default + # case to add the flag everywhere else + cygwin-*) + ;; + + *) + H5_CFLAGS="$H5_CFLAGS -std=c99" + ;; + esac + + H5_CFLAGS="$H5_CFLAGS $arch" + + ############## + # Production # + ############## + + # NDEBUG is handled explicitly by the configure script + if test $cc_vers_major -le 4; then + PROD_CFLAGS= + else + PROD_CFLAGS="-fstdarg-opt" + fi + + ######### + # Debug # + ######### + + # NDEBUG is handled explicitly by the configure script + # -g is handled by the symbols flags + if test $cc_vers_major -le 4; then + DEBUG_CFLAGS= + else + DEBUG_CFLAGS="-ftrapv -fno-common" + fi + + ########### + # Symbols # + ########### + + NO_SYMBOLS_CFLAGS="-s" + SYMBOLS_CFLAGS="-g" + + ############# + # Profiling # + ############# + + PROFILE_CFLAGS="-pg" + + ################ + # Optimization # + ################ + + if test $cc_vers_major -le 4; then + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS= + else + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS="-g" + fi + NO_OPT_CFLAGS="-O0" + + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -gt 4; then + H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)" + fi +# if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then +# H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)" +# fi + +echo "H5_CFLAGS: $H5_CFLAGS" + + ###################### + # Developer warnings # + ###################### + + NO_DEVELOPER_WARNING_CFLAGS=$(load_clang_arguments no-developer-general) + DEVELOPER_WARNING_CFLAGS=$(load_clang_arguments developer-general) + + ############################# + # Version-specific warnings # + ############################# + + + ################# + # Flags are set # + ################# + cc_flags_set=yes +fi + +# Clear cc info if no flags set +if test "X$cc_flags_set" = "X"; then + cc_vendor= + cc_version= +fi + diff --git a/config/clang-warnings/cxx-error-general b/config/clang-warnings/cxx-error-general new file mode 100644 index 0000000..85cd9a3 --- /dev/null +++ b/config/clang-warnings/cxx-error-general @@ -0,0 +1,32 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tcompound.cpp +# -Werror=cast-align +-Wcast-align +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp +# -Werror=missing-declarations +-Wmissing-declarations +-Werror=packed +-Werror=redundant-decls +-Werror=switch +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tattr.cpp +# -Werror=unused-but-set-variable +-Wunused-but-set-variable +-Werror=unused-function +-Werror=unused-variable +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp +# -Werror=unused-parameter +-Wunused-parameter +# +# Other files not compatible +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/titerate.cpp,c++/test/tarray.cpp +# -Werror=missing-declarations +# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp +# -Werror=unused-parameter diff --git a/config/clang-warnings/cxx-general b/config/clang-warnings/cxx-general new file mode 100644 index 0000000..9548cc0 --- /dev/null +++ b/config/clang-warnings/cxx-general @@ -0,0 +1,31 @@ +# Note that some of the flags listed here really should be developer +# flags (listed in separate files, gnu-warnings-developer*) but we put +# them here because they are not raised by the current code and we'd like to +# know if they do start showing up. +# +# NOTE: Don't add -Wpadded here since we can't/won't fix the (many) +# warnings that are emitted. If you need it, add it from the +# environment variable at configure time. +-Wall +-Wcast-qual +-Wconversion +-Wctor-dtor-privacy +-Weffc++ +-Wextra +-Wfloat-equal +-Wformat=2 +-Winit-self +-Winvalid-pch +-Wmissing-include-dirs +-Wno-format-nonliteral +-Wnon-virtual-dtor +-Wold-style-cast +-Woverloaded-virtual +-Wreorder +-Wshadow +-Wsign-promo +##-Wunreachable-code +-Wundef +##-Wvariadic-macros +-Wwrite-strings +-pedantic diff --git a/config/clang-warnings/no-developer-general b/config/clang-warnings/no-developer-general index 2f4e0c5..2bf1703 100644 --- a/config/clang-warnings/no-developer-general +++ b/config/clang-warnings/no-developer-general @@ -1 +1 @@ --Wmissing-noreturn +-Wno-missing-noreturn diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 39225e7..1a12006 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -42,6 +42,9 @@ fi # Figure out Intel C compiler flags . $srcdir/config/intel-flags +# Figure out Clang C compiler flags +. $srcdir/config/clang-flags + # Use default Fortran 90 compiler according to what C compiler is used. if test "X-" = "X-$FC"; then case $CC_BASENAME in @@ -61,6 +64,10 @@ if test "X-" = "X-$FC"; then FC=mpif90 FC_BASENAME=mpif90 ;; + clang*) + FC=gfortran + FC_BASENAME=gfortran + ;; esac else case $FC in @@ -194,6 +201,9 @@ fi # Figure out GNU CXX compiler flags . $srcdir/config/gnu-cxxflags +# Figure out Clang CXX compiler flags +. $srcdir/config/clang-cxxflags + # compiler version strings # check if the compiler_version_info is already set @@ -223,6 +233,17 @@ case $CC in sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'` ;; + *clang*) + # clang -v will return version number following "clang" on Linux machines, + # but on Macs the version number will follow "Apple LLVM version" + cc_version_info="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + else + cc_version_info="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ + grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`" + fi + ;; + *) echo "No match to get cc_version_info for $CC" ;; diff --git a/configure.ac b/configure.ac index db0cddf..50f823e 100644 --- a/configure.ac +++ b/configure.ac @@ -289,6 +289,58 @@ while test -n "$hname"; do test "$hname_tmp" = "$hname" && break done +## +## Enable/disable sanitizer checks for clang compilers, initially address sanitizer +## +AC_MSG_CHECKING([for clang sanitizer checks]) +AC_ARG_ENABLE([sanitize-checks], + [AS_HELP_STRING([--enable-sanitize-checks=address], + [(clang/clang++ compilers only) Enable sanitize checks. + Address is useful for detecting issues dealing with + memory. See AddressSanitizer in config/sanitizer/README.md + for more information. + [default=none] + ])], + [CLANG_SANITIZE_CHECKS=$enableval]) + +# Set default +if test "X-$CLANG_SANITIZE_CHECKS" = X- ; then + CLANG_SANITIZE_CHECKS=none +fi + +if test "X$CC_BASENAME" = "Xclang"; then + AC_SUBST([CLANG_SANITIZE_CHECKS]) + + ## These are all the packages that use H5*_DEBUG. + ## There is no harm in specifying a package not in this list; + ## you'll just get an unused H5_DEBUG symbol. + ## + ## Some packages that define debug checks or output are + ## too specialized or have huge performance hits. These + ## are not listed in the "all" packages list. + ## + ##all_packages="Address" + + case "X-$CLANG_SANITIZE_CHECKS" in + X-no|X-none) + CLANG_SANITIZE_CHECKS=none + CLANG_SANITIZE_LIST= + ;; + *) + CLANG_SANITIZE_LIST=$CLANG_SANITIZE_CHECKS + ;; + esac + AC_MSG_RESULT([$CLANG_SANITIZE_CHECKS]) + + ## Define H5*_DEBUG symbols that control package output + ## NOTE: No sanity checking done here! + if test -n "$CLANG_SANITIZE_LIST"; then + H5_CFLAGS="$H5_CFLAGS -fno-omit-frame-pointer" + for sanitizer in `echo $CLANG_SANITIZE_LIST`; do + H5_CFLAGS="$H5_CFLAGS -fsanitize=${sanitizer}" + done + fi +fi ## ---------------------------------------------------------------------- ## Determine build mode (debug, production, clean). -- cgit v0.12 From a0d9959b431fa21566ab6e3d83b8fbdbeb015c37 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 3 Jun 2020 23:07:14 -0700 Subject: Normalization of H5D.c with 1.10. --- src/H5D.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/H5D.c b/src/H5D.c index 37b3b39..3428d77 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -150,9 +150,9 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(NULL == (dset = H5VL_dataset_create(vol_obj, &loc_params, name, lcpl_id, type_id, space_id, dcpl_id, dapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset") - /* Get an atom for the dataset */ + /* Get an ID for the dataset */ if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize dataset handle") + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset") done: if(H5I_INVALID_HID == ret_value) @@ -315,7 +315,7 @@ done: * it. It is illegal to subsequently use that same dataset * ID in calls to other dataset functions. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -382,7 +382,7 @@ done: * * Purpose: Returns the status of dataspace allocation. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -719,8 +719,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, - hsize_t *size) +H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size) { H5VL_object_t *vol_obj; /* Dataset for this operation */ hbool_t supported; /* Whether 'get vlen buf size' operation is supported by VOL connector */ @@ -765,7 +764,7 @@ done: * Purpose: Modifies the dimensions of a dataset. * Can change to a smaller dimension. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success, negative on failure * *------------------------------------------------------------------------- */ @@ -802,7 +801,7 @@ done: * * Purpose: Flushes all buffers associated with a dataset. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success, negative on failure * *------------------------------------------------------------------------- */ @@ -840,7 +839,7 @@ done: * * Purpose: Refreshes all buffers associated with a dataset. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success, negative on failure * *------------------------------------------------------------------------- */ @@ -880,7 +879,7 @@ done: * For virtual: * No conversion * - * Return: SUCCEED/FAIL + * Return: Non-negative on success, negative on failure * * Programmer: Vailin Choi * Feb 2015 @@ -957,7 +956,7 @@ done: * Intended for use with the H5D(O)read_chunk API call so * the caller can construct an appropriate buffer. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success, negative on failure * * Programmer: Matthew Strong (GE Healthcare) * 20 October 2016 -- cgit v0.12 From e22d126639e139518e4b5f1ac35a008ec429f698 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 3 Jun 2020 23:34:16 -0700 Subject: Normalization of H5T.c with 1.10. --- src/H5T.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/H5T.c b/src/H5T.c index 5d3c4a1..47c4e4e 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1755,15 +1755,16 @@ H5Tcopy(hid_t obj_id) switch(H5I_get_type(obj_id)) { case H5I_DATATYPE: + /* The argument is a datatype handle */ if(NULL == (dt = (H5T_t *)H5I_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "type_id is not a datatype ID") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "obj_id is not a datatype ID") break; case H5I_DATASET: { H5VL_object_t *vol_obj = NULL; /* Dataset structure */ - /* Check args */ + /* The argument is a dataset handle */ if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(obj_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "type_id is not a dataset ID") @@ -1776,9 +1777,8 @@ H5Tcopy(hid_t obj_id) /* Unwrap the type ID */ if(NULL == (dt = (H5T_t *)H5I_object(dset_tid))) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5I_INVALID_HID, "received invalid datatype from the dataset") - - break; } + break; case H5I_UNINIT: case H5I_BADID: @@ -1802,7 +1802,7 @@ H5Tcopy(hid_t obj_id) /* Copy datatype */ if(NULL == (new_dt = H5T_copy(dt, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy"); /* Get an ID for the copied datatype */ if((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) @@ -2345,9 +2345,9 @@ H5T_get_super(const H5T_t *dt) HDassert(dt); if(!dt->shared->parent) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type"); if(NULL == (ret_value = H5T_copy(dt->shared->parent, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy parent data type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy parent data type"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -3222,7 +3222,7 @@ H5T__create(H5T_class_t type, size_t size) /* Copy the default string datatype */ if(NULL == (dt = H5T_copy(origin_dt, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); /* Modify the datatype */ if(H5T__set_size(dt, size) < 0) @@ -4000,7 +4000,7 @@ H5T_close_real(H5T_t *dt) /* Clean up resources, depending on shared state */ if(dt->shared->state != H5T_STATE_OPEN) { if(H5T__free(dt) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); } /* end if */ @@ -4094,7 +4094,7 @@ H5T_close(H5T_t *dt) /* Clean up resources */ if(H5T_close_real(dt) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to free datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to free datatype"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -4143,7 +4143,7 @@ H5T__set_size(H5T_t *dt, size_t size) if(dt->shared->parent) { if(H5T__set_size(dt->shared->parent, size) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for parent data type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for parent data type"); /* Adjust size of datatype appropriately */ if(dt->shared->type==H5T_ARRAY) @@ -4185,7 +4185,7 @@ H5T__set_size(H5T_t *dt, size_t size) size_t max_size; if((num_membs = H5T_get_nmembers(dt)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get number of members") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get number of members"); if(num_membs) { for(i = 0; i < (unsigned)num_membs; i++) { @@ -4199,7 +4199,7 @@ H5T__set_size(H5T_t *dt, size_t size) max_size = H5T__get_member_size(dt, max_index); if(size < (max_offset + max_size)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member ") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); } /* end if */ /* Compound must not have been packed previously */ @@ -4219,7 +4219,7 @@ H5T__set_size(H5T_t *dt, size_t size) /* Get a copy of unsigned char type as the base/parent type */ if(NULL == (base = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid base datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid base datatype"); dt->shared->parent=H5T_copy(base,H5T_COPY_ALL); /* change this datatype into a VL string */ @@ -4245,7 +4245,7 @@ H5T__set_size(H5T_t *dt, size_t size) /* Set up VL information */ if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY)<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location"); } /* end if */ else { prec = 8 * size; @@ -4261,7 +4261,7 @@ H5T__set_size(H5T_t *dt, size_t size) if(dt->shared->u.atomic.u.f.sign >= prec+offset || dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec+offset || dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec+offset) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first"); } break; @@ -4401,7 +4401,7 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) /* Build an index for each type so the names are sorted */ if(NULL == (idx1 = (unsigned *)H5MM_malloc(dt1->shared->u.compnd.nmembs * sizeof(unsigned))) || NULL == (idx2 = (unsigned *)H5MM_malloc(dt2->shared->u.compnd.nmembs * sizeof(unsigned)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed"); for(u = 0; u < dt1->shared->u.compnd.nmembs; u++) idx1[u] = idx2[u] = u; if(dt1->shared->u.enumer.nmembs > 1) { @@ -4487,7 +4487,7 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) /* Build an index for each type so the names are sorted */ if(NULL == (idx1 = (unsigned *)H5MM_malloc(dt1->shared->u.enumer.nmembs * sizeof(unsigned))) || NULL == (idx2 = (unsigned *)H5MM_malloc(dt2->shared->u.enumer.nmembs * sizeof(unsigned)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed"); for(u=0; ushared->u.enumer.nmembs; u++) idx1[u] = u; if(dt1->shared->u.enumer.nmembs > 1) { @@ -5661,7 +5661,7 @@ H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) /* Range check against compound member's offset */ if ((accum_change < 0) && ((ssize_t) dt->shared->u.compnd.memb[i].offset < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); /* Apply the accumulated size change to the offset of the field */ dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; @@ -5677,7 +5677,7 @@ H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) /* Mark the VL, compound, enum or array type */ if((changed = H5T_set_loc(memb_type, file, loc)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed > 0) ret_value = changed; @@ -5686,7 +5686,7 @@ H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) /* Fail if the old_size is zero */ if (0 == old_size) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "old_size of zero would cause division by zero") + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "old_size of zero would cause division by zero"); /* Adjust the size of the member */ dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size; @@ -5699,7 +5699,7 @@ H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) /* Range check against datatype size */ if ((accum_change < 0) && ((ssize_t) dt->shared->size < accum_change)) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); /* Apply the accumulated size change to the datatype */ dt->shared->size += (size_t) accum_change; @@ -5711,14 +5711,14 @@ H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ if(dt->shared->parent->shared->force_conv && H5T_IS_COMPLEX(dt->shared->parent->shared->type)) { if((changed = H5T_set_loc(dt->shared->parent, file, loc)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed > 0) ret_value = changed; } /* end if */ /* Mark this VL sequence */ if((changed = H5T__vlen_set_loc(dt, file, loc)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed > 0) ret_value = changed; break; -- cgit v0.12 From de54cff50c419751e0080b6a732facac43f87ba6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 5 Jun 2020 12:36:20 -0500 Subject: Detect when there's the same-shaped selection of a single block of elements on both selections, but with different selection types (i.e. one selection defined as an 'all' type and the other as a hyperslab or point type), without falling into the generic selection iteration case. --- src/H5Sselect.c | 9 +++++++++ test/tselect.c | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 56f14ba..1072d7d 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -1885,6 +1885,15 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2) space_a_dim--; } /* end while */ + + /* Check for a single block in each selection */ + if(H5S_SELECT_IS_SINGLE(space_a) && H5S_SELECT_IS_SINGLE(space_b)) { + /* If both selections are a single block and their bounds are + * the same, then the selections are the same, even if the + * selection types are different. + */ + HGOTO_DONE(TRUE) + } /* end if */ } /* end if */ /* If the dataspaces have the same selection type, use the selection's diff --git a/test/tselect.c b/test/tselect.c index 45806ae..aa0ab11 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -9388,15 +9388,15 @@ test_shape_same_dr__smoke_check_1(void) ** a "checker board" hyperslab as follows: ** ** * * - - * * - - * * -** * * - - * * - - * * -** - - * * - - * * - - -** - - * * - - * * - - ** * * - - * * - - * * -** * * - - * * - - * * -** - - * * - - * * - - -** - - * * - - * * - - +** - - * * - - * * - - +** - - * * - - * * - - +** * * - - * * - - * * +** * * - - * * - - * * +** - - * * - - * * - - +** - - * * - - * * - - +** * * - - * * - - * * ** * * - - * * - - * * -** * * - - * * - - * * ** ** where asterisks indicate selected elements, and dashes ** indicate unselected elements. -- cgit v0.12 From de9491e3651350969b2a75c602984a3786656dcb Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Sat, 6 Jun 2020 14:36:44 -0500 Subject: Add flags from config/clang-warnings/*general files to H5 C and CXX flags for all versions of Clang and Clang++ compilers. Switched from cut to awk in testcheck_version.sh.in to avoid dependence on tab vs. " " in version definitions in H5public.h. --- config/clang-cxxflags | 8 ++------ config/clang-flags | 8 ++------ config/clang-warnings/cxx-error-general | 32 -------------------------------- config/clang-warnings/cxx-general | 31 ------------------------------- config/linux-gnulibc1 | 1 + configure.ac | 26 ++++++++++++++------------ test/testcheck_version.sh.in | 6 +++--- 7 files changed, 22 insertions(+), 90 deletions(-) delete mode 100644 config/clang-warnings/cxx-error-general delete mode 100644 config/clang-warnings/cxx-general diff --git a/config/clang-cxxflags b/config/clang-cxxflags index c6b84c4..9c283cd 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -183,12 +183,8 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then # General # ########### - if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 2 -o $cxx_vers_major -gt 4; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" - fi -# if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -gt 4; then -# H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" -# fi + H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" + H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" echo "H5_CXXFLAGS: $H5_CXXFLAGS" diff --git a/config/clang-flags b/config/clang-flags index 32c29d4..e7ade49 100644 --- a/config/clang-flags +++ b/config/clang-flags @@ -183,12 +183,8 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then # General # ########### - if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 2 -o $cc_vers_major -gt 4; then - H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)" - fi -# if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then -# H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)" -# fi + H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)" + H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)" echo "H5_CFLAGS: $H5_CFLAGS" diff --git a/config/clang-warnings/cxx-error-general b/config/clang-warnings/cxx-error-general deleted file mode 100644 index 85cd9a3..0000000 --- a/config/clang-warnings/cxx-error-general +++ /dev/null @@ -1,32 +0,0 @@ -# -# HDF5 code should not trigger the following warnings under any -# circumstances, so ask the compiler to treat them as errors: -# -# NOTE: c++/test files are not compatible with these warnings as errors -# c++/test/tcompound.cpp -# -Werror=cast-align --Wcast-align -# NOTE: c++/src files are not compatible with these warnings as errors -# c++/src/H5Object.cpp -# -Werror=missing-declarations --Wmissing-declarations --Werror=packed --Werror=redundant-decls --Werror=switch -# NOTE: c++/test files are not compatible with these warnings as errors -# c++/test/tattr.cpp -# -Werror=unused-but-set-variable --Wunused-but-set-variable --Werror=unused-function --Werror=unused-variable -# NOTE: c++/src files are not compatible with these warnings as errors -# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp -# -Werror=unused-parameter --Wunused-parameter -# -# Other files not compatible -# NOTE: c++/test files are not compatible with these warnings as errors -# c++/test/titerate.cpp,c++/test/tarray.cpp -# -Werror=missing-declarations -# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp -# -Werror=unused-parameter diff --git a/config/clang-warnings/cxx-general b/config/clang-warnings/cxx-general deleted file mode 100644 index 9548cc0..0000000 --- a/config/clang-warnings/cxx-general +++ /dev/null @@ -1,31 +0,0 @@ -# Note that some of the flags listed here really should be developer -# flags (listed in separate files, gnu-warnings-developer*) but we put -# them here because they are not raised by the current code and we'd like to -# know if they do start showing up. -# -# NOTE: Don't add -Wpadded here since we can't/won't fix the (many) -# warnings that are emitted. If you need it, add it from the -# environment variable at configure time. --Wall --Wcast-qual --Wconversion --Wctor-dtor-privacy --Weffc++ --Wextra --Wfloat-equal --Wformat=2 --Winit-self --Winvalid-pch --Wmissing-include-dirs --Wno-format-nonliteral --Wnon-virtual-dtor --Wold-style-cast --Woverloaded-virtual --Wreorder --Wshadow --Wsign-promo -##-Wunreachable-code --Wundef -##-Wvariadic-macros --Wwrite-strings --pedantic diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 1a12006..055b075 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -65,6 +65,7 @@ if test "X-" = "X-$FC"; then FC_BASENAME=mpif90 ;; clang*) + # clang has no fortran compiler. Use gfortran. FC=gfortran FC_BASENAME=gfortran ;; diff --git a/configure.ac b/configure.ac index 50f823e..cf1e463 100644 --- a/configure.ac +++ b/configure.ac @@ -311,16 +311,8 @@ fi if test "X$CC_BASENAME" = "Xclang"; then AC_SUBST([CLANG_SANITIZE_CHECKS]) - ## These are all the packages that use H5*_DEBUG. - ## There is no harm in specifying a package not in this list; - ## you'll just get an unused H5_DEBUG symbol. - ## - ## Some packages that define debug checks or output are - ## too specialized or have huge performance hits. These - ## are not listed in the "all" packages list. - ## - ##all_packages="Address" - + # There are several sanitizer tools. At present we are testing + # and describing only -fsanitizer=address with autotools. case "X-$CLANG_SANITIZE_CHECKS" in X-no|X-none) CLANG_SANITIZE_CHECKS=none @@ -332,8 +324,18 @@ if test "X$CC_BASENAME" = "Xclang"; then esac AC_MSG_RESULT([$CLANG_SANITIZE_CHECKS]) - ## Define H5*_DEBUG symbols that control package output - ## NOTE: No sanity checking done here! + # Other tools can be added to the list of checks + # The clang compiler doesn't support some of them; they should be + # checked before adding them to the list in the help message. + # The sanitizers/sanitizers.cmake file lists these options: + # address, memory, memoryWithOrigins, undefined, thread, leak, + # 'address;undefined'. Which and which combinations of these are + # supported varies by compiler version, but unsupported options + # or combinations will result in configure errors reported in config.log. + # Comma separated lists of sanitize options wil be entered intact in + # one -fsanitize= flag. Space separated lists will be entered in + # separate -fsanitize= flags. + # NOTE: No sanity checking done here! if test -n "$CLANG_SANITIZE_LIST"; then H5_CFLAGS="$H5_CFLAGS -fno-omit-frame-pointer" for sanitizer in `echo $CLANG_SANITIZE_LIST`; do diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in index 836170d..0c2c4cd 100644 --- a/test/testcheck_version.sh.in +++ b/test/testcheck_version.sh.in @@ -216,9 +216,9 @@ h5libsettings=../src/libhdf5.settings PURPOSE # Figure out library version numbers from the header file. -h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | cut -f2` -h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | cut -f2` -h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | cut -f2` +h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | awk '{print $3}'` +h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | awk '{print $3}'` +h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | awk '{print $3}'` DEBUGPRINT $h5versmajor.$h5versminor.$h5versrelease case "$h5versmajor$h5versminor$h5versrelease" in [0-9]*) # good. noop. -- cgit v0.12 From 87695c999ad7ea348ee6dc03b46b0bd345f7d7df Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 7 Jun 2020 03:12:36 -0700 Subject: Minor normalizations with HDF5 1.10. --- src/H5F.c | 63 ++++++++++++++++++++++++-------------------------------- src/H5Fint.c | 4 ++-- src/H5Fprivate.h | 11 +++++----- src/H5Fquery.c | 1 + src/H5MF.c | 3 ++- src/H5PB.c | 2 +- 6 files changed, 38 insertions(+), 46 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index 1a9bab5..3dbd292 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -280,7 +280,7 @@ H5Fget_create_plist(hid_t file_id) /* Retrieve the file creation property list */ if(H5VL_file_get(vol_obj, H5VL_FILE_GET_FCPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "unable to retrieve file creation properties") + HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, H5I_INVALID_HID, "unable to retrieve file creation properties") done: FUNC_LEAVE_API(ret_value) @@ -320,7 +320,7 @@ H5Fget_access_plist(hid_t file_id) /* Retrieve the file's access property list */ if(H5VL_file_get(vol_obj, H5VL_FILE_GET_FAPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get file access property list") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't get file access property list") done: FUNC_LEAVE_API(ret_value) @@ -584,8 +584,8 @@ done: * * Purpose: Check if the file can be opened with the given fapl. * - * Return: Succeed: TRUE/FALSE - * Failure: FAIL (includes file does not exist) + * Return: Success: TRUE/FALSE + * Failure: -1 (includes file does not exist) * *------------------------------------------------------------------------- */ @@ -820,8 +820,7 @@ done: * not remove them from the cache. The OBJECT_ID can be a file, * dataset, group, attribute, or named data type. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -863,8 +862,8 @@ done: * closed until those objects are closed; however, all data for * the file and the open objects is flushed. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -879,11 +878,9 @@ H5Fclose(hid_t file_id) if(H5I_FILE != H5I_get_type(file_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file ID") - /* Decrement reference count on atom. When it reaches zero the file will - * be closed. - */ + /* Close the file */ if(H5I_dec_app_ref(file_id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed") done: FUNC_LEAVE_API(ret_value) @@ -1011,8 +1008,7 @@ done: * Purpose: Public API to retrieve the file's 'intent' flags passed * during H5Fopen() * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1117,8 +1113,8 @@ done: * is called after an existing file is opened in order * to learn the true size of the underlying file. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1622,14 +1618,14 @@ done: * set up flush dependency/proxy even for file opened without * SWMR to resolve issues with opened objects. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/negative on failure * *------------------------------------------------------------------------- */ herr_t H5Fstart_swmr_write(hid_t file_id) { - H5VL_object_t *vol_obj = NULL; /* File info */ + H5VL_object_t *vol_obj = NULL; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1658,8 +1654,7 @@ done: * Purpose: Start metadata cache logging operations for a file. * - Logging must have been set up via the fapl. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on errors *------------------------------------------------------------------------- */ herr_t @@ -1691,8 +1686,7 @@ done: * - Does not close the log file. * - Logging must have been set up via the fapl. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on errors *------------------------------------------------------------------------- */ herr_t @@ -1724,8 +1718,7 @@ done: * set up via the fapl. is_currently_logging determines if * log messages are being recorded at this time. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on errors *------------------------------------------------------------------------- */ herr_t @@ -1759,8 +1752,7 @@ done: * H5Fset_latest_format() starting release 1.10.2. * See explanation for H5Fset_latest_format() in H5Fdeprec.c. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1796,8 +1788,7 @@ done: * downgrade persistent file space to non-persistent * for 1.8 library. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1831,8 +1822,7 @@ done: * * Purpose: Resets statistics for the page buffer layer. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1862,8 +1852,7 @@ done: * * Purpose: Retrieves statistics for the page buffer layer. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1901,8 +1890,7 @@ done: * image_len: --size of the on disk metadata cache image * --zero if no cache image * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1934,7 +1922,10 @@ done: * allocated memory in the file. * (See H5FDget_eoa() in H5FD.c) * - * Return: SUCCEED/FAIL + * Return: Success: First byte after allocated memory. + * Failure: HADDR_UNDEF + * + * Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1967,7 +1958,7 @@ done: * * Purpose: Set the EOA for the file to the maximum of (EOA, EOF) + increment * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on errors *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Fint.c b/src/H5Fint.c index d50baad..0bda894 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1138,7 +1138,7 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTDEC, NULL, "can't close property list") f->shared = H5FL_FREE(H5F_shared_t, f->shared); - } /* end if */ + } /* Free VOL object */ if(f->vol_obj) @@ -1146,7 +1146,7 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTDEC, NULL, "unable to free VOL object") f = H5FL_FREE(H5F_t, f); - } /* end if */ + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__new() */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index fbb164d..c5d4c89 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -25,15 +25,15 @@ typedef struct H5F_t H5F_t; #include "H5Fpublic.h" /* Public headers needed by this file */ -#include "H5FDpublic.h" /* File drivers */ +#include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_PARALLEL -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ #endif /* H5_HAVE_PARALLEL */ -#include "H5VMprivate.h" /* Vectors and arrays */ -#include "H5VLprivate.h" /* Virtual Object Layer */ +#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VLprivate.h" /* Virtual Object Layer */ /**************************/ @@ -795,7 +795,6 @@ H5_DLL hsize_t H5F_get_alignment(const H5F_t *f); H5_DLL hsize_t H5F_get_threshold(const H5F_t *f); #ifdef H5_HAVE_PARALLEL H5_DLL H5P_coll_md_read_flag_t H5F_coll_md_read(const H5F_t *f); -H5_DLL void H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t flag); #endif /* H5_HAVE_PARALLEL */ H5_DLL hbool_t H5F_use_mdc_logging(const H5F_t *f); H5_DLL hbool_t H5F_start_mdc_log_on_access(const H5F_t *f); diff --git a/src/H5Fquery.c b/src/H5Fquery.c index db01dac..e1b11c8 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -229,6 +229,7 @@ H5F_get_extpath(const H5F_t *f) FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); + HDassert(f->shared); HDassert(f->shared->extpath); FUNC_LEAVE_NOAPI(f->shared->extpath) diff --git a/src/H5MF.c b/src/H5MF.c index 5c31f19..fac6620 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -1137,10 +1137,11 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN /* If it's metadata, check if the space to free intersects with the file's * metadata accumulator */ - if(H5FD_MEM_DRAW != alloc_type) + if(H5FD_MEM_DRAW != alloc_type) { /* Check if the space to free intersects with the file's metadata accumulator */ if(H5F__accum_free(f->shared, alloc_type, addr, size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't check free space intersection w/metadata accumulator") + } /* end if */ /* Check if the free space manager for the file has been initialized */ if(!f->shared->fs_man[fs_type]) { diff --git a/src/H5PB.c b/src/H5PB.c index 8ac863e..907fe82 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -314,7 +314,7 @@ H5PB_create(H5F_shared_t *f_sh, size_t size, unsigned page_buf_min_meta_perc, un /* Allocate the new page buffering structure */ if(NULL == (page_buf = H5FL_CALLOC(H5PB_t))) - HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "memory allocation failed") page_buf->max_size = size; H5_CHECKED_ASSIGN(page_buf->page_size, size_t, f_sh->fs_page_size, hsize_t); -- cgit v0.12 From b942a4d8a3e27317cac50ce37ff5302d477664d8 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 8 Jun 2020 15:52:13 -0500 Subject: Clean up code to get clang version in config/linux-gnulibc1 --- config/linux-gnulibc1 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 055b075..a6f81ff 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -235,14 +235,8 @@ case $CC in ;; *clang*) - # clang -v will return version number following "clang" on Linux machines, - # but on Macs the version number will follow "Apple LLVM version" - cc_version_info="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ + cc_version_info="`$CC $CFLAGS $H5_CFLAGS --version 2>&1 |\ grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" - else - cc_version_info="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ - grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`" - fi ;; *) @@ -339,6 +333,11 @@ case $CXX in cxx_version_info=`echo $cxx_version_info` ;; + *clang++*) + cxx_version_info="`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + ;; + *) echo "No match to get cxx_version_info for $CXX" ;; -- cgit v0.12 From 9e8899c3b47a2041242dc4539ca8b1c5e151a371 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 9 Jun 2020 15:48:14 -0500 Subject: Remove redundant metadata cache tagging from some low-level internal chunk functions. The metadata cache tagging has already been done by routines further up the call stack. --- src/H5Dchunk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 90516c6..5fda3c0 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -3351,7 +3351,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dset->oloc.addr) + FUNC_ENTER_STATIC HDassert(dset); HDassert(dset->shared); @@ -3515,7 +3515,7 @@ done: ((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS) ? NULL : &(dset->shared->dcpl_cache.pline))); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_flush_entry() */ @@ -4350,7 +4350,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -4754,7 +4754,7 @@ done: H5MM_free(chunk_info.addr); #endif - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_allocate() */ -- cgit v0.12 From 32c353ed4360630646e0bfd40387aa7b4fd403ea Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 9 Jun 2020 16:12:31 -0500 Subject: Update new clang files to not pick up clang as vendor for pgCC. Add new files to MANIFEST Temporary demotion of 2 -Werror warning flags that fail on macos 10.12 Remove Production flag unknown to Apple clang. --- MANIFEST | 2 ++ config/clang-cxxflags | 13 +++++-------- config/clang-flags | 13 +++++-------- config/clang-warnings/error-general | 9 +++++++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/MANIFEST b/MANIFEST index d9d8ab8..11f2926 100644 --- a/MANIFEST +++ b/MANIFEST @@ -119,6 +119,8 @@ ./config/apple ./config/cce-fflags ./config/cce-flags +./config/clang-cxxflags +./config/clang-flags ./config/commence.am ./config/conclude.am ./config/conclude_fc.am diff --git a/config/clang-cxxflags b/config/clang-cxxflags index 9c283cd..188570e 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -64,10 +64,11 @@ if test "X-" = "X-$cxx_flags_set"; then else cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 |\ grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`" - cxx_vendor="Apple LLVM" + if test -n "$cxx_version"; then + cxx_vendor="Apple LLVM" + fi fi if test "X-" != "X-$cxx_version"; then - echo "compiler '$CXX' is $cxx_vendor-$cxx_version" # Get the compiler version numbers cxx_vers_major=`echo $cxx_version | cut -f1 -d.` @@ -131,11 +132,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then ############## # NDEBUG is handled explicitly by the configure script - if test $cxx_vers_major -le 4; then - PROD_CXXFLAGS= - else - PROD_CXXFLAGS="-fstdarg-opt" - fi + PROD_CXXFLAGS= ######### # Debug # @@ -153,7 +150,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then # Symbols # ########### - NO_SYMBOLS_CXXFLAGS="-s" + NO_SYMBOLS_CXXFLAGS= SYMBOLS_CXXFLAGS="-g -fno-omit-frame-pointer" ############# diff --git a/config/clang-flags b/config/clang-flags index e7ade49..18ec5f6 100644 --- a/config/clang-flags +++ b/config/clang-flags @@ -64,10 +64,11 @@ if test "X-" = "X-$cc_flags_set"; then else cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ grep 'Apple LLVM version' | sed 's/.*Apple LLVM version \([-a-z0-9\.]*\).*/\1/'`" - cc_vendor="Apple LLVM" + if test -n "$cc_version"; then + cc_vendor="Apple LLVM" + fi fi if test "X-" != "X-$cc_version"; then - echo "compiler '$CC' is $cc_vendor-$cc_version" # Get the compiler version numbers cc_vers_major=`echo $cc_version | cut -f1 -d.` @@ -131,11 +132,7 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then ############## # NDEBUG is handled explicitly by the configure script - if test $cc_vers_major -le 4; then - PROD_CFLAGS= - else - PROD_CFLAGS="-fstdarg-opt" - fi + PROD_CFLAGS= ######### # Debug # @@ -153,7 +150,7 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then # Symbols # ########### - NO_SYMBOLS_CFLAGS="-s" + NO_SYMBOLS_CFLAGS= SYMBOLS_CFLAGS="-g" ############# diff --git a/config/clang-warnings/error-general b/config/clang-warnings/error-general index a9aa516..558d740 100644 --- a/config/clang-warnings/error-general +++ b/config/clang-warnings/error-general @@ -4,15 +4,20 @@ # -Werror=bad-function-cast -Werror=implicit-function-declaration --Werror=incompatible-pointer-types +#-Werror=incompatible-pointer-types -Werror=missing-declarations -Werror=packed -Werror=shadow --Werror=sometimes-uninitialized +#-Werror=sometimes-uninitialized -Werror=switch # #-Werror=discarded-qualifiers # +# Note: For macos 10.12, etc +# H5Dint.c,H5Dchunk.c,H5Gint.c +# -Wincompatible-pointer-types-discards-qualifiers +# # H5Dvirtual.c,H5SL.c +# -Wsometimes-uninitialized # # NOTE: File Driver files are not compatible with these warnings as errors # H5FDdirect.c,H5FDmpio.c,H5FDros3.c, -- cgit v0.12 From a8a4e9f27b67ae2e22970e42859225adcc2e5cbb Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 9 Jun 2020 16:24:48 -0500 Subject: Eliminate allocating file & memory offset & length arrays when performing I/O on a single element. --- src/H5Dselect.c | 59 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/src/H5Dselect.c b/src/H5Dselect.c index a843d93..c5469c2 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -113,51 +113,38 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, HDassert(io_info->store); HDassert(io_info->u.rbuf); - /* Get info from API context */ - if(H5CX_get_vec_size(&dxpl_vec_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") - - /* Allocate the vector I/O arrays */ - if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) - vec_size = dxpl_vec_size; - else - vec_size = H5D_IO_VECTOR_SIZE; - if(NULL == (mem_len = H5FL_SEQ_MALLOC(size_t, vec_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O length vector array") - if(NULL == (mem_off = H5FL_SEQ_MALLOC(hsize_t, vec_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O offset vector array") - if(NULL == (file_len = H5FL_SEQ_MALLOC(size_t, vec_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O length vector array") - if(NULL == (file_off = H5FL_SEQ_MALLOC(hsize_t, vec_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O offset vector array") - /* Check for only one element in selection */ if(nelmts == 1) { + hsize_t single_mem_off; /* Offset in memory */ + hsize_t single_file_off; /* Offset in the file */ + size_t single_mem_len; /* Length in memory */ + size_t single_file_len; /* Length in the file */ + /* Get offset of first element in selections */ - if(H5S_SELECT_OFFSET(file_space, file_off) < 0) + if(H5S_SELECT_OFFSET(file_space, &single_file_off) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "can't retrieve file selection offset") - if(H5S_SELECT_OFFSET(mem_space, mem_off) < 0) + if(H5S_SELECT_OFFSET(mem_space, &single_mem_off) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "can't retrieve memory selection offset") /* Set up necessary information for I/O operation */ file_nseq = mem_nseq = 1; curr_mem_seq = curr_file_seq = 0; - *file_off *= elmt_size; - *mem_off *= elmt_size; - *file_len = *mem_len = elmt_size; + single_file_off *= elmt_size; + single_mem_off *= elmt_size; + single_file_len = single_mem_len = elmt_size; /* Perform I/O on memory and file sequences */ if(io_info->op_type == H5D_IO_OP_READ) { if((tmp_file_len = (*io_info->layout_ops.readvv)(io_info, - file_nseq, &curr_file_seq, file_len, file_off, - mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) + file_nseq, &curr_file_seq, &single_file_len, &single_file_off, + mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") } /* end if */ else { HDassert(io_info->op_type == H5D_IO_OP_WRITE); if((tmp_file_len = (*io_info->layout_ops.writevv)(io_info, - file_nseq, &curr_file_seq, file_len, file_off, - mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) + file_nseq, &curr_file_seq, &single_file_len, &single_file_off, + mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") } /* end else */ @@ -168,6 +155,24 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, size_t mem_nelem; /* Number of elements used in memory sequences */ size_t file_nelem; /* Number of elements used in file sequences */ + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + + /* Allocate the vector I/O arrays */ + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; + else + vec_size = H5D_IO_VECTOR_SIZE; + if(NULL == (mem_len = H5FL_SEQ_MALLOC(size_t, vec_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O length vector array") + if(NULL == (mem_off = H5FL_SEQ_MALLOC(hsize_t, vec_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O offset vector array") + if(NULL == (file_len = H5FL_SEQ_MALLOC(size_t, vec_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O length vector array") + if(NULL == (file_off = H5FL_SEQ_MALLOC(hsize_t, vec_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O offset vector array") + /* Allocate the iterators */ if(NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate memory iterator") -- cgit v0.12 From 0ef32f07fb9e8fb6063f3318425506047454d6f4 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 9 Jun 2020 18:38:04 -0500 Subject: Remember the info for the last ID looked up for a given ID type. --- src/H5I.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/H5I.c b/src/H5I.c index 2ef3601..1752e5e 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -67,6 +67,7 @@ typedef struct { unsigned init_count; /* # of times this type has been initialized*/ uint64_t id_count; /* Current number of IDs held */ uint64_t nextid; /* ID to use for the next atom */ + H5I_id_info_t *last_info; /* Info for most recent ID looked up */ H5SL_t *ids; /* Pointer to skip list that stores IDs */ } H5I_id_type_t; @@ -318,6 +319,7 @@ H5I_register_type(const H5I_class_t *cls) type_ptr->cls = cls; type_ptr->id_count = 0; type_ptr->nextid = cls->reserved; + type_ptr->last_info = NULL; if(NULL == (type_ptr->ids = H5SL_create(H5SL_TYPE_HID, NULL))) HGOTO_ERROR(H5E_ATOM, H5E_CANTCREATE, FAIL, "skip list creation failed") } /* end if */ @@ -807,6 +809,9 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) /* Sanity check for the 'nextid' getting too large and wrapping around */ HDassert(type_ptr->nextid <= ID_MASK); + /* Set the most recent ID to this object */ + type_ptr->last_info = id_ptr; + /* Set return value */ ret_value = new_id; @@ -878,6 +883,9 @@ H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, h HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") type_ptr->id_count++; + /* Set the most recent ID to this object */ + type_ptr->last_info = id_ptr; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_using_existing_id() */ @@ -1236,6 +1244,10 @@ H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id) if(NULL == (curr_id = (H5I_id_info_t *)H5SL_remove(type_ptr->ids, &id))) HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node from skip list") + /* Check if this ID was the last one accessed */ + if(type_ptr->last_info == curr_id) + type_ptr->last_info = NULL; + ret_value = (void *)curr_id->obj_ptr; /* (Casting away const OK -QAK) */ curr_id = H5FL_FREE(H5I_id_info_t, curr_id); @@ -2185,8 +2197,16 @@ H5I__find_id(hid_t id) if(!type_ptr || type_ptr->init_count <= 0) HGOTO_DONE(NULL) - /* Locate the ID node for the ID */ - ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id); + /* Check for same ID as we have looked up last time */ + if(type_ptr->last_info && type_ptr->last_info->id == id) + ret_value = type_ptr->last_info; + else { + /* Locate the ID node for the ID */ + ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id); + + /* Remember this ID */ + type_ptr->last_info = ret_value; + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -- cgit v0.12 From e66cec622200dbb9c785ef4dae30c780a70a2b1a Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 9 Jun 2020 22:11:25 -0500 Subject: HDFFV-11000: update-testh5cc.sh.in to test sample versioned functions in HDF5 1.10, 1.12 and develop. --- examples/testh5cc.sh.in | 117 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 3 deletions(-) diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index 9f766dd..432a2cb 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -48,6 +48,10 @@ verbose=${HDF5_VERBOSE:-1} # 0: none; 1: default; 2: chatty; 3: everything test $verbose -gt 2 && set -x H5_NO_DEPRECATED_SYMBOLS=`grep '#define H5_NO_DEPRECATED_SYMBOLS ' ../src/H5pubconf.h` H5_USE_16_API_DEFAULT=`grep '#define H5_USE_16_API_DEFAULT ' ../src/H5pubconf.h` +H5_USE_18_API_DEFAULT=`grep '#define H5_USE_18_API_DEFAULT ' ../src/H5pubconf.h` +H5_USE_110_API_DEFAULT=`grep '#define H5_USE_110_API_DEFAULT ' ../src/H5pubconf.h` +H5_USE_112_API_DEFAULT=`grep '#define H5_USE_112_API_DEFAULT ' ../src/H5pubconf.h` +H5_USE_114_API_DEFAULT=`grep '#define H5_USE_114_API_DEFAULT ' ../src/H5pubconf.h` # setup my machine information. myos=`uname -s` @@ -61,6 +65,10 @@ v16main=${H5TOOL}_v16main.$suffix v16main_o=${H5TOOL}_v16main.o v18main=${H5TOOL}_v18main.$suffix v18main_o=${H5TOOL}_v18main.o +v110main=${H5TOOL}_v110main.$suffix +v110main_o=${H5TOOL}_v110main.o +v112main=${H5TOOL}_v112main.$suffix +v112main_o=${H5TOOL}_v112main.o appmain=${H5TOOL}_appmain.$suffix appmain_o=${H5TOOL}_appmain.o prog1=${H5TOOL}_prog1.$suffix @@ -74,7 +82,7 @@ applib=libapp${H5TOOL}.a # Don't use the wildcard form of *.h5 as it will wipe out even *.h5 generated # by otehr test programs. This will cause a racing condition error when # parallel make (e.g., gmake -j 4) is used. -temp_SRC="$hdf5main $v16main $v18main $appmain $prog1 $prog2" +temp_SRC="$hdf5main $v16main $v18main $v110main $v112main $appmain $prog1 $prog2" temp_OBJ=`echo $temp_SRC | sed -e "s/\.${suffix}/.o/g"` temp_FILES="a.out $applib" @@ -196,6 +204,82 @@ main (void) } EOF +# Generate HDF5 v1.10 Main Program: +# This makes unique V1.10 API calls. +cat > $v110main < $v112main < Date: Wed, 10 Jun 2020 09:41:07 -0500 Subject: Add tests for all version to H5_NO_DEPRECATED_SYMBOLS section and to section for current version, with and without default API version flags. --- examples/testh5cc.sh.in | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index 432a2cb..71e84ed 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -388,12 +388,17 @@ TOOLTEST -E $appmain $prog1 $prog2 # Group5: Version compatibility tests. echo "***"Version compatibility tests. -# Test these two cases now. More later. +# 20200610 Updated for versions 1.10 - 1.14. # If H5_NO_DEPRECATED_SYMBOLS; -# then only v18main works. +# then versions v18main, v110main, and v112main work. +# -DH5_USE__API_DEFAULT flags cannot be used with H5_NO_DEPRECATED_SYMBOLS; # else if H5_USE_16_API_DEFAULT; # then v16main works. # else v18main works and -DH5_USE_16_API_DEFAULT v16main also works. +# as new versions with versioned functions are added, they will work with and +# should be added to H5_NO_DEPRECATED_SYMBOLS and to the else section, with and +# without the -DH5_USE__API_DEFAULT flag. A new H5_USE__API_DEFAULT section +# should also be added. # if [ -n "$H5_USE_16_API_DEFAULT" ]; then echo "H5_USE_16_API_DEFAULT is defined." @@ -416,6 +421,9 @@ fi if [ -n "$H5_NO_DEPRECATED_SYMBOLS" ]; then echo "Skipping $v16main test" TOOLTEST $v18main + TOOLTEST $v18main + TOOLTEST $v110main + TOOLTEST $v112main elif [ -n "$H5_USE_16_API_DEFAULT" ]; then echo "Testing HDF5 with 16_API_DEFAULT" TOOLTEST $v16main @@ -440,6 +448,9 @@ else TOOLTEST -DH5_USE_18_API_DEFAULT $v18main TOOLTEST -DH5_USE_110_API_DEFAULT $v110main TOOLTEST -DH5_USE_112_API_DEFAULT $v112main + TOOLTEST $v18main + TOOLTEST $v110main + TOOLTEST $v112main fi ############################################################################## -- cgit v0.12 From 1e038bf49588d163762965c7a15fb76e3a689ef2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 10 Jun 2020 11:40:59 -0700 Subject: Fix MANIFEST --- MANIFEST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST b/MANIFEST index d9d8ab8..e3c3c50 100644 --- a/MANIFEST +++ b/MANIFEST @@ -145,6 +145,8 @@ ./config/solaris #warnings files for both autotools and CMake +./config/clang-cxxflags +./config/clang-flags ./config/clang-warnings/developer-general ./config/clang-warnings/error-general ./config/clang-warnings/general -- cgit v0.12 From 77efb340a1b06465587ca9dd4599271409a86a44 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 10 Jun 2020 14:25:10 -0500 Subject: Make changes to CMake CompilerFlags.cmake files so extra flags are loaded for non-GNU compilers. --- config/clang-warnings/developer-general | 1 + config/clang-warnings/error-general | 12 +++---- config/cmake/HDFCXXCompilerFlags.cmake | 56 ++++++++++++++------------------- config/cmake/HDFCompilerFlags.cmake | 26 +++++---------- 4 files changed, 35 insertions(+), 60 deletions(-) diff --git a/config/clang-warnings/developer-general b/config/clang-warnings/developer-general index aa8c32e..74d8404 100644 --- a/config/clang-warnings/developer-general +++ b/config/clang-warnings/developer-general @@ -1,3 +1,4 @@ -Wformat-nonliteral -Wmissing-noreturn +-Wsometimes-uninitialized -Wswitch-enum diff --git a/config/clang-warnings/error-general b/config/clang-warnings/error-general index 558d740..883dff7 100644 --- a/config/clang-warnings/error-general +++ b/config/clang-warnings/error-general @@ -4,20 +4,16 @@ # -Werror=bad-function-cast -Werror=implicit-function-declaration -#-Werror=incompatible-pointer-types +-Werror=incompatible-pointer-types -Werror=missing-declarations -Werror=packed -Werror=shadow -#-Werror=sometimes-uninitialized -Werror=switch # -#-Werror=discarded-qualifiers +# NOTE: Following files are not compatible with incompatible-pointer-types as errors +# src/H5Dchunk.c,src/H5Dint.c,src/H5Gint.c,src/H5HFcache.c,src/H5I.c,src/H5T.c +-Wno-error=incompatible-pointer-types-discards-qualifiers # -# Note: For macos 10.12, etc -# H5Dint.c,H5Dchunk.c,H5Gint.c -# -Wincompatible-pointer-types-discards-qualifiers -# # H5Dvirtual.c,H5SL.c -# -Wsometimes-uninitialized # # NOTE: File Driver files are not compatible with these warnings as errors # H5FDdirect.c,H5FDmpio.c,H5FDros3.c, diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 8527327..7bbebbc 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -40,7 +40,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) # warning level is given, so remove it. if (MSVC) set (HDF5_WARNINGS_BLOCKED 1) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_LOADED) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") endif () @@ -51,7 +51,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) # Most compilers use -w to suppress warnings. if (NOT HDF5_WARNINGS_BLOCKED) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_LOADED) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") endif () endif () @@ -65,7 +65,7 @@ endif () # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -if (NOT MSVC) +if (NOT MSVC AND NOT MINGW) if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP") else () @@ -194,7 +194,9 @@ if (NOT MSVC) endif () endif () else () + if (NOT MINGW) list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc") + endif () endif () #----------------------------------------------------------------------------- @@ -204,21 +206,19 @@ if (HDF5_ENABLE_ALL_WARNINGS) message (STATUS "....All Warnings are enabled") if (MSVC) if (HDF5_ENABLE_DEV_WARNINGS) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_LOADED) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall /wd4668") endif () else () - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_LOADED) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3") endif () endif () else () - if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4}) - endif () + if (CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4}) endif () endif () endif () @@ -229,15 +229,13 @@ endif () if (HDF5_ENABLE_GROUPZERO_WARNINGS) message (STATUS "....Group Zero warnings are enabled") if (MSVC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_LOADED) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1") endif () else () - if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0}) - endif () + if (CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0}) endif () endif () endif () @@ -248,15 +246,13 @@ endif () if (HDF5_ENABLE_GROUPONE_WARNINGS) message (STATUS "....Group One warnings are enabled") if (MSVC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_LOADED) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2") endif () else () - if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1}) - endif () + if (CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1}) endif () endif () endif () @@ -267,15 +263,13 @@ endif () if (HDF5_ENABLE_GROUPTWO_WARNINGS) message (STATUS "....Group Two warnings are enabled") if (MSVC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_LOADED) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3") endif () else () - if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2}) - endif () + if (CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2}) endif () endif () endif () @@ -286,15 +280,13 @@ endif () if (HDF5_ENABLE_GROUPTHREE_WARNINGS) message (STATUS "....Group Three warnings are enabled") if (MSVC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + if (CMAKE_CXX_COMPILER_LOADED) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}") list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4") endif () else () - if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3}) - endif () + if (CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3}) endif () endif () endif () @@ -305,10 +297,8 @@ endif () if (HDF5_ENABLE_GROUPFOUR_WARNINGS) message (STATUS "....Group Four warnings are enabled") if (NOT MSVC) - if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) - list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4}) - endif () + if (CMAKE_CXX_COMPILER_LOADED) + list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4}) endif () endif () endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index cd4ab48..31af2f8 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -68,7 +68,7 @@ endif () # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -if (NOT MSVC) +if (NOT MSVC AND NOT MINGW) if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP") else () @@ -209,9 +209,7 @@ if (HDF5_ENABLE_ALL_WARNINGS) list (APPEND HDF5_CMAKE_C_FLAGS "/W3") endif () else () - if (CMAKE_COMPILER_IS_GNUCC) - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}) - endif () + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}) endif () endif () @@ -225,9 +223,7 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") list (APPEND HDF5_CMAKE_C_FLAGS "/W1") else () - if (CMAKE_COMPILER_IS_GNUCC) - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0}) - endif () + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0}) endif () endif () @@ -241,9 +237,7 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") list (APPEND HDF5_CMAKE_C_FLAGS "/W2") else () - if (CMAKE_COMPILER_IS_GNUCC) - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1}) - endif () + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1}) endif () endif () @@ -257,9 +251,7 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") list (APPEND HDF5_CMAKE_C_FLAGS "/W3") else () - if (CMAKE_COMPILER_IS_GNUCC) - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2}) - endif () + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2}) endif () endif () @@ -273,9 +265,7 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}") list (APPEND HDF5_CMAKE_C_FLAGS "/W4") else () - if (CMAKE_COMPILER_IS_GNUCC) - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3}) - endif () + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3}) endif () endif () @@ -286,9 +276,7 @@ option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) if (HDF5_ENABLE_GROUPFOUR_WARNINGS) message (STATUS "....Group Four warnings are enabled") if (NOT MSVC) - if (CMAKE_COMPILER_IS_GNUCC) - list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4}) - endif () + list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4}) endif () endif () -- cgit v0.12 From 20eab963899841c9a003baebead8e3bc07d9e127 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 10 Jun 2020 15:17:32 -0500 Subject: Remove duplicate entries in MANIFEST. --- MANIFEST | 2 -- 1 file changed, 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index 998009a..e3c3c50 100644 --- a/MANIFEST +++ b/MANIFEST @@ -119,8 +119,6 @@ ./config/apple ./config/cce-fflags ./config/cce-flags -./config/clang-cxxflags -./config/clang-flags ./config/commence.am ./config/conclude.am ./config/conclude_fc.am -- cgit v0.12 From 715055bfdd8c5295d098a45c11b3782c012c6b51 Mon Sep 17 00:00:00 2001 From: buildbot Date: Wed, 10 Jun 2020 16:52:46 -0500 Subject: Add c++ to --enable-sanitize-checks option. --- config/clang-cxxflags | 2 +- configure.ac | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/clang-cxxflags b/config/clang-cxxflags index 188570e..a37509f 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -143,7 +143,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then if test $cxx_vers_major -le 4; then DEBUG_CXXFLAGS= else - DEBUG_CXXFLAGS="-ftrapv -fno-common -fsanitize=address" + DEBUG_CXXFLAGS="-ftrapv -fno-common" fi ########### diff --git a/configure.ac b/configure.ac index cf1e463..9480033 100644 --- a/configure.ac +++ b/configure.ac @@ -338,8 +338,10 @@ if test "X$CC_BASENAME" = "Xclang"; then # NOTE: No sanity checking done here! if test -n "$CLANG_SANITIZE_LIST"; then H5_CFLAGS="$H5_CFLAGS -fno-omit-frame-pointer" + H5_CXXFLAGS="$H5_CXXFLAGS -fno-omit-frame-pointer" for sanitizer in `echo $CLANG_SANITIZE_LIST`; do H5_CFLAGS="$H5_CFLAGS -fsanitize=${sanitizer}" + H5_CXXFLAGS="$H5_CXXFLAGS -fsanitize=${sanitizer}" done fi fi -- cgit v0.12 From c597bd50d22a8631c237237fefdac276229ca91d Mon Sep 17 00:00:00 2001 From: vchoi Date: Thu, 11 Jun 2020 13:17:35 -0500 Subject: Fix for HDFFV-10961: add description to usage for --increment option. --- tools/src/misc/h5clear.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 2c85e75..f95d1bc 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -101,8 +101,13 @@ static void usage(const char *prog) HDfprintf(stdout, " -s, --status Clear the status_flags field in the file's superblock\n"); HDfprintf(stdout, " -m, --image Remove the metadata cache image from the file\n"); HDfprintf(stdout, " --filesize Print the file's EOA and EOF\n"); - HDfprintf(stdout, " --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file \n"); - HDfprintf(stdout, " C is >= 0; C is optional and will default to 1M when not set"); + HDfprintf(stdout, " --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for\n"); + HDfprintf(stdout, " the file .\n"); + HDfprintf(stdout, " C is >= 0; C is optional and will default to 1M when not set.\n"); + HDfprintf(stdout, " This option helps to repair a crashed file where the stored EOA\n"); + HDfprintf(stdout, " in the superblock is different from the actual EOF.\n"); + HDfprintf(stdout, " The file’s EOA and EOF will be the same after applying\n"); + HDfprintf(stdout, " this option to the file.\n"); HDfprintf(stdout, "\n"); HDfprintf(stdout, "Examples of use:\n"); HDfprintf(stdout, "\n"); -- cgit v0.12 From 01b632c69ca1c97c2b0e1aaeeab1dd2362b580a6 Mon Sep 17 00:00:00 2001 From: vchoi Date: Thu, 11 Jun 2020 14:12:38 -0500 Subject: Fix for HDFFV-10961: Couple changes to the tests' usage output files for h5clear. --- tools/test/misc/testfiles/h5clear_missing_file.ddl | 10 ++++++++-- tools/test/misc/testfiles/h5clear_usage.ddl | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/test/misc/testfiles/h5clear_missing_file.ddl b/tools/test/misc/testfiles/h5clear_missing_file.ddl index 32dd549..c4d21c9 100644 --- a/tools/test/misc/testfiles/h5clear_missing_file.ddl +++ b/tools/test/misc/testfiles/h5clear_missing_file.ddl @@ -5,8 +5,14 @@ usage: h5clear [OPTIONS] file_name -s, --status Clear the status_flags field in the file's superblock -m, --image Remove the metadata cache image from the file --filesize Print the file's EOA and EOF - --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file - C is >= 0; C is optional and will default to 1M when not set + --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for + the file . + C is >= 0; C is optional and will default to 1M when not set. + This option helps to repair a crashed file where the stored EOA + in the superblock is different from the actual EOF. + The file’s EOA and EOF will be the same after applying + this option to the file. + Examples of use: h5clear -s file_name diff --git a/tools/test/misc/testfiles/h5clear_usage.ddl b/tools/test/misc/testfiles/h5clear_usage.ddl index 32dd549..c4d21c9 100644 --- a/tools/test/misc/testfiles/h5clear_usage.ddl +++ b/tools/test/misc/testfiles/h5clear_usage.ddl @@ -5,8 +5,14 @@ usage: h5clear [OPTIONS] file_name -s, --status Clear the status_flags field in the file's superblock -m, --image Remove the metadata cache image from the file --filesize Print the file's EOA and EOF - --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for the file - C is >= 0; C is optional and will default to 1M when not set + --increment=C Set the file's EOA to the maximum of (EOA, EOF) + C for + the file . + C is >= 0; C is optional and will default to 1M when not set. + This option helps to repair a crashed file where the stored EOA + in the superblock is different from the actual EOF. + The file’s EOA and EOF will be the same after applying + this option to the file. + Examples of use: h5clear -s file_name -- cgit v0.12 From 998c6470d78e14228695419c3b514c35ecf3d69e Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 12 Jun 2020 11:54:58 -0500 Subject: Remove unnecessary version conditions for Clang compilers. --- config/clang-cxxflags | 17 +++-------------- config/clang-flags | 17 +++-------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/config/clang-cxxflags b/config/clang-cxxflags index a37509f..edd62e7 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -140,11 +140,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then # NDEBUG is handled explicitly by the configure script # -g is handled by the symbols flags - if test $cxx_vers_major -le 4; then - DEBUG_CXXFLAGS= - else - DEBUG_CXXFLAGS="-ftrapv -fno-common" - fi + DEBUG_CXXFLAGS="-ftrapv -fno-common" ########### # Symbols # @@ -163,13 +159,8 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then # Optimization # ################ - if test $cxx_vers_major -le 4; then - HIGH_OPT_CXXFLAGS="-O3" - DEBUG_OPT_CXXFLAGS= - else - HIGH_OPT_CXXFLAGS="-O3" - DEBUG_OPT_CXXFLAGS="-g" - fi + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS="-g" NO_OPT_CXXFLAGS="-O0" ############ @@ -183,8 +174,6 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" -echo "H5_CXXFLAGS: $H5_CXXFLAGS" - ###################### # Developer warnings # ###################### diff --git a/config/clang-flags b/config/clang-flags index 18ec5f6..b4f5e2e 100644 --- a/config/clang-flags +++ b/config/clang-flags @@ -140,11 +140,7 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then # NDEBUG is handled explicitly by the configure script # -g is handled by the symbols flags - if test $cc_vers_major -le 4; then - DEBUG_CFLAGS= - else - DEBUG_CFLAGS="-ftrapv -fno-common" - fi + DEBUG_CFLAGS="-ftrapv -fno-common" ########### # Symbols # @@ -163,13 +159,8 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then # Optimization # ################ - if test $cc_vers_major -le 4; then - HIGH_OPT_CFLAGS="-O3" - DEBUG_OPT_CFLAGS= - else - HIGH_OPT_CFLAGS="-O3" - DEBUG_OPT_CFLAGS="-g" - fi + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS="-g" NO_OPT_CFLAGS="-O0" ############ @@ -183,8 +174,6 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)" H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)" -echo "H5_CFLAGS: $H5_CFLAGS" - ###################### # Developer warnings # ###################### -- cgit v0.12 From 49fad72f3e003e1e2d7d72edd9b7ec47c802d9f1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 16 Jun 2020 12:30:08 -0500 Subject: Reduce overhead for H5open, which is involved in the public symbols like H5T_NATIVE_INT, etc. --- src/H5.c | 8 +++++--- src/H5private.h | 29 +++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/H5.c b/src/H5.c index bd78ca2..31b8546 100644 --- a/src/H5.c +++ b/src/H5.c @@ -938,11 +938,13 @@ H5open(void) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API_NOCLEAR(FAIL) - H5TRACE0("e",""); + FUNC_ENTER_API_NOPUSH(FAIL) + /*NO TRACE*/ + /* all work is done by FUNC_ENTER() */ + done: - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_API_NOPUSH(ret_value) } /* end H5open() */ diff --git a/src/H5private.h b/src/H5private.h index 2236ee6..aca4851 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2145,8 +2145,9 @@ H5_DLL herr_t H5CX_pop(void); } /* end if */ \ \ /* Initialize the package, if appropriate */ \ - H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) \ - \ + H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) + +#define FUNC_ENTER_API_PUSH(err) \ /* Push the name of this function on the function stack */ \ H5_PUSH_FUNC \ \ @@ -2160,6 +2161,7 @@ H5_DLL herr_t H5CX_pop(void); #define FUNC_ENTER_API(err) {{ \ FUNC_ENTER_API_COMMON \ FUNC_ENTER_API_INIT(err); \ + FUNC_ENTER_API_PUSH(err); \ /* Clear thread error stack entering public functions */ \ H5E_clear_stack(NULL); \ { @@ -2171,6 +2173,7 @@ H5_DLL herr_t H5CX_pop(void); #define FUNC_ENTER_API_NOCLEAR(err) {{ \ FUNC_ENTER_API_COMMON \ FUNC_ENTER_API_INIT(err); \ + FUNC_ENTER_API_PUSH(err); \ { /* @@ -2200,6 +2203,18 @@ H5_DLL herr_t H5CX_pop(void); BEGIN_MPE_LOG \ { +/* + * Use this macro for API functions that should only perform initialization + * of the library or an interface, but not push any state (API context, + * function name, start MPE logging, etc) examples are: H5open. + * + */ +#define FUNC_ENTER_API_NOPUSH(err) {{{{{ \ + FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \ + FUNC_ENTER_API_THREADSAFE; \ + FUNC_ENTER_API_INIT(err); \ + { + /* Note: this macro only works when there's _no_ interface initialization routine for the module */ #define FUNC_ENTER_NOAPI_INIT(err) \ /* Initialize the package, if appropriate */ \ @@ -2389,6 +2404,16 @@ H5_DLL herr_t H5CX_pop(void); return(ret_value); \ }}}} /*end scope from beginning of FUNC_ENTER*/ +/* Use this macro to match the FUNC_ENTER_API_NOPUSH macro */ +#define FUNC_LEAVE_API_NOPUSH(ret_value) \ + ; \ + } /*end scope from end of FUNC_ENTER*/ \ + if(err_occurred) \ + (void)H5E_dump_api_stack(TRUE); \ + FUNC_LEAVE_API_THREADSAFE \ + return(ret_value); \ +}}}}} /*end scope from beginning of FUNC_ENTER*/ + #define FUNC_LEAVE_NOAPI(ret_value) \ ; \ } /*end scope from end of FUNC_ENTER*/ \ -- cgit v0.12 From c12da4884f18dda4c9dbc23efd10eb053ec7cf0d Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 19 Jun 2020 10:53:32 -0500 Subject: Fix HDFFV-10591 Description: h52gif produced a segfault when a buffer overflow occurred because the data size was corrupted and became very large. This commit added a check on the data size against the buffer size to prevent the segfault. It also added error reporting to h52gif to display an error message instead of silently exiting when the failure occurred. Platforms tested: Linux/64 (jelly) SunOS 5.11 (emu) --- hl/src/H5IM.c | 3 ++- hl/tools/gif2h5/hdf2gif.c | 33 ++++++++++++++++++++++----------- src/H5Oattr.c | 5 +++++ 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 2a7ed9b..6f7414b 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -274,7 +274,8 @@ herr_t H5IMget_image_info( hid_t loc_id, return -1; /* Try to find the attribute "INTERLACE_MODE" on the >>image<< dataset */ - has_attr = H5LT_find_attribute(did, "INTERLACE_MODE"); + if ((has_attr = H5LT_find_attribute(did, "INTERLACE_MODE")) < 0) + goto out; /* It exists, get it */ if(has_attr == 1) diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index e32facb..0e2a898 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -149,30 +149,41 @@ int main(int argc , char **argv) goto out; } - /* read image */ + /* get image's information */ if ( H5IMget_image_info( fid, image_name, &width, &height, &planes, interlace, &npals ) < 0 ) + { + fprintf(stderr , "Unable to get information of the image. Aborting.\n"); goto out; + } - if (width > IMAGE_WIDTH_MAX || height > IMAGE_HEIGHT_MAX){ - fprintf(stderr, "HDF5 image is too large. Limit is %d by %d.\n", IMAGE_WIDTH_MAX, IMAGE_HEIGHT_MAX); - goto out; - } + if (width > IMAGE_WIDTH_MAX || height > IMAGE_HEIGHT_MAX) + { + fprintf(stderr, "HDF5 image is too large. Limit is %d by %d.\n", IMAGE_WIDTH_MAX, IMAGE_HEIGHT_MAX); + goto out; + } - /* tool can handle single plane images only. */ - if (planes > 1){ - fprintf(stderr, "Cannot handle multiple planes image\n"); - goto out; - } + /* tool can handle single plane images only. */ + if (planes > 1) + { + fprintf(stderr, "Cannot handle multiple planes image\n"); + goto out; + } Image = (GIFBYTE*) malloc( (size_t) width * (size_t) height ); if ( H5IMread_image( fid, image_name, Image ) < 0 ) + { + fprintf(stderr , "Unable to read the image. Aborting.\n"); goto out; + } if (npals) { if ( H5IMget_palette_info( fid, image_name, 0, pal_dims ) < 0 ) + { + fprintf(stderr , "Unable to get information of the palette. Aborting.\n"); goto out; + } pal = (GIFBYTE*) malloc( (size_t) pal_dims[0] * (size_t) pal_dims[1] ); @@ -246,7 +257,7 @@ int main(int argc , char **argv) if (j==i) { /* wasn't found */ - pc2nc[i] = (GIFBYTE)nc; + pc2nc[i] = (GIFBYTE)nc; r1[nc] = Red[i]; g1[nc] = Green[i]; b1[nc] = Blue[i]; diff --git a/src/H5Oattr.c b/src/H5Oattr.c index aeaebea..e38ef5c 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -238,6 +238,11 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, /* Go get the data */ if(attr->shared->data_size) { + /* Ensure that data size doesn't exceed buffer size, in case of + it's being corrupted in the file */ + if(attr->shared->data_size > p_size) + HGOTO_ERROR(H5E_RESOURCE, H5E_OVERFLOW, NULL, "data size exceeds buffer size") + if(NULL == (attr->shared->data = H5FL_BLK_MALLOC(attr_buf, attr->shared->data_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") H5MM_memcpy(attr->shared->data, p, attr->shared->data_size); -- cgit v0.12 From ee6f7d1c96f2def94b96ebb5fdb34d592a80c8ad Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 19 Jun 2020 12:14:10 -0500 Subject: Fix issue in H5VL_wrap_register where datatype VOL objects are casted to H5T_t * --- src/H5VLint.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/H5VLint.c b/src/H5VLint.c index 861629f..98785f8 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -2363,23 +2363,25 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) /* Sanity check */ HDassert(obj); + /* Retrieve the VOL object wrapping context */ + if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") + if(NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector) + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "VOL object wrap context or its connector is NULL???") + /* If the datatype is already VOL-managed, the datatype's vol_obj * field will get clobbered later, so disallow this. */ - if(type == H5I_DATATYPE) - if(TRUE == H5T_already_vol_managed((const H5T_t *)obj)) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype") + if(type == H5I_DATATYPE) { + if(vol_wrap_ctx->connector->id == H5VL_NATIVE) + if(TRUE == H5T_already_vol_managed((const H5T_t *)obj)) + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype") + } /* Wrap the object with VOL connector info */ if(NULL == (new_obj = H5VL__wrap_obj(obj, type))) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object") - /* Retrieve the VOL object wrapping context */ - if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") - if(NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "VOL object wrap context or its connector is NULL???") - /* Get an ID for the object */ if((ret_value = H5VL_register_using_vol_id(type, new_obj, vol_wrap_ctx->connector->id, app_ref)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object") -- cgit v0.12 From 7d58d115079d286a566207c529e59bbccc952b03 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 19 Jun 2020 16:08:37 -0500 Subject: Added note for HDFFV-10591. --- release_docs/RELEASE.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 102402e..72cab28 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -631,6 +631,18 @@ Bug Fixes since HDF5-1.10.3 release Library ------- + - Fixed the decoding of an attribute message to prevent a segfault by h52gif + + The tool h52gif produced a segfault when the size of an attribute + message was corrupted and caused a buffer overflow. + + The problem was fixed by verifying the attribute message's size + against the buffer size before accessing the buffer. h52gif was + also fixed to display the failure instead of silently exiting + after the segfault was eliminated. + + (BMR - 2020/6/19, HDFFV-10591) + - Improved peformance when creating a large number of small datasets by retrieving default property values from the API context instead of doing skip list searches. -- cgit v0.12 From e1215177b6b87887233a90992a0264f11d78b88c Mon Sep 17 00:00:00 2001 From: Jacob Smith Date: Thu, 25 Jun 2020 12:24:05 -0500 Subject: * Fix intermittent error with Splitter VFD. Mismatch in time of test file creation was creating false negatives. Add file-duplication routine: `h5_duplicate_file_by_bytes()`. * Change library calls in `h5test.c:h5_compare_file_bytes()` to their HD-prefixed equivalents. --- test/h5test.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++----------- test/h5test.h | 1 + test/vfd.c | 80 ++++++++++++++++++++++++------------------- 3 files changed, 134 insertions(+), 54 deletions(-) diff --git a/test/h5test.c b/test/h5test.c index 9cca100..1b445dd 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2057,23 +2057,23 @@ h5_get_version_string(H5F_libver_t libver) int h5_compare_file_bytes(char *f1name, char *f2name) { - FILE *f1ptr = NULL; /* two file pointers */ - FILE *f2ptr = NULL; - hsize_t f1size = 0; /* size of the files */ - hsize_t f2size = 0; - char f1char = 0; /* one char from each file */ - char f2char = 0; - hsize_t ii = 0; - int ret_value = 0; /* for error handling */ + FILE *f1ptr = NULL; /* two file pointers */ + FILE *f2ptr = NULL; + off_t f1size = 0; /* size of the files */ + off_t f2size = 0; + char f1char = 0; /* one char from each file */ + char f2char = 0; + off_t ii = 0; + int ret_value = 0; /* for error handling */ /* Open files for reading */ - f1ptr = fopen(f1name, "r"); + f1ptr = HDfopen(f1name, "r"); if (f1ptr == NULL) { HDfprintf(stderr, "Unable to fopen() %s\n", f1name); ret_value = -1; goto done; } - f2ptr = fopen(f2name, "r"); + f2ptr = HDfopen(f2name, "r"); if (f2ptr == NULL) { HDfprintf(stderr, "Unable to fopen() %s\n", f2name); ret_value = -1; @@ -2081,11 +2081,11 @@ h5_compare_file_bytes(char *f1name, char *f2name) } /* Get the file sizes and verify that they equal */ - fseek(f1ptr , 0 , SEEK_END); - f1size = ftell(f1ptr); + HDfseek(f1ptr , 0 , SEEK_END); + f1size = HDftell(f1ptr); - fseek(f2ptr , 0 , SEEK_END); - f2size = ftell(f2ptr); + HDfseek(f2ptr , 0 , SEEK_END); + f2size = HDftell(f2ptr); if (f1size != f2size) { HDfprintf(stderr, "Files differ in size, %llu vs. %llu\n", f1size, f2size); @@ -2094,11 +2094,11 @@ h5_compare_file_bytes(char *f1name, char *f2name) } /* Compare each byte and fail if a difference is found */ - rewind(f1ptr); - rewind(f2ptr); + HDrewind(f1ptr); + HDrewind(f2ptr); for (ii = 0; ii < f1size; ii++) { - fread(&f1char, 1, 1, f1ptr); - fread(&f2char, 1, 1, f2ptr); + HDfread(&f1char, 1, 1, f1ptr); + HDfread(&f2char, 1, 1, f2ptr); if (f1char != f2char) { HDfprintf(stderr, "Mismatch @ 0x%llX: 0x%X != 0x%X\n", ii, f1char, f2char); ret_value = -1; @@ -2108,10 +2108,10 @@ h5_compare_file_bytes(char *f1name, char *f2name) done: if (f1ptr) { - fclose(f1ptr); + HDfclose(f1ptr); } if (f2ptr) { - fclose(f2ptr); + HDfclose(f2ptr); } return(ret_value); } /* end h5_compare_file_bytes() */ @@ -2169,3 +2169,70 @@ const char *H5_get_srcdir(void) return(NULL); } /* end H5_get_srcdir() */ +/*------------------------------------------------------------------------- + * Function: h5_duplicate_file_by_bytes + * + * Purpose: Duplicate a file byte-for-byte at filename/path 'orig' + * to a new (or replaced) file at 'dest'. + * + * Return: Success: 0, completed successfully + * Failure: -1 + * + * Programmer: Jake Smith + * 24 June 2020 + * + *------------------------------------------------------------------------- + */ +int +h5_duplicate_file_by_bytes(const char *orig, const char *dest) +{ + FILE *orig_ptr = NULL; + FILE *dest_ptr = NULL; + hsize_t fsize = 0; + hsize_t read_size = 0; + hsize_t max_buf = 0; + void *dup_buf = NULL; + int ret_value = 0; + + max_buf = 4096 * sizeof(char); + + orig_ptr = HDfopen(orig, "r"); + if (NULL == orig_ptr) { + ret_value = -1; + goto done; + } + + HDfseek(orig_ptr , 0 , SEEK_END); + fsize = (hsize_t)HDftell(orig_ptr); + HDrewind(orig_ptr); + + dest_ptr = HDfopen(dest, "w"); + if (NULL == dest_ptr) { + ret_value = -1; + goto done; + } + + read_size = MIN(fsize, max_buf); + dup_buf = HDmalloc(read_size); + if (NULL == dup_buf) { + ret_value = -1; + goto done; + } + + while (read_size > 0) { + HDfread(dup_buf, read_size, 1, orig_ptr); /* warning: no error-check */ + HDfwrite(dup_buf, read_size, 1, dest_ptr); + fsize -= read_size; + read_size = MIN(fsize, max_buf); + } + +done: + if (orig_ptr != NULL) + HDfclose(orig_ptr); + if (dest_ptr != NULL) + HDfclose(dest_ptr); + if (dup_buf != NULL) + HDfree(dup_buf); + return ret_value; +} /* end h5_duplicate_file_by_bytes() */ + diff --git a/test/h5test.h b/test/h5test.h index b1ddc58..3eeb1f8 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -210,6 +210,7 @@ H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void); H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void); H5TEST_DLL const char *h5_get_version_string(H5F_libver_t libver); H5TEST_DLL int h5_compare_file_bytes(char *fname1, char *fname2); +H5TEST_DLL int h5_duplicate_file_by_bytes(const char *orig, const char *dest); /* Functions that will replace components of a FAPL */ H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id); diff --git a/test/vfd.c b/test/vfd.c index d94aec6..038c967 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -2880,6 +2880,7 @@ done: static int splitter_tentative_open_test(hid_t child_fapl_id) { + const char filename_tmp[H5FD_SPLITTER_PATH_MAX + 1] = "splitter_tmp.h5"; char filename_rw[H5FD_SPLITTER_PATH_MAX + 1]; H5FD_splitter_vfd_config_t vfd_config; hid_t fapl_id = H5I_INVALID_HID; @@ -2926,7 +2927,16 @@ splitter_tentative_open_test(hid_t child_fapl_id) SPLITTER_TEST_FAULT("set FAPL not SPLITTER\n"); } - /* H5Fopen() with RDWR access. + /* Create instance of file on disk. + * Will be copied verbatim as needed, to avoid issues where differences in + * the creation time would befoul comparisons. + */ + if (splitter_create_single_file_at(filename_tmp, child_fapl_id, &data) < 0) { + SPLITTER_TEST_FAULT("can't write W/O file\n"); + } + + /* + * H5Fopen() with RDWR access. * Neither file exist already * Should fail. */ @@ -2944,13 +2954,14 @@ splitter_tentative_open_test(hid_t child_fapl_id) SPLITTER_TEST_FAULT("W/O file unexpectedly created\n"); } - /* H5Fopen() with RDWR access. - * W/O file exists already. + /* + * H5Fopen() with RDWR access. + * Only W/O file present. * Should fail. */ - if (splitter_create_single_file_at(vfd_config.wo_path, child_fapl_id, &data) < 0) { - SPLITTER_TEST_FAULT("can't write W/O file\n"); + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); @@ -2969,13 +2980,14 @@ splitter_tentative_open_test(hid_t child_fapl_id) SPLITTER_TEST_FAULT("failed to remove W/O file\n"); } - /* H5Fopen() with RDWR access. - * R/W file exists already. + /* + * H5Fopen() with RDWR access. + * Only R/W file present. * Should fail. */ - if (splitter_create_single_file_at(filename_rw, child_fapl_id, &data) < 0) { - SPLITTER_TEST_FAULT("can't write R/W file\n"); + if (h5_duplicate_file_by_bytes(filename_tmp, filename_rw) < 0) { + SPLITTER_TEST_FAULT("Can't create R/W file copy.\n"); } H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); @@ -2990,12 +3002,13 @@ splitter_tentative_open_test(hid_t child_fapl_id) SPLITTER_TEST_FAULT("W/O file unexpectedly created\n"); } - /* H5Fopen() with RDWR access. - * Both files already exist. + /* + * H5Fopen() with RDWR access. + * Both files present. */ - if (splitter_create_single_file_at(vfd_config.wo_path, child_fapl_id, &data) < 0) { - SPLITTER_TEST_FAULT("can't write W/O file\n"); + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); if (file_id == H5I_INVALID_HID) { @@ -3011,12 +3024,10 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(vfd_config.wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { - SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); - } - /* H5Fcreate() with TRUNC access. - * Both files already exist. + /* + * H5Fcreate() with TRUNC access. + * Both files present. */ file_id = H5Fcreate(filename_rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); @@ -3036,17 +3047,17 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } + HDremove(filename_rw); + HDremove(vfd_config.wo_path); - /* H5Fcreate() with TRUNC access. + /* + * H5Fcreate() with TRUNC access. * R/W already exists. */ - HDremove(filename_rw); - HDremove(vfd_config.wo_path); - if (splitter_create_single_file_at(filename_rw, child_fapl_id, &data) < 0) { - SPLITTER_TEST_FAULT("can't write R/W file\n"); + if (h5_duplicate_file_by_bytes(filename_tmp, filename_rw) < 0) { + SPLITTER_TEST_FAULT("Can't create R/W file copy.\n"); } - if (file_exists(vfd_config.wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("failed to remove W/O file\n"); } @@ -3067,17 +3078,17 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } + HDremove(filename_rw); + HDremove(vfd_config.wo_path); - /* H5Fcreate() with TRUNC access. - * W/O already exists. + /* + * H5Fcreate() with TRUNC access. + * Only W/O present. */ - HDremove(filename_rw); - HDremove(vfd_config.wo_path); - if (splitter_create_single_file_at(vfd_config.wo_path, child_fapl_id, &data) < 0) { - SPLITTER_TEST_FAULT("can't write R/W file\n"); + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } - if (file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("failed to remove R/W file\n"); } @@ -3098,10 +3109,13 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } + HDremove(filename_rw); + HDremove(vfd_config.wo_path); /* H5Fcreate with both files absent is tested elsewhere */ - /* Cleanup + /* + * Cleanup */ if (H5Pclose(fapl_id) < 0) { @@ -3225,7 +3239,6 @@ test_splitter(void) TEST_ERROR; } - /* Test file creation, utilizing different child FAPLs (default vs. * specified), logfile, and Write Channel error ignoring behavior. */ @@ -3251,7 +3264,6 @@ test_splitter(void) /* TODO: SWMR open? */ /* Concurrent opens with both drivers using the Splitter */ - if (H5Pclose(child_fapl_id) == FAIL) { TEST_ERROR; } -- cgit v0.12 From 7bdab523b3eb8eb5a83c3a6eca622171b88856ab Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 27 Jun 2020 09:47:55 -0500 Subject: Refactor code to remove remaining checks for H5_HAVE_GETTIMEOFDAY scattered around in various places. Also clean up iopipe.c. --- config/cmake/H5pubconf.h.in | 3 - config/cmake_ext_mod/ConfigureChecks.cmake | 1 - src/H5system.c | 32 --- src/H5timer.c | 41 +++ tools/test/perform/chunk_cache.c | 38 +-- tools/test/perform/iopipe.c | 403 ++++++++++------------------- 6 files changed, 190 insertions(+), 328 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 6edf6b4..eea12cd 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -424,9 +424,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_SYS_STAT_H @H5_HAVE_SYS_STAT_H@ -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_SYS_TIMEB_H @H5_HAVE_SYS_TIMEB_H@ - /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_SYS_TIME_H @H5_HAVE_SYS_TIME_H@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 0875aad..8252736 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -145,7 +145,6 @@ CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) if (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) endif () -CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H) if (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) diff --git a/src/H5system.c b/src/H5system.c index 7f953d7..a918571 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1461,38 +1461,6 @@ H5_nanosleep(uint64_t nanosec) FUNC_LEAVE_NOAPI_VOID } /* end H5_nanosleep() */ - -/*-------------------------------------------------------------------------- - * Function: H5_get_time - * - * Purpose: Get the current time, as the time of seconds after the UNIX epoch - * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * October 05, 2016 - *-------------------------------------------------------------------------- - */ -double -H5_get_time(void) -{ -#ifdef H5_HAVE_GETTIMEOFDAY - struct timeval curr_time; -#endif /* H5_HAVE_GETTIMEOFDAY */ - double ret_value = (double)0.0f; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&curr_time, NULL); - - ret_value = (double)curr_time.tv_sec + ((double)curr_time.tv_usec / (double)1000000.0f); -#endif /* H5_HAVE_GETTIMEOFDAY */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5_get_time() */ - - #ifdef H5_HAVE_WIN32_API #define H5_WIN32_ENV_VAR_BUFFER_SIZE 32767 diff --git a/src/H5timer.c b/src/H5timer.c index 8603b1c..180c774 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -215,6 +215,47 @@ H5_now_usec(void) } /* end H5_now_usec() */ +/*-------------------------------------------------------------------------- + * Function: H5_get_time + * + * Purpose: Get the current time, as the time of seconds after the UNIX epoch + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * October 05, 2016 + *-------------------------------------------------------------------------- + */ +double +H5_get_time(void) +{ + double ret_value = (double)0.0f; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + +#if defined(H5_HAVE_CLOCK_GETTIME) + { + struct timespec ts; + + HDclock_gettime(CLOCK_MONOTONIC, &ts); + ret_value = (double)ts.tv_sec + ((double)ts.tv_nsec / (double)1000000000.0f); + } +#elif defined(H5_HAVE_GETTIMEOFDAY) + { + struct timeval now_tv; + + HDgettimeofday(&now_tv, NULL); + ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / (double)1000000.0f); + } +#else /* H5_HAVE_GETTIMEOFDAY */ + ret_value = (double)HDtime(NULL); +#endif /* H5_HAVE_GETTIMEOFDAY */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5_get_time() */ + + + /*------------------------------------------------------------------------- * Function: H5__timer_get_timevals * diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index e594e34..f630da7 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -79,18 +79,6 @@ counter (unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, } /*---------------------------------------------------------------------------*/ -static double retrieve_time(void) -{ -#ifdef H5_HAVE_GETTIMEOFDAY - struct timeval t; - HDgettimeofday(&t, NULL); - return ((double)t.tv_sec + (double)t.tv_usec / 1000000); -#else - return 0.0; -#endif -} - -/*---------------------------------------------------------------------------*/ static void cleanup (void) { @@ -253,7 +241,7 @@ static int check_partial_chunks_perf(hid_t file) nbytes_global = 0; - start_t = retrieve_time(); + start_t = H5_get_time(); /* Read the data row by row */ for(i = 0; i < DSET1_DIM1; i++) { @@ -267,13 +255,12 @@ static int check_partial_chunks_perf(hid_t file) goto error; } - end_t = retrieve_time(); + end_t = H5_get_time(); -#ifdef H5_HAVE_GETTIMEOFDAY - printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); -#else - printf("1. Partial chunks: no total read time because gettimeofday() is not available; number of bytes being read from file is %lu\n", nbytes_global); -#endif + if((end_t - start_t) > 0.0f) + printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); + else + printf("1. Partial chunks: no total read time because timer is not available; number of bytes being read from file is %lu\n", nbytes_global); H5Dclose (dataset); H5Sclose (filespace); @@ -328,7 +315,7 @@ static int check_hash_value_perf(hid_t file) nbytes_global = 0; - start_t = retrieve_time(); + start_t = H5_get_time(); /* Read the data column by column */ for(i = 0; i < DSET2_DIM2; i++) { @@ -342,13 +329,12 @@ static int check_hash_value_perf(hid_t file) goto error; } - end_t = retrieve_time(); + end_t = H5_get_time(); -#ifdef H5_HAVE_GETTIMEOFDAY - printf("2. Hash value: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); -#else - printf("2. Hash value: no total read time because gettimeofday() is not available; number of bytes being read from file is %lu\n", nbytes_global); -#endif + if((end_t - start_t) > 0.0) + printf("2. Hash value: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); + else + printf("2. Hash value: no total read time because timer is not available; number of bytes being read from file is %lu\n", nbytes_global); H5Dclose (dataset); H5Sclose (filespace); diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index bf4728d..de56281 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -21,10 +21,6 @@ #include "H5private.h" -#ifdef H5_HAVE_SYS_TIMEB -#include -#endif - #define RAW_FILE_NAME "iopipe.raw" #define HDF5_FILE_NAME "iopipe.h5" @@ -56,25 +52,18 @@ * Programmer: Robb Matzke * Thursday, March 12, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_GETRUSAGE static void -print_stats (const char *prefix, +print_stats(const char *prefix, +#ifdef H5_HAVE_GETRUSAGE struct rusage *r_start, struct rusage *r_stop, - struct timeval *t_start, struct timeval *t_stop, - size_t nbytes) -#else /* H5_HAVE_GETRUSAGE */ -static void -print_stats (const char *prefix, - struct timeval *r_start, struct timeval *r_stop, - struct timeval *t_start, struct timeval *t_stop, - size_t nbytes) #endif /* H5_HAVE_GETRUSAGE */ + double t_start, double t_stop, + size_t nbytes) { - double e_time, bw; + double e_time; + char bw[16]; #ifdef H5_HAVE_GETRUSAGE double u_time, s_time; @@ -88,27 +77,16 @@ print_stats (const char *prefix, ((double)(r_start->ru_stime.tv_sec)+ (double)(r_start->ru_stime.tv_usec)/(double)1000000.0F); #endif -#ifndef H5_HAVE_SYS_TIMEB - e_time = ((double)(t_stop->tv_sec)+ - (double)(t_stop->tv_usec)/(double)1000000.0F) - - ((double)(t_start->tv_sec)+ - (double)(t_start->tv_usec)/(double)1000000.0F); -#else - e_time = ((double)(t_stop->tv_sec)+ - (double)(t_stop->tv_usec)/(double)1000.0F) - - ((double)(t_start->tv_sec)+ - (double)(t_start->tv_usec)/(double)1000.0F); -#endif - bw = (double)nbytes / e_time; + e_time = t_stop - t_start; + H5_bandwidth(bw, (double)nbytes, e_time); #ifdef H5_HAVE_GETRUSAGE - printf (HEADING "%1.2fuser %1.2fsystem %1.2felapsed %1.2fMB/s\n", - prefix, u_time, s_time, e_time, bw/(1024*1024)); + HDprintf(HEADING "%1.2fuser %1.2fsystem %1.2felapsed %s\n", + prefix, u_time, s_time, e_time, bw); #else - printf (HEADING "%1.2felapsed %1.2fMB/s\n", - prefix, e_time, bw/(1024*1024)); + HDprintf(HEADING "%1.2felapsed %s\n", + prefix, e_time, bw); #endif - } @@ -122,12 +100,10 @@ print_stats (const char *prefix, * Programmer: Robb Matzke * Thursday, March 12, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void -synchronize (void) +synchronize(void) { #ifdef H5_HAVE_SYSTEM #if defined(H5_HAVE_WIN32_API) && ! defined(__CYGWIN__) @@ -157,24 +133,20 @@ synchronize (void) * Programmer: Robb Matzke * Thursday, March 12, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int -main (void) +main(void) { - static hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y}; - static unsigned nread = NREAD_REQUESTS, nwrite = NWRITE_REQUESTS; + hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y}; + unsigned nread = NREAD_REQUESTS, nwrite = NWRITE_REQUESTS; unsigned char *the_data = NULL; hid_t file, dset, file_space = H5I_INVALID_HID; #ifdef H5_HAVE_GETRUSAGE struct rusage r_start, r_stop; -#else - struct timeval r_start, r_stop; #endif - struct timeval t_start, t_stop; + double t_start, t_stop; int fd; unsigned u; herr_t H5_ATTR_NDEBUG_UNUSED status; @@ -184,322 +156,221 @@ main (void) hsize_t count[2]; -#ifdef H5_HAVE_SYS_TIMEB - struct _timeb *tbstart = malloc(sizeof(struct _timeb)); - struct _timeb *tbstop = malloc(sizeof(struct _timeb)); -#endif /* * The extra cast in the following statement is a bug workaround for the * Win32 version 5.0 compiler. * 1998-11-06 ptl */ - printf ("I/O request size is %1.1fMB\n", - (double)(hssize_t)(size[0]*size[1])/(double)1024.0F*(double)1024); + HDprintf("I/O request size is %1.1fMB\n", + (double)(hssize_t)(size[0] * size[1]) / (double)1024.0F * (double)1024); /* Open the files */ - file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert (file>=0); - fd = HDopen (RAW_FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666); - HDassert (fd>=0); + file = H5Fcreate(HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + HDassert(file >= 0); + fd = HDopen(RAW_FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666); + HDassert(fd >= 0); /* Create the dataset */ - file_space = H5Screate_simple (2, size, size); + file_space = H5Screate_simple(2, size, size); HDassert(file_space >= 0); dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); HDassert(dset >= 0); - the_data = (unsigned char *)malloc((size_t)(size[0] * size[1])); + the_data = (unsigned char *)HDmalloc((size_t)(size[0] * size[1])); /* initial fill for lazy malloc */ HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1])); + /* Fill raw */ - synchronize (); + synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_start, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); -#endif -#endif - HDfprintf (stderr, HEADING, "fill raw"); + t_start = H5_get_time(); + HDfprintf(stderr, HEADING, "fill raw"); for(u = 0; u < nwrite; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - HDmemset(the_data, 0xAA, (size_t)(size[0]*size[1])); + HDputc(PROGRESS, stderr); + HDfflush(stderr); + HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_stop, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; -#endif -#endif - putc ('\n', stderr); - print_stats ("fill raw", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + t_stop = H5_get_time(); + HDputc('\n', stderr); + print_stats("fill raw", +#ifdef H5_HAVE_GETRUSAGE + &r_start, &r_stop, +#endif /* H5_HAVE_GETRUSAGE */ + t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Fill hdf5 */ - synchronize (); + synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_start, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); -#endif -#endif - HDfprintf (stderr, HEADING, "fill hdf5"); + t_start = H5_get_time(); + HDfprintf(stderr, HEADING, "fill hdf5"); for(u = 0; u < nread; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, - H5P_DEFAULT, the_data); - HDassert (status>=0); + HDputc(PROGRESS, stderr); + HDfflush(stderr); + status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, + H5P_DEFAULT, the_data); + HDassert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_stop, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; -#endif -#endif - putc ('\n', stderr); - print_stats ("fill hdf5", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + t_stop = H5_get_time(); + HDputc('\n', stderr); + print_stats("fill hdf5", +#ifdef H5_HAVE_GETRUSAGE + &r_start, &r_stop, +#endif /* H5_HAVE_GETRUSAGE */ + t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Write the raw dataset */ - synchronize (); + synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_start, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); -#endif -#endif - HDfprintf (stderr, HEADING, "out raw"); + t_start = H5_get_time(); + HDfprintf(stderr, HEADING, "out raw"); for(u = 0; u < nwrite; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - offset = HDlseek (fd, (off_t)0, SEEK_SET); - HDassert (0==offset); - n = HDwrite (fd, the_data, (size_t)(size[0]*size[1])); - HDassert (n>=0 && (size_t)n==size[0]*size[1]); + HDputc(PROGRESS, stderr); + HDfflush(stderr); + offset = HDlseek(fd, (off_t)0, SEEK_SET); + HDassert(0 == offset); + n = HDwrite(fd, the_data, (size_t)(size[0] * size[1])); + HDassert(n >= 0 && (size_t)n == (size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_stop, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; -#endif -#endif - putc ('\n', stderr); - print_stats ("out raw", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + t_stop = H5_get_time(); + HDputc('\n', stderr); + print_stats("out raw", +#ifdef H5_HAVE_GETRUSAGE + &r_start, &r_stop, +#endif /* H5_HAVE_GETRUSAGE */ + t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Write the hdf5 dataset */ - synchronize (); + synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_start, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); -#endif -#endif - HDfprintf (stderr, HEADING, "out hdf5"); + t_start = H5_get_time(); + HDfprintf(stderr, HEADING, "out hdf5"); for(u = 0; u < nwrite; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - status = H5Dwrite (dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, - H5P_DEFAULT, the_data); - HDassert (status>=0); + HDputc(PROGRESS, stderr); + HDfflush(stderr); + status = H5Dwrite(dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, + H5P_DEFAULT, the_data); + HDassert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_stop, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; -#endif -#endif - putc ('\n', stderr); - print_stats ("out hdf5", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + t_stop = H5_get_time(); + HDputc('\n', stderr); + print_stats("out hdf5", +#ifdef H5_HAVE_GETRUSAGE + &r_start, &r_stop, +#endif /* H5_HAVE_GETRUSAGE */ + t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Read the raw dataset */ - synchronize (); + synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_start, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); -#endif -#endif - HDfprintf (stderr, HEADING, "in raw"); + t_start = H5_get_time(); + HDfprintf(stderr, HEADING, "in raw"); for(u = 0; u < nread; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - offset = HDlseek (fd, (off_t)0, SEEK_SET); - HDassert (0==offset); - n = HDread (fd, the_data, (size_t)(size[0]*size[1])); - HDassert (n>=0 && (size_t)n==size[0]*size[1]); + HDputc(PROGRESS, stderr); + HDfflush(stderr); + offset = HDlseek(fd, (off_t)0, SEEK_SET); + HDassert(0 == offset); + n = HDread(fd, the_data, (size_t)(size[0] * size[1])); + HDassert(n >= 0 && (size_t)n == (size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_stop, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; -#endif -#endif - putc ('\n', stderr); - print_stats ("in raw", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + t_stop = H5_get_time(); + HDputc('\n', stderr); + print_stats("in raw", +#ifdef H5_HAVE_GETRUSAGE + &r_start, &r_stop, +#endif /* H5_HAVE_GETRUSAGE */ + t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Read the hdf5 dataset */ - synchronize (); + synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_start, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); -#endif -#endif - HDfprintf (stderr, HEADING, "in hdf5"); + t_start = H5_get_time(); + HDfprintf(stderr, HEADING, "in hdf5"); for(u = 0; u < nread; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, - H5P_DEFAULT, the_data); - HDassert (status>=0); + HDputc(PROGRESS, stderr); + HDfflush(stderr); + status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, + H5P_DEFAULT, the_data); + HDassert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_stop, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; -#endif -#endif - putc ('\n', stderr); - print_stats ("in hdf5", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + t_stop = H5_get_time(); + HDputc('\n', stderr); + print_stats("in hdf5", +#ifdef H5_HAVE_GETRUSAGE + &r_start, &r_stop, +#endif /* H5_HAVE_GETRUSAGE */ + t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Read hyperslab */ - HDassert (size[0]>20 && size[1]>20); + HDassert(size[0] > 20 && size[1] > 20); start[0] = start[1] = 10; - count[0] = count[1] = size[0]-20; - status = H5Sselect_hyperslab (file_space, H5S_SELECT_SET, start, NULL, count, NULL); - HDassert (status>=0); - synchronize (); + count[0] = count[1] = size[0] - 20; + status = H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, NULL, count, NULL); + HDassert(status >= 0); + synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_start, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); -#endif -#endif - HDfprintf (stderr, HEADING, "in hdf5 partial"); + t_start = H5_get_time(); + HDfprintf(stderr, HEADING, "in hdf5 partial"); for(u = 0; u < nread; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, - H5P_DEFAULT, the_data); - HDassert (status>=0); + HDputc(PROGRESS, stderr); + HDfflush(stderr); + status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, + H5P_DEFAULT, the_data); + HDassert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); #endif -#ifdef H5_HAVE_GETTIMEOFDAY - HDgettimeofday(&t_stop, NULL); -#else -#ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; -#endif -#endif - putc('\n', stderr); + t_stop = H5_get_time(); + HDputc('\n', stderr); print_stats("in hdf5 partial", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*count[0]*count[1])); - - +#ifdef H5_HAVE_GETRUSAGE + &r_start, &r_stop, +#endif /* H5_HAVE_GETRUSAGE */ + t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Close everything */ HDclose(fd); + H5Dclose(dset); H5Sclose(file_space); H5Fclose(file); - free(the_data); + + HDfree(the_data); return 0; } -- cgit v0.12 From ee4eb09b5f5a562b82ab7c48272edf91988eaf82 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 27 Jun 2020 13:44:24 -0500 Subject: va_arg -> HDva_arg --- src/H5system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5system.c b/src/H5system.c index a918571..b3db39c 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -419,7 +419,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) case 'T': /* Elapsed time, in seconds */ { - double seconds = va_arg(ap, double); + double seconds = HDva_arg(ap, double); char *time_string = H5_timer_get_time_string(seconds); if(time_string) { -- cgit v0.12 From 32c483cb86031962a09ecdb49dcb331d28dddee9 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Sat, 27 Jun 2020 15:39:53 -0500 Subject: Copy lib files for junit.sh to temporary subdirectory of /java/test instead of to the prefix/lib directory. Fix for HDFFV-11063. --- java/test/junit.sh.in | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 598b3d2..d9ff5a5 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -15,7 +15,6 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ -prefix=@prefix@ USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" @@ -43,8 +42,8 @@ myos=`uname -s` # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$prefix/lib" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" HDFTEST_HOME="$top_srcdir/java/test" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@test.jar @@ -204,10 +203,7 @@ CLEAN_LIBFILES_AND_BLDLIBDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - for tstfile in $COPY_JARTESTFILES - do - $RM $BLDLIBDIR/tstfile - done + $RM -rf $BLDLIBDIR fi } -- cgit v0.12 From 71b601d0d3610d508a5dfa0d3a3ff54b71f5090a Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 27 Jun 2020 20:02:51 -0500 Subject: Clean up warnings --- MANIFEST | 2 ++ config/cmake/H5pubconf.h.in | 3 -- config/cmake_ext_mod/ConfigureChecks.cmake | 3 -- src/H5FDlog.c | 8 +++-- src/H5timer.c | 2 +- test/timer.c | 41 +++++++++++++------------ tools/test/perform/chunk_cache.c | 48 +++++++++++++++--------------- 7 files changed, 53 insertions(+), 54 deletions(-) diff --git a/MANIFEST b/MANIFEST index e3c3c50..a20b248 100644 --- a/MANIFEST +++ b/MANIFEST @@ -192,6 +192,7 @@ ./examples/h5_chunk_read.c ./examples/h5_compound.c ./examples/h5_crtgrpd.c +./examples/h5_debug_trace.c ./examples/h5_subset.c ./examples/h5_cmprss.c ./examples/h5_rdwt.c @@ -1228,6 +1229,7 @@ ./test/theap.c ./test/thread_id.c ./test/tid.c +./test/timer.c ./test/titerate.c ./test/tlayouto.h5 ./test/tmeta.c diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index eea12cd..64b4852 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -267,9 +267,6 @@ /* Define to 1 if you have the `lstat' function. */ #cmakedefine H5_HAVE_LSTAT @H5_HAVE_LSTAT@ -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_MACH_MACH_TIME_H @H5_HAVE_MACH_MACH_TIME_H@ - /* Define if the map API (H5M) should be compiled */ #cmakedefine H5_HAVE_MAP_API @H5_HAVE_MAP_API@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 8252736..6f5a835 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -137,9 +137,6 @@ CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) -# Darwin -CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) - # Windows CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) if (NOT CYGWIN) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 2700286..78b7742 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -1146,9 +1146,11 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd size_t orig_size = size; /* Save the original size for later */ haddr_t orig_addr = addr; H5_timer_t read_timer; /* Timer for read operation */ - H5_timer_t seek_timer; /* Timer for seek operation */ H5_timevals_t read_times; /* Elapsed time for read operation */ +#ifndef H5_HAVE_PREADWRITE + H5_timer_t seek_timer; /* Timer for seek operation */ H5_timevals_t seek_times; /* Elapsed time for seek operation */ +#endif /* H5_HAVE_PREADWRITE */ HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ @@ -1348,9 +1350,11 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had size_t orig_size = size; /* Save the original size for later */ haddr_t orig_addr = addr; H5_timer_t write_timer; /* Timer for write operation */ - H5_timer_t seek_timer; /* Timer for seek operation */ H5_timevals_t write_times; /* Elapsed time for write operation */ +#ifndef H5_HAVE_PREADWRITE + H5_timer_t seek_timer; /* Timer for seek operation */ H5_timevals_t seek_times; /* Elapsed time for seek operation */ +#endif /* H5_HAVE_PREADWRITE */ HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5timer.c b/src/H5timer.c index 180c774..8f3d305 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -40,7 +40,7 @@ * Most time strings should be < 20 or so characters (max!) so this should be a * safe size. Dynamically allocating the correct size would be painful. */ -#define H5TIMER_TIME_STRING_LEN 256 +#define H5TIMER_TIME_STRING_LEN 1536 /* Conversion factors */ #define H5_SEC_PER_DAY (double)(24.0F * 60.0F * 60.0F) diff --git a/test/timer.c b/test/timer.c index 3a82b82..1014e75 100644 --- a/test/timer.c +++ b/test/timer.c @@ -70,13 +70,13 @@ test_time_formatting(void) HDfree(s); /* < 1 s milliseconds */ - s = H5_timer_get_time_string(4.56789E-3); + s = H5_timer_get_time_string(4.56789E-3F); if(NULL == s || HDstrcmp(s, "4.6 ms") != 0) TEST_ERROR; HDfree(s); /* < 1 min seconds */ - s = H5_timer_get_time_string(3.14); + s = H5_timer_get_time_string(3.14F); if(NULL == s || HDstrcmp(s, "3.14 s") != 0) TEST_ERROR; HDfree(s); @@ -149,7 +149,7 @@ test_timer_system_user(void) /* The system and user times may not be present on some systems. They * will be -1.0 if they are not. */ - if(timer.initial.system < 0.0 || timer.initial.user < 0.0) { + if(timer.initial.system < (double)0.0f || timer.initial.user < (double)0.0f) { SKIPPED(); printf("NOTE: No suitable way to get system/user times on this platform.\n"); return 0; @@ -157,7 +157,7 @@ test_timer_system_user(void) /* Do some fake work */ for(i=0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * i * sizeof(char)); + buf = (char *)HDmalloc(1024 * (size_t)i); HDfree(buf); } @@ -170,7 +170,7 @@ test_timer_system_user(void) TEST_ERROR; /* System and user times should be non-negative. */ - if(times.system < 0.0 || times.user < 0.0) + if(times.system < (double)0.0f || times.user < (double)0.0f) TEST_ERROR; PASSED(); @@ -217,7 +217,7 @@ test_timer_elapsed(void) /* Do some fake work */ for(i=0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * i * sizeof(char)); + buf = (char *)HDmalloc(1024 * (size_t)i); HDfree(buf); } @@ -230,7 +230,7 @@ test_timer_elapsed(void) TEST_ERROR; /* Elapsed time should be non-negative. */ - if(times.elapsed < 0.0) + if(times.elapsed < (double)0.0f) TEST_ERROR; PASSED(); @@ -248,7 +248,7 @@ test_timer_functionality(void) int i; char *buf = NULL; H5_timer_t timer; - + H5_timevals_t times; double prev_etime; double prev_total_etime; @@ -268,11 +268,11 @@ test_timer_functionality(void) /* Times should be initialized to zero */ err = H5_timer_get_times(timer, ×); - if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) + if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f)) TEST_ERROR; err = H5_timer_get_total_times(timer, ×); - if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) + if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f)) TEST_ERROR; @@ -287,7 +287,7 @@ test_timer_functionality(void) /* Do some fake work */ for(i=0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * i * sizeof(char)); + buf = (char *)HDmalloc(1024 * (size_t)i); HDfree(buf); } @@ -298,11 +298,11 @@ test_timer_functionality(void) /* Times should be positive and non-negative */ err = H5_timer_get_times(timer, ×); - if(err < 0 || times.elapsed < 0.0) + if(err < 0 || times.elapsed < (double)0.0f) TEST_ERROR; err = H5_timer_get_total_times(timer, ×); - if(err < 0 || times.elapsed < 0.0) + if(err < 0 || times.elapsed < (double)0.0f) TEST_ERROR; @@ -316,11 +316,11 @@ test_timer_functionality(void) TEST_ERROR; err = H5_timer_get_times(timer, ×); - if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) + if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f)) TEST_ERROR; err = H5_timer_get_total_times(timer, ×); - if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0)) + if(err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f)) TEST_ERROR; /* Timer state should flip */ @@ -330,24 +330,24 @@ test_timer_functionality(void) /* Do some fake work */ for(i=0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * i * sizeof(char)); + buf = (char *)HDmalloc(1024 * (size_t)i); HDfree(buf); } /* Times should be non-negative */ err = H5_timer_get_times(timer, ×); - if(err < 0 || times.elapsed < 0.0) + if(err < 0 || times.elapsed < (double)0.0f) TEST_ERROR; prev_etime = times.elapsed; err = H5_timer_get_total_times(timer, ×); - if(err < 0 || times.elapsed < 0.0) + if(err < 0 || times.elapsed < (double)0.0f) TEST_ERROR; prev_total_etime = times.elapsed; - + /* Do some fake work */ for(i=0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * i * sizeof(char)); + buf = (char *)HDmalloc(1024 * (size_t)i); HDfree(buf); } @@ -401,7 +401,6 @@ main(void) nerrors += test_timer_system_user() < 0 ? 1 : 0; nerrors += test_timer_elapsed() < 0 ? 1 : 0; nerrors += test_timer_functionality() < 0 ? 1 : 0; - if(nerrors) { printf("***** %d platform-independent timer TEST%s FAILED! *****\n", diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index f630da7..d7c56af 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -19,6 +19,7 @@ */ #include "hdf5.h" #include "H5private.h" +#include "h5test.h" #define FILENAME "chunk_cache_perf.h5" @@ -98,8 +99,7 @@ static int create_dset1(hid_t file) hid_t dcpl = H5I_INVALID_HID; hsize_t dims[RANK] = {DSET1_DIM1, DSET1_DIM2}; hsize_t chunk_dims[RANK] = {CHUNK1_DIM1, CHUNK1_DIM2}; - int data[DSET1_DIM1][DSET1_DIM2]; /* data for writing */ - int i, j; + int **data; /* data for writing */ /* Create the data space. */ if((dataspace = H5Screate_simple (RANK, dims, NULL)) < 0) @@ -123,9 +123,10 @@ static int create_dset1(hid_t file) H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - for (i = 0; i < DSET1_DIM1; i++) - for (j = 0; j < DSET1_DIM2; j++) - data[i][j] = i+j; + /* Create & fill array */ + H5TEST_ALLOCATE_2D_ARRAY(data, int, DSET1_DIM1, DSET1_DIM2); + H5TEST_FILL_2D_ARRAY(data, int, DSET1_DIM1, DSET1_DIM2); + /* Write data to dataset */ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, @@ -159,17 +160,16 @@ static int create_dset2(hid_t file) hid_t dcpl = H5I_INVALID_HID; hsize_t dims[RANK] = {DSET2_DIM1, DSET2_DIM2}; hsize_t chunk_dims[RANK] = {CHUNK2_DIM1, CHUNK2_DIM2}; - int data[DSET2_DIM1][DSET2_DIM2]; /* data for writing */ - int i, j; + int **data; /* data for writing */ /* Create the data space. */ - if((dataspace = H5Screate_simple (RANK, dims, NULL)) < 0) + if((dataspace = H5Screate_simple(RANK, dims, NULL)) < 0) goto error; /* Modify dataset creation properties, i.e. enable chunking */ - if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if(H5Pset_chunk (dcpl, RANK, chunk_dims) < 0) + if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) goto error; /* Set the dummy filter simply for counting the number of bytes being read into the memory */ @@ -179,35 +179,35 @@ static int create_dset2(hid_t file) goto error; /* Create a new dataset within the file using chunk creation properties. */ - if((dataset = H5Dcreate2 (file, DSET2_NAME, H5T_NATIVE_INT, dataspace, + if((dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - for (i = 0; i < DSET2_DIM1; i++) - for (j = 0; j < DSET2_DIM2; j++) - data[i][j] = i+j; + /* Create & fill array */ + H5TEST_ALLOCATE_2D_ARRAY(data, int, DSET2_DIM1, DSET2_DIM2); + H5TEST_FILL_2D_ARRAY(data, int, DSET2_DIM1, DSET2_DIM2); /* Write data to dataset */ - if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - H5P_DEFAULT, data) < 0) + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) goto error; /* Close resources */ - H5Dclose (dataset); - H5Pclose (dcpl); - H5Sclose (dataspace); + H5Dclose(dataset); + H5Pclose(dcpl); + H5Sclose(dataspace); return 0; error: H5E_BEGIN_TRY { - H5Dclose (dataset); - H5Pclose (dcpl); - H5Sclose (dataspace); + H5Dclose(dataset); + H5Pclose(dcpl); + H5Sclose(dataspace); } H5E_END_TRY; return 1; } + /*--------------------------------------------------------------------------- * Check the performance of the chunk cache when partial chunks exist * along the dataset dimensions. @@ -257,7 +257,7 @@ static int check_partial_chunks_perf(hid_t file) end_t = H5_get_time(); - if((end_t - start_t) > 0.0f) + if((end_t - start_t) > (double)0.0f) printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); else printf("1. Partial chunks: no total read time because timer is not available; number of bytes being read from file is %lu\n", nbytes_global); @@ -331,7 +331,7 @@ static int check_hash_value_perf(hid_t file) end_t = H5_get_time(); - if((end_t - start_t) > 0.0) + if((end_t - start_t) > (double)0.0f) printf("2. Hash value: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); else printf("2. Hash value: no total read time because timer is not available; number of bytes being read from file is %lu\n", nbytes_global); -- cgit v0.12 From c5258211e7ad24671ccd12889d3cbae3e2e5fe67 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 27 Jun 2020 22:14:52 -0500 Subject: Add new source files to CMake build --- examples/CMakeLists.txt | 1 + test/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1bcbbf2..527b11f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -31,6 +31,7 @@ set (examples h5_extlink h5_elink_unix2win h5_shared_mesg + h5_debug_trace h5_vds h5_vds-exc h5_vds-exclim diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e3bfeb3..009a071 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -295,6 +295,7 @@ set (H5_TESTS swmr thread_id # special link vol + timer ) macro (ADD_H5_EXE file) -- cgit v0.12 From ef05e68c38d2086c6f262744b4087f65a6e58957 Mon Sep 17 00:00:00 2001 From: Jacob Smith Date: Mon, 29 Jun 2020 12:06:57 -0500 Subject: Fix typo in HDftell macro definition: 'ftello -> ftell' --- src/H5private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5private.h b/src/H5private.h index aca4851..dc7ca57 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -959,7 +959,7 @@ typedef off_t h5_stat_size_t; #define H5_SIZEOF_H5_STAT_SIZE_T H5_SIZEOF_OFF_T #ifndef HDftell - #define HDftell(F) ftello(F) + #define HDftell(F) ftell(F) #endif /* HDftell */ #ifndef HDftruncate #define HDftruncate(F,L) ftruncate(F,L) -- cgit v0.12 From 7c006fd7617d54ab1b97e9aa1d7d8600385f3f3f Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 29 Jun 2020 14:16:35 -0500 Subject: - added comment to explain a kluge - added the associated entry to release notes --- release_docs/RELEASE.txt | 10 +++++++++- src/H5Fsuper.c | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 72cab28..d9267e8 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -631,7 +631,15 @@ Bug Fixes since HDF5-1.10.3 release Library ------- - - Fixed the decoding of an attribute message to prevent a segfault by h52gif + - Fixed CVE-2020-10810 + + The tool h5clear produced a segfault during an error recovery in + the superblock decoding. An internal pointer was reset to prevent + further accessing when it is not assigned with a value. + + (BMR - 2020/6/29, HDFFV-11053) + + - Fixed CVE-2018-17435 The tool h52gif produced a segfault when the size of an attribute message was corrupted and caused a buffer overflow. diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 40e93ec..459a046 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -898,7 +898,9 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) else { if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) { +#if 1 /* when removing "KLUGE ALERT" above, tidy this up as well */ /* BMR */ f->shared->sblock = NULL; +#endif /* BMR */ HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") } -- cgit v0.12 From b155a777629e991374fa2f8609719cb861de4cc2 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 30 Jun 2020 00:57:46 -0500 Subject: Changed wording in comment. --- src/H5Fsuper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 459a046..9fd2831 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -898,9 +898,9 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) else { if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) { -#if 1 /* when removing "KLUGE ALERT" above, tidy this up as well */ /* BMR */ +#if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ f->shared->sblock = NULL; -#endif /* BMR */ +#endif /* JRM */ HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") } -- cgit v0.12 From 7371c83f9777b34b31909e99e052398b93c31bed Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 30 Jun 2020 08:53:17 -0500 Subject: Remove non-existent example --- examples/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index 6c601b7..944a9d8 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -35,7 +35,7 @@ EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \ h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \ h5_crtatt h5_crtgrp h5_crtdat \ h5_group h5_select h5_attribute h5_mount h5_drivers \ - h5_reference_deprec h5_ref_extern h5_ref_compat h5_ref2reg h5_ref2reg_deprec \ + h5_reference_deprec h5_ref_extern h5_ref_compat h5_ref2reg_deprec \ h5_extlink h5_elink_unix2win h5_shared_mesg h5_debug_trace \ h5_vds h5_vds-exc h5_vds-exclim h5_vds-eiger h5_vds-simpleIO \ h5_vds-percival h5_vds-percival-unlim h5_vds-percival-unlim-maxmin @@ -48,7 +48,7 @@ INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c h5_compou h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c h5_extend.c \ h5_crtatt.c h5_crtgrp.c h5_crtdat.c \ h5_group.c h5_select.c h5_attribute.c h5_mount.c h5_drivers.c \ - h5_reference_deprec.c h5_ref_extern.c h5_ref_compat.c h5_ref2reg.c h5_ref2reg_deprec.c \ + h5_reference_deprec.c h5_ref_extern.c h5_ref_compat.c h5_ref2reg_deprec.c \ h5_extlink.c h5_elink_unix2win.c h5_shared_mesg.c h5_debug_trace.c \ ph5example.c \ h5_vds.c h5_vds-exc.c h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c \ -- cgit v0.12 From fc69de0e8ae30e80c1c3c542b156226a75444525 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Thu, 2 Jul 2020 11:29:12 -0500 Subject: Lib files needed are now copied to a subdirectory in the java/test directory, and on Macs the loader path for libhdf5.xxxs.so is changed in the temporary copy of libhdf5_java.dylib. Fix for HDFFV-11063 --- configure.ac | 5 ++++- java/test/junit.sh.in | 8 ++++++++ release_docs/RELEASE.txt | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 72223bb..88157c3 100644 --- a/configure.ac +++ b/configure.ac @@ -1150,10 +1150,13 @@ AC_CHECK_HEADERS([stdbool.h]) AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h]) ## Darwin +AC_SUBST([H5_IS_DARWIN]) +H5_IS_DARWIN="no case $host_os in darwin*) AC_DEFINE([HAVE_DARWIN], [1], [Define if Darwin or Mac OS X]) - ;; + H5_IS_DARWIN="yes" + ;; esac ## Windows diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index d9ff5a5..cbc57e9 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -20,6 +20,7 @@ USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" USE_ROS3_VFD="@HAVE_ROS3_VFD@" USE_HDFS_VFD="@HAVE_LIBHDFS@" +IS_DARWIN="@H5_IS_DARWIN@" TESTNAME=JUnitInterface EXIT_SUCCESS=0 @@ -145,6 +146,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd testlibs; \ + install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \ + exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \ + echo $exist_path; \ + install_name_tool -change $exist_path @rpath/libhdf5.1000.dylib libhdf5_java.dylib) + fi # copy jar files. Used -f to make sure get a new copy for tstfile in $COPY_JARTESTFILES do diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d9267e8..665a156 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1013,6 +1013,14 @@ Bug Fixes since HDF5-1.10.3 release Testing ------- + - Stopped java/test/junit.sh.in installing libs for testing under ${prefix} + + Lib files needed are now copied to a subdirectory in the java/test + directory, and on Macs the loader path for libhdf5.xxxs.so is changed + in the temporary copy of libhdf5_java.dylib. + + (LRK, 2020/7/2, HDFFV-11063) + - Fixed a test failure in testpar/t_dset.c caused by the test trying to use the parallel filters feature on MPI-2 implementations. -- cgit v0.12 From 88e8597cdef826c1087e4ec1383657a91dcb2a43 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 2 Jul 2020 13:52:03 -0500 Subject: Small changes discovered with mingw and windows defines moved --- config/cmake/HDFFortranCompilerFlags.cmake | 2 +- src/CMakeLists.txt | 4 +- src/H5I.c | 240 ++++++++++++++--------------- src/H5Tdbg.c | 52 +++---- src/H5public.h | 100 ++++-------- src/H5win32defs.h | 48 +++++- 6 files changed, 222 insertions(+), 224 deletions(-) diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index 15edaa8..2bbb35d 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -48,7 +48,7 @@ endif () # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -if (NOT MSVC) +if (NOT MSVC AND NOT MINGW) # General flags if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/ifort-general") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0915c8..39a9e3e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1139,7 +1139,7 @@ if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) target_include_directories (${HDF5_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" - INTERFACE "$/include>" + INTERFACE "$/include>;$" ) target_compile_options(${HDF5_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_LIB_TARGET} @@ -1176,7 +1176,7 @@ if (BUILD_SHARED_LIBS) target_include_directories (${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" PUBLIC "$<$:${HDFS_INCLUDE_DIR}>" - INTERFACE "$/include>" + INTERFACE "$/include>;$" ) target_compile_options(${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_LIBSH_TARGET} diff --git a/src/H5I.c b/src/H5I.c index 1752e5e..11209d6 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -33,9 +33,9 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Gprivate.h" /* Groups */ #include "H5Ipkg.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -48,25 +48,25 @@ /* Local Macros */ /* Combine a Type number and an atom index into an atom */ -#define H5I_MAKE(g,i) ((((hid_t)(g) & TYPE_MASK) << ID_BITS) | \ - ((hid_t)(i) & ID_MASK)) +#define H5I_MAKE(g,i) ((((hid_t)(g) & TYPE_MASK) << ID_BITS) | \ + ((hid_t)(i) & ID_MASK)) /* Local typedefs */ /* Atom information structure used */ typedef struct H5I_id_info_t { - hid_t id; /* ID for this info */ - unsigned count; /* ref. count for this atom */ + hid_t id; /* ID for this info */ + unsigned count; /* ref. count for this atom */ unsigned app_count; /* ref. count of application visible atoms */ - const void *obj_ptr; /* pointer associated with the atom */ + const void *obj_ptr; /* pointer associated with the atom */ } H5I_id_info_t; /* ID type structure used */ typedef struct { const H5I_class_t *cls; /* Pointer to ID class */ - unsigned init_count; /* # of times this type has been initialized*/ - uint64_t id_count; /* Current number of IDs held */ - uint64_t nextid; /* ID to use for the next atom */ + unsigned init_count; /* # of times this type has been initialized*/ + uint64_t id_count; /* Current number of IDs held */ + uint64_t nextid; /* ID to use for the next atom */ H5I_id_info_t *last_info; /* Info for most recent ID looked up */ H5SL_t *ids; /* Pointer to skip list that stores IDs */ } H5I_id_type_t; @@ -145,7 +145,7 @@ static int H5I__iterate_pub_cb(void *obj, hid_t id, void *udata); static int H5I__find_id_cb(void *_item, void *_key, void *_udata); static int H5I__id_dump_cb(void *_item, void *_key, void *_udata); - + /*------------------------------------------------------------------------- * Function: H5I_term_package * @@ -156,14 +156,14 @@ static int H5I__id_dump_cb(void *_item, void *_key, void *_udata); * Return: Success: Positive if any action was taken that might * affect some other interface; zero otherwise. * - * Failure: Negative + * Failure: Negative * *------------------------------------------------------------------------- */ int H5I_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -197,7 +197,7 @@ H5I_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5I_term_package() */ - + /*------------------------------------------------------------------------- * Function: H5Iregister_type * @@ -278,7 +278,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iregister_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_register_type * @@ -293,7 +293,7 @@ done: herr_t H5I_register_type(const H5I_class_t *cls) { - H5I_id_type_t *type_ptr = NULL; /* Ptr to the atomic type*/ + H5I_id_type_t *type_ptr = NULL; /* Ptr to the atomic type*/ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -328,7 +328,7 @@ H5I_register_type(const H5I_class_t *cls) type_ptr->init_count++; done: - if(ret_value < 0) { /* Clean up on error */ + if(ret_value < 0) { /* Clean up on error */ if(type_ptr) { if(type_ptr->ids) H5SL_close(type_ptr->ids); @@ -339,7 +339,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_type() */ - + /*------------------------------------------------------------------------- * Function: H5Itype_exists * @@ -371,7 +371,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Itype_exists() */ - + /*------------------------------------------------------------------------- * Function: H5Inmembers * @@ -382,8 +382,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: James Laird - * Nathaniel Furrer + * Programmer: James Laird + * Nathaniel Furrer * Friday, April 23, 2004 * *------------------------------------------------------------------------- @@ -421,7 +421,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Inmembers() */ - + /*------------------------------------------------------------------------- * Function: H5I_nmembers * @@ -432,7 +432,7 @@ done: * * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, March 24, 1999 * *------------------------------------------------------------------------- @@ -458,7 +458,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_nmembers() */ - + /*------------------------------------------------------------------------- * Function: H5I__unwrap * @@ -502,7 +502,7 @@ H5I__unwrap(void *obj_ptr, H5I_type_t type) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__unwrap() */ - + /*------------------------------------------------------------------------- * Function: H5Iclear_type * @@ -512,8 +512,8 @@ H5I__unwrap(void *obj_ptr, H5I_type_t type) * * Return: SUCCEED/FAIL * - * Programmer: James Laird - * Nathaniel Furrer + * Programmer: James Laird + * Nathaniel Furrer * Friday, April 23, 2004 * *------------------------------------------------------------------------- @@ -535,7 +535,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iclear_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_clear_type * @@ -544,7 +544,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, March 24, 1999 * *------------------------------------------------------------------------- @@ -577,7 +577,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_clear_type() */ - + /*------------------------------------------------------------------------- * Function: H5I__clear_type_cb * @@ -643,7 +643,7 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__clear_type_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Idestroy_type * @@ -655,8 +655,8 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata) * * Return: SUCCEED/FAIL * - * Programmer: Nathaniel Furrer - * James Laird + * Programmer: Nathaniel Furrer + * James Laird * *------------------------------------------------------------------------- */ @@ -677,7 +677,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idestroy_type() */ - + /*------------------------------------------------------------------------- * Function: H5I__destroy_type * @@ -688,15 +688,15 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Nathaniel Furrer - * James Laird + * Programmer: Nathaniel Furrer + * James Laird * *------------------------------------------------------------------------- */ static herr_t H5I__destroy_type(H5I_type_t type) { - H5I_id_type_t *type_ptr; /* ptr to the atomic type */ + H5I_id_type_t *type_ptr; /* ptr to the atomic type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -729,7 +729,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__destroy_type() */ - + /*------------------------------------------------------------------------- * Function: H5Iregister * @@ -757,7 +757,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iregister() */ - + /*------------------------------------------------------------------------- * Function: H5I_register * @@ -819,7 +819,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register() */ - + /*------------------------------------------------------------------------- * Function: H5I_register_using_existing_id * @@ -890,7 +890,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_using_existing_id() */ - + /*------------------------------------------------------------------------- * Function: H5I_subst * @@ -900,8 +900,8 @@ done: * with the specified ID. * Failure: NULL * - * Programmer: Quincey Koziol - * Saturday, February 27, 2010 + * Programmer: Quincey Koziol + * Saturday, February 27, 2010 * *------------------------------------------------------------------------- */ @@ -909,7 +909,7 @@ void * H5I_subst(hid_t id, const void *new_object) { H5I_id_info_t *id_ptr; /* Pointer to the atom */ - void *ret_value = NULL; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -927,7 +927,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_subst() */ - + /*------------------------------------------------------------------------- * Function: H5I_object * @@ -943,8 +943,8 @@ done: void * H5I_object(hid_t id) { - H5I_id_info_t *id_ptr; /* Pointer to the new atom */ - void *ret_value = NULL; /* Return value */ + H5I_id_info_t *id_ptr; /* Pointer to the new atom */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOERR @@ -957,7 +957,7 @@ H5I_object(hid_t id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_object() */ - + /*------------------------------------------------------------------------- * Function: H5Iobject_verify * @@ -991,7 +991,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iobject_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I_object_verify * @@ -1002,8 +1002,8 @@ done: * specified ID. * Failure: NULL * - * Programmer: Quincey Koziol - * Wednesday, July 31, 2002 + * Programmer: Quincey Koziol + * Wednesday, July 31, 2002 * *------------------------------------------------------------------------- */ @@ -1026,7 +1026,7 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) FUNC_LEAVE_NOAPI(ret_value) } /* H5I_object_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I_get_type * @@ -1040,8 +1040,8 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) * ID types). * Failure: H5I_BADID * - * Programmer: Robb Matzke - * Friday, February 19, 1999 + * Programmer: Robb Matzke + * Friday, February 19, 1999 * *------------------------------------------------------------------------- */ @@ -1060,7 +1060,7 @@ H5I_get_type(hid_t id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_type() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_type * @@ -1087,13 +1087,13 @@ H5Iget_type(hid_t id) ret_value = H5I_get_type(id); if(ret_value <= H5I_BADID || (int)ret_value >= H5I_next_type || NULL == H5I_object(id)) - HGOTO_DONE(H5I_BADID); + HGOTO_DONE(H5I_BADID); done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_is_file_object * @@ -1144,7 +1144,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* H5I_is_file_object() */ - + /*------------------------------------------------------------------------- * Function: H5Iremove_verify * @@ -1157,8 +1157,8 @@ done: * calling H5I_object(). * Failure: NULL * - * Programmer: James Laird - * Nathaniel Furrer + * Programmer: James Laird + * Nathaniel Furrer * *------------------------------------------------------------------------- */ @@ -1180,7 +1180,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iremove_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I__remove_verify * @@ -1192,15 +1192,15 @@ done: * calling H5I_object(). * Failure: NULL * - * Programmer: James Laird - * Nat Furrer + * Programmer: James Laird + * Nat Furrer * *------------------------------------------------------------------------- */ static void * H5I__remove_verify(hid_t id, H5I_type_t id_type) { - void * ret_value = NULL; /*return value */ + void * ret_value = NULL; /*return value */ FUNC_ENTER_STATIC_NOERR @@ -1213,7 +1213,7 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__remove_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I__remove_common * @@ -1232,8 +1232,8 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type) static void * H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id) { - H5I_id_info_t *curr_id; /* Pointer to the current atom */ - void *ret_value = NULL; /* Return value */ + H5I_id_info_t *curr_id; /* Pointer to the current atom */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -1258,7 +1258,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__remove_common() */ - + /*------------------------------------------------------------------------- * Function: H5I_remove * @@ -1269,16 +1269,16 @@ done: * calling H5I_object(). * Failure: NULL * - * Programmer: Unknown + * Programmer: Unknown * *------------------------------------------------------------------------- */ void * H5I_remove(hid_t id) { - H5I_id_type_t *type_ptr; /* Pointer to the atomic type */ - H5I_type_t type; /* Atom's atomic type */ - void * ret_value = NULL; /* Return value */ + H5I_id_type_t *type_ptr; /* Pointer to the atomic type */ + H5I_type_t type; /* Atom's atomic type */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1298,7 +1298,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_remove() */ - + /*------------------------------------------------------------------------- * Function: H5Idec_ref * @@ -1334,7 +1334,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idec_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_ref * @@ -1380,7 +1380,7 @@ H5I_dec_ref(hid_t id) * file. We have to close the dataset anyway. (SLU - 2010/9/7) */ if(1 == id_ptr->count) { - H5I_id_type_t *type_ptr; /*ptr to the type */ + H5I_id_type_t *type_ptr; /*ptr to the type */ /* Get the ID's type */ type_ptr = H5I_id_type_list_g[H5I_TYPE(id)]; @@ -1404,7 +1404,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_app_ref * @@ -1452,7 +1452,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_app_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_app_ref_always_close * @@ -1494,7 +1494,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_app_ref_always_close() */ - + /*------------------------------------------------------------------------- * Function: H5Iinc_ref * @@ -1525,7 +1525,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iinc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_inc_ref * @@ -1563,7 +1563,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_inc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_ref * @@ -1594,7 +1594,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_get_ref * @@ -1627,7 +1627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iinc_type_ref * @@ -1660,7 +1660,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iinc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I__inc_type_ref * @@ -1694,14 +1694,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__inc_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Idec_type_ref * * Purpose: Decrements the reference count on an entire type of IDs. * If the type reference count becomes zero then the type is * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling + * their reference counts. Destroying IDs involves calling * the free-func for each ID's object and then adding the ID * struct to the ID free list. Public interface to * H5I_dec_type_ref. @@ -1736,14 +1736,14 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idec_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_type_ref * * Purpose: Decrements the reference count on an entire type of IDs. * If the type reference count becomes zero then the type is * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling + * their reference counts. Destroying IDs involves calling * the free-func for each ID's object and then adding the ID * struct to the ID free list. * Returns the number of references to the type on success; a @@ -1789,7 +1789,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_type_ref * @@ -1822,7 +1822,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I__get_type_ref * @@ -1857,7 +1857,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__get_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iis_valid * @@ -1887,7 +1887,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iis_valid() */ - + /*------------------------------------------------------------------------- * Function: H5I__search_cb * @@ -1913,7 +1913,7 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) /* Set the return value based on the callback's return value */ if(cb_ret_val > 0) { - ret_value = H5_ITER_STOP; /* terminate iteration early */ + ret_value = H5_ITER_STOP; /* terminate iteration early */ udata->ret_obj = obj; /* also set out parameter */ } else if(cb_ret_val < 0) @@ -1922,7 +1922,7 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__search_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Isearch * @@ -1973,7 +1973,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Isearch() */ - + /*------------------------------------------------------------------------- * Function: H5I__iterate_pub_cb * @@ -2004,7 +2004,7 @@ H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata) /* Set the return value based on the callback's return value */ if(cb_ret_val > 0) - ret_value = H5_ITER_STOP; /* terminate iteration early */ + ret_value = H5_ITER_STOP; /* terminate iteration early */ else if(cb_ret_val < 0) ret_value = H5_ITER_ERROR; /* indicate failure (which terminates iteration) */ else @@ -2013,7 +2013,7 @@ H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__iterate_pub_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Iiterate * @@ -2060,7 +2060,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iiterate() */ - + /*------------------------------------------------------------------------- * Function: H5I__iterate_cb * @@ -2100,7 +2100,7 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) /* Set the return value based on the callback's return value */ if(cb_ret_val > 0) - ret_value = H5_ITER_STOP; /* terminate iteration early */ + ret_value = H5_ITER_STOP; /* terminate iteration early */ else if(cb_ret_val < 0) ret_value = H5_ITER_ERROR; /* indicate failure (which terminates iteration) */ } /* end if */ @@ -2108,9 +2108,9 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__iterate_cb() */ - + /*------------------------------------------------------------------------- - * Function: H5I_iterate + * Function: H5I_iterate * * Purpose: Apply function FUNC to each member of type TYPE (with * non-zero application reference count if app_ref is TRUE). @@ -2138,7 +2138,7 @@ herr_t H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref) { H5I_id_type_t *type_ptr; /* Pointer to the type */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2167,7 +2167,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_iterate() */ - + /*------------------------------------------------------------------------- * Function: H5I__find_id * @@ -2183,9 +2183,9 @@ done: static H5I_id_info_t * H5I__find_id(hid_t id) { - H5I_type_t type; /*ID's type */ - H5I_id_type_t *type_ptr; /*ptr to the type */ - H5I_id_info_t *ret_value = NULL; /* Return value */ + H5I_type_t type; /*ID's type */ + H5I_id_type_t *type_ptr; /*ptr to the type */ + H5I_id_info_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -2212,7 +2212,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__find_id() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_name * @@ -2263,7 +2263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_name() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_file_id * @@ -2307,7 +2307,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_file_id() */ - + /*------------------------------------------------------------------------- * Function: H5I__find_id_cb * @@ -2345,7 +2345,7 @@ H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__find_id_cb() */ - + /*------------------------------------------------------------------------- * Function: H5I_find_id * @@ -2394,7 +2394,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_find_id() */ - + /*------------------------------------------------------------------------- * Function: H5I__id_dump_cb * @@ -2414,9 +2414,9 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_ENTER_STATIC_NOERR - HDfprintf(stderr, " id = %lu\n", (unsigned long)(item->id)); - HDfprintf(stderr, " count = %u\n", item->count); - HDfprintf(stderr, " obj = 0x%08lx\n", (unsigned long)(item->obj_ptr)); + HDfprintf(stderr, " id = %lu\n", (unsigned long)(item->id)); + HDfprintf(stderr, " count = %u\n", item->count); + HDfprintf(stderr, " obj = 0x%08p\n", item->obj_ptr); /* Get the group location, so we get get the name */ switch (type) { @@ -2482,7 +2482,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(H5_ITER_CONT) } /* end H5I__id_dump_cb() */ - + /*------------------------------------------------------------------------- * Function: H5I_dump_ids_for_type * @@ -2505,14 +2505,14 @@ H5I_dump_ids_for_type(H5I_type_t type) if(type_ptr) { /* Header */ - HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count); - HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); - HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); - HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); + HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count); + HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); + HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); + HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); /* List */ if(type_ptr->id_count > 0) { - HDfprintf(stderr, " List:\n"); + HDfprintf(stderr, " List:\n"); H5SL_iterate(type_ptr->ids, H5I__id_dump_cb, &type); } } diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 693174a..7af736a 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5Tdbg.c - * Jul 19 2007 - * Quincey Koziol + * Created: H5Tdbg.c + * Jul 19 2007 + * Quincey Koziol * - * Purpose: Dump debugging information about a datatype + * Purpose: Dump debugging information about a datatype * *------------------------------------------------------------------------- */ @@ -72,7 +72,7 @@ /*******************/ - + /*------------------------------------------------------------------------- * Function: H5T__print_stats * @@ -99,18 +99,18 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* #ifdef H5T_DEBUG if(H5DEBUG(T) && path->stats.ncalls > 0) { - hsize_t nbytes; - char bandwidth[32]; - - if(nprint && 0 == (*nprint)++) { - HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "Conversion", "Elmts", "Calls", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "----------", "-----", "-----", "----", - "------", "-------", "---------"); - } /* end if */ + hsize_t nbytes; + char bandwidth[32]; + + if(nprint && 0 == (*nprint)++) { + HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "Conversion", "Elmts", "Calls", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "----------", "-----", "-----", "----", + "------", "-------", "---------"); + } /* end if */ if(path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); @@ -121,23 +121,23 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* else nbytes = 0; - nbytes *= path->stats.nelmts; + nbytes *= path->stats.nelmts; H5_bandwidth(bandwidth, (double)nbytes, path->stats.times.elapsed); HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8T %8T %8T %10s\n", - path->name, - path->stats.nelmts, - path->stats.ncalls, + path->name, + path->stats.nelmts, + path->stats.ncalls, path->stats.times.user, path->stats.times.system, path->stats.times.elapsed, - bandwidth); + bandwidth); } /* end if */ #endif FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T__print_stats() */ - + /*------------------------------------------------------------------------- * Function: H5T_debug * @@ -406,18 +406,18 @@ H5T_debug(const H5T_t *dt, FILE *stream) } /* end else */ } else if (H5T_ENUM == dt->shared->type) { - size_t base_size; + size_t base_size; /* Enumeration data type */ HDfprintf(stream, " "); H5T_debug(dt->shared->parent, stream); base_size = dt->shared->parent->shared->size; for (i = 0; i < dt->shared->u.enumer.nmembs; i++) { - size_t k; + size_t k; HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); for (k = 0; k < base_size; k++) - HDfprintf(stream, "%02lx", (unsigned long)((uint8_t *)dt->shared->u.enumer.value + (i * base_size) + k)); + HDfprintf(stream, "%02p", ((uint8_t *)dt->shared->u.enumer.value + (i * base_size) + k)); } /* end for */ HDfprintf(stream, "\n"); } diff --git a/src/H5public.h b/src/H5public.h index 0fd9f3b..93cb2ea 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -26,7 +26,7 @@ * it via H5public.h. The #ifndef _H5public_H guard above would * prevent repeated include. */ -#include "H5pubconf.h" /*from configure */ +#include "H5pubconf.h" /*from configure */ /* API Version macro wrapper definitions */ #include "H5version.h" @@ -38,58 +38,20 @@ #include #endif #ifdef H5_STDC_HEADERS -# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ +# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ # include /*for variadic functions in H5VLpublic.h */ #endif #ifndef __cplusplus # ifdef H5_HAVE_STDINT_H -# include /*for C9x types */ +# include /*for C9x types */ # endif #else # ifdef H5_HAVE_STDINT_H_CXX -# include /*for C9x types when include from C++ */ +# include /*for C9x types when include from C++ */ # endif #endif #ifdef H5_HAVE_INTTYPES_H # include /* C99/POSIX.1 header for uint64_t, PRIu64 */ -#else /* H5_HAVE_INTTYPES_H */ -/* The following definitions should be suitable for 64-bit Windows, which is - * LLP64, and for 32-bit Windows, which is ILP32. Those are the only - * platforms where is likely to be missing. VS2015 and later - * *may* provide these definitions. - */ -#ifdef _WIN64 -# define PRIdPTR "lld" -# define PRIoPTR "llo" -# define PRIuPTR "llu" -# define PRIxPTR "llx" -#else /* _WIN64 */ -# define PRIdPTR "ld" -# define PRIoPTR "lo" -# define PRIuPTR "lu" -# define PRIxPTR "lx" -#endif /* _WIN64 */ - -# define PRId8 "d" -# define PRIo8 "o" -# define PRIu8 "u" -# define PRIx8 "x" -# define PRId16 "d" -# define PRIo16 "o" -# define PRIu16 "u" -# define PRIx16 "x" -# define PRId32 "d" -# define PRIo32 "o" -# define PRIu32 "u" -# define PRIx32 "x" -# define PRId64 "lld" -# define PRIo64 "llo" -# define PRIu64 "llu" -# define PRIx64 "llx" -# define PRIdMAX "lld" -# define PRIoMAX "llo" -# define PRIuMAX "llu" -# define PRIxMAX "llx" #endif #ifdef H5_HAVE_STDDEF_H # include @@ -99,7 +61,7 @@ # define MPICH_SKIP_MPICXX 1 # define OMPI_SKIP_MPICXX 1 # include -#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ +#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ # include #endif #endif @@ -132,15 +94,15 @@ extern "C" { #endif /* Version numbers */ -#define H5_VERS_MAJOR 1 /* For major interface/format changes */ -#define H5_VERS_MINOR 13 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ - /* Empty string for real releases. */ +#define H5_VERS_MAJOR 1 /* For major interface/format changes */ +#define H5_VERS_MINOR 13 /* For minor interface/format changes */ +#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ + /* Empty string for real releases. */ #define H5_VERS_INFO "HDF5 library version: 1.13.0" /* Full version string */ -#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ - H5_VERS_RELEASE) +#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ + H5_VERS_RELEASE) /* macros for comparing the version */ #define H5_VERSION_GE(Maj,Min,Rel) \ @@ -160,8 +122,8 @@ extern "C" { * The negative failure value is most commonly -1, but don't bet on it. The * proper way to detect failure is something like: * - * if((dset = H5Dopen2(file, name)) < 0) - * fprintf(stderr, "unable to open the requested dataset\n"); + * if((dset = H5Dopen2(file, name)) < 0) + * fprintf(stderr, "unable to open the requested dataset\n"); */ typedef int herr_t; @@ -173,13 +135,13 @@ typedef int herr_t; * (false), positive (true), or negative (failure). The proper way to test * for truth from a htri_t function is: * - * if ((retval = H5Tcommitted(type))>0) { - * printf("data type is committed\n"); - * } else if (!retval) { - * printf("data type is not committed\n"); - * } else { - * printf("error determining whether data type is committed\n"); - * } + * if ((retval = H5Tcommitted(type))>0) { + * printf("data type is committed\n"); + * } else if (!retval) { + * printf("data type is not committed\n"); + * } else { + * printf("error determining whether data type is committed\n"); + * } */ #ifdef H5_HAVE_STDBOOL_H #include @@ -221,8 +183,8 @@ typedef long long ssize_t; */ #if H5_SIZEOF_LONG_LONG >= 8 H5_GCC_DIAG_OFF(long-long) -typedef unsigned long long hsize_t; -typedef signed long long hssize_t; +typedef unsigned long long hsize_t; +typedef signed long long hssize_t; H5_GCC_DIAG_ON(long-long) # define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG # define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG @@ -267,7 +229,7 @@ H5_GCC_DIAG_ON(long-long) #else # error "nothing appropriate for H5_PRINTF_HADDR_FMT" #endif -#define HADDR_MAX (HADDR_UNDEF-1) +#define HADDR_MAX (HADDR_UNDEF-1) /* uint32_t type is used for creation order field for messages. It may be * defined in Posix.1g, otherwise it is defined here. @@ -335,7 +297,7 @@ typedef enum { H5_ITER_INC, /* Increasing order */ H5_ITER_DEC, /* Decreasing order */ H5_ITER_NATIVE, /* No particular order, whatever is fastest */ - H5_ITER_N /* Number of iteration orders */ + H5_ITER_N /* Number of iteration orders */ } H5_iter_order_t; /* Iteration callback values */ @@ -352,10 +314,10 @@ typedef enum { * links in groups/attributes on objects. */ typedef enum H5_index_t { - H5_INDEX_UNKNOWN = -1, /* Unknown index type */ - H5_INDEX_NAME, /* Index on names */ - H5_INDEX_CRT_ORDER, /* Index on creation order */ - H5_INDEX_N /* Number of indices defined */ + H5_INDEX_UNKNOWN = -1, /* Unknown index type */ + H5_INDEX_NAME, /* Index on names */ + H5_INDEX_CRT_ORDER, /* Index on creation order */ + H5_INDEX_N /* Number of indices defined */ } H5_index_t; /* @@ -403,9 +365,9 @@ H5_DLL herr_t H5get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, size_t *fac_size); H5_DLL herr_t H5get_alloc_stats(H5_alloc_stats_t *stats); H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, - unsigned *relnum); + unsigned *relnum); H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, - unsigned relnum); + unsigned relnum); H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); H5_DLL herr_t H5free_memory(void *mem); H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 00df56d..71162eb 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -20,6 +20,45 @@ * inside H5private.h * */ +#ifndef H5_HAVE_INTTYPES_H +/* The following definitions should be suitable for 64-bit Windows, which is + * LLP64, and for 32-bit Windows, which is ILP32. Those are the only + * platforms where is likely to be missing. VS2015 and later + * *may* provide these definitions. + */ +#ifdef _WIN64 +# define PRIdPTR "lld" +# define PRIoPTR "llo" +# define PRIuPTR "llu" +# define PRIxPTR "llx" +#else /* _WIN64 */ +# define PRIdPTR "ld" +# define PRIoPTR "lo" +# define PRIuPTR "lu" +# define PRIxPTR "lx" +#endif /* _WIN64 */ + +# define PRId8 "d" +# define PRIo8 "o" +# define PRIu8 "u" +# define PRIx8 "x" +# define PRId16 "d" +# define PRIo16 "o" +# define PRIu16 "u" +# define PRIx16 "x" +# define PRId32 "d" +# define PRIo32 "o" +# define PRIu32 "u" +# define PRIx32 "x" +# define PRId64 "lld" +# define PRIo64 "llo" +# define PRIu64 "llu" +# define PRIx64 "llx" +# define PRIdMAX "lld" +# define PRIoMAX "llo" +# define PRIuMAX "llu" +# define PRIxMAX "llx" +#endif /* * _MSC_VER = 1900 VS2015 @@ -41,11 +80,6 @@ typedef __int64 h5_stat_size_t; #define HDfstat(F,B) _fstati64(F,B) #define HDisatty(F) _isatty(F) -/* The isnan function needs underscore in VS2012 and earlier */ -#if (_MSC_VER <= 1700) - #define HDisnan(X) _isnan(X) -#endif /* MSC_VER < 1700 */ - #define HDgetcwd(S,Z) _getcwd(S,Z) #define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z) #define HDgetdrive() _getdrive() @@ -111,8 +145,10 @@ struct timespec }; #endif /* MSC_VER < 1900 */ -/* The round functions do not exist in VS2012 and earlier */ #if (_MSC_VER <= 1700) +/* The isnan function needs underscore in VS2012 and earlier */ +#define HDisnan(X) _isnan(X) +/* The round functions do not exist in VS2012 and earlier */ #define HDllround(V) Wllround(V) #define HDllroundf(V) Wllroundf(V) #define HDlround(V) Wlround(V) -- cgit v0.12 From 870e3ba3f45e90a43ea824d67cc8562aa63a3f6f Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Thu, 2 Jul 2020 18:20:36 -0500 Subject: Add missing '"'. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 88157c3..d7e3cb5 100644 --- a/configure.ac +++ b/configure.ac @@ -1151,7 +1151,7 @@ AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h]) ## Darwin AC_SUBST([H5_IS_DARWIN]) -H5_IS_DARWIN="no +H5_IS_DARWIN="no" case $host_os in darwin*) AC_DEFINE([HAVE_DARWIN], [1], [Define if Darwin or Mac OS X]) -- cgit v0.12 From 13c9b3768e6193db89d06faf59194b77d7747f45 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 3 Jul 2020 11:28:12 -0500 Subject: Address CMake and deprecated API build failures from monotonic timer patch. --- examples/h5_debug_trace.c | 2 +- tools/test/perform/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/h5_debug_trace.c b/examples/h5_debug_trace.c index 3d89ba4..5da55ed 100644 --- a/examples/h5_debug_trace.c +++ b/examples/h5_debug_trace.c @@ -121,7 +121,7 @@ main(int argc, char **argv) err = H5Pset_shuffle(pid); sid = H5Screate_simple(1, dims, dims); - did = H5Dcreate(fid, "somedata", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); + did = H5Dcreate2(fid, "somedata", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); err = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data); H5Sclose(sid); diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 6780c06..3c45e85 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -78,7 +78,7 @@ set (chunk_cache_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk_cache.c ) add_executable (chunk_cache ${chunk_cache_SOURCES}) -target_include_directories (chunk_cache PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (chunk_cache PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (chunk_cache STATIC) target_link_libraries (chunk_cache PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -- cgit v0.12 From d9105b2fcf04f36ea348bf9726a49c05cacc0b78 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 6 Jul 2020 16:09:49 -0500 Subject: Fixes Autotools builds on Solaris after monotonic timer changes clock_gettime() wasn't being found, so some configure changes were needed to set an appropriate POSIX level and use a C99 compiler. This required several compiler flag changes. Autotools only --- config/solaris | 21 ++++++++++++++++----- configure.ac | 7 +++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/config/solaris b/config/solaris index 656fee1..a424503 100644 --- a/config/solaris +++ b/config/solaris @@ -29,7 +29,9 @@ fi # Try solaris native compiler flags if test "X-" = "X-$cc_flags_set"; then - H5_CFLAGS="$H5_CFLAGS -erroff=%none -DBSD_COMP" + # HDF5 must be built with a C99 compiler on Solaris + # -erroff=%none turns on all warnings + H5_CFLAGS="$H5_CFLAGS -xc99=all -erroff=%none" # Production # NDEBUG is handled explicitly by the configure script @@ -41,17 +43,26 @@ if test "X-" = "X-$cc_flags_set"; then DEBUG_CFLAGS= # Symbols + # -g produces output for dbx, NOT gdb. You can use "gdb on" from + # inside gdb to use gdb commands if you need to debug. + # If you want a LOT of debugging information (at the expense of + # really slow code), try using -g3. That will even let you debug + # into macros. + # -s strips symbols, as in gcc NO_SYMBOLS_CFLAGS="-s" SYMBOLS_CFLAGS="-g" # Profile + # This produces profiling output for gprof. If you want to use + # the Solaris profiler, use -xprofile instead. PROFILE_CFLAGS="-xpg" # Optimization - # -g produces rather slow code. "-g -O" produces much faster code with some - # loss of debugger functions such as not able to print local variables. - HIGH_OPT_CFLAGS="-O" - DEBUG_OPT_CFLAGS="-O" + # -O has switched to -xO{1|2|3|4|5}. -xO3 is probably a good compromise + # for the daily tests, but you might want to switch to -xO2 or lower + # if you are actively debugging. + HIGH_OPT_CFLAGS="-xO5" + DEBUG_OPT_CFLAGS="-xO3" NO_OPT_CFLAGS= cc_flags_set=yes diff --git a/configure.ac b/configure.ac index d7e3cb5..e16cbba 100644 --- a/configure.ac +++ b/configure.ac @@ -1249,6 +1249,13 @@ case "$host_cpu-$host_vendor-$host_os" in ## VFD on Linux systems. H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ;; + + *solaris*) + ## Solaris also needs _POSIX_C_SOURCE set correctly to pick up + ## clock_gettime(). + H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" + H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" + ;; esac ## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible -- cgit v0.12 From da607fe4638c9cc08f717fbe65e799c1676c17ff Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 7 Jul 2020 10:52:58 -0500 Subject: Change load path in libhdf5_java.dylib to unversioned libhdf5.dylib for junit tests on Macs. --- java/test/junit.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index cbc57e9..62a5104 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -151,7 +151,7 @@ COPY_LIBFILES_TO_BLDLIBDIR() install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \ exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \ echo $exist_path; \ - install_name_tool -change $exist_path @rpath/libhdf5.1000.dylib libhdf5_java.dylib) + install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib) fi # copy jar files. Used -f to make sure get a new copy for tstfile in $COPY_JARTESTFILES -- cgit v0.12 From 127d1cfdf06e9c1cd264595c496a063848358a0a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 9 Jul 2020 08:34:01 -0700 Subject: Minor changes from normalization with 1.10 --- src/H5Bdbg.c | 204 +++++++++--------- src/H5Dbtree2.c | 2 +- src/H5Dchunk.c | 20 +- src/H5Dearray.c | 398 +++++++++++++++++----------------- src/H5Dfarray.c | 180 ++++++++-------- src/H5Dio.c | 21 +- src/H5Dlayout.c | 36 ++-- src/H5Dmpio.c | 2 +- src/H5Dselect.c | 2 +- src/H5EAdbg.c | 108 +++++----- src/H5Pdcpl.c | 20 +- src/H5S.c | 645 ++++++++++++++++++++++++++++--------------------------- src/H5Sall.c | 8 +- src/H5Sdbg.c | 25 +-- src/H5Shyper.c | 211 +++++++++--------- src/H5Smpio.c | 32 +-- src/H5Snone.c | 69 +++--- src/H5Spkg.h | 6 +- src/H5Spoint.c | 132 ++++++------ src/H5Sprivate.h | 1 + src/H5Sselect.c | 7 +- 21 files changed, 1055 insertions(+), 1074 deletions(-) diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 665e826..d900852 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5Bdbg.c - * Dec 11 2008 - * Quincey Koziol + * Created: H5Bdbg.c + * Dec 11 2008 + * Quincey Koziol * - * Purpose: Debugging routines for B-link tree package. + * Purpose: Debugging routines for B-link tree package. * *------------------------------------------------------------------------- */ @@ -32,35 +32,33 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Bpkg.h" /* B-link trees */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Bpkg.h" /* B-link trees */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ /*------------------------------------------------------------------------- - * Function: H5B_debug + * Function: H5B_debug * - * Purpose: Prints debugging info about a B-tree. + * Purpose: Prints debugging info about a B-tree. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 4 1997 + * Programmer: Robb Matzke + * Aug 4 1997 * *------------------------------------------------------------------------- */ herr_t -H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, - const H5B_class_t *type, void *udata) +H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B_class_t *type, void *udata) { - H5B_t *bt = NULL; - H5UC_t *rc_shared; /* Ref-counted shared info */ + H5B_t *bt = NULL; + H5UC_t *rc_shared; /* Ref-counted shared info */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -97,55 +95,53 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, * Print the values. */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Tree type ID:", - ((shared->type->id) == H5B_SNODE_ID ? "H5B_SNODE_ID" : + "Tree type ID:", + ((shared->type->id) == H5B_SNODE_ID ? "H5B_SNODE_ID" : ((shared->type->id) == H5B_CHUNK_ID ? "H5B_CHUNK_ID" : "Unknown!"))); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Size of node:", - shared->sizeof_rnode); + "Size of node:", + shared->sizeof_rnode); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Size of raw (disk) key:", - shared->sizeof_rkey); + "Size of raw (disk) key:", + shared->sizeof_rkey); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Dirty flag:", - bt->cache_info.is_dirty ? "True" : "False"); + "Dirty flag:", + bt->cache_info.is_dirty ? "True" : "False"); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Level:", - bt->level); + "Level:", + bt->level); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Address of left sibling:", - bt->left); + "Address of left sibling:", + bt->left); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Address of right sibling:", - bt->right); + "Address of right sibling:", + bt->right); HDfprintf(stream, "%*s%-*s %u (%u)\n", indent, "", fwidth, - "Number of children (max):", - bt->nchildren, shared->two_k); + "Number of children (max):", + bt->nchildren, shared->two_k); /* * Print the child addresses */ for(u = 0; u < bt->nchildren; u++) { - HDfprintf(stream, "%*sChild %d...\n", indent, "", u); - HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), - "Address:", bt->child[u]); + HDfprintf(stream, "%*sChild %d...\n", indent, "", u); + HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), + "Address:", bt->child[u]); /* If there is a key debugging routine, use it to display the left & right keys */ - if(type->debug_key) { + if(type->debug_key) { /* Decode the 'left' key & print it */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), "Left Key:"); HDassert(H5B_NKEY(bt,shared,u)); - (void)(type->debug_key)(stream, indent + 6, MAX(0, fwidth - 6), - H5B_NKEY(bt, shared, u), udata); + (void)(type->debug_key)(stream, indent + 6, MAX(0, fwidth - 6), H5B_NKEY(bt, shared, u), udata); /* Decode the 'right' key & print it */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), "Right Key:"); HDassert(H5B_NKEY(bt, shared, u + 1)); - (void)(type->debug_key)(stream, indent + 6, MAX (0, fwidth - 6), - H5B_NKEY(bt, shared, u + 1), udata); - } /* end if */ + (void)(type->debug_key)(stream, indent + 6, MAX (0, fwidth - 6), H5B_NKEY(bt, shared, u + 1), udata); + } /* end if */ } /* end for */ done: @@ -157,16 +153,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5B__assert + * Function: H5B__assert * - * Purpose: Verifies that the tree is structured correctly. + * Purpose: Verifies that the tree is structured correctly. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: aborts if something is wrong. + * Failure: aborts if something is wrong. * - * Programmer: Robb Matzke - * Tuesday, November 4, 1997 + * Programmer: Robb Matzke + * Tuesday, November 4, 1997 * *------------------------------------------------------------------------- */ @@ -174,20 +170,20 @@ done: herr_t H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) { - H5B_t *bt = NULL; - H5UC_t *rc_shared; /* Ref-counted shared info */ + H5B_t *bt = NULL; + H5UC_t *rc_shared; /* Ref-counted shared info */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ - int ncell, cmp; - static int ncalls = 0; - herr_t status; + int ncell, cmp; + static int ncalls = 0; + herr_t status; herr_t ret_value = SUCCEED; /* Return value */ /* A queue of child data */ struct child_t { - haddr_t addr; - unsigned level; - struct child_t *next; + haddr_t addr; + unsigned level; + struct child_t *next; } *head = NULL, *tail = NULL, *prev = NULL, *cur = NULL, *tmp = NULL; FUNC_ENTER_PACKAGE @@ -228,60 +224,60 @@ H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) * test. */ for(ncell = 0; cur; ncell++) { - bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); - HDassert(bt); - - /* Check node header */ - HDassert(bt->level == cur->level); - if(cur->next && cur->next->level == bt->level) - HDassert(H5F_addr_eq(bt->right, cur->next->addr)); - else - HDassert(!H5F_addr_defined(bt->right)); - if(prev && prev->level == bt->level) - HDassert(H5F_addr_eq(bt->left, prev->addr)); - else - HDassert(!H5F_addr_defined(bt->left)); - - if(cur->level > 0) { + bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); + HDassert(bt); + + /* Check node header */ + HDassert(bt->level == cur->level); + if(cur->next && cur->next->level == bt->level) + HDassert(H5F_addr_eq(bt->right, cur->next->addr)); + else + HDassert(!H5F_addr_defined(bt->right)); + if(prev && prev->level == bt->level) + HDassert(H5F_addr_eq(bt->left, prev->addr)); + else + HDassert(!H5F_addr_defined(bt->left)); + + if(cur->level > 0) { unsigned u; - for(u = 0; u < bt->nchildren; u++) { - /* - * Check that child nodes haven't already been seen. If they - * have then the tree has a cycle. - */ - for(tmp = head; tmp; tmp = tmp->next) - HDassert(H5F_addr_ne(tmp->addr, bt->child[u])); - - /* Add the child node to the end of the queue */ - tmp = (struct child_t *)H5MM_calloc(sizeof(struct child_t)); - HDassert(tmp); - tmp->addr = bt->child[u]; - tmp->level = bt->level - 1; - tail->next = tmp; - tail = tmp; - - /* Check that the keys are monotonically increasing */ - cmp = (type->cmp2)(H5B_NKEY(bt, shared, u), udata, H5B_NKEY(bt, shared, u + 1)); - HDassert(cmp < 0); - } /* end for */ - } /* end if */ - - /* Release node */ - status = H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); - HDassert(status >= 0); + for(u = 0; u < bt->nchildren; u++) { + /* + * Check that child nodes haven't already been seen. If they + * have then the tree has a cycle. + */ + for(tmp = head; tmp; tmp = tmp->next) + HDassert(H5F_addr_ne(tmp->addr, bt->child[u])); + + /* Add the child node to the end of the queue */ + tmp = (struct child_t *)H5MM_calloc(sizeof(struct child_t)); + HDassert(tmp); + tmp->addr = bt->child[u]; + tmp->level = bt->level - 1; + tail->next = tmp; + tail = tmp; + + /* Check that the keys are monotonically increasing */ + cmp = (type->cmp2)(H5B_NKEY(bt, shared, u), udata, H5B_NKEY(bt, shared, u + 1)); + HDassert(cmp < 0); + } /* end for */ + } /* end if */ + + /* Release node */ + status = H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); + HDassert(status >= 0); bt = NULL; /* Make certain future references will be caught */ - /* Advance current location in queue */ - prev = cur; - cur = cur->next; + /* Advance current location in queue */ + prev = cur; + cur = cur->next; } /* end for */ /* Free all entries from queue */ while(head) { - tmp = head->next; - H5MM_xfree(head); - head = tmp; + tmp = head->next; + H5MM_xfree(head); + head = tmp; } /* end while */ done: diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index ae98654..ccb786b 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -292,7 +292,7 @@ H5D__bt2_dst_context(void *_ctx) /* Free array for chunk dimension sizes */ if(ctx->dim) - (void)H5FL_ARR_FREE(uint32_t, ctx->dim); + H5FL_ARR_FREE(uint32_t, ctx->dim); /* Release callback context */ ctx = H5FL_FREE(H5D_bt2_ctx_t, ctx); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 5fda3c0..62e3ec5 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -1914,7 +1914,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t new_chunk_info->mspace_shared = FALSE; /* Copy the chunk's scaled coordinates */ - H5MM_memcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims); + H5MM_memcpy(new_chunk_info->scaled, scaled, sizeof(hsize_t) * fm->f_ndims); new_chunk_info->scaled[fm->f_ndims] = 0; /* Insert the new chunk into the skip list */ @@ -2095,7 +2095,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) for(u = 0; u < fm->f_ndims; u++) { /* Compensate for the chunk offset */ H5_CHECK_OVERFLOW(coords[u], hsize_t, hssize_t); - chunk_adjust[u] = adjust[u] - (hssize_t)coords[u]; /*lint !e771 The adjust array will always be initialized */ + chunk_adjust[u] = adjust[u] - (hssize_t)coords[u]; } /* end for */ /* Adjust the selection */ @@ -2329,7 +2329,7 @@ H5D__chunk_mem_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, u { H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ - hsize_t coords_in_mem[H5S_MAX_RANK]; /* Coordinates of element in memory */ + hsize_t coords_in_mem[H5S_MAX_RANK]; /* Coordinates of element in memory */ hsize_t chunk_index; /* Chunk index */ herr_t ret_value = SUCCEED; /* Return value */ @@ -5991,7 +5991,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) if((udata->common.layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims)) must_filter = FALSE; - } /* end if */ + } /* Check parameter for type conversion */ if(udata->do_convert) { @@ -6029,7 +6029,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(!H5F_addr_defined(chunk_rec->chunk_addr)); H5MM_memcpy(buf, udata->chunk, nbytes); udata->chunk = NULL; - } /* end if */ + } else { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ unsigned idx; /* Index of chunk in cache, if present */ @@ -6062,13 +6062,13 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); H5MM_memcpy(buf, ent->chunk, nbytes); - } /* end if */ + } else { /* read chunk data from the source file */ if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") - } /* end else */ - } /* end else */ + } + } /* Need to uncompress filtered variable-length & reference data elements that are not found in chunk cache */ if(must_filter && (is_vlen || fix_ref) && !udata->chunk_in_cache) { @@ -7201,7 +7201,7 @@ H5D__get_num_chunks(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_ if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__get_num_chunks_cb, &num_chunks) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve allocated chunk information from index") *nchunks = num_chunks; - } /* end else */ + } done: FUNC_LEAVE_NOAPI_TAG(ret_value) @@ -7248,7 +7248,7 @@ H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Stop iterating */ ret_value = H5_ITER_STOP; - } /* end if */ + } /* Go to the next chunk */ else chunk_info->curr_idx++; diff --git a/src/H5Dearray.c b/src/H5Dearray.c index eaa8c46..a53489e 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -11,10 +11,10 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol - * Tuesday, January 27, 2009 +/* Programmer: Quincey Koziol + * Tuesday, January 27, 2009 * - * Purpose: Extensible array indexed (chunked) I/O functions. The chunks + * Purpose: Extensible array indexed (chunked) I/O functions. The chunks * are given a single-dimensional index which is used as the * offset in an extensible array that maps a chunk coordinate to * a disk address. @@ -183,7 +183,7 @@ const H5EA_class_t H5EA_CLS_CHUNK[1]={{ H5D__earray_fill, /* Fill block of missing elements callback */ H5D__earray_encode, /* Element encoding callback */ H5D__earray_decode, /* Element decoding callback */ - H5D__earray_debug, /* Element debugging callback */ + H5D__earray_debug, /* Element debugging callback */ H5D__earray_crt_dbg_context, /* Create debugging context */ H5D__earray_dst_dbg_context /* Destroy debugging context */ }}; @@ -216,14 +216,14 @@ H5FL_DEFINE_STATIC(H5D_earray_ctx_ud_t); /*------------------------------------------------------------------------- - * Function: H5D__earray_crt_context + * Function: H5D__earray_crt_context * - * Purpose: Create context for callbacks + * Purpose: Create context for callbacks * - * Return: Success: non-NULL - * Failure: NULL + * Return: Success: non-NULL + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 29, 2009 * *------------------------------------------------------------------------- @@ -265,14 +265,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_dst_context + * Function: H5D__earray_dst_context * - * Purpose: Destroy context for callbacks + * Purpose: Destroy context for callbacks * - * Return: Success: non-NULL - * Failure: NULL + * Return: Success: non-NULL + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 29, 2009 * *------------------------------------------------------------------------- @@ -295,14 +295,14 @@ H5D__earray_dst_context(void *_ctx) /*------------------------------------------------------------------------- - * Function: H5D__earray_fill + * Function: H5D__earray_fill * - * Purpose: Fill "missing elements" in block of elements + * Purpose: Fill "missing elements" in block of elements * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 27, 2009 * *------------------------------------------------------------------------- @@ -325,14 +325,14 @@ H5D__earray_fill(void *nat_blk, size_t nelmts) /*------------------------------------------------------------------------- - * Function: H5D__earray_encode + * Function: H5D__earray_encode * - * Purpose: Encode an element from "native" to "raw" form + * Purpose: Encode an element from "native" to "raw" form * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 27, 2009 * *------------------------------------------------------------------------- @@ -369,14 +369,14 @@ H5D__earray_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx) /*------------------------------------------------------------------------- - * Function: H5D__earray_decode + * Function: H5D__earray_decode * - * Purpose: Decode an element from "raw" to "native" form + * Purpose: Decode an element from "raw" to "native" form * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 29, 2009 * *------------------------------------------------------------------------- @@ -413,14 +413,14 @@ H5D__earray_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx) /*------------------------------------------------------------------------- - * Function: H5D__earray_debug + * Function: H5D__earray_debug * - * Purpose: Display an element for debugging + * Purpose: Display an element for debugging * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 29, 2009 * *------------------------------------------------------------------------- @@ -447,14 +447,14 @@ H5D__earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, /*------------------------------------------------------------------------- - * Function: H5D__earray_filt_fill + * Function: H5D__earray_filt_fill * - * Purpose: Fill "missing elements" in block of elements + * Purpose: Fill "missing elements" in block of elements * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -478,14 +478,14 @@ H5D__earray_filt_fill(void *nat_blk, size_t nelmts) /*------------------------------------------------------------------------- - * Function: H5D__earray_filt_encode + * Function: H5D__earray_filt_encode * - * Purpose: Encode an element from "native" to "raw" form + * Purpose: Encode an element from "native" to "raw" form * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -525,14 +525,14 @@ H5D__earray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx /*------------------------------------------------------------------------- - * Function: H5D__earray_filt_decode + * Function: H5D__earray_filt_decode * - * Purpose: Decode an element from "raw" to "native" form + * Purpose: Decode an element from "raw" to "native" form * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -571,14 +571,14 @@ H5D__earray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx /*------------------------------------------------------------------------- - * Function: H5D__earray_filt_debug + * Function: H5D__earray_filt_debug * - * Purpose: Display an element for debugging + * Purpose: Display an element for debugging * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -606,15 +606,15 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, /*------------------------------------------------------------------------- - * Function: H5D__earray_crt_dbg_context + * Function: H5D__earray_crt_dbg_context * - * Purpose: Create context for debugging callback - * (get the layout message in the specified object header) + * Purpose: Create context for debugging callback + * (get the layout message in the specified object header) * - * Return: Success: non-NULL - * Failure: NULL + * Return: Success: non-NULL + * Failure: NULL * - * Programmer: Vailin Choi; July 2010 + * Programmer: Vailin Choi; July 2010 * *------------------------------------------------------------------------- */ @@ -680,15 +680,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_dst_dbg_context + * Function: H5D__earray_dst_dbg_context * - * Purpose: Destroy context for debugging callback - * (free the layout message from the specified object header) + * Purpose: Destroy context for debugging callback + * (free the layout message from the specified object header) * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi; July 2010 + * Programmer: Vailin Choi; July 2010 * *------------------------------------------------------------------------- */ @@ -710,16 +710,16 @@ H5D__earray_dst_dbg_context(void *_dbg_ctx) /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_depend + * Function: H5D__earray_idx_depend * - * Purpose: Create flush dependency between extensible array and dataset's + * Purpose: Create flush dependency between extensible array and dataset's * object header. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol - * Tuesday, June 2, 2009 + * Programmer: Quincey Koziol + * Tuesday, June 2, 2009 * *------------------------------------------------------------------------- */ @@ -772,20 +772,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_open + * Function: H5D__earray_idx_open * - * Purpose: Opens an existing extensible array. + * Purpose: Opens an existing extensible array. * - * Note: This information is passively initialized from each index + * Note: This information is passively initialized from each index * operation callback because those abstract chunk index operations * are designed to work with the v1 B-tree chunk indices also, * which don't require an 'open' for the data structure. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol - * Thursday, January 29, 2009 + * Programmer: Quincey Koziol + * Thursday, January 29, 2009 * *------------------------------------------------------------------------- */ @@ -814,7 +814,7 @@ H5D__earray_idx_open(const H5D_chk_idx_info_t *idx_info) /* Open the extensible array for the chunk index */ if(NULL == (idx_info->storage->u.earray.ea = H5EA_open(idx_info->f, idx_info->storage->idx_addr, &udata))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open extensible array") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open extensible array") /* Check for SWMR writes to the file */ if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) @@ -827,13 +827,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_init + * Function: H5D__earray_idx_init * - * Purpose: Initialize the indexing information for a dataset. + * Purpose: Initialize the indexing information for a dataset. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 27, 2009 * *------------------------------------------------------------------------- @@ -862,7 +862,7 @@ H5D__earray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, /* Get the dim info for dataset */ if((sndims = H5S_get_simple_extent_dims(space, NULL, max_dims)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace dimensions") H5_CHECKED_ASSIGN(ndims, unsigned, sndims, int); /* Find the rank of the unlimited dimension */ @@ -895,20 +895,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_create + * Function: H5D__earray_idx_create * - * Purpose: Creates a new indexed-storage extensible array and initializes + * Purpose: Creates a new indexed-storage extensible array and initializes * the layout struct with information about the storage. The - * struct should be immediately written to the object header. + * struct should be immediately written to the object header. * - * This function must be called before passing LAYOUT to any of - * the other indexed storage functions! + * This function must be called before passing LAYOUT to any of + * the other indexed storage functions! * - * Return: Non-negative on success (with the LAYOUT argument initialized - * and ready to write to an object header). Negative on failure. + * Return: Non-negative on success (with the LAYOUT argument initialized + * and ready to write to an object header). Negative on failure. * - * Programmer: Quincey Koziol - * Tuesday, January 27, 2009 + * Programmer: Quincey Koziol + * Tuesday, January 27, 2009 * *------------------------------------------------------------------------- */ @@ -965,11 +965,11 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Create the extensible array for the chunk index */ if(NULL == (idx_info->storage->u.earray.ea = H5EA_create(idx_info->f, &cparam, &udata))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create extensible array") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create extensible array") /* Get the address of the extensible array in file */ if(H5EA_get_addr(idx_info->storage->u.earray.ea, &(idx_info->storage->idx_addr)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array address") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array address") /* Check for SWMR writes to the file */ if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) @@ -982,14 +982,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_is_space_alloc + * Function: H5D__earray_idx_is_space_alloc * - * Purpose: Query if space is allocated for index method + * Purpose: Query if space is allocated for index method * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, January 29, 2009 + * Programmer: Quincey Koziol + * Thursday, January 29, 2009 * *------------------------------------------------------------------------- */ @@ -1006,13 +1006,13 @@ H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_insert + * Function: H5D__earray_idx_insert * - * Purpose: Insert chunk address into the indexing structure. + * Purpose: Insert chunk address into the indexing structure. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; May 2014 + * Programmer: Vailin Choi; May 2014 * *------------------------------------------------------------------------- */ @@ -1021,7 +1021,7 @@ H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata const H5D_t H5_ATTR_UNUSED *dset) { H5EA_t *ea; /* Pointer to extensible array structure */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1046,26 +1046,26 @@ H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata ea = idx_info->storage->u.earray.ea; if(!H5F_addr_defined(udata->chunk_block.offset)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "The chunk should have allocated already") + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "The chunk should have allocated already") if(udata->chunk_idx != (udata->chunk_idx & 0xffffffff)) /* negative value */ - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "chunk index must be less than 2^32") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "chunk index must be less than 2^32") /* Check for filters on chunks */ if(idx_info->pline->nused > 0) { - H5D_earray_filt_elmt_t elmt; /* Extensible array element */ + H5D_earray_filt_elmt_t elmt; /* Extensible array element */ - elmt.addr = udata->chunk_block.offset; + elmt.addr = udata->chunk_block.offset; H5_CHECKED_ASSIGN(elmt.nbytes, uint32_t, udata->chunk_block.length, hsize_t); - elmt.filter_mask = udata->filter_mask; + elmt.filter_mask = udata->filter_mask; - /* Set the info for the chunk */ - if(H5EA_set(ea, udata->chunk_idx, &elmt) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info") + /* Set the info for the chunk */ + if(H5EA_set(ea, udata->chunk_idx, &elmt) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info") } /* end if */ else { - /* Set the address for the chunk */ - if(H5EA_set(ea, udata->chunk_idx, &udata->chunk_block.offset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk address") + /* Set the address for the chunk */ + if(H5EA_set(ea, udata->chunk_idx, &udata->chunk_block.offset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk address") } /* end else */ done: @@ -1074,15 +1074,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_get_addr + * Function: H5D__earray_idx_get_addr * - * Purpose: Get the file address of a chunk if file space has been - * assigned. Save the retrieved information in the udata - * supplied. + * Purpose: Get the file address of a chunk if file space has been + * assigned. Save the retrieved information in the udata + * supplied. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 29, 2009 * *------------------------------------------------------------------------- @@ -1092,7 +1092,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda { H5EA_t *ea; /* Pointer to extensible array structure */ hsize_t idx; /* Array index of chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1118,13 +1118,13 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda /* Check for unlimited dim. not being the slowest-changing dim. */ if(idx_info->layout->u.earray.unlim_dim > 0) { - hsize_t swizzled_coords[H5O_LAYOUT_NDIMS]; /* swizzled chunk coordinates */ + hsize_t swizzled_coords[H5O_LAYOUT_NDIMS]; /* swizzled chunk coordinates */ unsigned ndims = (idx_info->layout->ndims - 1); /* Number of dimensions */ - unsigned u; + unsigned u; - /* Compute coordinate offset from scaled offset */ - for(u = 0; u < ndims; u++) - swizzled_coords[u] = udata->common.scaled[u] * idx_info->layout->dim[u]; + /* Compute coordinate offset from scaled offset */ + for(u = 0; u < ndims; u++) + swizzled_coords[u] = udata->common.scaled[u] * idx_info->layout->dim[u]; H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim); @@ -1157,12 +1157,12 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Update the other (constant) information for the chunk */ - udata->chunk_block.length = idx_info->layout->size; + udata->chunk_block.length = idx_info->layout->size; udata->filter_mask = 0; } /* end else */ if(!H5F_addr_defined(udata->chunk_block.offset)) - udata->chunk_block.length = 0; + udata->chunk_block.length = 0; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1170,14 +1170,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_resize + * Function: H5D__earray_idx_resize * - * Purpose: Calculate/setup the swizzled down chunk array, used for chunk + * Purpose: Calculate/setup the swizzled down chunk array, used for chunk * index calculations. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 23, 2009 * *------------------------------------------------------------------------- @@ -1224,13 +1224,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_iterate_cb + * Function: H5D__earray_idx_iterate_cb * - * Purpose: Callback routine for extensible array element iteration. + * Purpose: Callback routine for extensible array element iteration. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; Feb 2015 + * Programmer: Vailin Choi; Feb 2015 * *------------------------------------------------------------------------- */ @@ -1257,8 +1257,8 @@ H5D__earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void * /* Make "generic chunk" callback */ if(H5F_addr_defined(udata->chunk_rec.chunk_addr)) - if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0) - HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback"); + if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0) + HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback"); /* Update coordinates of chunk in dataset */ ndims = udata->common.layout->ndims - 1; @@ -1283,18 +1283,18 @@ H5D__earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void * /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_iterate + * Function: H5D__earray_idx_iterate * - * Purpose: Iterate over the chunks in an index, making a callback + * Purpose: Iterate over the chunks in an index, making a callback * for each one. * - * Note: This implementation is slow, particularly for sparse + * Note: This implementation is slow, particularly for sparse * extensible arrays, replace it with call to H5EA_iterate() * when that's available. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 29, 2009 * *------------------------------------------------------------------------- @@ -1332,27 +1332,27 @@ H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, /* Get the extensible array statistics */ if(H5EA_get_stats(ea, &ea_stat) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics") if(ea_stat.stored.max_idx_set > 0) { H5D_earray_it_ud_t udata; /* User data for iteration callback */ - /* Initialize userdata */ - HDmemset(&udata, 0, sizeof udata); - udata.common.layout = idx_info->layout; - udata.common.storage = idx_info->storage; + /* Initialize userdata */ + HDmemset(&udata, 0, sizeof udata); + udata.common.layout = idx_info->layout; + udata.common.storage = idx_info->storage; HDmemset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec)); udata.filtered = (idx_info->pline->nused > 0); if(!udata.filtered) { udata.chunk_rec.nbytes = idx_info->layout->size; udata.chunk_rec.filter_mask = 0; } /* end if */ - udata.cb = chunk_cb; - udata.udata = chunk_udata; + udata.cb = chunk_cb; + udata.udata = chunk_udata; /* Iterate over the extensible array elements */ - if((ret_value = H5EA_iterate(ea, H5D__earray_idx_iterate_cb, &udata)) < 0) - HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); + if((ret_value = H5EA_iterate(ea, H5D__earray_idx_iterate_cb, &udata)) < 0) + HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); } /* end if */ done: @@ -1361,13 +1361,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_remove + * Function: H5D__earray_idx_remove * - * Purpose: Remove chunk from index. + * Purpose: Remove chunk from index. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 29, 2009 * *------------------------------------------------------------------------- @@ -1377,7 +1377,7 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t { H5EA_t *ea; /* Pointer to extensible array structure */ hsize_t idx; /* Array index of chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1404,13 +1404,13 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t /* Check for unlimited dim. not being the slowest-changing dim. */ if(idx_info->layout->u.earray.unlim_dim > 0) { - hsize_t swizzled_coords[H5O_LAYOUT_NDIMS]; /* swizzled chunk coordinates */ + hsize_t swizzled_coords[H5O_LAYOUT_NDIMS]; /* swizzled chunk coordinates */ unsigned ndims = (idx_info->layout->ndims - 1); /* Number of dimensions */ - unsigned u; + unsigned u; - /* Compute coordinate offset from scaled offset */ - for(u = 0; u < ndims; u++) - swizzled_coords[u] = udata->scaled[u] * idx_info->layout->dim[u]; + /* Compute coordinate offset from scaled offset */ + for(u = 0; u < ndims; u++) + swizzled_coords[u] = udata->scaled[u] * idx_info->layout->dim[u]; H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim); @@ -1472,14 +1472,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_delete_cb + * Function: H5D__earray_idx_delete_cb * - * Purpose: Delete space for chunk in file + * Purpose: Delete space for chunk in file * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -1509,19 +1509,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_delete + * Function: H5D__earray_idx_delete * - * Purpose: Delete index and raw data storage for entire dataset + * Purpose: Delete index and raw data storage for entire dataset * (i.e. all chunks) * - * Note: This implementation is slow, particularly for sparse + * Note: This implementation is slow, particularly for sparse * extensible arrays, replace it with call to H5EA_iterate() * when that's available. * - * Return: Success: Non-negative - * Failure: negative + * Return: Success: Non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 29, 2009 * *------------------------------------------------------------------------- @@ -1571,13 +1571,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_copy_setup + * Function: H5D__earray_idx_copy_setup * - * Purpose: Set up any necessary information for copying chunks + * Purpose: Set up any necessary information for copying chunks * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -1626,13 +1626,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_copy_shutdown + * Function: H5D__earray_idx_copy_shutdown * - * Purpose: Shutdown any information from copying chunks + * Purpose: Shutdown any information from copying chunks * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -1704,7 +1704,7 @@ H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) /* Get the extensible array statistics */ if(H5EA_get_stats(ea, &ea_stat) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics") /* Set the size of the extensible array */ *index_size = ea_stat.computed.hdr_size + ea_stat.computed.index_blk_size @@ -1722,13 +1722,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_reset + * Function: H5D__earray_idx_reset * - * Purpose: Reset indexing information. + * Purpose: Reset indexing information. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -1743,7 +1743,7 @@ H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /* Reset index info */ if(reset_addr) { - storage->idx_addr = HADDR_UNDEF; + storage->idx_addr = HADDR_UNDEF; storage->u.earray.dset_ohdr_addr = HADDR_UNDEF; } /* end if */ storage->u.earray.ea = NULL; @@ -1753,13 +1753,13 @@ H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_dump + * Function: H5D__earray_idx_dump * - * Purpose: Dump indexing information to a stream. + * Purpose: Dump indexing information to a stream. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -1780,13 +1780,13 @@ H5D__earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) /*------------------------------------------------------------------------- - * Function: H5D__earray_idx_dest + * Function: H5D__earray_idx_dest * - * Purpose: Release indexing information in memory. + * Purpose: Release indexing information in memory. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 31, 2009 * *------------------------------------------------------------------------- @@ -1806,7 +1806,7 @@ H5D__earray_idx_dest(const H5D_chk_idx_info_t *idx_info) /* Check if the extensible array is open */ if(idx_info->storage->u.earray.ea) { - /* Patch the top level file pointer contained in ea if needed */ + /* Patch the top level file pointer contained in ea if needed */ if(H5EA_patch_file(idx_info->storage->u.earray.ea, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch earray file pointer") diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 4eedf04..a9202c2 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -261,14 +261,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_dst_context + * Function: H5D__farray_dst_context * - * Purpose: Destroy context for callbacks + * Purpose: Destroy context for callbacks * - * Return: Success: non-NULL - * Failure: NULL + * Return: Success: non-NULL + * Failure: NULL * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -291,14 +291,14 @@ H5D__farray_dst_context(void *_ctx) /*------------------------------------------------------------------------- - * Function: H5D__farray_fill + * Function: H5D__farray_fill * - * Purpose: Fill "missing elements" in block of elements + * Purpose: Fill "missing elements" in block of elements * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -321,14 +321,14 @@ H5D__farray_fill(void *nat_blk, size_t nelmts) /*------------------------------------------------------------------------- - * Function: H5D__farray_encode + * Function: H5D__farray_encode * - * Purpose: Encode an element from "native" to "raw" form + * Purpose: Encode an element from "native" to "raw" form * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -365,14 +365,14 @@ H5D__farray_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx) /*------------------------------------------------------------------------- - * Function: H5D__farray_decode + * Function: H5D__farray_decode * - * Purpose: Decode an element from "raw" to "native" form + * Purpose: Decode an element from "raw" to "native" form * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -409,14 +409,14 @@ H5D__farray_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx) /*------------------------------------------------------------------------- - * Function: H5D__farray_debug + * Function: H5D__farray_debug * - * Purpose: Display an element for debugging + * Purpose: Display an element for debugging * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -443,23 +443,23 @@ H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, /*------------------------------------------------------------------------- - * Function: H5D__farray_crt_dbg_context + * Function: H5D__farray_crt_dbg_context * - * Purpose: Create context for debugging callback - * (get the layout message in the specified object header) + * Purpose: Create context for debugging callback + * (get the layout message in the specified object header) * - * Return: Success: non-NULL - * Failure: NULL + * Return: Success: non-NULL + * Failure: NULL * - * Programmer: Vailin Choi - * 5th August, 2009 + * Programmer: Vailin Choi + * 5th August, 2009 * *------------------------------------------------------------------------- */ static void * H5D__farray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) { - H5D_farray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ + H5D_farray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */ H5O_layout_t layout; /* Layout message */ @@ -518,16 +518,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_dst_dbg_context + * Function: H5D__farray_dst_dbg_context * - * Purpose: Destroy context for debugging callback - * (free the layout message from the specified object header) + * Purpose: Destroy context for debugging callback + * (free the layout message from the specified object header) * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol - * 24th September, 2009 + * Programmer: Quincey Koziol + * 24th September, 2009 * *------------------------------------------------------------------------- */ @@ -549,14 +549,14 @@ H5D__farray_dst_dbg_context(void *_dbg_ctx) /*------------------------------------------------------------------------- - * Function: H5D__farray_filt_fill + * Function: H5D__farray_filt_fill * - * Purpose: Fill "missing elements" in block of elements + * Purpose: Fill "missing elements" in block of elements * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -580,14 +580,14 @@ H5D__farray_filt_fill(void *nat_blk, size_t nelmts) /*------------------------------------------------------------------------- - * Function: H5D__farray_filt_encode + * Function: H5D__farray_filt_encode * - * Purpose: Encode an element from "native" to "raw" form + * Purpose: Encode an element from "native" to "raw" form * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -627,14 +627,14 @@ H5D__farray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx /*------------------------------------------------------------------------- - * Function: H5D__farray_filt_decode + * Function: H5D__farray_filt_decode * - * Purpose: Decode an element from "raw" to "native" form + * Purpose: Decode an element from "raw" to "native" form * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -673,14 +673,14 @@ H5D__farray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx /*------------------------------------------------------------------------- - * Function: H5D__farray_filt_debug + * Function: H5D__farray_filt_debug * - * Purpose: Display an element for debugging + * Purpose: Display an element for debugging * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -708,15 +708,15 @@ H5D__farray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_depend + * Function: H5D__farray_idx_depend * - * Purpose: Create flush dependency between fixed array and dataset's + * Purpose: Create flush dependency between fixed array and dataset's * object header. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -798,15 +798,15 @@ H5D__farray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t H5_ATTR_UNU /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_open + * Function: H5D__farray_idx_open * - * Purpose: Opens an existing fixed array and initializes + * Purpose: Opens an existing fixed array and initializes * the layout struct with information about the storage. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -849,19 +849,19 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_create + * Function: H5D__farray_idx_create * - * Purpose: Creates a new indexed-storage fixed array and initializes + * Purpose: Creates a new indexed-storage fixed array and initializes * the layout struct with information about the storage. The - * struct should be immediately written to the object header. + * struct should be immediately written to the object header. * - * This function must be called before passing LAYOUT to any of - * the other indexed storage functions! + * This function must be called before passing LAYOUT to any of + * the other indexed storage functions! * - * Return: Non-negative on success (with the LAYOUT argument initialized - * and ready to write to an object header). Negative on failure. + * Return: Non-negative on success (with the LAYOUT argument initialized + * and ready to write to an object header). Negative on failure. * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -869,9 +869,9 @@ done: static herr_t H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) { - H5FA_create_t cparam; /* Fixed array creation parameters */ + H5FA_create_t cparam; /* Fixed array creation parameters */ H5D_farray_ctx_ud_t udata; /* User data for fixed array create call */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -930,13 +930,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_is_space_alloc + * Function: H5D__farray_idx_is_space_alloc * - * Purpose: Query if space is allocated for index method + * Purpose: Query if space is allocated for index method * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * Thursday, April 30, 2009 * *------------------------------------------------------------------------- @@ -954,13 +954,13 @@ H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) /*------------------------------------------------------------------------- - * Function: H5D__farray_idx_insert + * Function: H5D__farray_idx_insert * - * Purpose: Insert chunk address into the indexing structure. + * Purpose: Insert chunk address into the indexing structure. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Vailin Choi; 5 May 2014 + * Programmer: Vailin Choi; 5 May 2014 * *------------------------------------------------------------------------- */ @@ -968,8 +968,8 @@ static herr_t H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t H5_ATTR_UNUSED *dset) { - H5FA_t *fa; /* Pointer to fixed array structure */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FA_t *fa; /* Pointer to fixed array structure */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Dio.c b/src/H5Dio.c index 84b7e7a..a972e00 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -149,7 +149,7 @@ done: * The PLIST_ID can be the constant H5P_DEFAULT in which * case the default data transfer properties are used. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -271,7 +271,7 @@ done: * The PLIST_ID can be the constant H5P_DEFAULT in which * case the default data transfer properties are used. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -280,7 +280,7 @@ done: */ herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t dxpl_id, const void *buf) + hid_t file_space_id, hid_t dxpl_id, const void *buf) { H5VL_object_t *vol_obj = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -410,7 +410,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* projected mem space must be discarded at the */ /* end of the function to avoid a memory leak. */ H5D_storage_t store; /* union of EFL and chunk pointer in file space */ - hsize_t nelmts; /* total number of elmts */ + hsize_t nelmts; /* total number of elmts */ hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ char fake_char; /* Temporary variable for NULL buffer pointers */ herr_t ret_value = SUCCEED; /* Return value */ @@ -621,7 +621,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* projected mem space must be discarded at the */ /* end of the function to avoid a memory leak. */ H5D_storage_t store; /* union of EFL and chunk pointer in file space */ - hsize_t nelmts; /* total number of elmts */ + hsize_t nelmts; /* total number of elmts */ hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ char fake_char; /* Temporary variable for NULL buffer pointers */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1153,10 +1153,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, /* Append each of the "reason for breaking collective I/O" error messages to the * local and global no collective cause strings */ - for (cause = 1, idx = 0; - (cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE) && - (idx < cause_strings_len); - cause <<= 1, idx++) { + for (cause = 1, idx = 0; (cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE) && (idx < cause_strings_len); cause <<= 1, idx++) { size_t cause_strlen = HDstrlen(cause_strings[idx]); if (cause & local_no_collective_cause) { @@ -1166,8 +1163,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, if(local_error_message_previously_written) HDstrncat(local_no_collective_cause_string, "; ", 2); - HDstrncat(local_no_collective_cause_string, - cause_strings[idx], cause_strlen); + HDstrncat(local_no_collective_cause_string, cause_strings[idx], cause_strlen); local_error_message_previously_written = TRUE; } /* end if */ @@ -1179,8 +1175,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, if(global_error_message_previously_written) HDstrncat(global_no_collective_cause_string, "; ", 2); - HDstrncat(global_no_collective_cause_string, - cause_strings[idx], cause_strlen); + HDstrncat(global_no_collective_cause_string, cause_strings[idx], cause_strlen); global_error_message_previously_written = TRUE; } /* end if */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index e257140..679a33b 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -66,7 +66,7 @@ const unsigned H5O_layout_ver_bounds[] = { - + /*------------------------------------------------------------------------- * Function: H5D__layout_set_io_ops * @@ -153,7 +153,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_set_io_ops() */ - + /*------------------------------------------------------------------------- * Function: H5D__layout_meta_size * @@ -284,7 +284,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_meta_size() */ - + /*------------------------------------------------------------------------- * Function: H5D__layout_set_version * @@ -322,7 +322,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_set_version() */ - + /*------------------------------------------------------------------------- * Function: H5D__layout_set_latest_indexing * @@ -362,7 +362,7 @@ H5D__layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space, if(ndims > 0) { hsize_t max_dims[H5O_LAYOUT_NDIMS]; /* Maximum dimension sizes */ hsize_t cur_dims[H5O_LAYOUT_NDIMS]; /* Current dimension sizes */ - unsigned unlim_count = 0; /* Count of unlimited max. dimensions */ + unsigned unlim_count = 0; /* Count of unlimited max. dimensions */ hbool_t single = TRUE; /* Fulfill single chunk indexing */ unsigned u; /* Local index variable */ @@ -446,7 +446,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_set_latest_indexing() */ - + /*------------------------------------------------------------------------- * Function: H5D__layout_oh_create * @@ -589,17 +589,17 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__layout_oh_create() */ - + /*------------------------------------------------------------------------- * Function: H5D__layout_oh_read * - * Purpose: Read layout/pline/efl information for dataset + * Purpose: Read layout/pline/efl information for dataset * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, July 27, 2009 + * Programmer: Quincey Koziol + * Monday, July 27, 2009 * *------------------------------------------------------------------------- */ @@ -683,17 +683,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_oh_read() */ - + /*------------------------------------------------------------------------- * Function: H5D__layout_oh_write * - * Purpose: Write layout information for dataset + * Purpose: Write layout information for dataset * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, July 27, 2009 + * Programmer: Quincey Koziol + * Monday, July 27, 2009 * *------------------------------------------------------------------------- */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 492902b..cfed02e 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -3272,7 +3272,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk if(H5S_close(dataspace) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") dataspace = NULL; - } /* end if */ + } H5MM_free(chunk_entry->async_info.receive_buffer_array[i]); } /* end for */ diff --git a/src/H5Dselect.c b/src/H5Dselect.c index c5469c2..5a5c491 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, September 30, 2004 * * Purpose: Dataspace I/O functions. diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 3d6c2ed..eb3624b 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5EAdbg.c - * Sep 11 2008 - * Quincey Koziol + * Created: H5EAdbg.c + * Sep 11 2008 + * Quincey Koziol * - * Purpose: Dump debugging information about an extensible array. + * Purpose: Dump debugging information about an extensible array. * *------------------------------------------------------------------------- */ @@ -37,9 +37,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5EApkg.h" /* Extensible Arrays */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5EApkg.h" /* Extensible Arrays */ /****************/ @@ -79,15 +79,14 @@ /*------------------------------------------------------------------------- - * Function: H5EA__hdr_debug + * Function: H5EA__hdr_debug * - * Purpose: Prints debugging info about a extensible array header. + * Purpose: Prints debugging info about a extensible array header. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -97,7 +96,7 @@ H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t obj_addr)) /* Local variables */ - H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */ + H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */ void *dbg_ctx = NULL; /* Extensible array debugging context */ /* Check arguments */ @@ -117,59 +116,59 @@ H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Load the extensible array header */ if(NULL == (hdr = H5EA__hdr_protect(f, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) - H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") + H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Print opening message */ HDfprintf(stream, "%*sExtensible Array Header...\n", indent, ""); /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Array class ID:", hdr->cparam.cls->name); + "Array class ID:", hdr->cparam.cls->name); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Header size:", - hdr->size); + "Header size:", + hdr->size); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Raw Element Size:", - (unsigned)hdr->cparam.raw_elmt_size); + "Raw Element Size:", + (unsigned)hdr->cparam.raw_elmt_size); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Native Element Size (on this platform):", - hdr->cparam.cls->nat_elmt_size); + "Native Element Size (on this platform):", + hdr->cparam.cls->nat_elmt_size); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Log2(Max. # of elements in array):", - (unsigned)hdr->cparam.max_nelmts_bits); + "Log2(Max. # of elements in array):", + (unsigned)hdr->cparam.max_nelmts_bits); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "# of elements in index block:", - (unsigned)hdr->cparam.idx_blk_elmts); + "# of elements in index block:", + (unsigned)hdr->cparam.idx_blk_elmts); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Min. # of elements per data block:", - (unsigned)hdr->cparam.data_blk_min_elmts); + "Min. # of elements per data block:", + (unsigned)hdr->cparam.data_blk_min_elmts); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Min. # of data block pointers for a super block:", - (unsigned)hdr->cparam.sup_blk_min_data_ptrs); + "Min. # of data block pointers for a super block:", + (unsigned)hdr->cparam.sup_blk_min_data_ptrs); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Log2(Max. # of elements in data block page):", - (unsigned)hdr->cparam.max_dblk_page_nelmts_bits); + "Log2(Max. # of elements in data block page):", + (unsigned)hdr->cparam.max_dblk_page_nelmts_bits); HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, - "Highest element index stored (+1):", - hdr->stats.stored.max_idx_set); + "Highest element index stored (+1):", + hdr->stats.stored.max_idx_set); HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, - "Number of super blocks created:", - hdr->stats.stored.nsuper_blks); + "Number of super blocks created:", + hdr->stats.stored.nsuper_blks); HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, - "Number of data blocks created:", - hdr->stats.stored.ndata_blks); + "Number of data blocks created:", + hdr->stats.stored.ndata_blks); HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, - "Number of elements 'realized':", - hdr->stats.stored.nelmts); + "Number of elements 'realized':", + hdr->stats.stored.nelmts); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Index Block Address:", - hdr->idx_blk_addr); + "Index Block Address:", + hdr->idx_blk_addr); CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") + H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__hdr_debug() */ @@ -384,21 +383,20 @@ CATCH if(sblock && H5EA__sblock_unprotect(sblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block") if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") + H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__sblock_debug() */ /*------------------------------------------------------------------------- - * Function: H5EA__dblock_debug + * Function: H5EA__dblock_debug * - * Purpose: Prints debugging info about a extensible array data block. + * Purpose: Prints debugging info about a extensible array data block. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 22 2008 + * Programmer: Quincey Koziol + * Sep 22 2008 * *------------------------------------------------------------------------- */ @@ -432,7 +430,7 @@ H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Load the extensible array header */ if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) - H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") + H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect data block */ /* (Note: setting parent of data block to 'hdr' for this operation should be OK -QAK) */ @@ -444,10 +442,10 @@ H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Array class ID:", hdr->cparam.cls->name); + "Array class ID:", hdr->cparam.cls->name); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Data Block size:", - dblock->size); + "Data Block size:", + dblock->size); /* Print the elements in the index block */ @@ -466,7 +464,7 @@ CATCH if(dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block") if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") + H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__dblock_debug() */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 7e49c4b..064a9b8 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -246,7 +246,7 @@ static hbool_t H5P_dcrt_def_layout_init_g = FALSE; static herr_t H5P__dcrt_reg_prop(H5P_genclass_t *pclass) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -421,13 +421,13 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size) for(u = 0; u < layout->storage.u.virt.list_nused; u++) { /* Source file name */ tmp_size = HDstrlen(layout->storage.u.virt.list[u].source_file_name) + (size_t)1; - (void)H5MM_memcpy(*pp, layout->storage.u.virt.list[u].source_file_name, tmp_size); + H5MM_memcpy(*pp, layout->storage.u.virt.list[u].source_file_name, tmp_size); *pp += tmp_size; *size += tmp_size; /* Source dataset name */ tmp_size = HDstrlen(layout->storage.u.virt.list[u].source_dset_name) + (size_t)1; - (void)H5MM_memcpy(*pp, layout->storage.u.virt.list[u].source_dset_name, tmp_size); + H5MM_memcpy(*pp, layout->storage.u.virt.list[u].source_dset_name, tmp_size); *pp += tmp_size; *size += tmp_size; @@ -597,14 +597,14 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) tmp_size = HDstrlen((const char *)*pp) + 1; if(NULL == (tmp_layout.storage.u.virt.list[u].source_file_name = (char *)H5MM_malloc(tmp_size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory for source file name") - (void)H5MM_memcpy(tmp_layout.storage.u.virt.list[u].source_file_name, *pp, tmp_size); + H5MM_memcpy(tmp_layout.storage.u.virt.list[u].source_file_name, *pp, tmp_size); *pp += tmp_size; /* Source dataset name */ tmp_size = HDstrlen((const char *)*pp) + 1; if(NULL == (tmp_layout.storage.u.virt.list[u].source_dset_name = (char *)H5MM_malloc(tmp_size))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "unable to allocate memory for source dataset name") - (void)H5MM_memcpy(tmp_layout.storage.u.virt.list[u].source_dset_name, *pp, tmp_size); + H5MM_memcpy(tmp_layout.storage.u.virt.list[u].source_dset_name, *pp, tmp_size); *pp += tmp_size; /* Source selection */ @@ -2375,7 +2375,7 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t idx) /* Get the virtual space */ if(idx >= layout.storage.u.virt.list_nused) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); if(NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_dset.virtual_select, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") @@ -2431,9 +2431,9 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t idx) if(H5D_VIRTUAL != layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout") - /* Check idx */ + /* Check index */ if(idx >= layout.storage.u.virt.list_nused) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); /* Attempt to open source dataset and patch extent if extent status is not @@ -2537,7 +2537,7 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t idx, char *name/*out*/, /* Get the virtual filename */ if(idx >= layout.storage.u.virt.list_nused) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); HDassert(layout.storage.u.virt.list[idx].source_file_name); if(name && (size > 0)) @@ -2600,7 +2600,7 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t idx, char *name/*out*/, /* Get the virtual filename */ if(idx >= layout.storage.u.virt.list_nused) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); HDassert(layout.storage.u.virt.list[idx].source_dset_name); if(name && (size > 0)) diff --git a/src/H5S.c b/src/H5S.c index ddfd064..bea86ca 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -88,18 +88,18 @@ H5FL_ARR_DEFINE(hsize_t, H5S_MAX_RANK); /* Dataspace ID class */ static const H5I_class_t H5I_DATASPACE_CLS[1] = {{ - H5I_DATASPACE, /* ID class value */ - 0, /* Class flags */ - 2, /* # of reserved IDs for class */ - (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */ + H5I_DATASPACE, /* ID class value */ + 0, /* Class flags */ + 2, /* # of reserved IDs for class */ + (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */ }}; /* Dataspace selection iterator ID class */ static const H5I_class_t H5I_SPACE_SEL_ITER_CLS[1] = {{ - H5I_SPACE_SEL_ITER, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5S_sel_iter_close /* Callback routine for closing objects of this class */ + H5I_SPACE_SEL_ITER, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5S_sel_iter_close /* Callback routine for closing objects of this class */ }}; @@ -107,7 +107,7 @@ static const H5I_class_t H5I_SPACE_SEL_ITER_CLS[1] = {{ static hbool_t H5S_top_package_initialize_s = FALSE; - + /*-------------------------------------------------------------------------- NAME H5S__init_package -- Initialize interface-specific information @@ -127,11 +127,11 @@ H5S__init_package(void) /* Initialize the atom group for the dataspace IDs */ if(H5I_register_type(H5I_DATASPACE_CLS) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace ID class") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace ID class") /* Initialize the atom group for the dataspace selction iterator IDs */ if(H5I_register_type(H5I_SPACE_SEL_ITER_CLS) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace selection iterator ID class") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace selection iterator ID class") /* Mark "top" of interface as initialized, too */ H5S_top_package_initialize_s = TRUE; @@ -140,7 +140,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__init_package() */ - + /*-------------------------------------------------------------------------- NAME H5S_top_term_package @@ -162,22 +162,22 @@ done: int H5S_top_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5S_top_package_initialize_s) { - if(H5I_nmembers(H5I_DATASPACE) > 0) { - (void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); + if(H5I_nmembers(H5I_DATASPACE) > 0) { + (void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ - if(H5I_nmembers(H5I_SPACE_SEL_ITER) > 0) { - (void)H5I_clear_type(H5I_SPACE_SEL_ITER, FALSE, FALSE); + if(H5I_nmembers(H5I_SPACE_SEL_ITER) > 0) { + (void)H5I_clear_type(H5I_SPACE_SEL_ITER, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ - /* Mark "top" of interface as closed */ + /* Mark "top" of interface as closed */ if(0 == n) H5S_top_package_initialize_s = FALSE; } /* end if */ @@ -185,7 +185,7 @@ H5S_top_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5S_top_term_package() */ - + /*-------------------------------------------------------------------------- NAME H5S_term_package @@ -209,7 +209,7 @@ H5S_top_term_package(void) int H5S_term_package(void) { - int n = 0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -225,7 +225,7 @@ H5S_term_package(void) /* Destroy the dataspace selection iterator object id group */ n += (H5I_dec_type_ref(H5I_SPACE_SEL_ITER) > 0); - /* Mark interface as closed */ + /* Mark interface as closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; } /* end if */ @@ -234,7 +234,7 @@ H5S_term_package(void) } /* end H5S_term_package() */ - + /*-------------------------------------------------------------------------- NAME H5S_get_validiated_dataspace @@ -278,13 +278,13 @@ H5S_get_validated_dataspace(hid_t space_id, const H5S_t **space) /* Check for valid selection */ if(H5S_SELECT_VALID(*space) != TRUE) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection + offset not within extent") - } /* end else */ + } done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_get_validated_dataspace() */ - + /*-------------------------------------------------------------------------- NAME H5S_create @@ -362,7 +362,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_create() */ - + /*-------------------------------------------------------------------------- NAME H5Screate @@ -409,16 +409,16 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Screate() */ - + /*------------------------------------------------------------------------- * Function: H5S__extent_release * - * Purpose: Releases all memory associated with a dataspace extent. + * Purpose: Releases all memory associated with a dataspace extent. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, July 23, 1998 + * Programmer: Quincey Koziol + * Thursday, July 23, 1998 * *------------------------------------------------------------------------- */ @@ -440,16 +440,16 @@ H5S__extent_release(H5S_extent_t *extent) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__extent_release() */ - + /*------------------------------------------------------------------------- * Function: H5S_close * - * Purpose: Releases all memory associated with a dataspace. + * Purpose: Releases all memory associated with a dataspace. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * *------------------------------------------------------------------------- */ @@ -481,16 +481,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_close() */ - + /*------------------------------------------------------------------------- * Function: H5Sclose * - * Purpose: Release access to a dataspace object. + * Purpose: Release access to a dataspace object. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * *------------------------------------------------------------------------- */ @@ -514,69 +514,70 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sclose() */ - + /*------------------------------------------------------------------------- * Function: H5Scopy * - * Purpose: Copies a dataspace. + * Purpose: Copies a dataspace. * - * Return: Success: ID of the new dataspace - * Failure: Negative + * Return: Success: ID of the new dataspace * - * Programmer: Robb Matzke - * Friday, January 30, 1998 + * Failure: H5I_INVALID_HID + * + * Programmer: Robb Matzke + * Friday, January 30, 1998 * *------------------------------------------------------------------------- */ hid_t H5Scopy(hid_t space_id) { - H5S_t *src; - H5S_t *dst = NULL; - hid_t ret_value; + H5S_t *src = NULL; + H5S_t *dst = NULL; + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", space_id); /* Check args */ if(NULL == (src = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataspace") /* Copy */ if(NULL == (dst = H5S_copy(src, FALSE, TRUE))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy dataspace") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace") /* Atomize */ if((ret_value = H5I_register (H5I_DATASPACE, dst, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom") done: if(ret_value < 0) if(dst && H5S_close(dst) < 0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace") + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to release dataspace") FUNC_LEAVE_API(ret_value) } /* end H5Scopy() */ - + /*------------------------------------------------------------------------- * Function: H5Sextent_copy * - * Purpose: Copies a dataspace extent. + * Purpose: Copies a dataspace extent. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, July 23, 1998 + * Programmer: Quincey Koziol + * Thursday, July 23, 1998 * *------------------------------------------------------------------------- */ herr_t H5Sextent_copy(hid_t dst_id,hid_t src_id) { - H5S_t *src; - H5S_t *dst; - herr_t ret_value = SUCCEED; + H5S_t *src; + H5S_t *dst; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE2("e", "ii", dst_id, src_id); @@ -595,7 +596,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sextent_copy() */ - + /*------------------------------------------------------------------------- * Function: H5S_extent_copy * @@ -632,16 +633,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_extent_copy() */ - + /*------------------------------------------------------------------------- * Function: H5S__extent_copy_real * - * Purpose: Copies a dataspace extent + * Purpose: Copies a dataspace extent * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Wednesday, June 3, 1998 + * Programmer: Quincey Koziol + * Wednesday, June 3, 1998 * *------------------------------------------------------------------------- */ @@ -701,29 +702,30 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__extent_copy_real() */ - + /*------------------------------------------------------------------------- * Function: H5S_copy * - * Purpose: Copies a dataspace, by copying the extent and selection through - * H5S_extent_copy and H5S_select_copy. If the SHARE_SELECTION flag - * is set, then the selection can be shared between the source and - * destination dataspaces. (This should only occur in situations - * where the destination dataspace will immediately change to a new - * selection) + * Purpose: Copies a dataspace, by copying the extent and selection through + * H5S_extent_copy and H5S_select_copy. If the SHARE_SELECTION flag + * is set, then the selection can be shared between the source and + * destination dataspaces. (This should only occur in situations + * where the destination dataspace will immediately change to a new + * selection) * - * Return: Success: A pointer to a new copy of SRC - * Failure: NULL + * Return: Success: A pointer to a new copy of SRC * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Failure: NULL + * + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ H5S_t * H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max) { - H5S_t *dst = NULL; + H5S_t *dst = NULL; H5S_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -750,17 +752,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_copy() */ - + /*------------------------------------------------------------------------- * Function: H5S_get_simple_extent_npoints * - * Purpose: Determines how many data points a dataset extent has. + * Purpose: Determines how many data points a dataset extent has. + * + * Return: Success: Number of data points in the dataset extent. * - * Return: Success: Number of data points in the dataset extent. - * Failure: negative + * Failure: Negative * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * * Note: This routine participates in the "Inlining C function pointers" * pattern, don't call it directly, use the appropriate macro @@ -785,17 +788,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_get_simple_extent_npoints() */ - + /*------------------------------------------------------------------------- * Function: H5Sget_simple_extent_npoints * - * Purpose: Determines how many data points a dataset extent has. + * Purpose: Determines how many data points a dataset extent has. * - * Return: Success: Number of data points in the dataset. - * Failure: negative + * Return: Success: Number of data points in the dataset. + * Failure: Negative * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * *------------------------------------------------------------------------- */ @@ -803,7 +806,7 @@ hssize_t H5Sget_simple_extent_npoints(hid_t space_id) { H5S_t *ds; - hssize_t ret_value; + hssize_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE1("Hs", "i", space_id); @@ -818,22 +821,22 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sget_simple_extent_npoints() */ - + /*------------------------------------------------------------------------- * Function: H5S_get_npoints_max * - * Purpose: Determines the maximum number of data points a dataspace may - * have. If the `max' array is null then the maximum number of - * data points is the same as the current number of data points - * without regard to the hyperslab. If any element of the `max' - * array is zero then the maximum possible size is returned. + * Purpose: Determines the maximum number of data points a dataspace may + * have. If the `max' array is null then the maximum number of + * data points is the same as the current number of data points + * without regard to the hyperslab. If any element of the `max' + * array is zero then the maximum possible size is returned. * - * Return: Success: Maximum number of data points the dataspace - * may have. - * Failure: 0 + * Return: Success: Maximum number of data points the dataspace + * may have. + * Failure: 0 * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * *------------------------------------------------------------------------- */ @@ -841,7 +844,7 @@ hsize_t H5S_get_npoints_max(const H5S_t *ds) { unsigned u; - hsize_t ret_value = 0; /* Return value */ + hsize_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI(0) @@ -863,11 +866,11 @@ H5S_get_npoints_max(const H5S_t *ds) if(H5S_UNLIMITED == ds->extent.max[u]) { ret_value = HSIZET_MAX; break; - } /* end if */ + } else ret_value *= ds->extent.max[u]; - } /* end for */ - } /* end if */ + } + } else for(ret_value = 1, u = 0; u < ds->extent.rank; u++) ret_value *= ds->extent.size[u]; @@ -877,38 +880,38 @@ H5S_get_npoints_max(const H5S_t *ds) default: HDassert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)") - } /* end switch */ + } done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_get_npoints_max() */ - + /*------------------------------------------------------------------------- * Function: H5Sget_simple_extent_ndims * - * Purpose: Determines the dimensionality of a dataspace. + * Purpose: Determines the dimensionality of a dataspace. * - * Return: Success: The number of dimensions in a dataspace. - * Failure: Negative + * Return: Success: The number of dimensions in a dataspace. + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, December 11, 1997 + * Programmer: Robb Matzke + * Thursday, December 11, 1997 * *------------------------------------------------------------------------- */ int H5Sget_simple_extent_ndims(hid_t space_id) { - H5S_t *ds; - int ret_value; /* Return value */ + H5S_t *ds; + int ret_value = -1; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API((-1)) H5TRACE1("Is", "i", space_id); /* Check args */ if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a dataspace") ret_value = (int)H5S_GET_EXTENT_NDIMS(ds); @@ -916,18 +919,19 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sget_simple_extent_ndims() */ - + /*------------------------------------------------------------------------- * Function: H5S_get_simple_extent_ndims * - * Purpose: Returns the number of dimensions in a dataspace. + * Purpose: Returns the number of dimensions in a dataspace. * - * Return: Success: Non-negative number of dimensions. Zero - * implies a scalar. - * Failure: Negative + * Return: Success: Non-negative number of dimensions. + * Zero implies a scalar. * - * Programmer: Robb Matzke - * Thursday, December 11, 1997 + * Failure: Negative + * + * Programmer: Robb Matzke + * hursday, December 11, 1997 * * Note: This routine participates in the "Inlining C function pointers" * pattern, don't call it directly, use the appropriate macro @@ -938,7 +942,7 @@ done: int H5S_get_simple_extent_ndims(const H5S_t *ds) { - int ret_value = -1; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -962,35 +966,35 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_get_simple_extent_ndims() */ - + /*------------------------------------------------------------------------- * Function: H5Sget_simple_extent_dims * - * Purpose: Returns the size and maximum sizes in each dimension of - * a dataspace DS through the DIMS and MAXDIMS arguments. + * Purpose: Returns the size and maximum sizes in each dimension of + * a dataspace DS through the DIMS and MAXDIMS arguments. + * + * Return: Success: Number of dimensions, the same value as + * returned by H5Sget_simple_extent_ndims(). * - * Return: Success: Number of dimensions, the same value as - * returned by H5Sget_simple_extent_ndims(). - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, December 11, 1997 + * Programmer: Robb Matzke + * Thursday, December 11, 1997 * *------------------------------------------------------------------------- */ int -H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[]/*out*/, - hsize_t maxdims[]/*out*/) +H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[]/*out*/, hsize_t maxdims[]/*out*/) { - H5S_t *ds; - int ret_value; /* Return value */ + H5S_t *ds; + int ret_value = -1; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API((-1)) H5TRACE3("Is", "ixx", space_id, dims, maxdims); /* Check args */ if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a dataspace") ret_value = H5S_get_simple_extent_dims(ds, dims, maxdims); @@ -998,26 +1002,26 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sget_simple_extent_dims() */ - + /*------------------------------------------------------------------------- * Function: H5S_extent_get_dims * - * Purpose: Returns the size in each dimension of a dataspace. This - * function may not be meaningful for all types of dataspaces. + * Purpose: Returns the size in each dimension of a dataspace. This + * function may not be meaningful for all types of dataspaces. * - * Return: Success: Number of dimensions. Zero implies scalar. - * Failure: Negative + * Return: Success: Number of dimensions. Zero implies scalar. + * Failure: Negative * - * Programmer: Quincey Koziol - * Tuesday, June 30, 2009 + * Programmer: Quincey Koziol + * Tuesday, June 30, 2009 * *------------------------------------------------------------------------- */ int H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]) { - int i; /* Local index variable */ - int ret_value = -1; /* Return value */ + int i; /* Local index variable */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1054,25 +1058,25 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_extent_get_dims() */ - + /*------------------------------------------------------------------------- * Function: H5S_get_simple_extent_dims * - * Purpose: Returns the size in each dimension of a dataspace. This - * function may not be meaningful for all types of dataspaces. + * Purpose: Returns the size in each dimension of a dataspace. This + * function may not be meaningful for all types of dataspaces. * - * Return: Success: Number of dimensions. Zero implies scalar. - * Failure: Negative + * Return: Success: Number of dimensions. Zero implies scalar. + * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, December 11, 1997 + * Programmer: Robb Matzke + * Thursday, December 11, 1997 * *------------------------------------------------------------------------- */ int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[]) { - int ret_value = -1; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1087,17 +1091,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_get_simple_extent_dims() */ - + /*------------------------------------------------------------------------- * Function: H5S_write * - * Purpose: Updates a dataspace by writing a message to an object - * header. + * Purpose: Updates a dataspace by writing a message to an object + * header. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * *------------------------------------------------------------------------- */ @@ -1121,17 +1125,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_write() */ - + /*------------------------------------------------------------------------- * Function: H5S_append * - * Purpose: Updates a dataspace by adding a message to an object - * header. + * Purpose: Updates a dataspace by adding a message to an object header. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, December 31, 2002 + * Programmer: Quincey Koziol + * Tuesday, December 31, 2002 * *------------------------------------------------------------------------- */ @@ -1155,24 +1158,25 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_append() */ - + /*------------------------------------------------------------------------- * Function: H5S_read * - * Purpose: Reads the dataspace from an object header. + * Purpose: Reads the dataspace from an object header. + * + * Return: Success: Pointer to a new dataspace. * - * Return: Success: Pointer to a new dataspace. - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 * *------------------------------------------------------------------------- */ H5S_t * H5S_read(const H5O_loc_t *loc) { - H5S_t *ds = NULL; /* Dataspace to return */ + H5S_t *ds = NULL; /* Dataspace to return */ H5S_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1201,7 +1205,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_read() */ - + /*-------------------------------------------------------------------------- NAME H5S__is_simple @@ -1233,7 +1237,7 @@ H5S__is_simple(const H5S_t *sdim) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__is_simple() */ - + /*-------------------------------------------------------------------------- NAME H5Sis_simple @@ -1241,7 +1245,7 @@ H5S__is_simple(const H5S_t *sdim) Check if a dataspace is simple USAGE htri_t H5Sis_simple(space_id) - hid_t space_id; IN: ID of dataspace object to query + hid_t space_id; IN: ID of dataspace object to query RETURNS TRUE/FALSE/FAIL DESCRIPTION @@ -1251,15 +1255,15 @@ H5S__is_simple(const H5S_t *sdim) htri_t H5Sis_simple(hid_t space_id) { - H5S_t *space; /* Dataspace to check */ - htri_t ret_value; /* Return value */ + H5S_t *space; /* Dataspace to check */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", space_id); /* Check args and all the boring stuff. */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a dataspace") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a dataspace") ret_value = H5S__is_simple(space); @@ -1267,7 +1271,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sis_simple() */ - + /*-------------------------------------------------------------------------- NAME H5Sset_extent_simple @@ -1275,11 +1279,11 @@ done: Sets the size of a simple dataspace USAGE herr_t H5Sset_extent_simple(space_id, rank, dims, max) - hid_t space_id; IN: Dataspace object to query - int rank; IN: # of dimensions for the dataspace - const size_t *dims; IN: Size of each dimension for the dataspace - const size_t *max; IN: Maximum size of each dimension for the - dataspace + hid_t space_id; IN: Dataspace object to query + int rank; IN: # of dimensions for the dataspace + const size_t *dims; IN: Size of each dimension for the dataspace + const size_t *max; IN: Maximum size of each dimension for the + dataspace RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -1298,8 +1302,8 @@ herr_t H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], const hsize_t max[/*rank*/]) { - H5S_t *space; /* Dataspace to modify */ - int u; /* Local counting variable */ + H5S_t *space; /* Dataspace to modify */ + int u; /* Local counting variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1322,26 +1326,25 @@ H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], for(u = 0; u < rank; u++) if(max[u] != H5S_UNLIMITED && max[u] < dims[u]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid maximum dimension size") - } /* end if */ + } /* Do it */ if(H5S_set_extent_simple(space, (unsigned)rank, dims, max) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set simple extent") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set simple extent") done: FUNC_LEAVE_API(ret_value) } /* end H5Sset_extent_simple() */ - + /*------------------------------------------------------------------------- * Function: H5S_set_extent_simple * - * Purpose: This is where the real work happens for - * H5Sset_extent_simple(). + * Purpose: This is where the real work happens for H5Sset_extent_simple(). * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, July 8, 1998 * *------------------------------------------------------------------------- @@ -1362,10 +1365,10 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, if(H5S__extent_release(&space->extent) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "failed to release previous dataspace extent") - if(rank == 0) { /* scalar variable */ + if(rank == 0) { /* scalar variable */ space->extent.type = H5S_SCALAR; space->extent.nelem = 1; - space->extent.rank = 0; /* set to scalar rank */ + space->extent.rank = 0; /* set to scalar rank */ } /* end if */ else { hsize_t nelem; /* Number of elements in extent */ @@ -1408,91 +1411,90 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_set_extent_simple() */ - + /*------------------------------------------------------------------------- * Function: H5Screate_simple * - * Purpose: Creates a new simple dataspace object and opens it for - * access. The DIMS argument is the size of the simple dataset - * and the MAXDIMS argument is the upper limit on the size of - * the dataset. MAXDIMS may be the null pointer in which case - * the upper limit is the same as DIMS. If an element of - * MAXDIMS is H5S_UNLIMITED then the corresponding dimension is - * unlimited, otherwise no element of MAXDIMS should be smaller - * than the corresponding element of DIMS. + * Purpose: Creates a new simple dataspace object and opens it for + * access. The DIMS argument is the size of the simple dataset + * and the MAXDIMS argument is the upper limit on the size of + * the dataset. MAXDIMS may be the null pointer in which case + * the upper limit is the same as DIMS. If an element of + * MAXDIMS is H5S_UNLIMITED then the corresponding dimension is + * unlimited, otherwise no element of MAXDIMS should be smaller + * than the corresponding element of DIMS. + * + * Return: Success: The ID for the new simple dataspace object. * - * Return: Success: The ID for the new simple dataspace object. - * Failure: Negative + * Failure: H5I_INVALID_HID * - * Programmer: Quincey Koziol - * Tuesday, January 27, 1998 + * Programmer: Quincey Koziol + * Tuesday, January 27, 1998 * *------------------------------------------------------------------------- */ hid_t -H5Screate_simple(int rank, const hsize_t dims[/*rank*/], - const hsize_t maxdims[/*rank*/]) +H5Screate_simple(int rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/*rank*/]) { - H5S_t *space = NULL; - int i; - hid_t ret_value; /* Return value */ + H5S_t *space = NULL; + int i; + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "Is*[a0]h*[a0]h", rank, dims, maxdims); /* Check arguments */ if(rank < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimensionality cannot be negative") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "dimensionality cannot be negative") if(rank > H5S_MAX_RANK) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimensionality is too large") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "dimensionality is too large") /* We allow users to use this function to create scalar or null dataspace. * Check DIMS isn't set when the RANK is 0. */ if(!dims && rank != 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dataspace information") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dataspace information") /* Check whether the current dimensions are valid */ for(i = 0; i < rank; i++) { if(H5S_UNLIMITED == dims[i]) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "current dimension must have a specific size, not H5S_UNLIMITED") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "current dimension must have a specific size, not H5S_UNLIMITED") if(maxdims && H5S_UNLIMITED != maxdims[i] && maxdims[i]extent))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy object") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy object") if(H5S__extent_release(extent) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTDELETE, NULL, "can't release previous dataspace") extent = H5FL_FREE(H5S_extent_t, extent); @@ -1754,17 +1752,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_decode() */ - + /*------------------------------------------------------------------------- * Function: H5S_get_simple_extent_type * - * Purpose: Internal function for retrieving the type of extent for a dataspace object + * Purpose: Internal function for retrieving the type of extent for a dataspace object * - * Return: Success: The class of the dataspace object - * Failure: N5S_NO_CLASS + * Return: Success: The class of the dataspace object * - * Programmer: Quincey Koziol - * Thursday, September 28, 2000 + * Failure: N5S_NO_CLASS + * + * Programmer: Quincey Koziol + * Thursday, September 28, 2000 * * Note: This routine participates in the "Inlining C function pointers" * pattern, don't call it directly, use the appropriate macro @@ -1775,7 +1774,7 @@ done: H5S_class_t H5S_get_simple_extent_type(const H5S_t *space) { - H5S_class_t ret_value = H5S_NO_CLASS; /* Return value */ + H5S_class_t ret_value = H5S_NO_CLASS; /* Return value */ FUNC_ENTER_NOAPI(H5S_NO_CLASS) @@ -1787,25 +1786,26 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_get_simple_extent_type() */ - + /*------------------------------------------------------------------------- * Function: H5Sget_simple_extent_type * - * Purpose: Retrieves the type of extent for a dataspace object + * Purpose: Retrieves the type of extent for a dataspace object + * + * Return: Success: The class of the dataspace object * - * Return: Success: The class of the dataspace object - * Failure: N5S_NO_CLASS + * Failure: N5S_NO_CLASS * - * Programmer: Quincey Koziol - * Thursday, July 23, 1998 + * Programmer: Quincey Koziol + * Thursday, July 23, 1998 * *------------------------------------------------------------------------- */ H5S_class_t H5Sget_simple_extent_type(hid_t sid) { - H5S_t *space; - H5S_class_t ret_value; /* Return value */ + H5S_t *space; + H5S_class_t ret_value; /* Return value */ FUNC_ENTER_API(H5S_NO_CLASS) H5TRACE1("Sc", "i", sid); @@ -1820,7 +1820,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sget_simple_extent_type() */ - + /*-------------------------------------------------------------------------- NAME H5Sset_extent_none @@ -1828,7 +1828,7 @@ done: Resets the extent of a dataspace back to "none" USAGE herr_t H5Sset_extent_none(space_id) - hid_t space_id; IN: Dataspace object to reset + hid_t space_id; IN: Dataspace object to reset RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -1838,8 +1838,8 @@ done: herr_t H5Sset_extent_none(hid_t space_id) { - H5S_t *space; /* Dataspace to modify */ - herr_t ret_value = SUCCEED; /* Return value */ + H5S_t *space; /* Dataspace to modify */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", space_id); @@ -1858,16 +1858,15 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sset_extent_none() */ - + /*------------------------------------------------------------------------- * Function: H5S_set_extent * * Purpose: Modify the dimensions of a dataspace. * - * Return: Success: Non-negative - * Failure: Negative + * Return: TRUE/FALSE/FAIL * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * March 13, 2002 * *------------------------------------------------------------------------- @@ -1905,7 +1904,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_set_extent() */ - + /*------------------------------------------------------------------------- * Function: H5S_has_extent * @@ -1938,7 +1937,7 @@ H5S_has_extent(const H5S_t *ds) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_has_extent() */ - + /*------------------------------------------------------------------------- * Function: H5S_set_extent_real * @@ -1947,7 +1946,7 @@ H5S_has_extent(const H5S_t *ds) * Return: Success: Non-negative * Failure: Negative * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * March 13, 2002 * *------------------------------------------------------------------------- @@ -1985,25 +1984,27 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_set_extent_real() */ - + /*------------------------------------------------------------------------- * Function: H5Sextent_equal * - * Purpose: Determines if two dataspace extents are equal. + * Purpose: Determines if two dataspace extents are equal. * - * Return: Success: TRUE if equal, FALSE if unequal - * Failure: Negative + * Return: Success: TRUE if equal, FALSE if unequal * - * Programmer: Quincey Koziol - * Monday, October 24, 2005 + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Monday, October 24, 2005 * *------------------------------------------------------------------------- */ htri_t H5Sextent_equal(hid_t space1_id, hid_t space2_id) { - const H5S_t *ds1, *ds2; /* Dataspaces to compare */ - htri_t ret_value; /* Return value */ + const H5S_t *ds1; /* Dataspaces to compare */ + const H5S_t *ds2; + htri_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", space1_id, space2_id); @@ -2011,17 +2012,17 @@ H5Sextent_equal(hid_t space1_id, hid_t space2_id) /* check args */ if(NULL == (ds1 = (const H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE)) || NULL == (ds2 = (const H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Check dataspaces for extent's equality */ if((ret_value = H5S_extent_equal(ds1, ds2)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "dataspace comparison failed") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "dataspace comparison failed") done: FUNC_LEAVE_API(ret_value) } /* end H5Sextent_equal() */ - + /*-------------------------------------------------------------------------- NAME H5S_extent_equal @@ -2082,17 +2083,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_extent_equal() */ - + /*------------------------------------------------------------------------- * Function: H5S_extent_nelem * - * Purpose: Determines how many elements a dataset extent describes. + * Purpose: Determines how many elements a dataset extent describes. * - * Return: Success: Number of data points in the dataset extent. - * Failure: negative + * Return: Success: Number of data points in the dataset extent. + * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, November 30, 2006 + * Programmer: Quincey Koziol + * Thursday, November 30, 2006 * *------------------------------------------------------------------------- */ @@ -2108,7 +2109,7 @@ H5S_extent_nelem(const H5S_extent_t *ext) FUNC_LEAVE_NOAPI(ext->nelem) } /* end H5S_extent_nelem() */ - + /*------------------------------------------------------------------------- * Function: H5S_set_version * diff --git a/src/H5Sall.c b/src/H5Sall.c index 8290ae2..9026e7c 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -29,7 +29,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ +#include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* ID Functions */ #include "H5Spkg.h" /* Dataspace functions */ #include "H5VMprivate.h" /* Vector functions */ @@ -599,7 +599,7 @@ H5S__all_serial_size(const H5S_t H5_ATTR_UNUSED *space) PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S_all_serialize(space, p) + herr_t H5S__all_serialize(space, p) const H5S_t *space; IN: Dataspace with selection to serialize uint8_t **p; OUT: Pointer to buffer to put serialized selection. Will be advanced to end of @@ -627,8 +627,8 @@ H5S__all_serialize(const H5S_t *space, uint8_t **p) HDassert(pp); /* Store the preamble information */ - UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(pp, (uint32_t)H5S_ALL_VERSION_1); /* Store the version number */ + UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(pp, (uint32_t)H5S_ALL_VERSION_1); /* Store the version number */ UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */ UINT32ENCODE(pp, (uint32_t)0); /* Store the additional information length */ diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index 8171191..32f5295 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -13,11 +13,12 @@ /*------------------------------------------------------------------------- * - * Created: H5Sdbg.c - * Jul 24 2007 - * Quincey Koziol + * Created: H5Sdbg.c + * Quincey Koziol + * Jul 24 2007 + * * - * Purpose: Dump debugging information about a dataspace + * Purpose: Dump debugging information about a dataspace * *------------------------------------------------------------------------- */ @@ -32,9 +33,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Spkg.h" /* Dataspaces */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Spkg.h" /* Dataspaces */ /****************/ @@ -74,13 +75,13 @@ /*------------------------------------------------------------------------- - * Function: H5S_debug + * Function: H5S_debug * - * Purpose: Prints debugging information about a dataspace. + * Purpose: Prints debugging information about a dataspace. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, July 21, 1998 * *------------------------------------------------------------------------- @@ -88,7 +89,7 @@ herr_t H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth) { - const H5S_t *mesg = (const H5S_t*)_mesg; + const H5S_t *mesg = (const H5S_t*)_mesg; FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5Shyper.c b/src/H5Shyper.c index b352374..7d99f39 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -15,7 +15,7 @@ * Programmer: Quincey Koziol * Thursday, June 18, 1998 * - * Purpose: Hyperslab selection dataspace I/O functions. + * Purpose: Hyperslab selection dataspace I/O functions. */ /****************/ @@ -30,8 +30,8 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* ID Functions */ #include "H5MMprivate.h" /* Memory management */ #include "H5Spkg.h" /* Dataspace functions */ @@ -304,7 +304,7 @@ H5FL_EXTERN(H5S_sel_iter_t); static uint64_t H5S_hyper_op_gen_g = 1; -/* Uncomment this, to provide the debugging routines for printing selection info */ +/* Uncomment this to provide the debugging routines for printing selection info */ /* #define H5S_HYPER_DEBUG */ #ifdef H5S_HYPER_DEBUG static herr_t @@ -385,7 +385,7 @@ H5S__hyper_print_diminfo(FILE *f, const H5S_t *space) FUNC_LEAVE_NOAPI(SUCCEED) } - + /*-------------------------------------------------------------------------- NAME H5S__hyper_print_spans_dfs @@ -531,7 +531,7 @@ H5S__hyper_print_space_dfs(FILE *f, const H5S_t *space) } /* end H5S__hyper_print_space_dfs() */ #endif /* H5S_HYPER_DEBUG */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_get_op_gen * @@ -555,15 +555,15 @@ H5S__hyper_get_op_gen(void) FUNC_LEAVE_NOAPI(H5S_hyper_op_gen_g++); } /* end H5S__hyper_op_gen() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_iter_init * - * Purpose: Initializes iteration information for hyperslab selection. + * Purpose: Initializes iteration information for hyperslab selection. * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, February 24, 2001 * * Notes: If the 'iter->elmt_size' field is set to zero, the regular @@ -794,16 +794,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_iter_init() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_iter_coords * - * Purpose: Retrieve the current coordinates of iterator for current + * Purpose: Retrieve the current coordinates of iterator for current * selection * - * Return: Non-negative on success, negative on failure + * Return: Non-negative on success, negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 22, 2003 * *------------------------------------------------------------------------- @@ -879,16 +879,16 @@ H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_coords() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_iter_block * - * Purpose: Retrieve the current block of iterator for current + * Purpose: Retrieve the current block of iterator for current * selection * - * Return: Non-negative on success, negative on failure + * Return: Non-negative on success, negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 2, 2003 * * Notes: This routine assumes that the iterator is always located at @@ -916,28 +916,28 @@ H5S__hyper_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) for(u = 0; u < iter->rank; u++) { start[u] = iter->u.hyp.off[u]; end[u] = (start[u] + iter->u.hyp.diminfo[u].block) - 1; - } /* end for */ + } } /* end if */ else { /* Copy the start & end of the block */ for(u = 0; u < iter->rank; u++) { start[u] = iter->u.hyp.span[u]->low; end[u] = iter->u.hyp.span[u]->high; - } /* end for */ + } } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_block() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_iter_nelmts * - * Purpose: Return number of elements left to process in iterator + * Purpose: Return number of elements left to process in iterator * - * Return: Non-negative number of elements on success, zero on failure + * Return: Non-negative number of elements on success, zero on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * *------------------------------------------------------------------------- @@ -953,7 +953,7 @@ H5S__hyper_iter_nelmts(const H5S_sel_iter_t *iter) FUNC_LEAVE_NOAPI(iter->elmt_left) } /* end H5S__hyper_iter_nelmts() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_iter_has_next_block @@ -1009,17 +1009,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_iter_has_next_block() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_iter_next * - * Purpose: Moves a hyperslab iterator to the beginning of the next sequence - * of elements to read. Handles walking off the end in all dimensions. + * Purpose: Moves a hyperslab iterator to the beginning of the next sequence + * of elements to read. Handles walking off the end in all dimensions. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, September 8, 2000 * *------------------------------------------------------------------------- @@ -1216,17 +1216,17 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_next() */ - + /*------------------------------------------------------------------------- * Function: H5S__hyper_iter_next_block * - * Purpose: Moves a hyperslab iterator to the beginning of the next sequence - * of elements to read. Handles walking off the end in all dimensions. + * Purpose: Moves a hyperslab iterator to the beginning of the next sequence + * of elements to read. Handles walking off the end in all dimensions. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 3, 2003 * *------------------------------------------------------------------------- @@ -1391,7 +1391,7 @@ H5S__hyper_iter_next_block(H5S_sel_iter_t *iter) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_next_block() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_iter_get_seq_list_gen @@ -1409,7 +1409,7 @@ H5S__hyper_iter_next_block(H5S_sel_iter_t *iter) hsize_t *off; OUT: Array of offsets size_t *len; OUT: Array of lengths RETURNS - Non-negative on success/Negative on failure. + Non-negative on success/Negative on failure DESCRIPTION Use the selection in the dataspace to generate a list of byte offsets and lengths for the region(s) selected. Start/Restart from the position in the @@ -1843,7 +1843,7 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_get_seq_list_gen() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_iter_get_seq_list_opt @@ -2287,7 +2287,7 @@ loc += fast_dim_buf_off; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_get_seq_list_opt() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_iter_get_seq_list_single @@ -2565,7 +2565,7 @@ H5S__hyper_iter_get_seq_list_single(H5S_sel_iter_t *iter, size_t maxseq, size_t FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_get_seq_list_single() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_iter_get_seq_list @@ -2727,7 +2727,7 @@ H5S__hyper_iter_get_seq_list(H5S_sel_iter_t *iter, size_t maxseq, FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_iter_get_seq_list() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_iter_release @@ -2760,7 +2760,7 @@ H5S__hyper_iter_release(H5S_sel_iter_t *iter) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_release() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_new_span @@ -2851,7 +2851,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_new_span_info() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_copy_span_helper @@ -2947,7 +2947,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_copy_span_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_copy_span @@ -2992,7 +2992,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_copy_span() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_cmp_spans @@ -3013,8 +3013,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5_ATTR_PURE hbool_t -H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, - const H5S_hyper_span_info_t *span_info2) +H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_span_info_t *span_info2) { hbool_t ret_value = TRUE; /* Return value */ @@ -3088,7 +3087,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_cmp_spans() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_free_span_info @@ -3145,7 +3144,7 @@ H5S__hyper_free_span_info(H5S_hyper_span_info_t *span_info) FUNC_LEAVE_NOAPI_VOID } /* end H5S__hyper_free_span_info() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_free_span @@ -3183,7 +3182,7 @@ H5S__hyper_free_span(H5S_hyper_span_t *span) FUNC_LEAVE_NOAPI_VOID } /* end H5S__hyper_free_span() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_copy @@ -3258,7 +3257,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_copy() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_is_valid @@ -3317,7 +3316,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_is_valid() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_span_nblocks_helper @@ -3385,7 +3384,7 @@ H5S__hyper_span_nblocks_helper(H5S_hyper_span_info_t *spans, unsigned op_info_i, FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_span_nblocks_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_span_nblocks @@ -3426,7 +3425,7 @@ H5S__hyper_span_nblocks(H5S_hyper_span_info_t *spans) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_span_nblocks() */ - + /*-------------------------------------------------------------------------- NAME H5S__get_select_hyper_nblocks @@ -3463,7 +3462,7 @@ H5S__get_select_hyper_nblocks(const H5S_t *space, hbool_t app_ref) /* Check each dimension */ for(ret_value = 1, u = 0; u < space->extent.rank; u++) ret_value *= (app_ref ? space->select.sel_info.hslab->diminfo.app[u].count : - space->select.sel_info.hslab->diminfo.opt[u].count); + space->select.sel_info.hslab->diminfo.opt[u].count); } /* end if */ else ret_value = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst); @@ -3471,7 +3470,7 @@ H5S__get_select_hyper_nblocks(const H5S_t *space, hbool_t app_ref) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__get_select_hyper_nblocks() */ - + /*-------------------------------------------------------------------------- NAME H5Sget_select_hyper_nblocks @@ -3512,7 +3511,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sget_select_hyper_nblocks() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_get_enc_size_real @@ -3707,13 +3706,13 @@ H5S__hyper_get_version_enc_size(const H5S_t *space, hsize_t block_count, uint32_ default: HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "unknown hyperslab selection version") break; - } /* end switch */ + } done: FUNC_LEAVE_NOAPI(ret_value) } /* H5S__hyper_get_version_enc_size() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_serial_size @@ -3738,14 +3737,15 @@ H5S__hyper_serial_size(const H5S_t *space) { hsize_t block_count = 0; /* block counter for regular hyperslabs */ uint32_t version; /* Version number */ - uint8_t enc_size; /* Encoded size of hyerslab selection info */ + uint8_t enc_size; /* Encoded size of hyperslab selection info */ hssize_t ret_value = -1; /* return value */ FUNC_ENTER_STATIC HDassert(space); - if(space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ + /* Determine the number of blocks */ + if(space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ block_count = H5S__get_select_hyper_nblocks(space, FALSE); /* Determine the version and the encoded size */ @@ -3787,7 +3787,7 @@ H5S__hyper_serial_size(const H5S_t *space) */ HDassert(enc_size == 8); ret_value = (hssize_t)17 + ((hssize_t)4 * (hssize_t)8 * (hssize_t)space->extent.rank); - } /* end else-if */ + } else { HDassert(version == H5S_HYPER_VERSION_1); HDassert(enc_size == 4); @@ -3807,7 +3807,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_serial_size() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_serialize_helper @@ -3928,14 +3928,14 @@ H5S__hyper_serialize_helper(const H5S_hyper_span_info_t *spans, FUNC_LEAVE_NOAPI_VOID } /* end H5S__hyper_serialize_helper() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_serialize PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S_hyper_serialize(space, p) + herr_t H5S__hyper_serialize(space, p) const H5S_t *space; IN: Dataspace with selection to serialize uint8_t **p; OUT: Pointer to buffer to put serialized selection. Will be advanced to end of @@ -3958,7 +3958,7 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p) hsize_t offset[H5S_MAX_RANK]; /* Offset of element in dataspace */ hsize_t start[H5S_MAX_RANK]; /* Location of start of hyperslab */ hsize_t end[H5S_MAX_RANK]; /* Location of end of hyperslab */ - uint8_t *pp; /* Local pointer for decoding */ + uint8_t *pp; /* Local pointer for encoding */ uint8_t *lenp = NULL; /* pointer to length location for later storage */ uint32_t len = 0; /* number of bytes used */ uint32_t version; /* Version number */ @@ -3969,7 +3969,7 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p) unsigned u; /* Local counting variable */ hbool_t complete = FALSE; /* Whether we are done with the iteration */ hbool_t is_regular; /* Whether selection is regular */ - uint8_t enc_size; + uint8_t enc_size; /* Encoded size */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_STATIC @@ -3984,7 +3984,8 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p) ndims = space->extent.rank; diminfo = space->select.sel_info.hslab->diminfo.opt; - if(space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ + /* Calculate the # of blocks */ + if(space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ block_count = H5S__get_select_hyper_nblocks(space, FALSE); /* Determine the version and the encoded size */ @@ -4120,7 +4121,7 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p) tmp_count[fast_dim]--; } /* end while */ - /* Work on other dimensions if necessary */ + /* Work on other dimensions if necessary */ if(fast_dim > 0) { int temp_dim; /* Temporary rank holder */ @@ -4141,7 +4142,7 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p) if(temp_dim == 0) complete = TRUE; - /* Reset the block count in this dimension */ + /* Reset the block count in this dimension */ tmp_count[temp_dim] = diminfo[temp_dim].count; /* Wrapped a dimension, go up to next dimension */ @@ -4204,7 +4205,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_serialize() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_deserialize @@ -4383,7 +4384,7 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p) size_t num_elem; /* Number of elements in selection */ unsigned v; /* Local counting variable */ - /* decode the number of blocks */ + /* Decode the number of blocks */ switch(enc_size) { case H5S_SELECT_INFO_ENC_SIZE_2: UINT16DECODE(pp, num_elem); @@ -4748,7 +4749,7 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__get_select_hyper_blocklist() */ - + /*-------------------------------------------------------------------------- NAME H5Sget_select_hyper_blocklist @@ -4761,7 +4762,7 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, hsize_t numblocks; IN: Number of hyperslab blocks to get hsize_t buf[]; OUT: List of hyperslab blocks selected RETURNS - Non-negative on success/Negative on failure + Non-negative on success, negative on failure DESCRIPTION Puts a list of the hyperslab blocks into the user's buffer. The blocks start with the 'startblock'th block in the list of blocks and put @@ -4809,7 +4810,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sget_select_hyper_blocklist() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_bounds @@ -4890,7 +4891,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_bounds() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_offset @@ -4999,7 +5000,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_offset() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_unlim_dim @@ -5026,7 +5027,7 @@ H5S__hyper_unlim_dim(const H5S_t *space) FUNC_LEAVE_NOAPI(space->select.sel_info.hslab->unlim_dim); } /* end H5S__hyper_unlim_dim() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_num_elem_non_unlim @@ -5068,7 +5069,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_num_elem_non_unlim() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_is_contiguous @@ -5254,7 +5255,7 @@ H5S__hyper_is_contiguous(const H5S_t *space) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_is_contiguous() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_is_single @@ -5327,7 +5328,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_is_single() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_is_regular @@ -5372,7 +5373,7 @@ H5S__hyper_is_regular(const H5S_t *space) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_is_regular() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_spans_shape_same_helper @@ -5724,7 +5725,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_shape_same() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_release @@ -5765,7 +5766,7 @@ H5S__hyper_release(H5S_t *space) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_release() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_coord_to_span @@ -5828,7 +5829,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_coord_to_span() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_add_span_element_helper @@ -6494,7 +6495,7 @@ H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset) if(0 != offset[u]) { non_zero_offset = TRUE; break; - } /* end if */ + } /* Only perform operation if the offset is non-zero */ if(non_zero_offset) { @@ -9020,7 +9021,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_generate_spans() */ - + /*-------------------------------------------------------------------------- NAME H5S__check_spans_overlap @@ -9404,11 +9405,11 @@ done: /*------------------------------------------------------------------------- * Function: H5S__generate_hyperlab * - * Purpose: Generate hyperslab information from H5S_select_hyperslab() + * Purpose: Generate hyperslab information from H5S_select_hyperslab() * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, September 12, 2000 * *------------------------------------------------------------------------- @@ -9824,11 +9825,11 @@ done: /*------------------------------------------------------------------------- * Function: H5S_select_hyperslab * - * Purpose: Internal version of H5Sselect_hyperslab(). + * Purpose: Internal version of H5Sselect_hyperslab(). * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, January 10, 2001 * *------------------------------------------------------------------------- @@ -10495,9 +10496,9 @@ hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], const hsize_t stride[], const hsize_t count[], const hsize_t block[]) { - H5S_t *space; /* Dataspace to modify selection of */ - H5S_t *new_space = NULL; /* New dataspace created */ - hid_t ret_value; /* Return value */ + H5S_t *space; /* Dataspace to modify selection of */ + H5S_t *new_space = NULL; /* New dataspace created */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE6("i", "iSs*h*h*h*h", space_id, op, start, stride, count, block); @@ -10529,11 +10530,11 @@ done: /*------------------------------------------------------------------------- * Function: H5S__combine_select * - * Purpose: Internal version of H5Scombine_select(). + * Purpose: Internal version of H5Scombine_select(). * - * Return: New dataspace on success/NULL on failure + * Return: New dataspace on success/NULL on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, October 30, 2001 * *------------------------------------------------------------------------- @@ -10668,15 +10669,15 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Scombine_select() */ - + /*------------------------------------------------------------------------- * Function: H5S__modify_select * - * Purpose: Internal version of H5Smodify_select(). + * Purpose: Internal version of H5Smodify_select(). * - * Return: New dataspace on success/NULL on failure + * Return: New dataspace on success/NULL on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, October 30, 2001 * *------------------------------------------------------------------------- diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 33dd492..147fd25 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -14,7 +14,7 @@ /* * Programmer: rky 980813 * - * Purpose: Create MPI data types for HDF5 selections. + * Purpose: Create MPI data types for HDF5 selections. * */ @@ -148,14 +148,14 @@ H5S__mpio_all_type(const H5S_t *space, size_t elmt_size, *new_type = MPI_BYTE; H5_CHECKED_ASSIGN(*count, int, total_bytes, hsize_t); *is_derived_type = FALSE; - } /* end if */ + } else { /* Create a LARGE derived datatype for this transfer */ if(H5_mpio_create_large_type(total_bytes, 0, MPI_BYTE, new_type) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large datatype from the all selection") *count = 1; *is_derived_type = TRUE; - } /* end else */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -253,7 +253,7 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, /* Commit MPI datatype for later use */ if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - } /* end if */ + } else { /* use LARGE_DATATYPE:: * We'll create an hindexed_block type for every 2G point count and then combine @@ -295,7 +295,7 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, #if MPI_VERSION >= 3 if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block((int)bigio_count, 1, &disp[(hsize_t)i*bigio_count], elmt_type, &inner_types[i]))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code); #else if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)bigio_count, blocks, &disp[i*bigio_count], elmt_type, &inner_types[i]))) @@ -309,7 +309,7 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, #if MPI_VERSION >= 3 if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(remaining_points, 1, &disp[(hsize_t)num_big_types*bigio_count], elmt_type, &inner_types[num_big_types]))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code); #else if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)remaining_points, blocks, &disp[num_big_types*bigio_count], elmt_type, &inner_types[num_big_types]))) @@ -317,11 +317,12 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, #endif inner_blocks[num_big_types] = 1; inner_disps[num_big_types] = 0; - } /* end if */ + } if(MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(total_types, inner_blocks, inner_disps, inner_types, new_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct", mpi_code) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct", mpi_code); + for(i = 0; i < total_types; i++) MPI_Type_free(&inner_types[i]); @@ -492,7 +493,7 @@ done: * selection and so the memory datatype has to be permuted using the * permutation map created by the file selection. * - * Note: This routine is called from H5_mpio_space_type(), which is + * Note: This routine is called from H5S_mpio_space_type(), which is * called first for the file dataspace and creates * * Return: Non-negative on success, negative on failure. @@ -799,7 +800,7 @@ if(H5DEBUG(S)) { /* Use a single MPI datatype that has a 32 bit size */ if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &inner_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) - } /* end if */ + } else /* Create the compound datatype for this operation (> 2GB) */ if(H5_mpio_create_large_type(elmt_size, 0, MPI_BYTE, &inner_type) < 0) @@ -836,7 +837,7 @@ if(H5DEBUG(S)) MPI_Type_free(&inner_type); if(mpi_code != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "couldn't create MPI vector type", mpi_code) - } /* end if */ + } else { /* Things get a bit more complicated and require LARGE_DATATYPE processing * There are two MPI datatypes that need to be created: @@ -858,7 +859,7 @@ if(H5DEBUG(S)) if(bigio_count < d[i].block) { if(H5_mpio_create_large_type(d[i].block, 0, inner_type, &block_type) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large block datatype in hyper selection") - } /* end if */ + } else if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)d[i].block, inner_type, &block_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) @@ -879,7 +880,7 @@ if(H5DEBUG(S)) if(bigio_count < d[i].count) { if(H5_mpio_create_large_type(d[i].count, stride_in_bytes, block_type, &outer_type) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large outer datatype in hyper selection") - } /* end if */ + } /* otherwise a regular create_hvector will do */ else if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector((int)d[i].count, /* count */ @@ -891,7 +892,7 @@ if(H5DEBUG(S)) MPI_Type_free(&block_type); MPI_Type_free(&inner_type); - } /* end else */ + } /* end else */ /**************************************** * Then build the dimension type as (start, vector type, xtent). @@ -1004,7 +1005,7 @@ H5S__mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, if(bigio_count >= elmt_size) { if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) - } /* end if */ + } else if(H5_mpio_create_large_type(elmt_size, 0, MPI_BYTE, &elmt_type) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large element datatype in span_hyper selection") @@ -1113,7 +1114,6 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, { H5S_hyper_span_t *span; /* Hyperslab span to iterate with */ hsize_t bigio_count; /* Transition point to create derived type */ - size_t alloc_count = 0; /* Number of span tree nodes allocated at this level */ size_t outercount = 0; /* Number of span tree nodes at this level */ MPI_Datatype *inner_type = NULL; diff --git a/src/H5Snone.c b/src/H5Snone.c index 630d1d5..672302d 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -29,7 +29,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ +#include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* ID Functions */ #include "H5Spkg.h" /* Dataspace functions */ #include "H5VMprivate.h" /* Vector functions */ @@ -68,8 +68,7 @@ static htri_t H5S__none_intersect_block(const H5S_t *space, const hsize_t *start static herr_t H5S__none_adjust_u(H5S_t *space, const hsize_t *offset); static herr_t H5S__none_adjust_s(H5S_t *space, const hssize_t *offset); static herr_t H5S__none_project_scalar(const H5S_t *space, hsize_t *offset); -static herr_t H5S__none_project_simple(const H5S_t *space, H5S_t *new_space, - hsize_t *offset); +static herr_t H5S__none_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset); static herr_t H5S__none_iter_init(const H5S_t *space, H5S_sel_iter_t *iter); /* Selection iteration callbacks */ @@ -143,13 +142,13 @@ static const H5S_sel_iter_class_t H5S_sel_iter_none[1] = {{ /*------------------------------------------------------------------------- - * Function: H5S__none_iter_init + * Function: H5S__none_iter_init * - * Purpose: Initializes iteration information for "none" selection. + * Purpose: Initializes iteration information for "none" selection. * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * *------------------------------------------------------------------------- @@ -171,21 +170,20 @@ H5S__none_iter_init(const H5S_t H5_ATTR_UNUSED *space, H5S_sel_iter_t *iter) /*------------------------------------------------------------------------- - * Function: H5S__none_iter_coords + * Function: H5S__none_iter_coords * - * Purpose: Retrieve the current coordinates of iterator for current + * Purpose: Retrieve the current coordinates of iterator for current * selection * - * Return: Non-negative on success, negative on failure + * Return: Non-negative on success, negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 22, 2003 * *------------------------------------------------------------------------- */ static herr_t -H5S__none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, - hsize_t H5_ATTR_UNUSED *coords) +H5S__none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_UNUSED *coords) { FUNC_ENTER_STATIC_NOERR @@ -198,21 +196,20 @@ H5S__none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, /*------------------------------------------------------------------------- - * Function: H5S__none_iter_block + * Function: H5S__none_iter_block * - * Purpose: Retrieve the current block of iterator for current + * Purpose: Retrieve the current block of iterator for current * selection * - * Return: Non-negative on success, negative on failure + * Return: Non-negative on success, negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 2, 2003 * *------------------------------------------------------------------------- */ static herr_t -H5S__none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, - hsize_t H5_ATTR_UNUSED *start, hsize_t H5_ATTR_UNUSED *end) +H5S__none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_UNUSED *start, hsize_t H5_ATTR_UNUSED *end) { FUNC_ENTER_STATIC_NOERR @@ -226,13 +223,13 @@ H5S__none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, /*------------------------------------------------------------------------- - * Function: H5S__none_iter_nelmts + * Function: H5S__none_iter_nelmts * - * Purpose: Return number of elements left to process in iterator + * Purpose: Return number of elements left to process in iterator * - * Return: Non-negative number of elements on success, zero on failure + * Return: Non-negative number of elements on success, zero on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * *------------------------------------------------------------------------- @@ -472,8 +469,7 @@ H5S__none_release(H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, - hbool_t H5_ATTR_UNUSED share_selection) +H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection) { FUNC_ENTER_STATIC_NOERR @@ -586,8 +582,8 @@ H5S__none_serialize(const H5S_t *space, uint8_t **p) HDassert(pp); /* Store the preamble information */ - UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(pp, (uint32_t)H5S_NONE_VERSION_1); /* Store the version number */ + UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(pp, (uint32_t)H5S_NONE_VERSION_1); /* Store the version number */ UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */ UINT32ENCODE(pp, (uint32_t)0); /* Store the additional information length */ @@ -698,8 +694,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__none_bounds(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *start, - hsize_t H5_ATTR_UNUSED *end) +H5S__none_bounds(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *start, hsize_t H5_ATTR_UNUSED *end) { FUNC_ENTER_STATIC_NOERR @@ -708,7 +703,7 @@ H5S__none_bounds(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *star HDassert(end); FUNC_LEAVE_NOAPI(FAIL) -} /* end H5Sget_none_bounds() */ +} /* end H5S_none_bounds() */ /*-------------------------------------------------------------------------- @@ -991,11 +986,11 @@ H5S__none_adjust_s(H5S_t H5_ATTR_UNUSED *space, const hssize_t H5_ATTR_UNUSED *o /*------------------------------------------------------------------------- - * Function: H5S__none_project_scalar + * Function: H5S__none_project_scalar * - * Purpose: Projects a 'none' selection into a scalar dataspace + * Purpose: Projects a 'none' selection into a scalar dataspace * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol * Sunday, July 18, 2010 @@ -1016,14 +1011,14 @@ H5S__none_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUS /*------------------------------------------------------------------------- - * Function: H5S__none_project_simple + * Function: H5S__none_project_simple * - * Purpose: Projects an 'none' selection onto/into a simple dataspace + * Purpose: Projects an 'none' selection onto/into a simple dataspace * of a different rank * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, July 18, 2010 * *------------------------------------------------------------------------- diff --git a/src/H5Spkg.h b/src/H5Spkg.h index da2dd4a..e08fedf 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -324,11 +324,9 @@ struct H5S_t { /* Selection iteration methods */ /* Method to retrieve the current coordinates of iterator for current selection */ -typedef herr_t (*H5S_sel_iter_coords_func_t)(const H5S_sel_iter_t *iter, - hsize_t *coords); +typedef herr_t (*H5S_sel_iter_coords_func_t)(const H5S_sel_iter_t *iter, hsize_t *coords); /* Method to retrieve the current block of iterator for current selection */ -typedef herr_t (*H5S_sel_iter_block_func_t)(const H5S_sel_iter_t *iter, - hsize_t *start, hsize_t *end); +typedef herr_t (*H5S_sel_iter_block_func_t)(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); /* Method to determine number of elements left in iterator for current selection */ typedef hsize_t (*H5S_sel_iter_nelmts_func_t)(const H5S_sel_iter_t *iter); /* Method to determine if there are more blocks left in the current selection */ diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 6948125..60e810d 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -15,7 +15,7 @@ * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * - * Purpose: Point selection dataspace I/O functions. + * Purpose: Point selection dataspace I/O functions. */ /****************/ @@ -30,8 +30,8 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* ID Functions */ #include "H5MMprivate.h" /* Memory management */ #include "H5Spkg.h" /* Dataspace functions */ @@ -75,21 +75,17 @@ static htri_t H5S__point_is_contiguous(const H5S_t *space); static htri_t H5S__point_is_single(const H5S_t *space); static htri_t H5S__point_is_regular(const H5S_t *space); static htri_t H5S__point_shape_same(const H5S_t *space1, const H5S_t *space2); -static htri_t H5S__point_intersect_block(const H5S_t *space, const hsize_t *start, - const hsize_t *end); +static htri_t H5S__point_intersect_block(const H5S_t *space, const hsize_t *start, const hsize_t *end); static herr_t H5S__point_adjust_u(H5S_t *space, const hsize_t *offset); static herr_t H5S__point_adjust_s(H5S_t *space, const hssize_t *offset); static herr_t H5S__point_project_scalar(const H5S_t *spasce, hsize_t *offset); -static herr_t H5S__point_project_simple(const H5S_t *space, H5S_t *new_space, - hsize_t *offset); +static herr_t H5S__point_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset); static herr_t H5S__point_iter_init(const H5S_t *space, H5S_sel_iter_t *iter); -static herr_t H5S__point_get_version_enc_size(const H5S_t *space, - uint32_t *version, uint8_t *enc_size); +static herr_t H5S__point_get_version_enc_size(const H5S_t *space, uint32_t *version, uint8_t *enc_size); /* Selection iteration callbacks */ static herr_t H5S__point_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); -static herr_t H5S__point_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, - hsize_t *end); +static herr_t H5S__point_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); static hsize_t H5S__point_iter_nelmts(const H5S_sel_iter_t *iter); static htri_t H5S__point_iter_has_next_block(const H5S_sel_iter_t *iter); static herr_t H5S__point_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); @@ -169,16 +165,15 @@ H5FL_BARR_DEFINE_STATIC(H5S_pnt_node_t, hcoords_t, H5S_MAX_RANK); /* Declare a free list to manage the H5S_pnt_list_t struct */ H5FL_DEFINE_STATIC(H5S_pnt_list_t); - - + /*------------------------------------------------------------------------- * Function: H5S__point_iter_init * - * Purpose: Initializes iteration information for point selection. + * Purpose: Initializes iteration information for point selection. * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * *------------------------------------------------------------------------- @@ -223,16 +218,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_iter_init() */ - + /*------------------------------------------------------------------------- * Function: H5S__point_iter_coords * - * Purpose: Retrieve the current coordinates of iterator for current + * Purpose: Retrieve the current coordinates of iterator for current * selection * - * Return: Non-negative on success, negative on failure + * Return: Non-negative on success, negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 22, 2003 * *------------------------------------------------------------------------- @@ -252,16 +247,16 @@ H5S__point_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__point_iter_coords() */ - + /*------------------------------------------------------------------------- - * Function: H5S__point_iter_block + * Function: H5S_point_iter_block * - * Purpose: Retrieve the current block of iterator for current + * Purpose: Retrieve the current block of iterator for current * selection * - * Return: Non-negative on success, negative on failure + * Return: Non-negative on success, negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 2, 2003 * *------------------------------------------------------------------------- @@ -283,15 +278,15 @@ H5S__point_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__point_iter_block() */ - + /*------------------------------------------------------------------------- * Function: H5S__point_iter_nelmts * - * Purpose: Return number of elements left to process in iterator + * Purpose: Return number of elements left to process in iterator * - * Return: Non-negative number of elements on success, zero on failure + * Return: Non-negative number of elements on success, zero on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * *------------------------------------------------------------------------- @@ -307,7 +302,7 @@ H5S__point_iter_nelmts(const H5S_sel_iter_t *iter) FUNC_LEAVE_NOAPI(iter->elmt_left) } /* end H5S__point_iter_nelmts() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_iter_has_next_block @@ -343,7 +338,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_iter_has_next_block() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_iter_next @@ -380,7 +375,7 @@ H5S__point_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__point_iter_next() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_iter_next_block @@ -412,7 +407,7 @@ H5S__point_iter_next_block(H5S_sel_iter_t *iter) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__point_iter_next_block() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_iter_get_seq_list @@ -577,7 +572,7 @@ H5S__point_iter_release(H5S_sel_iter_t * iter) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__point_iter_release() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_add @@ -694,7 +689,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_add() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_release @@ -732,7 +727,7 @@ H5S__point_release(H5S_t *space) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__point_release() */ - + /*-------------------------------------------------------------------------- NAME H5S_select_elements @@ -789,7 +784,7 @@ H5S_select_elements(H5S_t *space, H5S_seloper_t op, size_t num_elem, /* Set the bound box to the default value */ H5VM_array_fill(space->select.sel_info.pnt_lst->low_bounds, &tmp, sizeof(hsize_t), space->extent.rank); HDmemset(space->select.sel_info.pnt_lst->high_bounds, 0, sizeof(hsize_t) * space->extent.rank); - } /* end if */ + } /* Add points to selection */ if(H5S__point_add(space, op, num_elem, coord) < 0) @@ -802,7 +797,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_elements() */ - + /*-------------------------------------------------------------------------- NAME H5S__copy_pnt_list @@ -960,7 +955,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_copy() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_is_valid @@ -1004,7 +999,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_is_valid() */ - + /*-------------------------------------------------------------------------- NAME H5Sget_select_elem_npoints @@ -1050,7 +1045,7 @@ done: PURPOSE Determine the version and the size (2, 4 or 8 bytes) to encode point selection info USAGE - hssize_t H5S__point_set_enc_size(space, version, enc_size) + hssize_t H5S__point_get_version_enc_size(space, version, enc_size) const H5S_t *space: IN: Dataspace ID of selection to query uint32_t *version: OUT: The version to use for encoding uint8_t *enc_size: OUT: The size to use for encoding @@ -1161,7 +1156,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5S__point_get_version_enc_size() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_serial_size @@ -1220,7 +1215,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_serial_size() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_serialize @@ -1246,7 +1241,7 @@ static herr_t H5S__point_serialize(const H5S_t *space, uint8_t **p) { H5S_pnt_node_t *curr; /* Point information nodes */ - uint8_t *pp; /* Local pointer for decoding */ + uint8_t *pp; /* Local pointer for encoding */ uint8_t *lenp = NULL; /* pointer to length location for later storage */ uint32_t len=0; /* number of bytes used */ unsigned u; /* local counting variable */ @@ -1352,8 +1347,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5S__point_serialize() */ - - + /*-------------------------------------------------------------------------- NAME H5S__point_deserialize @@ -1508,7 +1502,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_deserialize() */ - + /*-------------------------------------------------------------------------- NAME H5S__get_select_elem_pointlist @@ -1539,8 +1533,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, - hsize_t numpoints, hsize_t *buf) +H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, hsize_t numpoints, hsize_t *buf) { H5S_pnt_node_t *node; /* Point node */ unsigned rank; /* Dataspace rank */ @@ -1573,7 +1566,7 @@ H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__get_select_elem_pointlist() */ - + /*-------------------------------------------------------------------------- NAME H5Sget_select_elem_pointlist @@ -1627,7 +1620,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Sget_select_elem_pointlist() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_bounds @@ -1685,7 +1678,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_bounds() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_offset @@ -1749,7 +1742,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_offset() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_unlim_dim @@ -1778,7 +1771,7 @@ H5S__point_unlim_dim(const H5S_t H5_ATTR_UNUSED *space) FUNC_LEAVE_NOAPI(-1) } /* end H5S__point_unlim_dim() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_is_contiguous @@ -1818,7 +1811,7 @@ H5S__point_is_contiguous(const H5S_t *space) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_is_contiguous() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_is_single @@ -1855,7 +1848,7 @@ H5S__point_is_single(const H5S_t *space) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_is_single() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_is_regular @@ -1896,7 +1889,7 @@ H5S__point_is_regular(const H5S_t *space) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_is_regular() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_shape_same @@ -2061,7 +2054,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_intersect_block() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_adjust_u @@ -2098,7 +2091,7 @@ H5S__point_adjust_u(H5S_t *space, const hsize_t *offset) if(0 != offset[u]) { non_zero_offset = TRUE; break; - } /* end if */ + } /* Only perform operation if the offset is non-zero */ if(non_zero_offset) { @@ -2129,7 +2122,7 @@ H5S__point_adjust_u(H5S_t *space, const hsize_t *offset) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__point_adjust_u() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_adjust_s @@ -2199,15 +2192,16 @@ H5S__point_adjust_s(H5S_t *space, const hssize_t *offset) } /* end H5S__point_adjust_s() */ + /*------------------------------------------------------------------------- * Function: H5S__point_project_scalar * - * Purpose: Projects a single element point selection into a scalar + * Purpose: Projects a single element point selection into a scalar * dataspace * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, July 18, 2010 * *------------------------------------------------------------------------- @@ -2238,16 +2232,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_project_scalar() */ - + /*------------------------------------------------------------------------- - * Function: H5S__point_project_simple + * Function: H5S_point_project_simple * - * Purpose: Projects a point selection onto/into a simple dataspace + * Purpose: Projects a point selection onto/into a simple dataspace * of a different rank * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, July 18, 2010 * *------------------------------------------------------------------------- @@ -2374,7 +2368,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_project_simple() */ - + /*-------------------------------------------------------------------------- NAME H5Sselect_elements diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index a61c505..5100f1c 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -183,6 +183,7 @@ typedef struct H5S_sel_iter_op_t { #define H5S_SELECT_ITER_GET_SEQ_LIST(ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN) (H5S_select_iter_get_seq_list(ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN)) #define H5S_SELECT_ITER_RELEASE(ITER) (H5S_select_iter_release(ITER)) #endif /* H5S_MODULE */ + /* Handle these callbacks in a special way, since they have prologs that need to be executed */ #define H5S_SELECT_COPY(DST,SRC,SHARE) (H5S_select_copy(DST,SRC,SHARE)) #define H5S_SELECT_SHAPE_SAME(S1,S2) (H5S_select_shape_same(S1,S2)) diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 1072d7d..901dec1 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -32,6 +32,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Spkg.h" /* Dataspaces */ #include "H5VMprivate.h" /* Vector and array functions */ @@ -144,8 +145,8 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset) herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset) { - H5S_t *space; /* Dataspace to query */ - herr_t ret_value = SUCCEED; /* Return value */ + H5S_t *space; /* Dataspace to modify */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Hs", space_id, offset); @@ -582,7 +583,7 @@ H5S_select_deserialize(H5S_t **space, const uint8_t **p) default: break; - } /* end switch */ + } if(ret_value < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTLOAD, FAIL, "can't deserialize selection") -- cgit v0.12 From 07a52ecb2ffa1d8d32f06db23470833899db3deb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 9 Jul 2020 13:03:58 -0500 Subject: HDFFV-11116 Add option for install location of Fortran MOD files --- CMakeLists.txt | 11 +++++++++++ config/cmake/cacheinit.cmake | 3 +++ fortran/src/CMakeLists.txt | 20 ++++++++++++++++++++ hl/fortran/src/CMakeLists.txt | 21 ++++++++++++++++++++- release_docs/INSTALL_CMake.txt | 8 ++++++++ release_docs/RELEASE.txt | 31 ++++++++++++++++++++++++++++--- 6 files changed, 90 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b559446..ac291fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -995,6 +995,17 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for endif () endif () + #option (HDF5_INSTALL_MOD_FORTRAN "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" "NO") + set (HDF5_INSTALL_MOD_FORTRAN "SHARED" CACHE STRING "Copy FORTRAN mod files to include directory (NO SHARED STATIC)") + set_property (CACHE HDF5_INSTALL_MOD_FORTRAN PROPERTY STRINGS NO SHARED STATIC) + if (NOT HDF5_INSTALL_MOD_FORTRAN MATCHES "NO") + if (NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) + set (HDF5_INSTALL_MOD_FORTRAN "STATIC") + elseif (BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) + set (HDF5_INSTALL_MOD_FORTRAN "SHARED") + endif () + endif () + add_subdirectory (fortran) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 4846997..64e8dcc 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -23,6 +23,9 @@ set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) +set (HDF5_INSTALL_MOD_FORTRAN "NO" CACHE STRING "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" FORCE) +set_property (CACHE HDF5_INSTALL_MOD_FORTRAN PROPERTY STRINGS NO SHARED STATIC) + set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE) set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index bf2fd84..b1add54 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -412,6 +412,16 @@ if (NOT ONLY_SHARED_LIBS) COMPONENT fortheaders ) + if (HDF5_INSTALL_MOD_FORTRAN MATCHES "STATIC") + install ( + FILES + ${mod_files} + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR} + COMPONENT + fortheaders + ) + endif () endif () if (BUILD_SHARED_LIBS) @@ -445,6 +455,16 @@ if (BUILD_SHARED_LIBS) COMPONENT fortheaders ) + if (HDF5_INSTALL_MOD_FORTRAN MATCHES "SHARED") + install ( + FILES + ${modsh_files} + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR} + COMPONENT + fortheaders + ) + endif () endif () #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 71b9380..d682d5f 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -234,7 +234,6 @@ if (NOT ONLY_SHARED_LIBS) ${MOD_BUILD_DIR}/h5lt_const.mod ${MOD_BUILD_DIR}/h5im.mod ) - install ( FILES ${mod_files} @@ -243,6 +242,16 @@ if (NOT ONLY_SHARED_LIBS) COMPONENT fortheaders ) + if (HDF5_INSTALL_MOD_FORTRAN MATCHES "STATIC") + install ( + FILES + ${mod_files} + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR} + COMPONENT + fortheaders + ) + endif () endif () if (BUILD_SHARED_LIBS) set (modsh_files @@ -261,6 +270,16 @@ if (BUILD_SHARED_LIBS) COMPONENT fortheaders ) + if (HDF5_INSTALL_MOD_FORTRAN MATCHES "SHARED") + install ( + FILES + ${modsh_files} + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR} + COMPONENT + fortheaders + ) + endif () endif () #----------------------------------------------------------------------------- diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 5442f6c..89cd9f8 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -624,6 +624,7 @@ The config/cmake/cacheinit.cmake file can override the following values. ---------------- General Build Options --------------------- BUILD_SHARED_LIBS "Build Shared Libraries" ON +BUILD_STATIC_LIBS "Build Static Libraries" ON BUILD_STATIC_EXECS "Build Static Executables" OFF BUILD_TESTING "Build HDF5 Unit Testing" ON @@ -636,6 +637,7 @@ HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON HDF5_BUILD_TOOLS "Build HDF5 Tools" ON ---------------- HDF5 Advanced Options --------------------- +ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF HDF5_EXTERNAL_LIB_PREFIX "Use prefix for custom library naming." "" HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF @@ -676,6 +678,12 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF if (HDF5_TEST_VFD) HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON +if (HDF5_BUILD_FORTRAN) + HDF5_INSTALL_MOD_FORTRAN "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" "XX" + if (BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) default HDF5_INSTALL_MOD_FORTRAN is SHARED + if (BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) default HDF5_INSTALL_MOD_FORTRAN is SHARED + if (NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) default HDF5_INSTALL_MOD_FORTRAN is STATIC + if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) default HDF5_INSTALL_MOD_FORTRAN is SHARED ---------------- External Library Options --------------------- HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO" diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 665a156..56e5569 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -48,6 +48,31 @@ New Features Configuration: ------------- + - CMake option to link the generated Fortran MOD files into the include + directory. + + The Fortran generation of MOD files by a Fortran compile can produce + different binary files between SHARED and STATIC compiles with different + compilers and/or different platforms. Note that it has been found that + different versions of Fortran compilers will produce incompatible MOD + files. Currently, CMake will locate these MOD files in subfolders of + the include directory and add that path to the Fortran library target + in the CMake config file, which can be used by the CMake find library + process. For other build systems using the binary from a CMake install, + a new CMake configuration can be used to copy the pre-chosen version + of the Fortran MOD files into the install include directory. + + The default will depend on the configuration of + BUILD_STATIC_LIBS and BUILD_SHARED_LIBS: + YES YES Default to SHARED + YES NO Default to STATIC + NO YES Default to SHARED + NO NO Default to SHARED + The defaults can be overriden by setting the config option + HDF5_INSTALL_MOD_FORTRAN to one of NO, SHARED, or STATIC + + (ADB - 2020/07/9, HDFFV-11116) + - CMake option to use AEC (open source SZip) library instead of SZip The open source AEC library is a replacement library for SZip. In @@ -1015,9 +1040,9 @@ Bug Fixes since HDF5-1.10.3 release ------- - Stopped java/test/junit.sh.in installing libs for testing under ${prefix} - Lib files needed are now copied to a subdirectory in the java/test - directory, and on Macs the loader path for libhdf5.xxxs.so is changed - in the temporary copy of libhdf5_java.dylib. + Lib files needed are now copied to a subdirectory in the java/test + directory, and on Macs the loader path for libhdf5.xxxs.so is changed + in the temporary copy of libhdf5_java.dylib. (LRK, 2020/7/2, HDFFV-11063) -- cgit v0.12 From 0f3fd8d53d9af7e024668c1cfae0780cb9f424dd Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 10 Jul 2020 13:39:59 -0500 Subject: Remove path to szip header file from AM_CPPFLAGS when configure check of libsz fails. Fix for HDFFV-10830. --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d7e3cb5..fb50f94 100644 --- a/configure.ac +++ b/configure.ac @@ -1604,7 +1604,10 @@ case "X-$withval" in if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, - [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) + if test -z "$HAVE_SZLIB"; then + AC_MSG_RESULT([Using SZ_BufftoBuffCompress from libsz in $szlib_lib failed. Szip not enabled.]) + fi fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then -- cgit v0.12 From 4305d9677b4bf4c7e21999a32dbd532250b79abd Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 14 Jul 2020 05:01:22 -0700 Subject: Fallback to older time functions in new timer code. --- src/H5timer.c | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/src/H5timer.c b/src/H5timer.c index 8f3d305..cef7bf9 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -220,7 +220,8 @@ H5_now_usec(void) * * Purpose: Get the current time, as the time of seconds after the UNIX epoch * - * Return: SUCCEED/FAIL + * Return: Success: A non-negative time value + * Failure: -1.0 (in theory, can't currently fail) * * Programmer: Quincey Koziol * October 05, 2016 @@ -247,9 +248,9 @@ H5_get_time(void) HDgettimeofday(&now_tv, NULL); ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / (double)1000000.0f); } -#else /* H5_HAVE_GETTIMEOFDAY */ +#else ret_value = (double)HDtime(NULL); -#endif /* H5_HAVE_GETTIMEOFDAY */ +#endif FUNC_LEAVE_NOAPI(ret_value) } /* end H5_get_time() */ @@ -279,9 +280,9 @@ H5__timer_get_timevals(H5_timevals_t *times /*in,out*/) /* Windows call handles both system/user and elapsed times */ #ifdef H5_HAVE_WIN32_API if(H5_get_win32_times(times) < 0) { - times->elapsed = -1; - times->system = -1; - times->user = -1; + times->elapsed = -1.0; + times->system = -1.0; + times->user = -1.0; return -1; } /* end if */ @@ -310,24 +311,8 @@ H5__timer_get_timevals(H5_timevals_t *times /*in,out*/) * Elapsed time * ****************/ - /* NOTE: Not having a way to get elapsed time IS an error, unlike - * the system and user times. - */ + times->elapsed = H5_get_time(); -#if defined(H5_HAVE_CLOCK_GETTIME) -{ - struct timespec ts; - - if(HDclock_gettime(CLOCK_MONOTONIC, &ts) != 0) - return -1; - times->elapsed = (double)ts.tv_sec + ((double)ts.tv_nsec / (double)1.0E9F); -} -#else - /* Die here. We'd like to know about this so we can support some - * other time functionality. - */ - HDassert(0); -#endif #endif /* H5_HAVE_WIN32_API */ return 0; -- cgit v0.12 From b8013380792a3503003f0a2bd60d7541656b03c7 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 14 Jul 2020 07:49:00 -0500 Subject: Removed POSIX #defines from configure on Solaris. --- configure.ac | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure.ac b/configure.ac index 670b0eb..f79e9e6 100644 --- a/configure.ac +++ b/configure.ac @@ -1250,12 +1250,6 @@ case "$host_cpu-$host_vendor-$host_os" in H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ;; - *solaris*) - ## Solaris also needs _POSIX_C_SOURCE set correctly to pick up - ## clock_gettime(). - H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" - H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" - ;; esac ## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible -- cgit v0.12 From 4bc49d8b2bb6b549141a47f50062eb4ddfba4557 Mon Sep 17 00:00:00 2001 From: vchoi Date: Tue, 14 Jul 2020 10:56:33 -0500 Subject: Fix for jira issue HDFFV-11080: (1) Patch up the file pointer when reading attribute of variable length datatype (2) Test to verify the fix when doing multiple threads --- release_docs/RELEASE.txt | 14 ++++ src/H5Aint.c | 4 ++ test/Makefile.am | 2 +- test/ttsafe.c | 1 + test/ttsafe.h | 2 + test/ttsafe_attr_vlen.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 test/ttsafe_attr_vlen.c diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 56e5569..84f339a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -656,6 +656,20 @@ Bug Fixes since HDF5-1.10.3 release Library ------- + - Fixed the segmentation fault when reading attributes with multiple threads + + It was reported that the reading of attributes with variable length string + datatype will crash with segmentation fault particularly when the number of + threads is high (>16 threads). The problem was due to the file pointer that + was set in the variable length string datatype for the attribute. That file + pointer was already closed when the attribute was accessed. + + The problem was fixed by setting the file pointer to the current opened file pointer + when the attribute was accessed. Similar patch up was done before when reading + dataset with variable length string datatype. + + (VC - 2020/07/13, HDFFV-11080) + - Fixed CVE-2020-10810 The tool h5clear produced a segfault during an error recovery in diff --git a/src/H5Aint.c b/src/H5Aint.c index 1a74abe..cd0ab80 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -616,6 +616,10 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) HDassert(mem_type); HDassert(buf); + /* Patch the top level file pointer in attr->shared->dt->shared->u.vlen.f if needed */ + if(H5T_patch_vlen_file(attr->shared->dt, H5F_VOL_OBJ(attr->oloc.file)) < 0 ) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch VL datatype file pointer") + /* Create buffer for data to store on disk */ if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") diff --git a/test/Makefile.am b/test/Makefile.am index e6ce954..7ebeae7 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -146,7 +146,7 @@ LDADD=libh5test.la $(LIBHDF5) # List the source files for tests that have more than one ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ - ttsafe_acreate.c + ttsafe_acreate.c ttsafe_attr_vlen.c cache_image_SOURCES=cache_image.c genall5.c mirror_vfd_SOURCES=mirror_vfd.c genall5.c diff --git a/test/ttsafe.c b/test/ttsafe.c index e6edd9a..2de460b 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -111,6 +111,7 @@ int main(int argc, char *argv[]) AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL); #endif /* H5_HAVE_PTHREAD_H */ AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation", NULL); + AddTest("attr_vlen", tts_attr_vlen, cleanup_attr_vlen, "multi-file-attribute-vlen read", NULL); #else /* H5_HAVE_THREADSAFE */ diff --git a/test/ttsafe.h b/test/ttsafe.h index c29fadc..f1cbe4d 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -35,12 +35,14 @@ void tts_dcreate(void); void tts_error(void); void tts_cancel(void); void tts_acreate(void); +void tts_attr_vlen(void); /* Prototypes for the cleanup routines */ void cleanup_dcreate(void); void cleanup_error(void); void cleanup_cancel(void); void cleanup_acreate(void); +void cleanup_attr_vlen(void); #endif /* H5_HAVE_THREADSAFE */ #endif /* TTSAFE_H */ diff --git a/test/ttsafe_attr_vlen.c b/test/ttsafe_attr_vlen.c new file mode 100644 index 0000000..b07e362 --- /dev/null +++ b/test/ttsafe_attr_vlen.c @@ -0,0 +1,176 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/******************************************************************** + * + * Testing for thread safety in H5A library operations. + * ------------------------------------------------------------------ + * + * Purpose: Verify that the segmentation fault described in HDFFV-11080 + * is fixed. + * + * This test simulates what the user did to trigger the error: + * --Create an HDF5 file + * --Create an attribute with variable length string datatype + * --Attach the attribute to a group + * --Write data to the attribute + * --Close the file + * --Create NUM_THREADS threads + * --For each thread: + * --Open the test file + * --Open and read the attribute for each opened file + * + * The cause of the problem in this jira issue is due to the file pointer + * that is set in the variable length string datatype for the attribute. + * That file pointer is already closed and therefore needs to be set to + * the current opened file pointer when the attribute is accessed. + * Similar patch up was done before when reading dataset in H5D__read() + * in src/H5Aint.c. + * Hopefully this kind of patch can go away when we resolve the + * shared file pointer issue. + * + ********************************************************************/ + +#include "ttsafe.h" + +#ifdef H5_HAVE_THREADSAFE + +#define FILENAME "ttsafe_attr_vlen.h5" +#define ATTR_NAME "root_attr" +#define NUM_THREADS 32 + +void *tts_attr_vlen_thread(void *); + +void +tts_attr_vlen(void) +{ + pthread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ + hid_t asid = H5I_INVALID_HID; /* Dataspace ID for attribute */ + hid_t aid = H5I_INVALID_HID; /* The attribute ID */ + char *string_attr = "2.0"; /* The attribute data */ + int ret; /* Return value */ + int i; /* Local index variable */ + + /* Create the HDF5 test file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid, H5I_INVALID_HID, "H5Fcreate"); + + /* Create variable length string type for attribute */ + atid = H5Tcopy(H5T_C_S1); + CHECK(atid, H5I_INVALID_HID, "H5Tcopy"); + H5Tset_size(atid, H5T_VARIABLE); + + /* Create dataspace for attribute */ + asid = H5Screate(H5S_SCALAR); + CHECK(asid, H5I_INVALID_HID, "H5Screate"); + + /* Open the root group */ + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + CHECK(gid, H5I_INVALID_HID, "H5Gopen2"); + + /* Attach the attribute to the root group */ + aid = H5Acreate2(gid, ATTR_NAME, atid, asid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, H5I_INVALID_HID, "H5Acreate2"); + + /* Write data to the attribute */ + ret = H5Awrite(aid, atid, &string_attr); + CHECK(ret, H5I_INVALID_HID, "H5Awrite"); + + /* Close IDs */ + ret = H5Sclose(asid); + CHECK(ret, H5I_INVALID_HID, "H5Sclose"); + + ret = H5Aclose(aid); + CHECK(ret, H5I_INVALID_HID, "H5Aclose"); + + ret = H5Gclose(gid); + CHECK(ret, H5I_INVALID_HID, "H5Gclose"); + + ret = H5Fclose(fid); + CHECK(ret, H5I_INVALID_HID, "H5Fclose"); + + ret = H5Tclose(atid); + CHECK(ret, H5I_INVALID_HID, "H5Tclose"); + + /* Start multiple threads and execute tts_attr_vlen_thread() for each thread */ + for(i = 0; i < NUM_THREADS; i++) + pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); + + /* Wait for the threads to end */ + for(i = 0; i < NUM_THREADS; i++) + pthread_join(threads[i], NULL); + +} /* end tts_attr_vlen() */ + +/* Start execution for each thread */ +void * +tts_attr_vlen_thread(void *client_data) +{ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ + char *string_attr_check; /* The attribute data being read */ + char *string_attr = "2.0"; /* The expected attribute data */ + herr_t ret; /* Return value */ + + /* Open the test file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(fid, H5I_INVALID_HID, "H5Fopen"); + + /* Open the group */ + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + CHECK(gid, H5I_INVALID_HID, "H5Gopen"); + + /* Open the attribte */ + aid = H5Aopen(gid, "root_attr", H5P_DEFAULT); + CHECK(aid, H5I_INVALID_HID, "H5Aopen"); + + /* Get the attribute datatype */ + atid = H5Aget_type(aid); + CHECK(atid, H5I_INVALID_HID, "H5Aget_type"); + + /* Read the attribute */ + ret = H5Aread(aid, atid, &string_attr_check); + CHECK(ret, FAIL, "H5Aclose"); + + /* Verify the attribute data is as expected */ + VERIFY_STR(string_attr_check, string_attr, "H5Aread"); + + /* Close IDs */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Aclose"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Aclose"); + + ret = H5Tclose(atid); + CHECK(ret, FAIL, "H5Aclose"); + + return NULL; +} /* end tts_attr_vlen_thread() */ + +void +cleanup_attr_vlen(void) +{ + HDunlink(FILENAME); +} + +#endif /*H5_HAVE_THREADSAFE*/ + -- cgit v0.12 From bac0fc6309aaf777d4b6d093cf027dce3ecfb58c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 15 Jul 2020 11:20:16 -0500 Subject: Tools refactor Move error_stack setup to tools library Add structure for h5dump properties Eliminate duplicated h5diff functions Use properties structure in place of argument lists. --- MANIFEST | 3 + config/cmake/HDF5UseFortran.cmake | 2 +- config/cmake_ext_mod/ConfigureChecks.cmake | 1 - hl/tools/gif2h5/hdf2gif.c | 61 +- hl/tools/h5watch/h5watch.c | 76 +- tools/lib/h5diff.c | 179 +- tools/lib/h5diff.h | 176 +- tools/lib/h5diff_array.c | 4456 +++++++++---------------- tools/lib/h5diff_attr.c | 164 +- tools/lib/h5diff_dset.c | 672 +++- tools/lib/h5tools.c | 140 +- tools/lib/h5tools.h | 67 +- tools/lib/h5tools_dump.c | 525 +-- tools/lib/h5tools_dump.h | 80 +- tools/lib/h5tools_str.c | 74 +- tools/lib/h5tools_str.h | 5 +- tools/lib/io_timer.c | 1 - tools/src/h5copy/h5copy.c | 18 +- tools/src/h5diff/h5diff_common.c | 342 +- tools/src/h5diff/h5diff_main.c | 36 +- tools/src/h5dump/h5dump.c | 101 +- tools/src/h5dump/h5dump.h | 39 +- tools/src/h5dump/h5dump_ddl.c | 70 +- tools/src/h5dump/h5dump_extern.h | 43 +- tools/src/h5dump/h5dump_xml.c | 30 +- tools/src/h5format_convert/h5format_convert.c | 178 +- tools/src/h5jam/h5jam.c | 82 +- tools/src/h5jam/h5unjam.c | 20 +- tools/src/h5ls/h5ls.c | 273 +- tools/src/h5repack/h5repack_main.c | 18 +- tools/src/h5stat/h5stat.c | 22 +- tools/src/misc/h5clear.c | 9 +- tools/src/misc/h5mkgrp.c | 14 +- tools/test/h5diff/CMakeTests.cmake | 19 +- tools/test/h5diff/h5diffgentest.c | 113 +- tools/test/h5diff/testfiles/diff_eps1.h5 | Bin 0 -> 2272 bytes tools/test/h5diff/testfiles/diff_eps2.h5 | Bin 0 -> 2272 bytes tools/test/h5diff/testfiles/h5diff_10.txt | 15 +- tools/test/h5diff/testfiles/h5diff_58_ref.txt | 12 +- tools/test/h5diff/testfiles/h5diff_600.txt | 15 +- tools/test/h5diff/testfiles/h5diff_603.txt | 15 +- tools/test/h5diff/testfiles/h5diff_606.txt | 15 +- tools/test/h5diff/testfiles/h5diff_612.txt | 15 +- tools/test/h5diff/testfiles/h5diff_615.txt | 15 +- tools/test/h5diff/testfiles/h5diff_621.txt | 15 +- tools/test/h5diff/testfiles/h5diff_622.txt | 15 +- tools/test/h5diff/testfiles/h5diff_623.txt | 15 +- tools/test/h5diff/testfiles/h5diff_624.txt | 15 +- tools/test/h5diff/testfiles/h5diff_70.txt | 32 + tools/test/h5diff/testfiles/h5diff_700.txt | 32 + tools/test/h5diff/testfiles/h5diff_701.txt | 32 + tools/test/h5diff/testfiles/h5diff_702.txt | 32 + tools/test/h5diff/testfiles/h5diff_703.txt | 32 + tools/test/h5diff/testfiles/h5diff_80.txt | 64 +- tools/test/h5diff/testfiles/h5diff_eps.txt | 17 + tools/test/h5diff/testfiles/h5diff_reg.txt | 9 +- tools/test/h5diff/testh5diff.sh.in | 15 + tools/test/h5jam/tellub.c | 40 +- tools/testfiles/trefer_attrR.ddl | 6 +- tools/testfiles/trefer_extR.ddl | 6 +- 60 files changed, 3911 insertions(+), 4677 deletions(-) create mode 100644 tools/test/h5diff/testfiles/diff_eps1.h5 create mode 100644 tools/test/h5diff/testfiles/diff_eps2.h5 create mode 100644 tools/test/h5diff/testfiles/h5diff_eps.txt diff --git a/MANIFEST b/MANIFEST index a20b248..d3e74bb 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2399,6 +2399,8 @@ #test files for h5diff +./tools/test/h5diff/testfiles/diff_eps1.txt +./tools/test/h5diff/testfiles/diff_eps2.txt ./tools/test/h5diff/testfiles/h5diff_10.txt ./tools/test/h5diff/testfiles/h5diff_11.txt ./tools/test/h5diff/testfiles/h5diff_12.txt @@ -2634,6 +2636,7 @@ ./tools/test/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5 ./tools/test/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5 ./tools/test/h5diff/testfiles/h5diff_enum_invalid_values.h5 +./tools/test/h5diff/testfiles/h5diff_eps.txt ./tools/test/h5diff/testfiles/compounds_array_vlen1.h5 ./tools/test/h5diff/testfiles/compounds_array_vlen2.h5 ./tools/test/h5diff/testfiles/non_comparables1.h5 diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index c5d8200..4350b7a 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -435,7 +435,7 @@ set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: ENABLE_LANGUAGE (C) if (NOT CMAKE_VERSION VERSION_LESS "3.14.0") -include (CheckCSourceRuns) + include (CheckCSourceRuns) else () #----------------------------------------------------------------------------- # The provided CMake C macros don't provide a general compile/run function diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 6f5a835..0ddb6d0 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -679,4 +679,3 @@ endif () # the cache value is set in it's config file) # set (${HDF_PREFIX}_CONVERT_DENORMAL_FLOAT 1) - diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index 0e2a898..1833c92 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -18,8 +18,11 @@ #include "h5tools.h" #include "h5tools_utils.h" -#define IMAGE_WIDTH_MAX 65535 /* unsigned 16bits integer */ -#define IMAGE_HEIGHT_MAX 65535 /* unsigned 16bits integer */ +/* Name of tool */ +#define PROGRAMNAME "hdf2gif" + +#define IMAGE_WIDTH_MAX 65535 /* unsigned 16bits integer */ +#define IMAGE_HEIGHT_MAX 65535 /* unsigned 16bits integer */ int EndianOrder; @@ -42,12 +45,17 @@ usage(void) } +static void +leave(int ret) +{ + h5tools_close(); + HDexit(ret); +} + FILE *fpGif = NULL; int main(int argc , char **argv) { GIFBYTE *Image; - void *edata; - H5E_auto2_t func; /* compression structs */ GIFCHAR *HDFName = NULL; @@ -73,9 +81,8 @@ int main(int argc , char **argv) char *image_name = NULL; int idx; - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); /* Initialize h5tools lib */ h5tools_init(); @@ -83,8 +90,7 @@ int main(int argc , char **argv) if ( argv[1] && (strcmp("-V",argv[1])==0) ) { print_version("gif2h5"); - exit(EXIT_SUCCESS); - + h5tools_setstatus(EXIT_SUCCESS); } @@ -92,7 +98,7 @@ int main(int argc , char **argv) { /* they didn't supply at least one image -- bail */ usage(); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } HDFName = argv[1]; @@ -156,18 +162,18 @@ int main(int argc , char **argv) goto out; } - if (width > IMAGE_WIDTH_MAX || height > IMAGE_HEIGHT_MAX) + if (width > IMAGE_WIDTH_MAX || height > IMAGE_HEIGHT_MAX) { - fprintf(stderr, "HDF5 image is too large. Limit is %d by %d.\n", IMAGE_WIDTH_MAX, IMAGE_HEIGHT_MAX); - goto out; - } + fprintf(stderr, "HDF5 image is too large. Limit is %d by %d.\n", IMAGE_WIDTH_MAX, IMAGE_HEIGHT_MAX); + goto out; + } - /* tool can handle single plane images only. */ - if (planes > 1) + /* tool can handle single plane images only. */ + if (planes > 1) { - fprintf(stderr, "Cannot handle multiple planes image\n"); - goto out; - } + fprintf(stderr, "Cannot handle multiple planes image\n"); + goto out; + } Image = (GIFBYTE*) malloc( (size_t) width * (size_t) height ); @@ -222,9 +228,9 @@ int main(int argc , char **argv) numcols = 256; for (i = 0 ; i < numcols ; i++) { - Red[i] = (GIFBYTE)(255 - i); - Green[i] = (GIFBYTE)(255 - i); - Blue[i] = (GIFBYTE)(255 - i); + Red[i] = (GIFBYTE)(255 - i); + Green[i] = (GIFBYTE)(255 - i); + Blue[i] = (GIFBYTE)(255 - i); } } else @@ -257,7 +263,7 @@ int main(int argc , char **argv) if (j==i) { /* wasn't found */ - pc2nc[i] = (GIFBYTE)nc; + pc2nc[i] = (GIFBYTE)nc; r1[nc] = Red[i]; g1[nc] = Green[i]; b1[nc] = Blue[i]; @@ -345,9 +351,7 @@ int main(int argc , char **argv) if (image_name != NULL) free(image_name); - H5Eset_auto2(H5E_DEFAULT, func, edata); - - return EXIT_SUCCESS; + leave(h5tools_getstatus()); out: @@ -357,7 +361,6 @@ out: if (image_name != NULL) free(image_name); - H5Eset_auto2(H5E_DEFAULT, func, edata); - - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + leave(h5tools_getstatus()); } diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index ff9a078..a05c63b 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -821,10 +821,6 @@ main(int argc, const char *argv[]) char drivername[50]; /* VFD name */ char *fname = NULL; /* File name */ char *dname = NULL; /* Dataset name */ - void *edata; /* Error reporting */ - void *tools_edata; /* Error reporting */ - H5E_auto2_t func; /* Error reporting */ - H5E_auto2_t tools_func; /* Error reporting */ char *x; /* Temporary string pointer */ hid_t fid = -1; /* File ID */ hid_t fapl = -1; /* File access property list */ @@ -833,17 +829,9 @@ main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /* To exit from h5watch for SIGTERM signal */ if(HDsignal(SIGTERM, catch_signal) == SIG_ERR) { error_msg("An error occurred while setting a signal handler.\n"); @@ -865,6 +853,9 @@ main(int argc, const char *argv[]) leave(EXIT_FAILURE); } + /* enable error reporting if command line option */ + h5tools_error_report(); + /* Mostly copied from tools/h5ls coding & modified accordingly */ /* * [OBJECT] is specified as @@ -881,18 +872,22 @@ main(int argc, const char *argv[]) * doesn't exist). */ if((fname = HDstrdup(argv[opt_ind])) == NULL) { - error_msg("memory allocation failed (file %s:line %d)\n", - __FILE__, __LINE__); + error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); h5tools_setstatus(EXIT_FAILURE); + goto done; } /* Create a copy of file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - return -1; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { + h5tools_setstatus(EXIT_FAILURE); + goto done; + } /* Set to use the latest library format */ - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - return -1; + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { + h5tools_setstatus(EXIT_FAILURE); + goto done; + } do { while(fname && *fname) { @@ -917,30 +912,37 @@ main(int argc, const char *argv[]) if(fid < 0) { error_msg("unable to open file \"%s\"\n", fname); - if(fname) HDfree(fname); - if(fapl >= 0) H5Pclose(fapl); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } if(!dname) { error_msg("no dataset specified\n"); h5tools_setstatus(EXIT_FAILURE); - } else { + goto done; + } + else { *dname = '/'; x = dname; if((dname = HDstrdup(dname)) == NULL) { - error_msg("memory allocation failed (file %s:line %d)\n", - __FILE__, __LINE__); + error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); h5tools_setstatus(EXIT_FAILURE); - } else { + goto done; + } + else { *x = '\0'; /* Validate dataset */ - if(check_dataset(fid, dname) < 0) + if(check_dataset(fid, dname) < 0) { h5tools_setstatus(EXIT_FAILURE); + goto done; + } /* Validate input "fields" */ - else if(g_list_of_fields && *g_list_of_fields) - if(process_cmpd_fields(fid, dname) < 0) + else if(g_list_of_fields && *g_list_of_fields) { + if(process_cmpd_fields(fid, dname) < 0) { h5tools_setstatus(EXIT_FAILURE); + goto done; + } + } } } @@ -949,15 +951,20 @@ main(int argc, const char *argv[]) if(monitor_dataset(fid, dname) < 0) h5tools_setstatus(EXIT_FAILURE); +done: /* Free spaces */ - if(fname) HDfree(fname); - if(dname) HDfree(dname); - if(g_list_of_fields) HDfree(g_list_of_fields); + if(fname) + HDfree(fname); + if(dname) + HDfree(dname); + if(g_list_of_fields) + HDfree(g_list_of_fields); if(g_listv) { H5LD_clean_vector(g_listv); HDfree(g_listv); } - if(g_dup_fields) HDfree(g_dup_fields); + if(g_dup_fields) + HDfree(g_dup_fields); /* Close the file access property list */ if(fapl >= 0 && H5Pclose(fapl) < 0) { @@ -966,14 +973,11 @@ main(int argc, const char *argv[]) } /* Close the file */ - if(H5Fclose(fid) < 0) { + if(fid >= 0 && H5Fclose(fid) < 0) { error_msg("unable to close file\n"); h5tools_setstatus(EXIT_FAILURE); } - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - /* exit */ leave(h5tools_getstatus()); } /* main() */ diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 8b6ace9..96c2d32 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -29,7 +29,7 @@ H5_ATTR_PURE int print_objname (diff_opt_t * opts, hsize_t nfound) { - return ((opts->m_verbose || nfound) && !opts->m_quiet) ? 1 : 0; + return ((opts->mode_verbose || nfound) && !opts->mode_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- @@ -45,7 +45,7 @@ do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_op * displaying any object or symbolic links. This improves * readability of the output. */ - if (opts->m_verbose_level >= 1) + if (opts->mode_verbose_level >= 1) parallel_print("\n"); parallel_print("%-7s: <%s> and <%s>\n", OBJ, path1, path2); } @@ -74,7 +74,7 @@ do_print_attrname (const char *attr, const char *path1, const char *path2) static int print_warn(diff_opt_t *opts) { - return ((opts->m_verbose)) ? 1: 0; + return ((opts->mode_verbose)) ? 1: 0; } @@ -141,7 +141,7 @@ is_valid_options(diff_opt_t *opts) /*----------------------------------------------- * no -q(quiet) with -v (verbose) or -r (report) */ - if(opts->m_quiet && (opts->m_verbose || opts->m_report)) { + if(opts->mode_quiet && (opts->mode_verbose || opts->mode_report)) { parallel_print("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); opts->err_stat = H5DIFF_ERR; H5TOOLS_GOTO_DONE(0); @@ -169,9 +169,9 @@ done: * 0 - not excluded path *------------------------------------------------------------------------*/ static int -is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *opts) +is_exclude_path (char *path, h5trav_type_t type, diff_opt_t *opts) { - struct exclude_path_list * exclude_path_ptr; + struct exclude_path_list *exclude_path_ptr; int ret_cmp; int ret_value = 0; @@ -210,7 +210,7 @@ is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *opts) if (ret_cmp == 0) { /* found matching object */ /* excluded non-group object */ ret_value = 1; - /* remember the type of this maching object. + /* remember the type of this matching object. * if it's group, it can be used for excluding its member * objects in this while() loop */ exclude_path_ptr->obj_type = type; @@ -224,6 +224,71 @@ done: return ret_value; } +/*------------------------------------------------------------------------- + * Function: is_exclude_attr + * + * Purpose: check if 'paths' are part of exclude path list + * + * Return: + * 1 - excluded path + * 0 - not excluded path + *------------------------------------------------------------------------*/ +static int +is_exclude_attr (char *path, h5trav_type_t type, diff_opt_t *opts) +{ + struct exclude_path_list *exclude_ptr; + int ret_cmp; + int ret_value = 0; + + /* check if exclude attr option is given */ + if (!opts->exclude_attr_path) + H5TOOLS_GOTO_DONE(0); + + /* assign to local exclude list pointer */ + exclude_ptr = opts->exclude_attr; + + /* search objects in exclude list */ + while (NULL != exclude_ptr) { + /* if exclude path is is group, exclude its members as well */ + if (exclude_ptr->obj_type == H5TRAV_TYPE_GROUP) { + ret_cmp = HDstrncmp(exclude_ptr->obj_path, path, + HDstrlen(exclude_ptr->obj_path)); + if (ret_cmp == 0) { /* found matching members */ + size_t len_grp; + + /* check if given path belong to an excluding group, if so + * exclude it as well. + * This verifies if “/grp1/dset1” is only under “/grp1”, but + * not under “/grp1xxx/” group. + */ + len_grp = HDstrlen(exclude_ptr->obj_path); + if (path[len_grp] == '/') { + /* belong to excluded group! */ + ret_value = 1; + break; /* while */ + } + } + } + /* exclude target is not group, just exclude the object */ + else { + ret_cmp = HDstrcmp(exclude_ptr->obj_path, path); + if (ret_cmp == 0) { /* found matching object */ + /* excluded non-group object */ + ret_value = 1; + /* remember the type of this matching object. + * if it's group, it can be used for excluding its member + * objects in this while() loop */ + exclude_ptr->obj_type = type; + break; /* while */ + } + } + exclude_ptr = exclude_ptr->next; + } + +done: + return ret_value; +} + /*------------------------------------------------------------------------- * Function: free_exclude_path_list @@ -243,6 +308,25 @@ free_exclude_path_list(diff_opt_t *opts) } } + +/*------------------------------------------------------------------------- + * Function: free_exclude_attr_list + * + * Purpose: free exclude object attribute list from diff options + *------------------------------------------------------------------------*/ +static void +free_exclude_attr_list(diff_opt_t *opts) +{ + struct exclude_path_list *curr = opts->exclude_attr; + struct exclude_path_list *next; + + while (NULL != curr) { + next = curr->next; + HDfree(curr); + curr = next; + } +} + /*------------------------------------------------------------------------- * Function: build_match_list * @@ -288,6 +372,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2 * All the objects belong to given groups are the candidates. * So prepare to compare paths without the group names. */ + H5TOOLS_DEBUG("objname1 = %s objname2 = %s ", objname1, objname2); /* if obj1 is not root */ if (HDstrcmp (objname1,"/") != 0) @@ -572,8 +657,8 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char *------------------------------------------------------------------------- */ /* open file 1 */ - if (opts->custom_vol_1) { - if((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->vol_info_1), NULL)) < 0 ) { + if (opts->custom_vol[0]) { + if((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->vol_info[0]), NULL)) < 0 ) { parallel_print("h5diff: unable to create fapl for input file\n"); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create input fapl\n"); } @@ -587,8 +672,8 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* open file 2 */ - if (opts->custom_vol_2) { - if((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->vol_info_2), NULL)) < 0 ) { + if (opts->custom_vol[1]) { + if((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->vol_info[1]), NULL)) < 0 ) { parallel_print("h5diff: unable to create fapl for output file\n"); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create output fapl\n"); } @@ -627,6 +712,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char } else obj1fullname = HDstrdup(objname1); + H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname); /* make the given object2 fullpath, start with "/" */ if (HDstrncmp(objname2, "/", 1)) { @@ -644,6 +730,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char } else obj2fullname = HDstrdup(objname2); + H5TOOLS_DEBUG("obj2fullname = %s", obj2fullname); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink @@ -777,12 +864,12 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_DEBUG("h5diff ... dangling link"); if (opts->no_dangle_links) { /* treat dangling link as error */ - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "treat dangling link as error"); } else { - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("obj1 <%s> is a dangling link.\n", obj1fullname); if (l_ret1 != 0 || l_ret2 != 0) { nfound++; @@ -818,12 +905,12 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_DEBUG("h5diff ... dangling link"); if (opts->no_dangle_links) { /* treat dangling link as error */ - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "treat dangling link as error"); } else { - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname); if (l_ret1 != 0 || l_ret2 != 0) { nfound++; @@ -857,8 +944,8 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char * comparing details of same objects. */ - if(!(opts->m_verbose || opts->m_report)) { - H5TOOLS_DEBUG("h5diff NOT (opts->m_verbose || opts->m_report)"); + if(!(opts->mode_verbose || opts->mode_report)) { + H5TOOLS_DEBUG("h5diff NOT (opts->mode_verbose || opts->mode_report)"); /* if no danglink links */ if (l_ret1 > 0 && l_ret2 > 0) if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname) != 0) @@ -924,9 +1011,14 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /*------------------------------------------------------ * print the list */ - if(opts->m_verbose) { + if(opts->mode_verbose) { unsigned u; + if(opts->mode_verbose_level > 2) { + parallel_print("file1: %s\n", fname1); + parallel_print("file2: %s\n", fname2); + } + parallel_print("\n"); /* if given objects is group under root */ if (HDstrcmp (obj1fullname,"/") || HDstrcmp (obj2fullname,"/")) @@ -947,6 +1039,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char nfound = diff_match(file1_id, obj1fullname, info1_lp, file2_id, obj2fullname, info2_lp, match_list, opts); + H5TOOLS_DEBUG("diff_match nfound: %d - errstat:%d", nfound, opts->err_stat); done: opts->err_stat = opts->err_stat | ret_value; @@ -1047,12 +1140,14 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, *------------------------------------------------------------------------- */ + H5TOOLS_DEBUG("exclude_path opts->contents:%d", opts->contents); /* not valid compare used when --exclude-path option is used */ if (!opts->exclude_path) { /* number of different objects */ if (info1->nused != info2->nused) { opts->contents = 0; } + H5TOOLS_DEBUG("opts->exclude_path opts->contents:%d", opts->contents); } /* objects in one file and not the other */ @@ -1061,6 +1156,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, opts->contents = 0; break; } + H5TOOLS_DEBUG("table->nobjs[%d] opts->contents:%d", i, opts->contents); } /*------------------------------------------------------------------------- @@ -1133,9 +1229,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, opts->cmn_objs = 1; if(!g_Parallel) { H5TOOLS_DEBUG("diff paths - errstat:%d", opts->err_stat); - nfound += diff(file1_id, obj1_fullpath, - file2_id, obj2_fullpath, - opts, &argdata); + nfound += diff(file1_id, obj1_fullpath, file2_id, obj2_fullpath, opts, &argdata); } /* end if */ #ifdef H5_HAVE_PARALLEL else { @@ -1380,6 +1474,8 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, opts->err_stat = opts->err_stat | ret_value; + free_exclude_attr_list (opts); + /* free table */ if (table) trav_table_free(table); @@ -1404,7 +1500,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, *------------------------------------------------------------------------- */ hsize_t -diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_opt_t * opts, diff_args_t *argdata) +diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_opt_t *opts, diff_args_t *argdata) { int status = -1; hid_t dset1_id = H5I_INVALID_HID; @@ -1453,7 +1549,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ if (status == 0) { if (opts->no_dangle_links) { /* dangling link is error */ - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "dangling link is error"); } @@ -1468,7 +1564,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ if (status == 0) { if (opts->no_dangle_links) { /* dangling link is error */ - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path2); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "dangling link is error"); } @@ -1494,11 +1590,11 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ /* if objects are not the same type */ if (argdata->type[0] != argdata->type[1]) { H5TOOLS_DEBUG("diff objects are not the same"); - if (opts->m_verbose||opts->m_list_not_cmp) { + if (opts->mode_verbose||opts->mode_list_not_cmp) { parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n", - path1, get_type(argdata->type[0]), - path2, get_type(argdata->type[1])); + path1, get_type(argdata->type[0]), path2, get_type(argdata->type[1])); } + opts->not_cmp = 1; /* TODO: will need to update non-comparable is different * opts->contents = 0; @@ -1523,7 +1619,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ object_type == H5TRAV_TYPE_GROUP); if (opts->follow_links || is_hard_link) { /* print information is only verbose option is used */ - if(opts->m_verbose || opts->m_report) { + if(opts->mode_verbose || opts->mode_report) { switch(object_type) { case H5TRAV_TYPE_DATASET: do_print_objname("dataset", path1, path2, opts); @@ -1552,7 +1648,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ } /* switch(type)*/ print_found(nfound); - } /* if(opts->m_verbose || opts->m_report) */ + } /* if(opts->mode_verbose || opts->mode_report) */ /* exact same, so comparison is done */ H5TOOLS_GOTO_DONE(H5DIFF_NO_ERR); @@ -1570,15 +1666,16 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dopen2 failed"); if((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dopen2 failed"); + H5TOOLS_DEBUG("paths: %s - %s", path1, path2); /* verbose (-v) and report (-r) mode */ - if(opts->m_verbose || opts->m_report) { + if(opts->mode_verbose || opts->mode_report) { do_print_objname("dataset", path1, path2, opts); H5TOOLS_DEBUG("call diff_dataset 1:%s 2:%s ", path1, path2); nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if(opts->m_quiet) { + else if(opts->mode_quiet) { nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); } /* the rest (-c, none, ...) */ @@ -1598,7 +1695,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ * referenced object *--------------------------------------------------------- */ - if(path1) { + if(path1 && !is_exclude_attr(path1, object_type, opts)) { H5TOOLS_DEBUG( "call diff_attr 1:%s 2:%s ", path1, path2); nfound += diff_attr(dset1_id, dset2_id, path1, path2, opts); } @@ -1630,7 +1727,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ do_print_objname("datatype", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if(opts->m_verbose) + if(opts->mode_verbose) print_found(nfound); /*----------------------------------------------------------------- @@ -1639,7 +1736,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ * referenced object *----------------------------------------------------------------- */ - if(path1) { + if(path1 && !is_exclude_attr(path1, object_type, opts)) { H5TOOLS_DEBUG("call diff_attr 1:%s 2:%s ", path1, path2); nfound += diff_attr(type1_id, type2_id, path1, path2, opts); } @@ -1660,7 +1757,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ do_print_objname("group", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if(opts->m_verbose) + if(opts->mode_verbose) print_found(nfound); if((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0) @@ -1674,7 +1771,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ * referenced object *----------------------------------------------------------------- */ - if(path1) { + if(path1 && !is_exclude_attr(path1, object_type, opts)) { H5TOOLS_DEBUG("call diff_attr 1:%s 2:%s ", path1, path2); nfound += diff_attr(grp1_id, grp2_id, path1, path2, opts); } @@ -1702,7 +1799,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ do_print_objname("link", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if(opts->m_verbose) + if(opts->mode_verbose) print_found(nfound); } break; @@ -1752,14 +1849,14 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ } /* end else */ /* always print the number of differences found in verbose mode */ - if(opts->m_verbose) + if(opts->mode_verbose) print_found(nfound); } break; case H5TRAV_TYPE_UNKNOWN: default: - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type(object_type) ); opts->not_cmp = 1; @@ -1781,7 +1878,7 @@ done: } /* path1 is dangling link */ else if (is_dangle_link1) { - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("obj1 <%s> is a dangling link.\n", path1); nfound++; if(print_objname(opts, nfound)) @@ -1789,7 +1886,7 @@ done: } /* path2 is dangling link */ else if (is_dangle_link2) { - if(opts->m_verbose) + if(opts->mode_verbose) parallel_print("obj2 <%s> is a dangling link.\n", path2); nfound++; if(print_objname(opts, nfound)) diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 37eb775..c3c111f 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -18,23 +18,6 @@ #include "h5tools.h" #include "h5trav.h" -/* - * Debug printf macros. The prefix allows output filtering by test scripts. - */ -#ifdef H5DIFF_DEBUG -#define h5difftrace(x) HDfprintf(stderr, "h5diff debug: " x) -#define h5diffdebug2(x1, x2) HDfprintf(stderr, "h5diff debug: " x1, x2) -#define h5diffdebug3(x1, x2, x3) HDfprintf(stderr, "h5diff debug: " x1, x2, x3) -#define h5diffdebug4(x1, x2, x3, x4) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4) -#define h5diffdebug5(x1, x2, x3, x4, x5) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5) -#else -#define h5difftrace(x) -#define h5diffdebug2(x1, x2) -#define h5diffdebug3(x1, x2, x3) -#define h5diffdebug4(x1, x2, x3, x4) -#define h5diffdebug5(x1, x2, x3, x4, x5) -#endif - #define MAX_FILENAME 1024 /*------------------------------------------------------------------------- @@ -58,6 +41,7 @@ struct exclude_path_list { struct exclude_path_list *next; }; + /* Enumeration value for keeping track of whether an error occurred or differences were found */ typedef enum { H5DIFF_NO_ERR, /* No error occurred */ @@ -66,31 +50,46 @@ typedef enum { } diff_err_t; typedef struct { - int m_quiet; /* quiet mode: no output at all */ - int m_report; /* report mode: print the data */ - int m_verbose; /* verbose mode: print the data, list of objcets, warnings */ - int m_verbose_level; /* control verbose details */ - int d; /* delta, absolute value to compare */ - double delta; /* delta value */ - int p; /* relative error to compare*/ - int use_system_epsilon; /* flag to use system epsilon (1 or 0) */ - double percent; /* relative error value */ - int n; /* count, compare up to count */ - hsize_t count; /* count value */ - hbool_t follow_links; /* follow symbolic links */ - int no_dangle_links; /* return error when find dangling link */ - diff_err_t err_stat; /* an error ocurred (2, error, 1, differences, 0, no error) */ - int cmn_objs; /* do we have common objects */ - int not_cmp; /* are the objects comparable */ - int contents; /* equal contents */ - int do_nans; /* consider Nans while diffing floats */ - int m_list_not_cmp; /* list not comparable messages */ - int exclude_path; /* exclude path to an object */ - struct exclude_path_list * exclude; /* keep exclude path list */ - h5tools_vol_info_t vol_info_1; /* VOL information for input file */ - h5tools_vol_info_t vol_info_2; /* VOL information for output file */ - hbool_t custom_vol_1; /* Using a custom input VOL? */ - hbool_t custom_vol_2; /* Using a custom output VOL? */ + int mode_quiet; /* quiet mode: no output at all */ + int mode_report; /* report mode: print the data */ + int mode_verbose; /* verbose mode: print the data, list of objcets, warnings */ + int mode_verbose_level; /* control verbose details */ + int mode_list_not_cmp; /* list not comparable messages */ + int print_header; /* print header */ + int print_percentage; /* print percentage */ + int delta_bool; /* delta, absolute value to compare */ + double delta; /* delta value */ + int use_system_epsilon; /* flag to use system epsilon (1 or 0) */ + int percent_bool; /* relative error to compare*/ + double percent; /* relative error value */ + hbool_t follow_links; /* follow symbolic links */ + int no_dangle_links; /* return error when find dangling link */ + int cmn_objs; /* do we have common objects */ + int not_cmp; /* are the objects comparable */ + int contents; /* equal contents */ + int do_nans; /* consider Nans while diffing floats */ + int exclude_path; /* exclude path to an object */ + int exclude_attr_path; /* exclude path to an object */ + struct exclude_path_list *exclude; /* keep exclude path list */ + struct exclude_path_list *exclude_attr; /* keep exclude attribute list */ + int count_bool; /* count, compare up to count */ + hsize_t count; /* count value */ + diff_err_t err_stat; /* an error ocurred (2, error, 1, differences, 0, no error) */ + hsize_t nelmts; /* total number of elements */ + hsize_t hs_nelmts; /* number of elements to read at a time*/ + int rank; /* dimensionality */ + size_t m_size; /* m_size for diff */ + hid_t m_tid; /* m_tid for diff */ + hsize_t dims[H5S_MAX_RANK]; /* dimensions of object */ + hsize_t p_min_idx[H5S_MAX_RANK]; /* min selected index */ + hsize_t p_max_idx[H5S_MAX_RANK]; /* max selected index */ + hsize_t acc[H5S_MAX_RANK]; /* accumulator position */ + hsize_t pos[H5S_MAX_RANK]; /* matrix position */ + hsize_t sm_pos[H5S_MAX_RANK]; /* stripmine position */ + char *obj_name[2]; /* name for object */ + struct subset_t *sset[2]; /* subsetting parameters */ + h5tools_vol_info_t vol_info[2]; /* VOL information for input file, output file */ + hbool_t custom_vol[2]; /* Using a custom input, output VOL? */ } diff_opt_t; @@ -103,18 +102,9 @@ typedef struct { extern "C" { #endif -H5TOOLS_DLL hsize_t h5diff(const char *fname1, - const char *fname2, - const char *objname1, - const char *objname2, - diff_opt_t *opts); +H5TOOLS_DLL hsize_t h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, diff_opt_t *opts); -H5TOOLS_DLL hsize_t diff( hid_t file1_id, - const char *path1, - hid_t file2_id, - const char *path2, - diff_opt_t *opts, - diff_args_t *argdata); +H5TOOLS_DLL hsize_t diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_opt_t *opts, diff_args_t *argdata); #ifdef H5_HAVE_PARALLEL H5TOOLS_DLL void phdiff_dismiss_workers(void); @@ -133,63 +123,29 @@ H5TOOLS_DLL void print_manager_output(void); */ -hsize_t diff_dataset( hid_t file1_id, - hid_t file2_id, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *opts); - -hsize_t diff_datasetid( hid_t dset1_id, - hid_t dset2_id, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *opts); - - -hsize_t diff_match( hid_t file1_id, const char *grp1, trav_info_t *info1, - hid_t file2_id, const char *grp2, trav_info_t *info2, - trav_table_t *table, diff_opt_t *opts ); - -hsize_t diff_array( void *_mem1, - void *_mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - diff_opt_t *opts, - const char *name1, - const char *name2, - hid_t m_type, - hid_t container1_id, - hid_t container2_id); /* dataset where the reference came from*/ - - -int diff_can_type( hid_t f_type1, /* file data type */ - hid_t f_type2, /* file data type */ - int rank1, - int rank2, - hsize_t *dims1, - hsize_t *dims2, - hsize_t *maxdim1, - hsize_t *maxdim2, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *opts, - int is_compound); - -hsize_t diff_attr_data(hid_t attr1_id, - hid_t attr2_id, - const char *attr1_name, - const char *attr2_name, - const char *path1, - const char *path2, - diff_opt_t *opts); - -hsize_t diff_attr(hid_t loc1_id, - hid_t loc2_id, - const char *path1, - const char *path2, - diff_opt_t *opts); +hsize_t diff_dataset(hid_t file1_id, hid_t file2_id, + const char *obj1_name, const char *obj2_name, diff_opt_t *opts); + +hsize_t diff_datasetid(hid_t dset1_id, hid_t dset2_id, + const char *obj1_name, const char *obj2_name, diff_opt_t *opts); + + +hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, + hid_t file2_id, const char *grp2, trav_info_t *info2, + trav_table_t *table, diff_opt_t *opts); + +hsize_t diff_array(void *_mem1, void *_mem2, + diff_opt_t *opts, hid_t container1_id, hid_t container2_id); + +int diff_can_type(hid_t f_type1, hid_t f_type2, int rank1, int rank2, + hsize_t *dims1, hsize_t *dims2, hsize_t *maxdim1, hsize_t *maxdim2, + diff_opt_t *opts, int is_compound); + +hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *name2, + const char *path1, const char *path2, diff_opt_t *opts); + +hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, + const char *path1, const char *path2, diff_opt_t *opts); /*------------------------------------------------------------------------- diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 52bae51..9b680ec 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -132,97 +132,39 @@ typedef struct mcomp_t { * local prototypes *------------------------------------------------------------------------- */ -static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, - hid_t region2_id, diff_opt_t *opts); static hbool_t all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); -static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); -static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, - hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); +static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, ssize_t u, diff_opt_t *opts); +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, diff_opt_t *opts); static hbool_t equal_float(float value, float expected, diff_opt_t *opts); static hbool_t equal_double(double value, double expected, diff_opt_t *opts); #if H5_SIZEOF_LONG_DOUBLE !=0 static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts); #endif + static int print_data(diff_opt_t *opts); -static void print_pos(int *ph, int pp, hsize_t curr_pos, hsize_t *acc, - hsize_t *pos, int rank, hsize_t *dims, const char *obj1, - const char *obj2); -static void print_char_pos(int *ph, int pp, hsize_t curr_pos, size_t u, - hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, const char *obj1, - const char *obj2); +static void print_pos(diff_opt_t *opts, hsize_t elemtno, ssize_t u); static void h5diff_print_char(char ch); -static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *opts, const char *obj1, const char *obj2, - hid_t container1_id, hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members); /*compound members */ -static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); + +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *opts); +static hsize_t diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, + hid_t container1_id, hid_t container2_id, mcomp_t *members); +/* element diffs */ +static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); #if H5_SIZEOF_LONG_DOUBLE !=0 -static hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *opts, - const char *obj1, - const char *obj2, - int *ph); +static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); #endif -static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); +static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); /*------------------------------------------------------------------------- * NaN detection @@ -260,26 +202,24 @@ static void close_member_types(mcomp_t *members); *------------------------------------------------------------------------- */ -hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, diff_opt_t *opts, const char *name1, const char *name2, - hid_t m_type, hid_t container1_id, hid_t container2_id) +hsize_t +diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_t container2_id) { hsize_t nfound = 0; /* number of differences found */ size_t size; /* size of datum */ unsigned char *mem1 = (unsigned char*) _mem1; unsigned char *mem2 = (unsigned char*) _mem2; - hsize_t acc[32]; /* accumulator position */ - hsize_t pos[32]; /* matrix position */ - int ph = 1; /* print header */ hsize_t i; int j; mcomp_t members; H5T_class_t type_class; - H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); + H5TOOLS_START_DEBUG(" - rank:%d hs_nelmts:%ld errstat:%d", opts->rank, opts->hs_nelmts, opts->err_stat); + opts->print_header = 1; /* enable print header */ + /* get the size. */ - size = H5Tget_size(m_type); - type_class = H5Tget_class(m_type); + size = H5Tget_size(opts->m_tid); + type_class = H5Tget_class(opts->m_tid); /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught @@ -289,24 +229,18 @@ hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start type_class != H5T_COMPOUND && type_class != H5T_STRING && type_class != H5T_VLEN && - HDmemcmp(mem1, mem2, size*nelmts) == 0) + HDmemcmp(mem1, mem2, size * opts->hs_nelmts) == 0) { + H5TOOLS_ENDDEBUG(":Fast comparison - errstat:%d", opts->err_stat); return 0; - - if (rank > 0) { - acc[rank - 1] = 1; - for (j = (rank - 2); j >= 0; j--) { - acc[j] = acc[j + 1] * dims[j + 1]; - } - for (j = 0; j < rank; j++) - pos[j] = 0; } - H5TOOLS_DEBUG("diff_array type_class:%d", type_class); + H5TOOLS_DEBUG("type_class:%d", type_class); switch (type_class) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: default: + H5TOOLS_DEBUG("type_class:INVALID"); HDassert(0); break; @@ -315,37 +249,142 @@ hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start *------------------------------------------------------------------------- */ case H5T_FLOAT: - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) - nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) - nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); + H5TOOLS_DEBUG("type_class:H5T_FLOAT"); + if (H5Tequal(opts->m_tid, H5T_NATIVE_FLOAT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_float_element(mem1, mem2, i, opts); + + mem1 += sizeof(float); + mem2 += sizeof(float); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_DOUBLE)){ + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_double_element(mem1, mem2, i, opts); + + mem1 += sizeof(double); + mem2 += sizeof(double); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } #if H5_SIZEOF_LONG_DOUBLE != 0 - else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE)) - nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); + else if (H5Tequal(opts->m_tid, H5T_NATIVE_LDOUBLE)) { + for ( i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_ldouble_element(mem1, mem2, i, opts); + + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } #endif break; case H5T_INTEGER: - if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) - nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) - nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) - nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) - nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_INT)) - nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_UINT)) - nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_LONG)) - nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) - nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) - nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) - nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); + H5TOOLS_DEBUG("type_class:H5T_INTEGER"); + if (H5Tequal(opts->m_tid, H5T_NATIVE_SCHAR)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_schar_element(mem1, mem2, i, opts); + mem1 += sizeof(char); + mem2 += sizeof(char); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_UCHAR)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_uchar_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_SHORT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_short_element(mem1, mem2, i, opts); + + mem1 += sizeof(short); + mem2 += sizeof(short); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_USHORT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_ushort_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_INT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_int_element(mem1, mem2, i, opts); + + mem1 += sizeof(int); + mem2 += sizeof(int); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_UINT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_int_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_LONG)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_long_element(mem1, mem2, i, opts); + + mem1 += sizeof(long); + mem2 += sizeof(long); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_ULONG)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_ulong_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_LLONG)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_llong_element(mem1, mem2, i, opts); + + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_ULLONG)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_ullong_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } break; /*------------------------------------------------------------------------- @@ -360,13 +399,13 @@ hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start case H5T_ARRAY: case H5T_VLEN: case H5T_REFERENCE: + H5TOOLS_DEBUG("type_class:OTHER"); HDmemset(&members, 0, sizeof(mcomp_t)); - get_member_types(m_type, &members); - H5TOOLS_DEBUG("call diff_datum nelmts:%d - errstat:%d", nelmts, opts->err_stat); - for (i = 0; i < nelmts; i++) { - nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, opts, - name1, name2, container1_id, container2_id, &ph, &members); - if (opts->n && nfound >= opts->count) + get_member_types(opts->m_tid, &members); + for (i = 0; i < opts->hs_nelmts; i++) { + H5TOOLS_DEBUG("opts->pos[%ld]:%ld - nelmts:%ld", i, opts->pos[i], opts->hs_nelmts); + nfound += diff_datum(mem1 + i * size, mem2 + i * size, i, opts, container1_id, container2_id, &members); + if (opts->count_bool && nfound >= opts->count) break; } /* i */ close_member_types(&members); @@ -409,12 +448,7 @@ hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start *------------------------------------------------------------------------- */ static hsize_t -diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, - hid_t container1_id, hid_t container2_id, - int *ph, /*print header */ - mcomp_t *members) /*compound members */ +diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t container1_id, hid_t container2_id, mcomp_t *members) { unsigned char *mem1 = (unsigned char*) _mem1; unsigned char *mem2 = (unsigned char*) _mem2; @@ -425,7 +459,6 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, size_t offset; unsigned nmembs; unsigned j; - hsize_t nelmts; size_t size = 0; hbool_t iszero1; hbool_t iszero2; @@ -434,10 +467,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hbool_t both_zero; diff_err_t ret_value = opts->err_stat; - H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); + H5TOOLS_START_DEBUG("ph:%d elemtno:%d - errstat:%d", opts->print_header, elemtno, opts->err_stat); - type_size = H5Tget_size(m_type); - type_class = H5Tget_class(m_type); + type_size = H5Tget_size(opts->m_tid); + type_class = H5Tget_class(opts->m_tid); /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught @@ -450,7 +483,7 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, HDmemcmp(mem1, mem2, type_size) == 0) H5TOOLS_GOTO_DONE(opts->err_stat); - switch (H5Tget_class(m_type)) { + switch (H5Tget_class(opts->m_tid)) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: @@ -463,18 +496,22 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ case H5T_COMPOUND: - H5TOOLS_DEBUG("diff_datum H5T_COMPOUND"); + H5TOOLS_DEBUG("H5T_COMPOUND"); { - hid_t memb_type = H5I_INVALID_HID; + diff_opt_t cmpd_opts; + + cmpd_opts = *opts; nmembs = members->n; for (j = 0; j < nmembs; j++) { offset = members->offsets[j]; - memb_type = members->ids[j]; + cmpd_opts.m_tid = members->ids[j]; - nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, idx, - rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members->m[j]); + nfound += diff_datum(mem1 + offset, mem2 + offset, elemtno, &cmpd_opts, container1_id, container2_id, members->m[j]); } + opts->err_stat = opts->err_stat | cmpd_opts.err_stat; + opts->print_header = cmpd_opts.print_header; + opts->not_cmp = cmpd_opts.not_cmp; } break; @@ -483,7 +520,7 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ case H5T_STRING: - H5TOOLS_DEBUG("diff_datum H5T_STRING"); + H5TOOLS_DEBUG("H5T_STRING"); { char *s = NULL; char *sx = NULL; @@ -492,12 +529,12 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, size_t size1; size_t size2; size_t sizex; - size_t size_mtype = H5Tget_size(m_type); - H5T_str_t pad = H5Tget_strpad(m_type); + size_t size_mtype = H5Tget_size(opts->m_tid); + H5T_str_t pad = H5Tget_strpad(opts->m_tid); /* if variable length string */ - if (H5Tis_variable_str(m_type)) { - H5TOOLS_DEBUG("diff_datum H5T_STRING variable"); + if (H5Tis_variable_str(opts->m_tid)) { + H5TOOLS_DEBUG("H5T_STRING variable"); /* Get pointer to first string */ s1 = *(char **)((void *)mem1); if (s1) @@ -513,7 +550,7 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, size2 = 0; } else if (H5T_STR_NULLTERM == pad) { - H5TOOLS_DEBUG("diff_datum H5T_STRING null term"); + H5TOOLS_DEBUG("H5T_STRING null term"); /* Get pointer to first string */ s1 = (char*) mem1; if (s1) @@ -550,10 +587,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, * of length of strings. * For now mimic the previous way. */ - H5TOOLS_DEBUG("diff_datum string size:%d", size1); - H5TOOLS_DEBUG("diff_datum string size:%d", size2); + H5TOOLS_DEBUG("string size:%d", size1); + H5TOOLS_DEBUG("string size:%d", size2); if (size1 != size2) { - H5TOOLS_DEBUG("diff_datum string sizes difference"); + H5TOOLS_DEBUG("string sizes difference"); nfound++; } if (size1 < size2) { @@ -572,15 +609,13 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, /* check for NULL pointer for string */ if (s != NULL) { /* try fast compare first */ - if (HDmemcmp(s, sx, size) == 0) { - if (size1 != size2) - if (print_data(opts)) - for (u = size; u < sizex; u++) - character_compare(s + u, sx + u, idx, u, rank, dims, acc, pos, opts, obj1, obj2, ph); + if ((HDmemcmp(s, sx, size) == 0) && (size1 != size2)) { + for (u = size; u < sizex; u++) + character_compare(s + u, sx + u, elemtno, u, opts); } else for (u = 0; u < size; u++) - nfound += character_compare(s + u, sx + u, idx, u, rank, dims, acc, pos, opts, obj1, obj2, ph); + nfound += character_compare(s + u, sx + u, elemtno, u, opts); } /* end check for NULL pointer for string */ } break; @@ -590,10 +625,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ case H5T_BITFIELD: - H5TOOLS_DEBUG("diff_datum H5T_BITFIELD"); + H5TOOLS_DEBUG("H5T_BITFIELD"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, opts, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, elemtno, opts); break; /*------------------------------------------------------------------------- @@ -601,10 +636,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ case H5T_OPAQUE: - H5TOOLS_DEBUG("diff_datum H5T_OPAQUE"); + H5TOOLS_DEBUG("H5T_OPAQUE"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, opts, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, elemtno, opts); break; /*------------------------------------------------------------------------- @@ -617,7 +652,7 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, * compared, we convert both bit patterns to their corresponding * enumeration constant and do a string comparison */ - H5TOOLS_DEBUG("diff_datum H5T_ENUM"); + H5TOOLS_DEBUG("H5T_ENUM"); { char enum_name1[1024]; char enum_name2[1024]; @@ -629,11 +664,11 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, /* If the enum value cannot be converted to a string * it is set to an error string for later output. */ - err1 = H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1); + err1 = H5Tenum_nameof(opts->m_tid, mem1, enum_name1, sizeof enum_name1); if (err1 < 0) HDsnprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); - err2 = H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2); + err2 = H5Tenum_nameof(opts->m_tid, mem2, enum_name2, sizeof enum_name2); if (err2 < 0) HDsnprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); @@ -644,9 +679,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, * don't attempt to convert them - just report errors. */ nfound += 1; + opts->print_percentage = 0; + print_pos(opts, elemtno, -1); if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); } } @@ -654,15 +689,15 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, /* Both enum values were valid */ if (HDstrcmp(enum_name1, enum_name2) != 0) { nfound = 1; + opts->print_percentage = 0; + print_pos(opts, elemtno, -1); if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); } } else { for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, opts, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, elemtno, opts); } } /* enable error reporting */ @@ -676,26 +711,32 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, */ case H5T_ARRAY: { - hid_t memb_type = H5I_INVALID_HID; hsize_t adims[H5S_MAX_RANK]; int ndims; + diff_opt_t arr_opts; + + H5TOOLS_DEBUG("H5T_ARRAY ph=%d", opts->print_header); - H5TOOLS_DEBUG("diff_datum H5T_ARRAY"); + arr_opts = *opts; + H5TOOLS_DEBUG("Check opts: hs_nelmts:%ld to %ld rank:%d to %ld", opts->hs_nelmts, arr_opts.hs_nelmts, opts->rank, arr_opts.rank); /* get the array's base datatype for each element */ - memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); - ndims = H5Tget_array_ndims(m_type); - H5Tget_array_dims2(m_type, adims); + arr_opts.m_tid = H5Tget_super(opts->m_tid); + size = H5Tget_size(arr_opts.m_tid); + ndims = H5Tget_array_ndims(opts->m_tid); + H5Tget_array_dims2(opts->m_tid, adims); HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); + H5TOOLS_DEBUG("attr ph=%d", arr_opts.print_header); /* calculate the number of array elements */ - for (u = 0, nelmts = 1; u < (unsigned) ndims; u++) - nelmts *= adims[u]; - for (u = 0; u < nelmts; u++) { - nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, idx, - rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); - } - H5Tclose(memb_type); + for (u = 0, arr_opts.hs_nelmts = 1; u < (unsigned) ndims; u++) + arr_opts.hs_nelmts *= adims[u]; + for (u = 0; u < arr_opts.hs_nelmts; u++) { + nfound += diff_datum(mem1 + u * size, mem2 + u * size, elemtno, &arr_opts, container1_id, container2_id, members); + } + opts->err_stat = opts->err_stat | arr_opts.err_stat; + opts->print_header = arr_opts.print_header; + opts->not_cmp = arr_opts.not_cmp; + H5Tclose(arr_opts.m_tid); } break; @@ -704,9 +745,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ case H5T_REFERENCE: - H5TOOLS_DEBUG("diff_datum H5T_REFERENCE"); - iszero1 = all_zero(_mem1, H5Tget_size(m_type)); - iszero2 = all_zero(_mem2, H5Tget_size(m_type)); + H5TOOLS_DEBUG("H5T_REFERENCE"); + iszero1 = all_zero(_mem1, H5Tget_size(opts->m_tid)); + iszero2 = all_zero(_mem2, H5Tget_size(opts->m_tid)); if (iszero1 != iszero2) { nfound++; H5TOOLS_GOTO_DONE(opts->err_stat); @@ -714,13 +755,17 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, else if (!iszero1 && !iszero2) { hid_t obj1_id = H5I_INVALID_HID; hid_t obj2_id = H5I_INVALID_HID; + diff_opt_t ref_opts; /*------------------------------------------------------------------------- * H5T_STD_REF * Reference *------------------------------------------------------------------------- */ - if (H5Tequal(m_type, H5T_STD_REF)) { + ref_opts = *opts; + ref_opts.obj_name[0] = NULL; + ref_opts.obj_name[1] = NULL; + if (H5Tequal(ref_opts.m_tid, H5T_STD_REF)) { /* if (type_size == H5R_STD_REF_SIZE) */ hid_t region1_id = H5I_INVALID_HID; hid_t region2_id = H5I_INVALID_HID; @@ -730,66 +775,67 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, H5O_type_t obj2_type = -1; /* Object type */ H5R_type_t ref_type; /* Reference type */ - H5TOOLS_DEBUG("diff_datum H5T_REFERENCE - H5T_STD_REF"); + H5TOOLS_DEBUG("H5T_REFERENCE - H5T_STD_REF"); ref_type = H5Rget_type(ref1_buf); switch (ref_type) { case H5R_OBJECT1: H5TOOLS_DEBUG("ref_type is H5R_OBJECT1"); - if (H5Rget_obj_type3(ref1_buf, H5P_DEFAULT, &obj1_type) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_obj_type3 object 1 failed"); - } - if (H5Rget_obj_type3(ref2_buf, H5P_DEFAULT, &obj2_type) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_obj_type3 object 2 failed"); - } - - /* check object type */ - if (obj1_type != obj2_type) { - parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); - opts->not_cmp = 1; - H5TOOLS_GOTO_DONE(opts->err_stat); - } - - if((obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Ropen_object object 1 failed"); - } - if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Ropen_object object 2 failed"); - } - - switch (obj1_type) { - case H5O_TYPE_DATASET: - nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, opts); - break; - - case H5O_TYPE_GROUP: - case H5O_TYPE_NAMED_DATATYPE: - case H5O_TYPE_MAP: - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - if (opts->m_verbose) - parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", obj1, obj2); - opts->not_cmp = 1; - break; - } /* end switch */ - if(obj1_id >= 0) - if(H5Oclose(obj1_id) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Oclose H5R_OBJECT1 failed"); + if (H5Rget_obj_type3(ref1_buf, H5P_DEFAULT, &obj1_type) >= 0) { + if (H5Rget_obj_type3(ref2_buf, H5P_DEFAULT, &obj2_type) >= 0) { + /* check object type */ + if (obj1_type == obj2_type) { + switch (obj1_type) { + case H5O_TYPE_DATASET: + if((obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + nfound = diff_datasetid(obj1_id, obj2_id, opts->obj_name[0], opts->obj_name[1], &ref_opts); + if(H5Dclose(obj2_id) < 0) { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Dclose H5R_OBJECT1 failed"); + } + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Ropen_object object 2 failed"); + } + if(H5Dclose(obj1_id) < 0) { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Dclose H5R_OBJECT1 failed"); + } + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Ropen_object object 1 failed"); + } + break; + + case H5O_TYPE_GROUP: + case H5O_TYPE_NAMED_DATATYPE: + case H5O_TYPE_MAP: + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + if (ref_opts.mode_verbose) + parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", opts->obj_name[0], opts->obj_name[1]); + ref_opts.not_cmp = 1; + break; + } /* end switch */ + } + else { + parallel_print("Different object types referenced: <%s> and <%s>", opts->obj_name[0], opts->obj_name[1]); + ref_opts.not_cmp = 1; + ref_opts.err_stat = H5DIFF_ERR; + } } - if(obj2_id >= 0) - if(H5Oclose(obj2_id) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Oclose H5R_OBJECT1 failed"); + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Rget_obj_type3 object 2 failed"); } - if(H5Rdestroy(ref2_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_OBJECT1 failed"); - if(H5Rdestroy(ref1_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_OBJECT1 failed"); + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Rget_obj_type3 object 1 failed"); + } break; case H5R_DATASET_REGION1: H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION1"); @@ -797,149 +843,143 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { if((region1_id = H5Ropen_region(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { if((region2_id = H5Ropen_region(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts); + nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, &ref_opts); if(H5Sclose(region2_id) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Sclose H5R_DATASET_REGION1 failed"); + H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION1 failed"); } if(H5Sclose(region1_id) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Sclose H5R_DATASET_REGION1 failed"); + H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION1 failed"); } - if(H5Oclose(obj2_id) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Oclose H5R_DATASET_REGION1 failed"); + if(H5Dclose(obj2_id) < 0) + H5TOOLS_INFO("H5Oclose H5R_DATASET_REGION1 failed"); } else { - H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_object H5R_DATASET_REGION1 failed"); + H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION1 failed"); } - if(H5Oclose(obj1_id) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Oclose H5R_DATASET_REGION1 failed"); + if(H5Dclose(obj1_id) < 0) + H5TOOLS_INFO("H5Oclose H5R_DATASET_REGION1 failed"); } else { - H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_object H5R_DATASET_REGION1 failed"); + H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION1 failed"); } - if(H5Rdestroy(ref2_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_DATASET_REGION1 failed"); - if(H5Rdestroy(ref1_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_DATASET_REGION1 failed"); break; case H5R_OBJECT2: H5TOOLS_DEBUG("ref_type is H5R_OBJECT2"); - if (H5Rget_obj_type3(ref1_buf, H5P_DEFAULT, &obj1_type) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_obj_type3 object 1 failed"); - } - if (H5Rget_obj_type3(ref2_buf, H5P_DEFAULT, &obj2_type) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_obj_type3 object 2 failed"); - } - - /* check object type */ - if (obj1_type != obj2_type) { - parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); - opts->not_cmp = 1; - H5TOOLS_GOTO_DONE(opts->err_stat); - } - - if((obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Ropen_object object 1 failed"); - } - if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Ropen_object object 2 failed"); - } - - switch (obj1_type) { - case H5O_TYPE_DATASET: - H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : DATASET"); - nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, opts); - break; - - case H5O_TYPE_GROUP: - H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : GROUP"); - if (opts->m_verbose) - parallel_print("Warning: Comparison not possible of group object types referenced: <%s> and <%s>\n", obj1, obj2); - opts->not_cmp = 1; - break; - - case H5O_TYPE_NAMED_DATATYPE: - H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : NAMED"); - if (opts->m_verbose) - parallel_print("Warning: Comparison not possible of named datatypes object types referenced: <%s> and <%s>\n", obj1, obj2); - opts->not_cmp = 1; - break; - - case H5O_TYPE_MAP: - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - if (opts->m_verbose) - parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", obj1, obj2); - opts->not_cmp = 1; - break; - } /* end switch */ - if(obj1_id >= 0) - if(H5Oclose(obj1_id) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed"); + if (H5Rget_obj_type3(ref1_buf, H5P_DEFAULT, &obj1_type) >= 0) { + if (H5Rget_obj_type3(ref2_buf, H5P_DEFAULT, &obj2_type) >= 0) { + /* check object type */ + if (obj1_type == obj2_type) { + if((obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + switch (obj1_type) { + case H5O_TYPE_DATASET: + H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : DATASET"); + nfound = diff_datasetid(obj1_id, obj2_id, opts->obj_name[0], opts->obj_name[1], &ref_opts); + break; + + case H5O_TYPE_GROUP: + H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : GROUP"); + if (ref_opts.mode_verbose) + parallel_print("Warning: Comparison not possible of group object types referenced: <%s> and <%s>\n", opts->obj_name[0], opts->obj_name[1]); + ref_opts.not_cmp = 1; + break; + + case H5O_TYPE_NAMED_DATATYPE: + H5TOOLS_DEBUG("ref_type is H5R_OBJECT2 : NAMED"); + if (ref_opts.mode_verbose) + parallel_print("Warning: Comparison not possible of named datatypes object types referenced: <%s> and <%s>\n", opts->obj_name[0], opts->obj_name[1]); + ref_opts.not_cmp = 1; + break; + + case H5O_TYPE_MAP: + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + if (ref_opts.mode_verbose) + parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", opts->obj_name[0], opts->obj_name[1]); + ref_opts.not_cmp = 1; + break; + } /* end switch */ + if(H5Oclose(obj2_id) < 0) { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed"); + } + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Ropen_object object 2 failed"); + } + if(H5Oclose(obj1_id) < 0) { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed"); + } + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Ropen_object object 1 failed"); + } + } + else { + parallel_print("Different object types referenced: <%s> and <%s>", opts->obj_name[0], opts->obj_name[1]); + ref_opts.not_cmp = 1; + ref_opts.err_stat = H5DIFF_ERR; + } } - if(obj2_id >= 0) - if(H5Oclose(obj2_id) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed"); + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Rget_obj_type3 object 2 failed"); } - if(H5Rdestroy(ref2_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_OBJECT2 failed"); - if(H5Rdestroy(ref1_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_OBJECT2 failed"); + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Rget_obj_type3 object 1 failed"); + } break; case H5R_DATASET_REGION2: H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION2"); /* if (obj_id < 0) - could mean that no reference was written do not throw failure */ - obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT); - obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT); - if((obj1_id < 0) || (obj2_id < 0)) { - H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 failed"); + if((obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 object 1 failed"); } else { - H5TOOLS_DEBUG("open_region - H5R_DATASET_REGION2"); - if((region1_id = H5Ropen_region(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - if (h5tools_is_zero(ref1_buf, H5Tget_size(H5T_STD_REF))) { - H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2"); - } - else { - if((region2_id = H5Ropen_region(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - if (h5tools_is_zero(ref2_buf, H5Tget_size(H5T_STD_REF))) { - H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2"); - } - else { - nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts); - } - if(H5Sclose(region2_id) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Sclose H5R_DATASET_REGION2 failed"); + if((obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + H5TOOLS_DEBUG("open_region - H5R_DATASET_REGION2"); + if((region1_id = H5Ropen_region(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (h5tools_is_zero(ref1_buf, H5Tget_size(H5T_STD_REF))) { + H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2"); } - else - H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_region H5R_DATASET_REGION2 failed"); - } /* end else to if (h5tools_is_zero(... */ - if(H5Sclose(region1_id) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Sclose H5R_DATASET_REGION2 failed"); - } - else - H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_region H5R_DATASET_REGION2 failed"); - if (obj1_id >= 0) - if(H5Dclose(obj1_id) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed"); + else { + if((region2_id = H5Ropen_region(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (h5tools_is_zero(ref2_buf, H5Tget_size(H5T_STD_REF))) { + H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2"); + } + else { + nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, &ref_opts); + } + if(H5Sclose(region2_id) < 0) + H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION2 failed"); + } + else + H5TOOLS_INFO("H5Ropen_region H5R_DATASET_REGION2 failed"); + } /* end else to if (h5tools_is_zero(... */ + if(H5Sclose(region1_id) < 0) + H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION2 failed"); } - if (obj2_id >= 0) + else + H5TOOLS_ERROR(H5DIFF_ERR, "H5Ropen_region H5R_DATASET_REGION2 failed"); if(H5Dclose(obj2_id) < 0) { - opts->err_stat = H5DIFF_ERR; + ref_opts.err_stat = H5DIFF_ERR; H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed"); } - if(H5Rdestroy(ref1_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_DATASET_REGION2 failed"); - if(H5Rdestroy(ref2_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_DATASET_REGION2 failed"); + } + else { + H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 object 2 failed"); + } + if(H5Dclose(obj1_id) < 0) { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed"); + } } break; case H5R_ATTR: @@ -948,44 +988,42 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, char name2[ATTR_NAME_MAX]; H5TOOLS_DEBUG("ref_type is H5R_ATTR"); - if((obj1_id = H5Ropen_attr(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - parallel_print("Warning: Cannot open referenced attribute: attribute 1\n"); - H5TOOLS_INFO("H5Ropen_attr object 1 failed"); - } - if((obj2_id = H5Ropen_attr(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - parallel_print("Warning: Cannot open referenced attribute: attribute 2\n"); - H5TOOLS_INFO("H5Ropen_attr object 2 failed"); - } - - if((obj1_id < 0) || (obj2_id < 0)) { - H5TOOLS_INFO("H5Ropen_attr H5R_ATTR failed"); - } - else { - /* get name */ - if(H5Aget_name(obj1_id, (size_t)ATTR_NAME_MAX, name1) < 0) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_name first attribute failed"); - /* get name */ - if(H5Aget_name(obj2_id, (size_t)ATTR_NAME_MAX, name2) < 0) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_name second attribute failed"); - - H5TOOLS_DEBUG("H5R_ATTR diff_attr_data - name1=%s, name2=%s", name1, name2); - nfound = diff_attr_data(obj1_id, obj2_id, name1, name2, NULL, NULL, opts); - } + if((obj1_id = H5Ropen_attr(ref1_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if((obj2_id = H5Ropen_attr(ref2_buf, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + /* get name */ + if(H5Aget_name(obj1_id, (size_t)ATTR_NAME_MAX, name1) >= 0) { + /* get name */ + if(H5Aget_name(obj2_id, (size_t)ATTR_NAME_MAX, name2) >= 0) { + H5TOOLS_DEBUG("H5R_ATTR diff_attr_data - name1=%s, name2=%s", name1, name2); + nfound = diff_attr_data(obj1_id, obj2_id, name1, name2, opts->obj_name[0], opts->obj_name[1], &ref_opts); + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Aget_name second attribute failed"); + } + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Aget_name first attribute failed"); + } - if(obj1_id >= 0) - if(H5Aclose(obj1_id) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Aclose H5R_ATTR failed"); + if(H5Aclose(obj2_id) < 0) { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Aclose H5R_ATTR failed"); + } + } + else { + parallel_print("Warning: Cannot open referenced attribute2\n"); + H5TOOLS_INFO("H5Ropen_attr object 2 failed"); } - if(obj2_id >= 0) - if(H5Aclose(obj2_id) < 0) { - opts->err_stat = H5DIFF_ERR; + if(H5Aclose(obj1_id) < 0) { H5TOOLS_INFO("H5Aclose H5R_ATTR failed"); } - if(H5Rdestroy(ref2_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_ATTR failed"); - if(H5Rdestroy(ref1_buf) < 0) - H5TOOLS_ERROR(H5DIFF_ERR, "H5Rdestroy H5R_ATTR failed"); + } + else { + parallel_print("Warning: Cannot open referenced attribute1\n"); + H5TOOLS_INFO("H5Ropen_attr object 1 failed"); + } } break; case H5R_BADTYPE: @@ -993,43 +1031,20 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, default: break; } /* end switch */ - H5TOOLS_DEBUG("diff_datum H5T_REFERENCE - H5T_STD_REF complete nfound:%d - errstat:%d", nfound, opts->err_stat); + if(H5Rdestroy(ref2_buf) < 0) + H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1 failed"); + if(H5Rdestroy(ref1_buf) < 0) + H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1 failed"); + H5TOOLS_DEBUG("H5T_REFERENCE - H5T_STD_REF complete nfound:%d - errstat:%d", nfound, ref_opts.err_stat); } /*------------------------------------------------------------------------- * H5T_STD_REF_DSETREG * Dataset region reference *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) { + else if (H5Tequal(ref_opts.m_tid, H5T_STD_REF_DSETREG)) { /* if (type_size == H5R_DSET_REG_REF_BUF_SIZE) */ - hid_t region1_id = H5I_INVALID_HID; - hid_t region2_id = H5I_INVALID_HID; - - H5TOOLS_INFO("H5T_STD_REF_DSETREG reference type"); - - if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rdereference2 object 1 failed"); - } - if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rdereference2 object 2 failed"); - } - if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_region object 1 failed"); - } - if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_region object 2 failed"); - } - - nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts); - - H5Oclose(obj1_id); - H5Oclose(obj2_id); - H5Sclose(region1_id); - H5Sclose(region2_id); + H5TOOLS_DEBUG("H5T_STD_REF_DSETREG"); }/*dataset reference*/ /*------------------------------------------------------------------------- @@ -1037,52 +1052,15 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, * Object references. get the type and OID of the referenced object *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_STD_REF_OBJ)) { + else if (H5Tequal(ref_opts.m_tid, H5T_STD_REF_OBJ)) { /* if (type_size == H5R_OBJ_REF_BUF_SIZE) */ - H5O_type_t obj1_type; - H5O_type_t obj2_type; - - H5TOOLS_INFO("H5T_STD_REF_OBJ reference type"); - - if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_obj_type2 object 1 failed"); - } - if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_obj_type2 object 2 failed"); - } - - /* check object type */ - if (obj1_type != obj2_type) { - parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); - opts->not_cmp = 1; - H5TOOLS_GOTO_DONE(opts->err_stat); - } - - if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rdereference2 object 1 failed"); - } - if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rdereference2 object 2 failed"); - } - - /* compare */ - if (obj1_type == H5O_TYPE_DATASET) - nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, opts); - else { - if (opts->m_verbose) - parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", obj1, obj2); - opts->not_cmp = 1; - } - - H5Oclose(obj1_id); - H5Oclose(obj2_id); + H5TOOLS_DEBUG("H5T_STD_REF_OBJ"); }/*object reference*/ + opts->print_header = ref_opts.print_header; + opts->not_cmp = ref_opts.not_cmp; + opts->err_stat = ref_opts.err_stat | ret_value; }/*is zero*/ - H5TOOLS_DEBUG("diff_datum H5T_REFERENCE complete"); + H5TOOLS_DEBUG("H5T_REFERENCE complete"); break; /*------------------------------------------------------------------------- @@ -1091,21 +1069,26 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, */ case H5T_VLEN: { - hid_t memb_type = H5I_INVALID_HID; + diff_opt_t vl_opts; - H5TOOLS_DEBUG("diff_datum H5T_VLEN"); + H5TOOLS_DEBUG("H5T_VLEN"); + + vl_opts = *opts; /* get the VL sequences's base datatype for each element */ - memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); + vl_opts.m_tid = H5Tget_super(opts->m_tid); + size = H5Tget_size(vl_opts.m_tid); /* get the number of sequence elements */ - nelmts = ((hvl_t *)((void *)mem1))->len; + vl_opts.hs_nelmts = ((hvl_t *)((void *)mem1))->len; - for (j = 0; j < nelmts; j++) - nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *)((void *)mem2))->p)) + j * size, memb_type, idx, /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */ - rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); + for (j = 0; j < vl_opts.hs_nelmts; j++) + nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *)((void *)mem2))->p)) + j * size, elemtno, /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */ + &vl_opts, container1_id, container2_id, members); + opts->print_header = vl_opts.print_header; + opts->not_cmp = vl_opts.not_cmp; + opts->err_stat = opts->err_stat | vl_opts.err_stat; - H5Tclose(memb_type); + H5Tclose(vl_opts.m_tid); } break; @@ -1114,81 +1097,16 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ case H5T_INTEGER: - H5TOOLS_DEBUG("diff_datum H5T_INTEGER"); - type_sign = H5Tget_sign(m_type); + H5TOOLS_DEBUG("H5T_INTEGER"); + type_sign = H5Tget_sign(opts->m_tid); /*------------------------------------------------------------------------- * H5T_NATIVE_SCHAR *------------------------------------------------------------------------- */ if (type_size == 1 && type_sign != H5T_SGN_NONE) { - char temp1_char; - char temp2_char; - if(type_size != sizeof(char)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not char size"); - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (ABS(temp1_char-temp2_char) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER(temp1_char, temp2_char); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER(temp1_char, temp2_char); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); - } - nfound++; - } - } - else if (temp1_char != temp2_char) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; - } + nfound += diff_schar_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_SCHAR*/ /*------------------------------------------------------------------------- @@ -1196,75 +1114,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ else if (type_size == 1 && type_sign == H5T_SGN_NONE) { - unsigned char temp1_uchar; - unsigned char temp2_uchar; - if(type_size != sizeof(unsigned char)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned char size"); - - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } - else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); - } - nfound++; - } - } - else if (temp1_uchar != temp2_uchar) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } + nfound += diff_uchar_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_UCHAR*/ /*------------------------------------------------------------------------- @@ -1272,75 +1124,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ else if (type_size == 2 && type_sign != H5T_SGN_NONE) { - short temp1_short; - short temp2_short; - if(type_size != sizeof(short)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not short size"); - - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (ABS(temp1_short - temp2_short) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER(temp1_short, temp2_short); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER(temp1_short, temp2_short); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); - } - nfound++; - } - } - else if (temp1_short != temp2_short) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; - } + nfound += diff_short_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_SHORT*/ /*------------------------------------------------------------------------- @@ -1348,227 +1134,29 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ else if (type_size == 2 && type_sign == H5T_SGN_NONE) { - unsigned short temp1_ushort; - unsigned short temp2_ushort; - if(type_size != sizeof(unsigned short)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned short size"); + nfound += diff_ushort_element(mem1, mem2, elemtno, opts); + } /*H5T_NATIVE_USHORT*/ - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); - } - nfound++; - } - } - else if (temp1_ushort != temp2_ushort) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - } /*H5T_NATIVE_USHORT*/ - - /*------------------------------------------------------------------------- - * H5T_NATIVE_INT - *------------------------------------------------------------------------- - */ - else if (type_size == 4 && type_sign != H5T_SGN_NONE) { - int temp1_int; - int temp2_int; - - if(type_size != sizeof(int)) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not int size"); - - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (ABS(temp1_int-temp2_int) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER(temp1_int, temp2_int); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER(temp1_int, temp2_int); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); - } - nfound++; - } - } - else if (temp1_int != temp2_int) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; - } - } /*H5T_NATIVE_INT*/ + /*------------------------------------------------------------------------- + * H5T_NATIVE_INT + *------------------------------------------------------------------------- + */ + else if (type_size == 4 && type_sign != H5T_SGN_NONE) { + if(type_size != sizeof(int)) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not int size"); + nfound += diff_int_element(mem1, mem2, elemtno, opts); + } /*H5T_NATIVE_INT*/ /*------------------------------------------------------------------------- * H5T_NATIVE_UINT *------------------------------------------------------------------------- */ else if (type_size == 4 && type_sign == H5T_SGN_NONE) { - unsigned int temp1_uint; - unsigned int temp2_uint; - if(type_size != sizeof(unsigned int)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned int size"); - - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER_UNSIGN(signed int, temp1_uint, temp2_uint); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER_UNSIGN(signed int, temp1_uint, temp2_uint); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } - else if (per > opts->percent && PDIFF(temp1_uint,temp2_uint) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); - } - nfound++; - } - } - else if (temp1_uint != temp2_uint) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } + nfound += diff_uint_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_UINT*/ /*------------------------------------------------------------------------- @@ -1576,75 +1164,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ else if (type_size == 8 && type_sign != H5T_SGN_NONE) { - long temp1_long; - long temp2_long; - if(type_size != sizeof(long)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not long size"); - - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (ABS(temp1_long-temp2_long) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER(temp1_long, temp2_long); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER(temp1_long, temp2_long); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); - } - nfound++; - } - } - else if (temp1_long != temp2_long) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } + nfound += diff_long_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_LONG*/ /*------------------------------------------------------------------------- @@ -1652,76 +1174,30 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ else if (type_size == 8 && type_sign == H5T_SGN_NONE) { - unsigned long temp1_ulong; - unsigned long temp2_ulong; - if(type_size != sizeof(unsigned long)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned long size"); + nfound += diff_ulong_element(mem1, mem2, elemtno, opts); + } /*H5T_NATIVE_ULONG*/ - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + /*------------------------------------------------------------------------- + * H5T_NATIVE_LLONG + *------------------------------------------------------------------------- + */ + else if (type_size == 16 && type_sign != H5T_SGN_NONE) { + if(type_size != sizeof(long long)) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not long long size"); + nfound += diff_llong_element(mem1, mem2, elemtno, opts); + } /*H5T_NATIVE_LLONG*/ - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - else if (per > opts->percent && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); - } - nfound++; - } - } - else if (temp1_ulong != temp2_ulong) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - } /*H5T_NATIVE_ULONG*/ + /*------------------------------------------------------------------------- + * H5T_NATIVE_ULLONG + *------------------------------------------------------------------------- + */ + else if (type_size == 16 && type_sign == H5T_SGN_NONE) { + if(type_size != sizeof(unsigned long long)) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned long long size"); + nfound += diff_ullong_element(mem1, mem2, elemtno, opts); + } /*H5T_NATIVE_ULLONG*/ break; /* H5T_INTEGER class */ /*------------------------------------------------------------------------- @@ -1733,319 +1209,21 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, * H5T_NATIVE_FLOAT *------------------------------------------------------------------------- */ - H5TOOLS_DEBUG("diff_datum H5T_FLOAT"); + H5TOOLS_DEBUG("H5T_FLOAT"); if (type_size == 4) { - float temp1_float; - float temp2_float; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; - if(type_size != sizeof(float)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not float size"); - - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - /* logic for detecting NaNs is different with opts -d, -p and no opts */ - - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (opts->d && !opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_float-temp2_float) > (float) opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_float, temp2_float); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, - (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if (opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_float, temp2_float); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, - (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_float(temp1_float, temp2_float, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - } /*H5T_NATIVE_FLOAT*/ - + nfound += diff_float_element(mem1, mem2, elemtno, opts); + } /*------------------------------------------------------------------------- * H5T_NATIVE_DOUBLE *------------------------------------------------------------------------- */ else if (type_size == 8) { - double temp1_double; - double temp2_double; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; - if(type_size != sizeof(double)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not double size"); - - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); - - /* logic for detecting NaNs is different with opts -d, -p and no opts */ - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (opts->d && !opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } /* opts->d && !opts->p */ - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if (opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent && - ABS(temp1_double-temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_double(temp1_double, temp2_double, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } /*H5T_NATIVE_DOUBLE*/ - + nfound += diff_double_element(mem1, mem2, elemtno, opts); + } #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE /*------------------------------------------------------------------------- @@ -2053,157 +1231,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, *------------------------------------------------------------------------- */ else if (type_size == H5_SIZEOF_LONG_DOUBLE) { - long double temp1_double; - long double temp2_double; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; - if(type_size != sizeof(long double)) { H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not long double size"); } - - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - /* logic for detecting NaNs is different with options -d, -p and no options */ - - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (opts->d && !opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } /* NaN */ - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double,temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); - } - nfound++; - } - } /* NaN */ - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if (opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double,temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); - } - nfound++; - } - } /* NaN */ - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } + nfound += diff_ldouble_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_LDOUBLE*/ #endif /* H5_SIZEOF_LONG_DOUBLE */ @@ -2320,8 +1351,8 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t npoints1 = H5Sget_select_elem_npoints(region1_id); npoints2 = H5Sget_select_elem_npoints(region2_id); } H5E_END_TRY; - H5TOOLS_DEBUG("diff_region blocks: 1=%ld-2=%ld", nblocks1, nblocks2); - H5TOOLS_DEBUG("diff_region points: 1=%ld-2=%ld", npoints1, npoints2); + H5TOOLS_DEBUG("blocks: 1=%ld-2=%ld", nblocks1, nblocks2); + H5TOOLS_DEBUG("points: 1=%ld-2=%ld", npoints1, npoints2); if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { opts->not_cmp = 1; @@ -2369,7 +1400,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t } /* print differences if found */ - if (nfound_b && opts->m_verbose) { + if (nfound_b && opts->mode_verbose) { H5O_info2_t oi1, oi2; char *obj1_str = NULL, *obj2_str = NULL; @@ -2437,7 +1468,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t } } - if (nfound_p && opts->m_verbose) { + if (nfound_p && opts->mode_verbose) { parallel_print("Region points\n"); for (i = 0; i < npoints1; i++) { hsize_t pt1, pt2; @@ -2497,8 +1528,7 @@ done: *------------------------------------------------------------------------- */ -static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) +static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, ssize_t u, diff_opt_t *opts) { hsize_t nfound = 0; /* differences found */ char temp1_uchar; @@ -2506,12 +1536,13 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - H5TOOLS_START_DEBUG(" %d=%d",temp1_uchar,temp2_uchar); + H5TOOLS_START_DEBUG(" %d=%d", temp1_uchar, temp2_uchar); if (temp1_uchar != temp2_uchar) { if (print_data(opts)) { - print_char_pos(ph, 0, i, u, acc, pos, rank, dims, obj1, obj2); - parallel_print(" "); + opts->print_percentage = 0; + print_pos(opts, elemtno, u); + parallel_print(" "); h5diff_print_char(temp1_uchar); parallel_print(" "); h5diff_print_char(temp2_uchar); @@ -2532,1953 +1563,1455 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, *------------------------------------------------------------------------- */ -static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, - hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, diff_opt_t *opts) { hsize_t nfound = 0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; + hbool_t both_zero = FALSE; double per; - hbool_t both_zero; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + H5TOOLS_START_DEBUG(" %d=%d", temp1_uchar, temp2_uchar); /* -d and !-p */ - if (opts->d && !opts->p) { + if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elemtno, -1); if (print_data(opts)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { + else if (!opts->delta_bool && opts->percent_bool) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elemtno, -1); if (print_data(opts)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { + else if (opts->delta_bool && opts->percent_bool) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elemtno, -1); if (print_data(opts)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } nfound++; } } else if (temp1_uchar != temp2_uchar) { + opts->print_percentage = 0; + print_pos(opts, elemtno, -1); if (print_data(opts)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } + H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero); return nfound; } /*------------------------------------------------------------------------- - * Function: diff_float + * Function: diff_float_element * - * Purpose: diff a H5T_NATIVE_FLOAT type + * Purpose: diff a single H5T_NATIVE_FLOAT type * * Return: number of differences found * *------------------------------------------------------------------------- */ -static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) - +static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ float temp1_float; float temp2_float; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); + + /* logic for detecting NaNs is different with opts -d, -p and no opts */ + /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ + if (opts->delta_bool && !opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); + } - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if ((double) ABS(temp1_float - temp2_float) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if ((double) ABS(temp1_float - temp2_float) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; - } - mem1 += sizeof(float); - mem2 += sizeof(float); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); + } + nfound++; + } } /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - /* both not NaN, do the comparison */ - if ((!isnan1 && !isnan2)) { - PER(temp1_float, temp2_float); + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); + } + /* both not NaN, do the comparison */ + if ((!isnan1 && !isnan2)) { + PER(temp1_float, temp2_float); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, - (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } nfound++; - } - mem1 += sizeof(float); - mem2 += sizeof(float); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); + } + nfound++; + } } /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } + * -d and -p + *------------------------------------------------------------------------- + */ + else if (opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); + } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_float, temp2_float); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_float, temp2_float); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; - } - else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, - (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } - + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } nfound++; - } - mem1 += sizeof(float); - mem2 += sizeof(float); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); + } + nfound++; + } } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ + * no -d and -p + *------------------------------------------------------------------------- + */ else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - if (equal_float(temp1_float, temp2_float, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); - } - nfound++; + if (equal_float(temp1_float, temp2_float, opts) == FALSE) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } - - mem1 += sizeof(float); - mem2 += sizeof(float); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + nfound++; + } } + H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero); return nfound; } /*------------------------------------------------------------------------- - * Function: diff_double + * Function: diff_double_element * - * Purpose: diff a H5T_NATIVE_DOUBLE type + * Purpose: diff a single H5T_NATIVE_DOUBLE type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) - +static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ double temp1_double; double temp2_double; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (opts->delta_bool && !opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } - mem1 += sizeof(double); - mem2 += sizeof(double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, + ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } nfound++; - } - mem1 += sizeof(double); - mem2 += sizeof(double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if (opts->d && opts->p) { - - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } + * -d and -p + *------------------------------------------------------------------------- + */ + else if (opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, + ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } nfound++; } - mem1 += sizeof(double); - mem2 += sizeof(double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ + * no -d and -p + *------------------------------------------------------------------------- + */ else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); - - if (equal_double(temp1_double, temp2_double, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; + if (equal_double(temp1_double, temp2_double, opts) == FALSE) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } - - mem1 += sizeof(double); - mem2 += sizeof(double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + nfound++; + } } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); return nfound; } /*------------------------------------------------------------------------- - * Function: diff_ldouble + * Function: diff_ldouble_element * - * Purpose: diff a H5T_NATIVE_LDOUBLE type + * Purpose: diff a single H5T_NATIVE_LDOUBLE type * * Return: number of differences found *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE !=0 -static hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *opts, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ long double temp1_double; long double temp2_double; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); + + /* logic for detecting NaNs is different with options -d, -p and no options */ + /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ + if (opts->delta_bool && !opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - if (opts->d && !opts->p) { - for ( i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } - mem1 += sizeof(long double); - mem2 += sizeof(long double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } /* NaN */ + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } - /*------------------------------------------------------------------------- * !-d and -p *------------------------------------------------------------------------- */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); + else if (!opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_double,temp2_double); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 0, hyper_start+i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } nfound++; } - mem1 += sizeof(long double); - mem2 += sizeof(long double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } /* NaN */ + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- * -d and -p *------------------------------------------------------------------------- */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } + else if (opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_double,temp2_double); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } nfound++; } - mem1 += sizeof(long double); - mem2 += sizeof(long double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } /* NaN */ + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- * no -d and -p *------------------------------------------------------------------------- */ - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - mem1 += sizeof(long double); - mem2 += sizeof(long double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } #endif /* H5_SIZEOF_LONG_DOUBLE */ /*------------------------------------------------------------------------- - * Function: diff_schar + * Function: diff_schar_element * - * Purpose: diff a H5T_NATIVE_SCHAR type + * Purpose: diff a single H5T_NATIVE_SCHAR type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) - +static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ char temp1_char; char temp2_char; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); - if (ABS(temp1_char-temp2_char) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_char-temp2_char) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } - mem1 += sizeof(char); - mem2 += sizeof(char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); - - PER(temp1_char, temp2_char); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_char, temp2_char); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } - mem1 += sizeof(char); - mem2 += sizeof(char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_char, temp2_char); - PER(temp1_char, temp2_char); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } - else if (per > opts->percent && ABS(temp1_char-temp2_char) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } - mem1 += sizeof(char); - mem2 += sizeof(char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); - - if (temp1_char != temp2_char) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; - } - - mem1 += sizeof(char); - mem2 += sizeof(char); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_char != temp2_char) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_uchar + * Function: diff_uchar_element * - * Purpose: diff a H5T_NATIVE_UCHAR type + * Purpose: diff a single H5T_NATIVE_UCHAR type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) +static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } - mem1 += sizeof(unsigned char); - mem2 += sizeof(unsigned char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - - PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + else if (!opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } - mem1 += sizeof(unsigned char); - mem2 += sizeof(unsigned char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - - PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + else if (opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } - else if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } - mem1 += sizeof(unsigned char); - mem2 += sizeof(unsigned char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - - if (temp1_uchar != temp2_uchar) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } - - mem1 += sizeof(unsigned char); - mem2 += sizeof(unsigned char); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_uchar != temp2_uchar) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_short + * Function: diff_short_element * * Purpose: diff a H5T_NATIVE_SHORT type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) +static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ short temp1_short; short temp2_short; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (ABS(temp1_short-temp2_short) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_short - temp2_short) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } - mem1 += sizeof(short); - mem2 += sizeof(short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_short, temp2_short); - PER(temp1_short, temp2_short); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } - mem1 += sizeof(short); - mem2 += sizeof(short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); - - PER(temp1_short, temp2_short); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_short, temp2_short); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } - else if (per > opts->percent && ABS(temp1_short-temp2_short) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } - mem1 += sizeof(short); - mem2 += sizeof(short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); - - if (temp1_short != temp2_short) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; - } - - mem1 += sizeof(short); - mem2 += sizeof(short); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_short != temp2_short) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_ushort + * Function: diff_ushort_element * - * Purpose: diff a H5T_NATIVE_USHORT type + * Purpose: diff a single H5T_NATIVE_USHORT type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) - +static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned short temp1_ushort; unsigned short temp2_ushort; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (PDIFF(temp1_ushort,temp2_ushort) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } - mem1 += sizeof(unsigned short); - mem2 += sizeof(unsigned short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + else if (!opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } - mem1 += sizeof(unsigned short); - mem2 += sizeof(unsigned short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - - PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); + else if (opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } - else if (per > opts->percent && PDIFF(temp1_ushort,temp2_ushort) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } - mem1 += sizeof(unsigned short); - mem2 += sizeof(unsigned short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - - if (temp1_ushort != temp2_ushort) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - - mem1 += sizeof(unsigned short); - mem2 += sizeof(unsigned short); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_ushort != temp2_ushort) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_int + * Function: diff_int_element * - * Purpose: diff a H5T_NATIVE_INT type + * Purpose: diff a single H5T_NATIVE_INT type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) +static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ int temp1_int; int temp2_int; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (ABS(temp1_int-temp2_int) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_int-temp2_int) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } - mem1 += sizeof(int); - mem2 += sizeof(int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); - - PER(temp1_int, temp2_int); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_int, temp2_int); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } - mem1 += sizeof(int); - mem2 += sizeof(int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_int, temp2_int); - PER(temp1_int, temp2_int); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } - else if (per > opts->percent && ABS(temp1_int-temp2_int) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } - mem1 += sizeof(int); - mem2 += sizeof(int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); - - if (temp1_int != temp2_int) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; - } + else if (temp1_int != temp2_int) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); + } + nfound++; + } - mem1 += sizeof(int); - mem2 += sizeof(int); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); - } return nfound; } /*------------------------------------------------------------------------- - * Function: diff_uint + * Function: diff_uint_element * - * Purpose: diff a H5T_NATIVE_UINT type + * Purpose: diff a single H5T_NATIVE_UINT type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) +static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned int temp1_uint; unsigned int temp2_uint; - hsize_t i; double per; - hbool_t both_zero; - - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); + hbool_t both_zero = FALSE; - if (PDIFF(temp1_uint,temp2_uint) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } - mem1 += sizeof(unsigned int); - mem2 += sizeof(unsigned int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); + else if (!opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed int, temp1_uint, temp2_uint); - PER_UNSIGN(signed int, temp1_uint, temp2_uint); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } - mem1 += sizeof(unsigned int); - mem2 += sizeof(unsigned int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - - PER_UNSIGN(signed int, temp1_uint, temp2_uint); + else if (opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed int, temp1_uint, temp2_uint); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } - else if (per > opts->percent - && PDIFF(temp1_uint,temp2_uint) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_uint,temp2_uint) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } - mem1 += sizeof(unsigned int); - mem2 += sizeof(unsigned int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - - if (temp1_uint != temp2_uint) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } - - mem1 += sizeof(unsigned int); - mem2 += sizeof(unsigned int); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_uint != temp2_uint) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_long + * Function: diff_long_element * - * Purpose: diff a H5T_NATIVE_LONG type + * Purpose: diff a single H5T_NATIVE_LONG type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) +static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ long temp1_long; long temp2_long; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (ABS(temp1_long-temp2_long) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } - mem1 += sizeof(long); - mem2 += sizeof(long); - if (opts->n && nfound >= opts->count) - return nfound; + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_long-temp2_long) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_long, temp2_long); - PER(temp1_long, temp2_long); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } - mem1 += sizeof(long); - mem2 += sizeof(long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); - - PER(temp1_long, temp2_long); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_long, temp2_long); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } - else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } - mem1 += sizeof(long); - mem2 += sizeof(long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); - - if (temp1_long != temp2_long) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } - - mem1 += sizeof(long); - mem2 += sizeof(long); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_long != temp2_long) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_ulong + * Function: diff_ulong_element * - * Purpose: diff a H5T_NATIVE_ULONG type + * Purpose: diff a single H5T_NATIVE_ULONG type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) +static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned long temp1_ulong; unsigned long temp2_ulong; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - mem1 += sizeof(unsigned long); - mem2 += sizeof(unsigned long); - if (opts->n && nfound >= opts->count) - return nfound; + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + else if (!opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } - mem1 += sizeof(unsigned long); - mem2 += sizeof(unsigned long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - - PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + else if (opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } - else if (per > opts->percent - && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } - mem1 += sizeof(unsigned long); - mem2 += sizeof(unsigned long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - - if (temp1_ulong != temp2_ulong) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - - mem1 += sizeof(unsigned long); - mem2 += sizeof(unsigned long); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_ulong != temp2_ulong) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_llong + * Function: diff_llong_element * - * Purpose: diff a H5T_NATIVE_LLONG type + * Purpose: diff a single H5T_NATIVE_LLONG type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph) +static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ long long temp1_llong; long long temp2_llong; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (ABS( temp1_llong-temp2_llong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); - } - nfound++; + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); + + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS( temp1_llong-temp2_llong) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } - mem1 += sizeof(long long); - mem2 += sizeof(long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_llong, temp2_llong); - PER(temp1_llong, temp2_llong); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); } nfound++; } - mem1 += sizeof(long long); - mem2 += sizeof(long long); - if (opts->n && nfound >= opts->count) - return nfound; - } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - - PER(temp1_llong, temp2_llong); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_llong, temp2_llong); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } - else if (per > opts->percent - && ABS(temp1_llong-temp2_llong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_llong-temp2_llong) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); } - mem1 += sizeof(long long); - mem2 += sizeof(long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - - if (temp1_llong != temp2_llong) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); - } - nfound++; + if (temp1_llong != temp2_llong) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } - - mem1 += sizeof(long long); - mem2 += sizeof(long long); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + nfound++; + } } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_ullong + * Function: diff_ullong_element * - * Purpose: diff a H5T_NATIVE_ULLONG type + * Purpose: diff a single H5T_NATIVE_ULLONG type * * Return: number of differences found *------------------------------------------------------------------------- */ -static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, - hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) - +static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned long long temp1_ullong; unsigned long long temp2_ullong; - hsize_t i; float f1, f2; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); - } - nfound++; + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } - mem1 += sizeof(unsigned long long); - mem2 += sizeof(unsigned long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - - ull2float(temp1_ullong, &f1); - ull2float(temp2_ullong, &f2); - PER(f1, f2); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); - } - nfound++; + else if (!opts->delta_bool && opts->percent_bool) { + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); + + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong,temp2_ullong), per); } - mem1 += sizeof(unsigned long long); - mem2 += sizeof(unsigned long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - - ull2float(temp1_ullong, &f1); - ull2float(temp2_ullong, &f2); - PER(f1, f2); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); - } - nfound++; + else if (opts->delta_bool && opts->percent_bool) { + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); + + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } - else if (per > opts->percent - && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong), per); } - mem1 += sizeof(unsigned long long); - mem2 += sizeof(unsigned long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - - if (temp1_ullong != temp2_ullong) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); - } - nfound++; + if (temp1_ullong != temp2_ullong) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, -1); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } - - mem1 += sizeof(unsigned long long); - mem2 += sizeof(unsigned long long); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + nfound++; + } } + H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero); return nfound; } @@ -4681,7 +3214,7 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *opts) { static int print_data(diff_opt_t *opts) { - return ((opts->m_report || opts->m_verbose) && !opts->m_quiet) ? 1 : 0; + return ((opts->mode_report || opts->mode_verbose) && !opts->mode_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- @@ -4691,25 +3224,24 @@ int print_data(diff_opt_t *opts) *------------------------------------------------------------------------- */ static -void print_header(int pp, /* print percentage */ - int rank, hsize_t *dims, const char *obj1, const char *obj2) +void print_header(diff_opt_t *opts) { /* print header */ parallel_print("%-16s", "size:"); - print_dimensions(rank, dims); + print_dimensions(opts->rank, opts->dims); parallel_print("%-11s", ""); - print_dimensions(rank, dims); + print_dimensions(opts->rank, opts->dims); parallel_print("\n"); - if (pp) { + if (opts->print_percentage) { parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position", - (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference", "relative"); + opts->obj_name[0], opts->obj_name[1], "difference", "relative"); parallel_print( "------------------------------------------------------------------------\n"); } else { parallel_print("%-15s %-15s %-15s %-20s\n", "position", - (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference"); + opts->obj_name[0], opts->obj_name[1], "difference"); parallel_print( "------------------------------------------------------------\n"); } @@ -4722,77 +3254,93 @@ void print_header(int pp, /* print percentage */ *------------------------------------------------------------------------- */ static -void print_pos(int *ph, /* print header */ - int pp, /* print percentage */ - hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, - const char *obj1, const char *obj2) +void print_pos(diff_opt_t *opts, hsize_t idx, ssize_t u) { - int i; - - /* print header */ - if (*ph == 1) { - *ph = 0; - - print_header(pp, rank, dims, obj1, obj2); - } /* end print header */ - - for (i = 0; i < rank; i++) { - pos[i] = curr_pos / acc[i]; - curr_pos -= acc[i] * pos[i]; - } - HDassert(curr_pos == 0); + int i,j; + + H5TOOLS_START_DEBUG(" -- idx:%ld", idx); + + if (print_data(opts)) { + /* print header */ + if (opts->print_header == 1) { + opts->print_header = 0; + + print_header(opts); + } /* end print header */ + + H5TOOLS_DEBUG("rank=%d", opts->rank); + if(opts->rank > 0) { + hsize_t curr_pos = idx; + + parallel_print("[ "); + H5TOOLS_DEBUG("do calc_acc_pos[%ld] nelmts:%d - errstat:%d", i, opts->hs_nelmts, opts->err_stat); + + if (opts->sset[0] != NULL) { + /* Subsetting is used - calculate total position */ + hsize_t elmnt_cnt = 1; + hsize_t dim_cnt = 0; /* previous dim size */ + hsize_t str_cnt = 0; /* previous dim stride */ + hsize_t curr_idx = idx; /* calculated running position */ + hsize_t str_idx = 0; + hsize_t blk_idx = 0; + hsize_t cnt_idx = 0; + hsize_t hs_idx = 0; + j = opts->rank-1; + do { + cnt_idx = opts->sset[0]->count.data[j]; /* Count value for current dim */ + H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - count:%ld", j, curr_pos, curr_idx, cnt_idx); + blk_idx = opts->sset[0]->block.data[j]; /* Block value for current dim */ + H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - block:%ld", j, curr_pos, curr_idx, blk_idx); + hs_idx = cnt_idx * blk_idx; /* hyperslab area value for current dim */ + H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - hs:%ld", j, curr_pos, curr_idx, hs_idx); + str_idx = opts->sset[0]->stride.data[j]; /* Stride value for current dim */ + H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - stride:%ld", j, curr_pos, curr_idx, str_idx); + elmnt_cnt *= opts->dims[j]; /* Total number of elements in dimension */ + H5TOOLS_DEBUG("... sset loop:%d with elmnt_cnt:%ld", j, elmnt_cnt); + if (str_idx > blk_idx) + curr_idx += dim_cnt * (str_idx - blk_idx); /* */ + else if (curr_idx >= hs_idx) + curr_idx += dim_cnt * str_cnt; + H5TOOLS_DEBUG("... sset loop:%d with idx:%ld (curr_idx:%ld) - stride:%ld", j, idx, curr_idx, str_idx); + dim_cnt = elmnt_cnt; /* */ + if (str_idx > blk_idx) + str_cnt = str_idx - blk_idx; /* */ + else + str_cnt = str_idx; /* */ + H5TOOLS_DEBUG("... sset loop:%d with dim_cnt:%ld - str_cnt:%ld", j, dim_cnt, str_cnt); + j--; + } while (curr_idx >= elmnt_cnt && j >= 0); + curr_pos = curr_idx; /* New current position */ + H5TOOLS_DEBUG("pos loop:%d,%d with elmnt_cnt:%ld - curr_pos:%ld", i, j, elmnt_cnt, curr_pos); + } /* if (opts->sset[0] != NULL) */ + /* + * Calculate the number of elements represented by a unit change in a + * certain index position. + */ + calc_acc_pos(opts->rank, curr_pos, opts->acc, opts->pos); - if (rank > 0) { - parallel_print("[ "); - for (i = 0; i < rank; i++) { - parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); - parallel_print(" "); + for (i = 0; i < opts->rank; i++) { + H5TOOLS_DEBUG("pos loop:%d with opts->pos=%ld opts->sm_pos=%ld", i, opts->pos[i], opts->sm_pos[i]); + opts->pos[i] += (unsigned long) opts->sm_pos[i]; + H5TOOLS_DEBUG("pos loop:%d with opts->pos=%ld", i, opts->pos[i]); + parallel_print(HSIZE_T_FORMAT, (unsigned long long)opts->pos[i]); + parallel_print(" "); + } + parallel_print("]"); } - parallel_print("]"); - } - else - parallel_print(" "); -} - -/*------------------------------------------------------------------------- - * Function: print_char_pos - * - * Purpose: print character position in string - *------------------------------------------------------------------------- - */ -static -void print_char_pos(int *ph, /* print header */ - int pp, /* print percentage */ - hsize_t curr_pos, size_t u, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, - const char *obj1, const char *obj2) -{ - int i; - - /* print header */ - if (*ph == 1) { - *ph = 0; - - print_header(pp, rank, dims, obj1, obj2); - } /* end print header */ - - for (i = 0; i < rank; i++) { - pos[i] = curr_pos / acc[i]; - curr_pos -= acc[i] * pos[i]; - } - HDassert(curr_pos == 0); - - parallel_print("[ "); - if (rank > 0) { - for (i = 0; i < rank; i++) { - parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); - parallel_print(" "); + else { + if (u >= 0) { + parallel_print("[ "); + parallel_print("%zu", u); + parallel_print("]"); + } + else + parallel_print(" "); } - + parallel_print(SPACES); } - else - parallel_print("%zu", u); - parallel_print("]"); + H5TOOLS_ENDDEBUG(""); } /*------------------------------------------------------------------------- diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 5ad29fc..774859b 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -137,7 +137,7 @@ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *ta * Parameter: * table_out [OUT] : return the list *------------------------------------------------------------------------*/ -static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *opts) +static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *opts) { table_attrs_t *table_lp = NULL; H5O_info2_t oinfo1, oinfo2; /* Object info */ @@ -171,8 +171,8 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t * build the list */ while(curr1 < oinfo1.num_attrs && curr2 < oinfo2.num_attrs) { - H5TOOLS_DEBUG("build_match_list_attrs 1: %ld - %ld", curr1, oinfo1.num_attrs); - H5TOOLS_DEBUG("build_match_list_attrs 2: %ld - %ld", curr2, oinfo2.num_attrs); + H5TOOLS_DEBUG("list_attrs 1: %ld - %ld", curr1, oinfo1.num_attrs); + H5TOOLS_DEBUG("list_attrs 2: %ld - %ld", curr2, oinfo2.num_attrs); /*------------------ * open attribute1 */ @@ -226,7 +226,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t infile[0] = 1; infile[1] = 0; while(curr1 < oinfo1.num_attrs) { - H5TOOLS_DEBUG("build_match_list_attrs 1: %ld - %ld", curr1, oinfo1.num_attrs); + H5TOOLS_DEBUG("list_attrs 1: %ld - %ld", curr1, oinfo1.num_attrs); /*------------------ * open attribute1 */ @@ -235,7 +235,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /* get name */ if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_name first attribute failed"); - H5TOOLS_DEBUG("build_match_list_attrs #1 name - %s", name1); + H5TOOLS_DEBUG("list_attrs 1 name - %s", name1); table_attr_mark_exist(infile, name1, table_lp); table_lp->nattrs_only1++; @@ -250,7 +250,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t infile[0] = 0; infile[1] = 1; while(curr2 < oinfo2.num_attrs) { - H5TOOLS_DEBUG("build_match_list_attrs 2: %ld - %ld", curr2, oinfo2.num_attrs); + H5TOOLS_DEBUG("list_attrs 2: %ld - %ld", curr2, oinfo2.num_attrs); /*------------------ * open attribute2 */ if((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -258,7 +258,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /* get name */ if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_name second attribute failed"); - H5TOOLS_DEBUG("build_match_list_attrs #2 name - %s", name2); + H5TOOLS_DEBUG("list_attrs 2 name - %s", name2); table_attr_mark_exist(infile, name2, table_lp); table_lp->nattrs_only2++; @@ -272,7 +272,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /*------------------------------------------------------ * print the list */ - if(opts->m_verbose_level == 2) { + if(opts->mode_verbose_level == 2) { /* if '-v2' is detected */ parallel_print(" obj1 obj2\n"); parallel_print(" --------------------------------------\n"); @@ -284,7 +284,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t } /* end for */ } - if(opts->m_verbose_level >= 1) + if(opts->mode_verbose_level >= 1) parallel_print("Attributes status: %d common, %d only in obj1, %d only in obj2\n", table_lp->nattrs - table_lp->nattrs_only1 - table_lp->nattrs_only2, table_lp->nattrs_only1, table_lp->nattrs_only2); @@ -313,7 +313,8 @@ done: *------------------------------------------------------------------------- */ -hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *name2, const char *path1, const char *path2, diff_opt_t *opts) +hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, + const char *name1, const char *name2, const char *path1, const char *path2, diff_opt_t *opts) { hid_t space1_id = H5I_INVALID_HID; /* space ID */ hid_t space2_id = H5I_INVALID_HID; /* space ID */ @@ -327,19 +328,15 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const void *buf2 = NULL; /* data buffer */ hbool_t buf1hasdata = FALSE; /* buffer has data */ hbool_t buf2hasdata = FALSE; /* buffer has data */ - hsize_t nelmts1; /* number of elements in dataset */ int rank1; /* rank of dataset */ int rank2; /* rank of dataset */ hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */ hsize_t dims2[H5S_MAX_RANK]; /* dimensions of dataset */ - char np1[512]; - char np2[512]; hsize_t nfound = 0; int j; diff_err_t ret_value = opts->err_stat; H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); - /* get the datatypes */ if((ftype1_id = H5Aget_type(attr1_id)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_type first attribute failed"); @@ -383,11 +380,32 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const * check for comparable TYPE and SPACE *---------------------------------------------------------------------- */ - H5TOOLS_DEBUG("diff_attr_data check for comparable TYPE and SPACE"); + H5TOOLS_DEBUG("Check for comparable TYPE and SPACE"); + + H5TOOLS_DEBUG("attr_names: %s - %s", name1, name2); + if (name1) { + j = (int)HDstrlen(name1); + H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j); + if (j > 0) { + opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); + HDstrncpy(opts->obj_name[0], name1, (size_t)j); + opts->obj_name[0][j] = '\0'; + } + } + if (name2) { + j = (int)HDstrlen(name2); + H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j); + if (j > 0) { + opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); + HDstrncpy(opts->obj_name[1], name2, (size_t)j); + opts->obj_name[1][j] = '\0'; + } + } + H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); /* pass dims1 and dims2 for maxdims as well since attribute's maxdims * are always same */ - if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, dims1, dims2, name1, name2, opts, 0) == 1) { + if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, dims1, dims2, opts, 0) == 1) { /*----------------------------------------------------------------- * "upgrade" the smaller memory size *------------------------------------------------------------------ @@ -395,17 +413,26 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const if(FAIL == match_up_memsize(ftype1_id, ftype2_id, &mtype1_id, &mtype2_id, &msize1, &msize2)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "match_up_memsize failed"); - H5TOOLS_DEBUG("diff_attr_data read"); + H5TOOLS_DEBUG("initialize read"); /*--------------------------------------------------------------------- - * read + * initialize diff_opt_t structure for dimensions *---------------------------------------------------------------------- */ - nelmts1 = 1; - for(j = 0; j < rank1; j++) - nelmts1 *= dims1[j]; + opts->nelmts = 1; + for(j = 0; j < rank1; j++) { + opts->dims[j] = dims1[j]; + opts->nelmts *= dims1[j]; + } + opts->rank = rank1; + init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); - buf1 = (void *)HDcalloc((size_t)(nelmts1), msize1); - buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2); + /*--------------------------------------------------------------------- + * read + *---------------------------------------------------------------------- + */ + buf1 = (void *)HDcalloc((size_t)(opts->nelmts), msize1); + buf2 = (void *)HDcalloc((size_t)(opts->nelmts), msize2); + H5TOOLS_DEBUG("attr buffer size %ld * %ld", opts->nelmts, msize1); if(buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "buffer allocation failed"); @@ -416,6 +443,7 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const } else buf1hasdata = TRUE; + H5TOOLS_DEBUG("attr H5Aread 1"); if(H5Aread(attr2_id, mtype2_id, buf2) < 0) { parallel_print("Failed reading attribute2 %s\n", name2); @@ -423,49 +451,84 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const } else buf2hasdata = TRUE; + H5TOOLS_DEBUG("attr H5Aread 2"); /* format output string */ - HDsnprintf(np1, sizeof(np1), "%s of <%s>", name1, path1); - HDsnprintf(np2, sizeof(np1), "%s of <%s>", name2, path2); + if (opts->obj_name[0] != NULL) + HDfree(opts->obj_name[0]); + opts->obj_name[0] = NULL; + if (opts->obj_name[1] != NULL) + HDfree(opts->obj_name[1]); + opts->obj_name[1] = NULL; + + H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2); + if (name1) { + j = (int)HDstrlen(name1) + (int)HDstrlen(path1) + 7; + H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j); + if (j > 0) { + opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); + HDsnprintf(opts->obj_name[0], j, "%s of <%s>", name1, path1); + opts->obj_name[0][j] = '\0'; + } + } + if (name2) { + j = (int)HDstrlen(name2) + (int)HDstrlen(path2) + 7; + H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j); + if (j > 0) { + opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); + HDsnprintf(opts->obj_name[1], j, "%s of <%s>", name2, path2); + opts->obj_name[1][j] = '\0'; + } + } /*--------------------------------------------------------------------- * array compare *---------------------------------------------------------------------- */ - H5TOOLS_DEBUG("diff_attr_data array compare %s - %s", name1, name1); + H5TOOLS_DEBUG("array compare %s - %s", opts->obj_name[0], opts->obj_name[1]); + + opts->hs_nelmts = opts->nelmts; + opts->m_tid = mtype1_id; + + /* initialize the current stripmine position; this is necessary to print the array indices */ + for (j = 0; j < opts->rank; j++) + opts->sm_pos[j] = (hsize_t)0; /* always print name */ /* verbose (-v) and report (-r) mode */ - if(opts->m_verbose || opts->m_report) { - do_print_attrname("attribute", np1, np2); + if(opts->mode_verbose || opts->mode_report) { + do_print_attrname("attribute", opts->obj_name[0], opts->obj_name[1]); - nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); + nfound = diff_array(buf1, buf2, opts, attr1_id, attr2_id); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if(opts->m_quiet) { - nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); + else if(opts->mode_quiet) { + nfound = diff_array(buf1, buf2, opts, attr1_id, attr2_id); } /* the rest (-c, none, ...) */ else { - nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); + nfound = diff_array(buf1, buf2, opts, attr1_id, attr2_id); /* print info if compatible and difference found */ if (nfound) { - do_print_attrname("attribute", np1, np2); + do_print_attrname("attribute", opts->obj_name[0], opts->obj_name[1]); print_found(nfound); } /* end if */ } /* end else */ } - H5TOOLS_DEBUG("diff_attr_data check for comparable TYPE and SPACE complete nfound:%d - errstat:%d", nfound, opts->err_stat); + H5TOOLS_DEBUG("check for comparable TYPE and SPACE complete nfound:%d - errstat:%d", nfound, opts->err_stat); /*---------------------------------------------------------------------- * close *---------------------------------------------------------------------- */ + if (opts->obj_name[0] != NULL) + HDfree(opts->obj_name[0]); + opts->obj_name[0] = NULL; + if (opts->obj_name[1] != NULL) + HDfree(opts->obj_name[1]); + opts->obj_name[1] = NULL; /* Free buf1 and buf2, check both VLEN-data VLEN-string to reclaim any * VLEN memory first */ @@ -543,28 +606,32 @@ hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *p unsigned u; /* Local index variable */ hsize_t nfound = 0; hsize_t nfound_total = 0; + diff_opt_t attr_opts; diff_err_t ret_value = opts->err_stat; H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); + attr_opts = *opts; + attr_opts.obj_name[0] = NULL; + attr_opts.obj_name[1] = NULL; - if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, opts) < 0) { + if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, &attr_opts) < 0) { H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "build_match_list_attrs failed"); } - H5TOOLS_DEBUG("build_match_list_attrs - errstat:%d", opts->err_stat); + H5TOOLS_DEBUG("check match_list_attrs - opts->contents:%d - errstat:%d", attr_opts.contents, attr_opts.err_stat); /* if detect any unique extra attr */ if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) { - H5TOOLS_DEBUG("diff_attr attributes only in one file"); + H5TOOLS_DEBUG("attributes only in one file"); /* exit will be 1 */ - opts->contents = 0; + attr_opts.contents = 0; } - H5TOOLS_DEBUG("match_list_attrs info - errstat:%d", opts->err_stat); + H5TOOLS_DEBUG("match_list_attrs info - opts->contents:%d", attr_opts.contents); for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { - H5TOOLS_DEBUG("match_list_attrs loop[%d] - errstat:%d", u, opts->err_stat); + H5TOOLS_DEBUG("match_list_attrs loop[%d] - errstat:%d", u, attr_opts.err_stat); if((match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1])) { name1 = name2 = match_list_attrs->attrs[u].name; - H5TOOLS_DEBUG("diff_attr name - %s", name1); + H5TOOLS_DEBUG("name - %s", name1); /*-------------- * attribute 1 */ @@ -576,8 +643,8 @@ hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *p if((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aopen second attribute failed"); - H5TOOLS_DEBUG("diff_attr got attributes"); - nfound = diff_attr_data(attr1_id, attr2_id, name1, name2, path1, path2, opts); + H5TOOLS_DEBUG("got attributes"); + nfound = diff_attr_data(attr1_id, attr2_id, name1, name2, path1, path2, &attr_opts); if(H5Aclose(attr1_id) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_type first attribute failed"); if(H5Aclose(attr2_id) < 0) @@ -588,7 +655,10 @@ hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *p } /* u */ done: - opts->err_stat = opts->err_stat | ret_value; + opts->print_header = attr_opts.print_header; + opts->contents = attr_opts.contents; + opts->not_cmp = attr_opts.not_cmp; + opts->err_stat = attr_opts.err_stat | ret_value; H5E_BEGIN_TRY { table_attrs_free(match_list_attrs); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index cea20a8..602255e 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -27,7 +27,8 @@ * Return: Number of differences found *------------------------------------------------------------------------- */ -hsize_t diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, diff_opt_t *opts) +hsize_t +diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, diff_opt_t *opts) { int status = -1; hid_t did1 = H5I_INVALID_HID; @@ -35,9 +36,15 @@ hsize_t diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, cons hid_t dcpl1 = H5I_INVALID_HID; hid_t dcpl2 = H5I_INVALID_HID; hsize_t nfound = 0; + diff_opt_t diff_opts; diff_err_t ret_value = opts->err_stat; H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); + diff_opts = *opts; + diff_opts.obj_name[0] = NULL; + diff_opts.obj_name[1] = NULL; + + H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); /*------------------------------------------------------------------------- * open the handles *------------------------------------------------------------------------- @@ -64,20 +71,22 @@ hsize_t diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, cons * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - H5TOOLS_DEBUG("diff_dataset h5tools_canreadf then diff_datasetid"); - if ((status = h5tools_canreadf((opts->m_verbose ? obj1_name : NULL), dcpl1) == 1) && - (status = h5tools_canreadf((opts->m_verbose ? obj2_name : NULL), dcpl2) == 1)) - nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, opts); + H5TOOLS_DEBUG("h5tools_canreadf then diff_datasetid"); + if ((status = h5tools_canreadf((opts->mode_verbose ? obj1_name : NULL), dcpl1) == 1) && + (status = h5tools_canreadf((opts->mode_verbose ? obj2_name : NULL), dcpl2) == 1)) + nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, &diff_opts); else if (status < 0) { H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "h5tools_canreadf failed"); } else { ret_value = 1; - opts->not_cmp = 1; + diff_opts.not_cmp = 1; } done: - opts->err_stat = opts->err_stat | ret_value; + opts->print_header = diff_opts.print_header; + opts->not_cmp = diff_opts.not_cmp; + opts->err_stat = diff_opts.err_stat | ret_value; /* disable error reporting */ H5E_BEGIN_TRY { @@ -143,36 +152,31 @@ done: * *------------------------------------------------------------------------- */ -hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_name, diff_opt_t *opts) +hsize_t +diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_name, diff_opt_t *opts) { hid_t sid1 = H5I_INVALID_HID; hid_t sid2 = H5I_INVALID_HID; hid_t f_tid1 = H5I_INVALID_HID; hid_t f_tid2 = H5I_INVALID_HID; - hid_t dam_tid = H5I_INVALID_HID; /* m_tid for diff_array function */ hid_t m_tid1 = H5I_INVALID_HID; hid_t m_tid2 = H5I_INVALID_HID; hid_t dcpl1 = H5I_INVALID_HID; hid_t dcpl2 = H5I_INVALID_HID; H5D_layout_t stl1 = -1; H5D_layout_t stl2 = -1; - size_t dam_size; /* m_size for diff_array function */ size_t m_size1; size_t m_size2; H5T_sign_t sign1; H5T_sign_t sign2; int rank1; int rank2; - hsize_t danelmts; /* nelmts for diff_array function */ hsize_t nelmts1; hsize_t nelmts2; - hsize_t *dadims; /* dims for diff_array function */ hsize_t dims1[H5S_MAX_RANK]; hsize_t dims2[H5S_MAX_RANK]; hsize_t maxdim1[H5S_MAX_RANK]; hsize_t maxdim2[H5S_MAX_RANK]; - const char *name1 = NULL; /* relative names */ - const char *name2 = NULL; hsize_t storage_size1; hsize_t storage_size2; hsize_t nfound = 0; /* number of differences found */ @@ -181,9 +185,10 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char void *buf2 = NULL; void *sm_buf1 = NULL; void *sm_buf2 = NULL; - hid_t sm_space = H5I_INVALID_HID; /*stripmine data space */ + hid_t sm_space1 = H5I_INVALID_HID; /*stripmine data space */ + hid_t sm_space2 = H5I_INVALID_HID; /*stripmine data space */ size_t need; /* bytes needed for malloc */ - int i; + int i, j; unsigned int vl_data1 = 0; /*contains VL datatypes */ unsigned int vl_data2 = 0; /*contains VL datatypes */ diff_err_t ret_value = opts->err_stat; @@ -233,13 +238,15 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char */ if((dcpl1 = H5Dget_create_plist(did1)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dget_create_plist failed"); - if((dcpl2 = H5Dget_create_plist(did2)) < 0) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dget_create_plist failed"); - if((stl1 = H5Pget_layout(dcpl1)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Pget_layout failed"); + H5Pclose(dcpl1); + + if((dcpl2 = H5Dget_create_plist(did2)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dget_create_plist failed"); if((stl2 = H5Pget_layout(dcpl2)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Pget_layout failed"); + H5Pclose(dcpl2); /*------------------------------------------------------------------------- * check for empty datasets @@ -253,27 +260,48 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char if(storage_size1 == 0 || storage_size2 == 0) { if(stl1 == H5D_VIRTUAL || stl2 == H5D_VIRTUAL) { - if((opts->m_verbose||opts->m_list_not_cmp) && obj1_name && obj2_name) + if((opts->mode_verbose||opts->mode_list_not_cmp) && obj1_name && obj2_name) parallel_print("Warning: <%s> or <%s> is a virtual dataset\n", obj1_name, obj2_name); } else { - if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) + if((opts->mode_verbose || opts->mode_list_not_cmp) && obj1_name && obj2_name) parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name); can_compare = 0; opts->not_cmp = 1; } } + H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); + opts->obj_name[0] = NULL; + if (obj1_name) { + j = (int)HDstrlen(obj1_name); + H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j); + if (j > 0) { + opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); + HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j ); + opts->obj_name[0][j] = '\0'; + } + } + + + opts->obj_name[1] = NULL; + if (obj2_name) { + j = (int)HDstrlen(obj2_name); + H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j); + if (j > 0) { + opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); + HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j); + opts->obj_name[1][j] = '\0'; + } + } + /*------------------------------------------------------------------------- * check for comparable TYPE and SPACE *------------------------------------------------------------------------- */ - if (diff_can_type(f_tid1, f_tid2, rank1, rank2, - dims1, dims2, maxdim1, maxdim2, - obj1_name, obj2_name, - opts, 0) != 1) + if (diff_can_type(f_tid1, f_tid2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, opts, 0) != 1) can_compare = 0; - H5TOOLS_DEBUG("diff_can_type - errstat:%d", opts->err_stat); + H5TOOLS_DEBUG("diff_can_type returned errstat:%d", opts->err_stat); /*------------------------------------------------------------------------- * memory type and sizes @@ -312,7 +340,7 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char sign2 = H5Tget_sign(m_tid2); if(sign1 != sign2) { H5TOOLS_DEBUG("sign1 != sign2"); - if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->mode_verbose || opts->mode_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } @@ -360,41 +388,56 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *------------------------------------------------------------------ */ H5TOOLS_DEBUG("NOT H5T_ARRAY, upgrade the smaller memory size?"); - if (FAIL == match_up_memsize (f_tid1, f_tid2, - &m_tid1, &m_tid2, - &m_size1, &m_size2)) + if (FAIL == match_up_memsize (f_tid1, f_tid2, &m_tid1, &m_tid2, &m_size1, &m_size2)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "match_up_memsize failed"); H5TOOLS_DEBUG("m_size: %ld - %ld", m_size1, m_size2); - dadims = dims1; - dam_size = m_size1; - dam_tid = m_tid1; - danelmts = nelmts1; + opts->rank = rank1; + for(i = 0; i < rank1; i++) + opts->dims[i] = dims1[i]; + opts->m_size = m_size1; + opts->m_tid = m_tid1; + opts->nelmts = nelmts1; need = (size_t)(nelmts1 * m_size1); /* bytes needed */ } else { H5TOOLS_DEBUG("Array dims: %d - %d", dims1[0], dims2[0]); /* Compare the smallest array, but create the largest buffer */ if(m_size1 <= m_size2) { - dadims = dims1; - dam_size = m_size1; - dam_tid = m_tid1; - danelmts = nelmts1; + opts->rank = rank1; + for(i = 0; i < rank1; i++) + opts->dims[i] = dims1[i]; + opts->m_size = m_size1; + opts->m_tid = m_tid1; + opts->nelmts = nelmts1; need = (size_t)(nelmts2 * m_size2); /* bytes needed */ } else { - dadims = dims2; - dam_size = m_size2; - dam_tid = m_tid2; - danelmts = nelmts2; + opts->rank = rank2; + for(i = 0; i < rank2; i++) + opts->dims[i] = dims2[i]; + opts->m_size = m_size2; + opts->m_tid = m_tid2; + opts->nelmts = nelmts2; need = (size_t)(nelmts1 * m_size1); /* bytes needed */ } } + opts->hs_nelmts = opts->nelmts; + H5TOOLS_DEBUG("need: %ld", need); /* print names */ + H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); + + if (opts->obj_name[0] != NULL) + HDfree(opts->obj_name[0]); + opts->obj_name[0] = NULL; + if (opts->obj_name[1] != NULL) + HDfree(opts->obj_name[1]); + opts->obj_name[1] = NULL; + if(obj1_name) - name1 = diff_basename(obj1_name); + opts->obj_name[0] = HDstrdup(diff_basename(obj1_name)); if(obj2_name) - name2 = diff_basename(obj2_name); - H5TOOLS_DEBUG("obj_names: %s - %s", name1, name2); + opts->obj_name[1] = HDstrdup(diff_basename(obj2_name)); + H5TOOLS_DEBUG("obj_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); H5TOOLS_DEBUG("read/compare"); @@ -407,7 +450,14 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char buf2 = HDmalloc(need); } /* end if */ - if(buf1 != NULL && buf2 != NULL) { + /* Assume entire data space to be printed */ + init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + + for(i = 0; i < opts->rank; i++) { + opts->p_max_idx[i] = opts->dims[i]; + } + + if(buf1 != NULL && buf2 != NULL && opts->sset[0] == NULL && opts->sset[1] == NULL) { H5TOOLS_DEBUG("buf1 != NULL && buf2 != NULL"); H5TOOLS_DEBUG("H5Dread did1"); if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0) @@ -416,10 +466,13 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dread failed"); + /* initialize the current stripmine position; this is necessary to print the array indices */ + for (j = 0; j < opts->rank; j++) + opts->sm_pos[j] = (hsize_t)0; + /* array diff */ - nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, - opts, name1, name2, dam_tid, did1, did2); - H5TOOLS_DEBUG("diff_array nfound:%d - errstat:%d", nfound, opts->err_stat); + nfound = diff_array(buf1, buf2, opts, did1, did2); + H5TOOLS_DEBUG("diff_array ret nfound:%d - errstat:%d", nfound, opts->err_stat); /* reclaim any VL memory, if necessary */ H5TOOLS_DEBUG("check vl_data1:%d", vl_data1); @@ -438,111 +491,369 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char } } /* end if */ else { /* possibly not enough memory, read/compare by hyperslabs */ - size_t p_type_nbytes = dam_size; /*size of memory type */ - hsize_t p_nelmts = danelmts; /*total selected elmts */ - hsize_t elmtno; /*counter */ - int carry; /*counter carry value */ + hsize_t elmtno; /* counter */ + int carry; /* counter carry value */ /* stripmine info */ - hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ - hsize_t sm_nbytes; /*bytes per stripmine */ - hsize_t sm_nelmts; /*elements per stripmine*/ + hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ + hsize_t sm_block[H5S_MAX_RANK]; /* stripmine block size */ + hsize_t sm_nbytes; /* bytes per stripmine */ + hsize_t sm_nelmts1; /* elements per stripmine */ + hsize_t sm_nelmts2; /* elements per stripmine */ + hssize_t ssm_nelmts; /* elements temp */ /* hyperslab info */ - hsize_t hs_offset[H5S_MAX_RANK]; /*starting offset */ - hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */ - hsize_t hs_nelmts; /*elements in request */ - hsize_t zero[8]; /*vector of zeros */ + hsize_t hs_offset1[H5S_MAX_RANK]; /* starting offset */ + hsize_t hs_count1[H5S_MAX_RANK]; /* number of blocks */ + hsize_t hs_block1[H5S_MAX_RANK]; /* size of blocks */ + hsize_t hs_stride1[H5S_MAX_RANK]; /* stride */ + hsize_t hs_size1[H5S_MAX_RANK]; /* size this pass */ + hsize_t hs_offset2[H5S_MAX_RANK]; /* starting offset */ + hsize_t hs_count2[H5S_MAX_RANK]; /* number of blocks */ + hsize_t hs_block2[H5S_MAX_RANK]; /* size of blocks */ + hsize_t hs_stride2[H5S_MAX_RANK]; /* stride */ + hsize_t hs_size2[H5S_MAX_RANK]; /* size this pass */ + hsize_t hs_nelmts1 = 0; /* elements in request */ + hsize_t hs_nelmts2 = 0; /* elements in request */ + hsize_t zero[8]; /* vector of zeros */ + hsize_t low[H5S_MAX_RANK]; /* low bound of hyperslab */ + hsize_t high[H5S_MAX_RANK]; /* higher bound of hyperslab */ + + H5TOOLS_DEBUG("reclaim any VL memory and free unused buffers"); + if(buf1 != NULL) { + /* reclaim any VL memory, if necessary */ + if(vl_data1) + H5Treclaim(m_tid1, sid1, H5P_DEFAULT, buf1); + HDfree(buf1); + buf1 = NULL; + } + if(buf2 != NULL) { + /* reclaim any VL memory, if necessary */ + if(vl_data2) + H5Treclaim(m_tid2, sid2, H5P_DEFAULT, buf2); + HDfree(buf2); + buf2 = NULL; + } + + /* the stripmine loop */ + HDmemset(hs_offset1, 0, sizeof hs_offset1); + HDmemset(hs_stride1, 0, sizeof hs_stride1); + HDmemset(hs_count1, 0, sizeof hs_count1); + HDmemset(hs_block1, 0, sizeof hs_block1); + HDmemset(hs_size1, 0, sizeof hs_size1); + HDmemset(hs_offset2, 0, sizeof hs_offset2); + HDmemset(hs_stride2, 0, sizeof hs_stride2); + HDmemset(hs_count2, 0, sizeof hs_count2); + HDmemset(hs_block2, 0, sizeof hs_block2); + HDmemset(hs_size2, 0, sizeof hs_size2); + HDmemset(zero, 0, sizeof zero); + + /* if subsetting was requested - initialize the subsetting variables */ + H5TOOLS_DEBUG("compare by hyperslabs: opts->nelmts=%ld - opts->m_size=%ld", opts->nelmts, opts->m_size); + if (opts->sset[0] != NULL) { + H5TOOLS_DEBUG("opts->sset[0] != NULL"); + + /* Check for valid settings - default if not specified */ + if(!opts->sset[0]->start.data || !opts->sset[0]->stride.data || !opts->sset[0]->count.data || !opts->sset[0]->block.data) { + /* they didn't specify a ``stride'' or ``block''. default to 1 in all + * dimensions */ + if(!opts->sset[0]->start.data) { + /* default to (0, 0, ...) for the start coord */ + opts->sset[0]->start.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->start.len = (unsigned)rank1; + } + + if(!opts->sset[0]->stride.data) { + opts->sset[0]->stride.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->stride.len = (unsigned)rank1; + for (i = 0; i < rank1; i++) + opts->sset[0]->stride.data[i] = 1; + } + + if(!opts->sset[0]->count.data) { + opts->sset[0]->count.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->count.len = (unsigned)rank1; + for (i = 0; i < rank1; i++) + opts->sset[0]->count.data[i] = 1; + } + + if(!opts->sset[0]->block.data) { + opts->sset[0]->block.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->block.len = (unsigned)rank1; + for (i = 0; i < rank1; i++) + opts->sset[0]->block.data[i] = 1; + } + + /*------------------------------------------------------------------------- + * check for block overlap + *------------------------------------------------------------------------- + */ + for(i = 0; i < rank1; i++) { + if(opts->sset[0]->count.data[i] > 1) { + if(opts->sset[0]->stride.data[i] < opts->sset[0]->block.data[i]) { + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "wrong subset selection[0]; blocks overlap"); + } /* end if */ + } /* end if */ + } /* end for */ + } + + /* Reset the total number of elements to the subset from the command */ + opts->nelmts = 1; + for (i = 0; i < rank1; i++) { + hs_offset1[i] = opts->sset[0]->start.data[i]; + hs_stride1[i] = opts->sset[0]->stride.data[i]; + hs_count1[i] = opts->sset[0]->count.data[i]; + hs_block1[i] = opts->sset[0]->block.data[i]; + opts->nelmts *= hs_count1[i] * hs_block1[i]; + hs_size1[i] = 0; + H5TOOLS_DEBUG("[%d]hs_offset1:%ld, hs_stride1:%ld, hs_count1:%ld, hs_block1:%ld", i, hs_offset1[i], hs_stride1[i], hs_count1[i], hs_block1[i]); + } + } + if (opts->sset[1] != NULL) { + H5TOOLS_DEBUG("opts->sset[1] != NULL"); + + /* Check for valid settings - default if not specified */ + if(!opts->sset[1]->start.data || !opts->sset[1]->stride.data || !opts->sset[1]->count.data || !opts->sset[1]->block.data) { + /* they didn't specify a ``stride'' or ``block''. default to 1 in all + * dimensions */ + if(!opts->sset[1]->start.data) { + /* default to (0, 0, ...) for the start coord */ + opts->sset[1]->start.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->start.len = (unsigned)rank2; + } + + if(!opts->sset[1]->stride.data) { + opts->sset[1]->stride.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->stride.len = (unsigned)rank2; + for (i = 0; i < rank2; i++) + opts->sset[1]->stride.data[i] = 1; + } + + if(!opts->sset[1]->count.data) { + opts->sset[1]->count.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->count.len = (unsigned)rank2; + for (i = 0; i < rank2; i++) + opts->sset[1]->count.data[i] = 1; + } + + if(!opts->sset[1]->block.data) { + opts->sset[1]->block.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->block.len = (unsigned)rank2; + for (i = 0; i < rank2; i++) + opts->sset[1]->block.data[i] = 1; + } + + /*------------------------------------------------------------------------- + * check for block overlap + *------------------------------------------------------------------------- + */ + for(i = 0; i < rank2; i++) { + if(opts->sset[1]->count.data[i] > 1) { + if(opts->sset[1]->stride.data[i] < opts->sset[1]->block.data[i]) { + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "wrong subset selection[1]; blocks overlap"); + } /* end if */ + } /* end if */ + } /* end for */ + } + + for (i = 0; i < rank2; i++) { + hs_offset2[i] = opts->sset[1]->start.data[i]; + hs_stride2[i] = opts->sset[1]->stride.data[i]; + hs_count2[i] = opts->sset[1]->count.data[i]; + hs_block2[i] = opts->sset[1]->block.data[i]; + hs_size2[i] = 0; + H5TOOLS_DEBUG("[%d]hs_offset2:%ld, hs_stride2:%ld, hs_count2:%ld, hs_block2:%ld", i, hs_offset2[i], hs_stride2[i], hs_count2[i], hs_block2[i]); + } + } /* * determine the strip mine size and allocate a buffer. The strip mine is * a hyperslab whose size is manageable. */ - sm_nbytes = p_type_nbytes; - - for(i = rank1; i > 0; --i) { - hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - - if(size == 0) /* datum size > H5TOOLS_BUFSIZE */ - size = 1; - sm_size[i - 1] = MIN(dadims[i - 1], size); - sm_nbytes *= sm_size[i - 1]; - H5TOOLS_DEBUG("sm_nbytes: %ld", sm_nbytes); - } /* end for */ - - /* malloc return code should be verified. - * If fail, need to handle the error. - * This else branch should be recoded as a separate function. - * Note that there are many "goto error" within this branch - * that fails to address freeing other objects created here. - * E.g., sm_space. - */ - if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "HDmalloc failed"); - if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "HDmalloc failed"); + sm_nbytes = opts->m_size; + if(opts->rank > 0) { + for (i = opts->rank; i > 0; --i) { + hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; + if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ + size = 1; + H5TOOLS_DEBUG("opts->dims[%d]: %ld - size: %ld", i - 1, opts->dims[i - 1], size); + if (opts->sset[1] != NULL) { + sm_size[i - 1] = MIN(hs_block1[i - 1] * hs_count1[i - 1], size); + sm_block[i - 1] = MIN(hs_block1[i - 1], sm_size[i - 1]); + } + else { + sm_size[i - 1] = MIN(opts->dims[i - 1], size); + sm_block[i - 1] = sm_size[i - 1]; + } + H5TOOLS_DEBUG("sm_size[%d]: %ld - sm_block:%ld", i - 1, sm_size[i - 1], sm_block[i - 1]); + sm_nbytes *= sm_size[i - 1]; + H5TOOLS_DEBUG("sm_nbytes: %ld", sm_nbytes); + } + } - sm_nelmts = sm_nbytes / p_type_nbytes; - sm_space = H5Screate_simple(1, &sm_nelmts, NULL); + H5TOOLS_DEBUG("opts->nelmts: %ld", opts->nelmts); + for(elmtno = 0; elmtno < opts->nelmts; elmtno += opts->hs_nelmts) { + H5TOOLS_DEBUG("elmtno: %ld - hs_nelmts1: %ld", elmtno, hs_nelmts1); - /* the stripmine loop */ - HDmemset(hs_offset, 0, sizeof hs_offset); - HDmemset(zero, 0, sizeof zero); + if(NULL == (sm_buf1 = (unsigned char *)HDmalloc((size_t) sm_nbytes))) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not allocate buffer for strip-mine"); + if(NULL == (sm_buf2 = (unsigned char *)HDmalloc((size_t) sm_nbytes))) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not allocate buffer for strip-mine"); - for(elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { /* calculate the hyperslab size */ - if(rank1 > 0) { - for(i = 0, hs_nelmts = 1; i < rank1; i++) { - hs_size[i] = MIN(dadims[i] - hs_offset[i], sm_size[i]); - hs_nelmts *= hs_size[i]; - } /* end for */ - if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab failed"); - if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) + /* initialize subset */ + if(opts->rank > 0) { + if (opts->sset[0] != NULL) { + H5TOOLS_DEBUG("sset1 has data"); + /* calculate the potential number of elements */ + for(i = 0; i < rank1; i++) { + H5TOOLS_DEBUG("[%d]opts->dims: %ld - hs_offset1: %ld - sm_block: %ld", i, opts->dims[i], hs_offset1[i], sm_block[i]); + hs_size1[i] = MIN(opts->dims[i] - hs_offset1[i], sm_block[i]); + H5TOOLS_DEBUG("hs_size1[%d]: %ld", i, hs_size1[i]); + } + if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset1, hs_stride1, hs_count1, hs_size1) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab sid1 failed"); + } + else { + for(i = 0, hs_nelmts1 = 1; i < rank1; i++) { + H5TOOLS_DEBUG("[%d]opts->dims: %ld - hs_offset1: %ld - sm_block: %ld", i, opts->dims[i], hs_offset1[i], sm_block[i]); + hs_size1[i] = MIN(opts->dims[i] - hs_offset1[i], sm_block[i]); + H5TOOLS_DEBUG("hs_size1[%d]: %ld", i, hs_size1[i]); + hs_nelmts1 *= hs_size1[i]; + H5TOOLS_DEBUG("hs_nelmts1:%ld *= hs_size1[%d]: %ld", hs_nelmts1, i, hs_size1[i]); + } + if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset1, NULL, hs_size1, NULL) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab sid1 failed"); + } + + if((ssm_nelmts = H5Sget_select_npoints(sid1)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sget_select_npoints failed"); + sm_nelmts1 = (hsize_t)ssm_nelmts; + H5TOOLS_DEBUG("sm_nelmts1: %ld", sm_nelmts1); + hs_nelmts1 = sm_nelmts1; + + if((sm_space1 = H5Screate_simple(1, &sm_nelmts1, NULL)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Screate_simple failed"); + + if(H5Sselect_hyperslab(sm_space1, H5S_SELECT_SET, zero, NULL, &sm_nelmts1, NULL) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab failed"); - if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) + + if (opts->sset[1] != NULL) { + H5TOOLS_DEBUG("sset2 has data"); + for(i = 0; i < rank2; i++) { + H5TOOLS_DEBUG("[%d]opts->dims: %ld - hs_offset2: %ld - sm_block: %ld", i, opts->dims[i], hs_offset2[i], sm_block[i]); + hs_size2[i] = MIN(opts->dims[i] - hs_offset2[i], sm_block[i]); + H5TOOLS_DEBUG("hs_size2[%d]: %ld", i, hs_size2[i]); + } + if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset2, hs_stride2, hs_count2, hs_size2) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab sid2 failed"); + } + else { + for(i = 0, hs_nelmts2 = 1; i < rank2; i++) { + H5TOOLS_DEBUG("[%d]opts->dims: %ld - hs_offset2: %ld - sm_block: %ld", i, opts->dims[i], hs_offset2[i], sm_block[i]); + hs_size2[i] = MIN(opts->dims[i] - hs_offset2[i], sm_block[i]); + H5TOOLS_DEBUG("hs_size2[%d]: %ld", i, hs_size2[i]); + hs_nelmts2 *= hs_size2[i]; + H5TOOLS_DEBUG("hs_nelmts2:%ld *= hs_size2[%d]: %ld", hs_nelmts2, i, hs_size2[i]); + } + if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset2, NULL, hs_size2, NULL) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab sid2 failed"); + } + + if((ssm_nelmts = H5Sget_select_npoints(sid2)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sget_select_npoints failed"); + sm_nelmts2 = (hsize_t)ssm_nelmts; + H5TOOLS_DEBUG("sm_nelmts2: %ld", sm_nelmts2); + hs_nelmts2 = sm_nelmts2; + + if((sm_space2 = H5Screate_simple(1, &sm_nelmts2, NULL)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Screate_simple failed"); + + if(H5Sselect_hyperslab(sm_space2, H5S_SELECT_SET, zero, NULL, &sm_nelmts2, NULL) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab failed"); - } /* end if */ + } else - hs_nelmts = 1; + hs_nelmts1 = 1; + opts->hs_nelmts = hs_nelmts1; + H5TOOLS_DEBUG("hs_nelmts: %ld", opts->hs_nelmts); - if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0) + /* read the data */ + if(H5Dread(did1, m_tid1, sm_space1, sid1, H5P_DEFAULT, sm_buf1) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dread failed"); - if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0) + if(H5Dread(did2, m_tid2, sm_space2, sid2, H5P_DEFAULT, sm_buf2) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dread failed"); + /* print array indices. get the lower bound of the hyperslab and calculate + the element position at the start of hyperslab */ + if(H5Sget_select_bounds(sid1, low, high) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sget_select_bounds failed"); + /* initialize the current stripmine position; this is necessary to print the array indices */ + for (j = 0; j < opts->rank; j++) + opts->sm_pos[j] = low[j]; + + /* Assume entire data space to be printed */ + init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ - nfound += diff_array(sm_buf1, sm_buf2, hs_nelmts, elmtno, rank1, - dadims, opts, name1, name2, dam_tid, did1, did2); - - /* reclaim any VL memory, if necessary */ - if(vl_data1) - H5Treclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); - if(vl_data2) - H5Treclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2); + nfound += diff_array(sm_buf1, sm_buf2, opts, did1, did2); + + if(sm_buf1 != NULL) { + /* reclaim any VL memory, if necessary */ + if(vl_data1) + H5Treclaim(m_tid1, sm_space1, H5P_DEFAULT, sm_buf1); + HDfree(sm_buf1); + sm_buf1 = NULL; + } + if(sm_buf2 != NULL) { + /* reclaim any VL memory, if necessary */ + if(vl_data2) + H5Treclaim(m_tid2, sm_space2, H5P_DEFAULT, sm_buf2); + HDfree(sm_buf2); + sm_buf2 = NULL; + } + + H5Sclose(sm_space1); + H5Sclose(sm_space2); /* calculate the next hyperslab offset */ - for(i = rank1, carry = 1; i > 0 && carry; --i) { - hs_offset[i - 1] += hs_size[i - 1]; - if(hs_offset[i - 1] == dadims[i - 1]) - hs_offset[i - 1] = 0; + for(i = opts->rank, carry = 1; i > 0 && carry; --i) { + if (opts->sset[0] != NULL) { + H5TOOLS_DEBUG("[%d]hs_size1:%ld - hs_block1:%ld - hs_stride1:%ld", i-1, hs_size1[i-1], hs_block1[i - 1], hs_stride1[i - 1]); + if(hs_size1[i - 1] >= hs_block1[i - 1]) { + hs_offset1[i - 1] += hs_size1[i - 1]; + } + else { + hs_offset1[i - 1] += hs_stride1[i - 1]; + } + } + else + hs_offset1[i - 1] += hs_size1[i - 1]; + H5TOOLS_DEBUG("[%d]hs_offset1:%ld - opts->dims:%ld", i-1, hs_offset1[i-1], opts->dims[i - 1]); + if(hs_offset1[i - 1] >= opts->dims[i - 1]) + hs_offset1[i - 1] = 0; else carry = 0; - } /* i */ - } /* elmtno */ - if(sm_buf1 != NULL) { - HDfree(sm_buf1); - sm_buf1 = NULL; - } - if(sm_buf2 != NULL) { - HDfree(sm_buf2); - sm_buf2 = NULL; - } - - H5Sclose(sm_space); + H5TOOLS_DEBUG("[%d]hs_offset1:%ld", i-1, hs_offset1[i-1]); + if (opts->sset[1] != NULL) { + H5TOOLS_DEBUG("[%d]hs_size2:%ld - hs_block2:%ld - hs_stride2:%ld", i-1, hs_size2[i-1], hs_block2[i - 1], hs_stride2[i - 1]); + if(hs_size2[i - 1] >= hs_block2[i - 1]) { + hs_offset2[i - 1] += hs_size2[i - 1]; + } + else { + hs_offset2[i - 1] += hs_stride2[i - 1]; + } + } + else + hs_offset2[i - 1] += hs_size2[i - 1]; + H5TOOLS_DEBUG("[%d]hs_offset2:%ld - opts->dims:%ld", i-1, hs_offset2[i-1], opts->dims[i - 1]); + if(hs_offset2[i - 1] >= opts->dims[i - 1]) + hs_offset2[i - 1] = 0; + H5TOOLS_DEBUG("[%d]hs_offset2:%ld", i-1, hs_offset2[i-1]); + } + } /* elmtno for loop */ } /* hyperslab read */ - H5TOOLS_DEBUG("can_compare complete"); + H5TOOLS_DEBUG("can compare complete"); } /*can_compare*/ @@ -550,12 +861,20 @@ hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char * close *------------------------------------------------------------------------- */ - H5TOOLS_DEBUG("reclaim any VL memory - errstat:%d", opts->err_stat); done: opts->err_stat = opts->err_stat | ret_value; + H5TOOLS_DEBUG("free names - errstat:%d", opts->err_stat); /* free */ + if (opts->obj_name[0] != NULL) + HDfree(opts->obj_name[0]); + opts->obj_name[0] = NULL; + if (opts->obj_name[1] != NULL) + HDfree(opts->obj_name[1]); + opts->obj_name[1] = NULL; + + H5TOOLS_DEBUG("reclaim any VL memory"); if(buf1 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data1) @@ -570,26 +889,31 @@ done: HDfree(buf2); buf2 = NULL; } + H5TOOLS_DEBUG("reclaim any stripmine VL memory"); if(sm_buf1 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data1) - H5Treclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); + H5Treclaim(m_tid1, sm_space1, H5P_DEFAULT, sm_buf1); HDfree(sm_buf1); sm_buf1 = NULL; } if(sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ if(vl_data2) - H5Treclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2); + H5Treclaim(m_tid2, sm_space2, H5P_DEFAULT, sm_buf2); HDfree(sm_buf2); sm_buf2 = NULL; } + H5TOOLS_DEBUG("close ids"); /* disable error reporting */ H5E_BEGIN_TRY { H5Sclose(sid1); H5Sclose(sid2); - H5Sclose(sm_space); + H5Sclose(sm_space1); + H5Sclose(sm_space2); + H5Pclose(dcpl1); + H5Pclose(dcpl2); H5Tclose(f_tid1); H5Tclose(f_tid2); H5Tclose(m_tid1); @@ -613,10 +937,9 @@ done: *------------------------------------------------------------------------- */ -int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, - hsize_t *dims1, hsize_t *dims2, hsize_t *maxdim1, hsize_t *maxdim2, - const char *obj1_name, const char *obj2_name, - diff_opt_t *opts, int is_compound) +int +diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, hsize_t *dims2, + hsize_t *maxdim1, hsize_t *maxdim2, diff_opt_t *opts, int is_compound) { H5T_class_t tclass1; H5T_class_t tclass2; @@ -635,19 +958,21 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, if((tclass2 = H5Tget_class(f_tid2)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_class second object failed"); + H5TOOLS_DEBUG("obj_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); if(tclass1 != tclass2) { - if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { if(is_compound) { parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2)); + opts->obj_name[0], get_class(tclass1), + opts->obj_name[1], get_class(tclass2)); } else { parallel_print("Not comparable: <%s> is of class %s and <%s> is of class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2)); + opts->obj_name[0], get_class(tclass1), + opts->obj_name[1], get_class(tclass2)); } } + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -658,10 +983,11 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, */ switch (tclass1) { case H5T_TIME: - if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { parallel_print("Not comparable: <%s> and <%s> are of class %s\n", - obj1_name, obj2_name, get_class(tclass2)); + opts->obj_name[0], opts->obj_name[1], get_class(tclass2)); } /* end if */ + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); break; @@ -679,7 +1005,7 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, case H5T_NO_CLASS: case H5T_NCLASSES: default: - H5TOOLS_DEBUG("diff_can_type class - %s", get_class(tclass1)); + H5TOOLS_DEBUG("class - %s", get_class(tclass1)); break; } /* end switch */ @@ -687,15 +1013,15 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, * check for equal file datatype; warning only *------------------------------------------------------------------------- */ - if((H5Tequal(f_tid1, f_tid2) == 0) && (opts->m_verbose) && obj1_name && obj2_name) { + if((H5Tequal(f_tid1, f_tid2) == 0) && (opts->mode_verbose) && opts->obj_name[0] && opts->obj_name[1]) { H5T_class_t cl = H5Tget_class(f_tid1); parallel_print("Warning: different storage datatype\n"); if(cl == H5T_INTEGER || cl == H5T_FLOAT) { - parallel_print("<%s> has file datatype ", obj1_name); + parallel_print("<%s> has file datatype ", opts->obj_name[0]); print_type(f_tid1); parallel_print("\n"); - parallel_print("<%s> has file datatype ", obj2_name); + parallel_print("<%s> has file datatype ", opts->obj_name[1]); print_type(f_tid2); parallel_print("\n"); } @@ -706,18 +1032,19 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, *------------------------------------------------------------------------- */ if(rank1 != rank2) { - if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); + if((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { + parallel_print("Not comparable: <%s> has rank %d, dimensions ", opts->obj_name[0], rank1); print_dimensions(rank1, dims1); parallel_print(", max dimensions "); print_dimensions(rank1, maxdim1); parallel_print("\n" ); - parallel_print("and <%s> has rank %d, dimensions ", obj2_name, rank2); + parallel_print("and <%s> has rank %d, dimensions ", opts->obj_name[1], rank2); print_dimensions(rank2, dims2); parallel_print(", max dimensions "); print_dimensions(rank2, maxdim2); parallel_print("\n"); } + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -740,20 +1067,21 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, *------------------------------------------------------------------------- */ if(dim_diff == 1) { - if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); + if((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { + parallel_print("Not comparable: <%s> has rank %d, dimensions ", opts->obj_name[0], rank1); print_dimensions(rank1, dims1); if(maxdim1 && maxdim2) { parallel_print(", max dimensions "); print_dimensions(rank1, maxdim1); parallel_print("\n" ); - parallel_print("and <%s> has rank %d, dimensions ", obj2_name, rank2); + parallel_print("and <%s> has rank %d, dimensions ", opts->obj_name[1], rank2); print_dimensions(rank2, dims2); parallel_print(", max dimensions "); print_dimensions(rank2, maxdim2); parallel_print("\n"); } } + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -762,13 +1090,13 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, * maximum dimensions; just give a warning *------------------------------------------------------------------------- */ - if(maxdim1 && maxdim2 && maxdim_diff == 1 && obj1_name) { - if(opts->m_verbose) { + if(maxdim1 && maxdim2 && maxdim_diff == 1 && opts->obj_name[0]) { + if(opts->mode_verbose) { parallel_print( "Warning: different maximum dimensions\n"); - parallel_print("<%s> has max dimensions ", obj1_name); + parallel_print("<%s> has max dimensions ", opts->obj_name[0]); print_dimensions(rank1, maxdim1); parallel_print("\n"); - parallel_print("<%s> has max dimensions ", obj2_name); + parallel_print("<%s> has max dimensions ", opts->obj_name[1]); print_dimensions(rank2, maxdim2); parallel_print("\n"); } @@ -777,16 +1105,17 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, if(tclass1 == H5T_STRING) { htri_t vstrtype1 = -1; htri_t vstrtype2 = -1; - H5TOOLS_DEBUG("diff_can_type end - H5T_STRING"); + H5TOOLS_DEBUG(" - H5T_STRING"); vstrtype1 = H5Tis_variable_str(f_tid1); vstrtype2 = H5Tis_variable_str(f_tid2); /* no compare if either one but not both are variable string type */ if (vstrtype1 != vstrtype2) { - if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) + if((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) parallel_print("Not comparable: <%s> or <%s> is of mixed string type\n", - obj1_name, obj2_name); + opts->obj_name[0], opts->obj_name[1]); + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -798,17 +1127,18 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, int j; hid_t memb_type1 = H5I_INVALID_HID; hid_t memb_type2 = H5I_INVALID_HID; - H5TOOLS_DEBUG("diff_can_type end - H5T_COMPOUND"); + H5TOOLS_DEBUG(" - H5T_COMPOUND"); nmembs1 = H5Tget_nmembers(f_tid1); nmembs2 = H5Tget_nmembers(f_tid2); if(nmembs1 != nmembs2) { - if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("Not comparable: <%s> has %d members ", obj1_name, nmembs1); - parallel_print("<%s> has %d members ", obj2_name, nmembs2); + if((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { + parallel_print("Not comparable: <%s> has %d members ", opts->obj_name[0], nmembs1); + parallel_print("<%s> has %d members ", opts->obj_name[1], nmembs2); parallel_print("\n"); } + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -817,9 +1147,7 @@ int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, memb_type1 = H5Tget_member_type(f_tid1, (unsigned)j); memb_type2 = H5Tget_member_type(f_tid2, (unsigned)j); - if (diff_can_type(memb_type1, memb_type2, rank1, rank2, - dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, - opts, 1) != 1) { + if (diff_can_type(memb_type1, memb_type2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, opts, 1) != 1) { opts->not_cmp = 1; H5Tclose(memb_type1); H5Tclose(memb_type2); @@ -838,19 +1166,17 @@ done: } +#if defined (H5DIFF_DEBUG_UNUSED) +/* this function is not currently used, but could be useful */ /*------------------------------------------------------------------------- * Function: print_sizes * * Purpose: Print datatype sizes *------------------------------------------------------------------------- */ -#if defined (H5DIFF_DEBUG) -void print_sizes( const char *obj1, - const char *obj2, - hid_t f_tid1, - hid_t f_tid2, - hid_t m_tid1, - hid_t m_tid2 ) +void print_sizes( const char *obj1, const char *obj2, hid_t f_tid1, hid_t f_tid2, hid_t m_tid1, hid_t m_tid2); + +void print_sizes( const char *obj1, const char *obj2, hid_t f_tid1, hid_t f_tid2, hid_t m_tid1, hid_t m_tid2) { size_t f_size1, f_size2; /* size of type in file */ size_t m_size1, m_size2; /* size of type in memory */ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index cc51e2c..d9c6715 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -29,28 +29,37 @@ int H5tools_INDENT_g = 0; /* global variables */ +H5E_auto2_t lib_func; +H5E_auto2_t tools_func; +void *lib_edata; +void *tools_edata; + hid_t H5tools_ERR_STACK_g = H5I_INVALID_HID; hid_t H5tools_ERR_CLS_g = H5I_INVALID_HID; hid_t H5E_tools_g = H5I_INVALID_HID; hid_t H5E_tools_min_id_g = H5I_INVALID_HID; hid_t H5E_tools_min_info_id_g = H5I_INVALID_HID; hid_t H5E_tools_min_dbg_id_g = H5I_INVALID_HID; -int compound_data; + FILE *rawattrstream = NULL; /* should initialize to stdout but gcc moans about it */ FILE *rawdatastream = NULL; /* should initialize to stdout but gcc moans about it */ FILE *rawinstream = NULL; /* should initialize to stdin but gcc moans about it */ FILE *rawoutstream = NULL; /* should initialize to stdout but gcc moans about it */ FILE *rawerrorstream = NULL; /* should initialize to stderr but gcc moans about it */ + int bin_output; /* binary output */ int bin_form = 0; /* binary form, default NATIVE */ int region_output; /* region output */ int oid_output; /* oid output */ int data_output; /* data output */ int attr_data_output; /* attribute data output */ +int compound_data; + unsigned packed_bits_num; /* number of packed bits to display */ unsigned packed_data_offset; /* offset of packed bits to display */ unsigned packed_data_length; /* length of packed bits to display */ unsigned long long packed_data_mask; /* mask in which packed bits to display */ + int enable_error_stack = 0; /* re-enable error stack; disable=0 enable=1 */ /* sort parameters */ @@ -103,6 +112,10 @@ const char *drivernames[] = { void h5tools_init(void) { + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &lib_func, &lib_edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + if (!h5tools_init_g) { H5TOOLS_INIT_ERROR(); @@ -121,6 +134,29 @@ h5tools_init(void) h5tools_init_g++; } + + /* Disable tools error reporting */ + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); +} + +/*------------------------------------------------------------------------- + * Function: h5tools_error_report + * + * Purpose: Enable error stack reporting after command line is parsed. + * + * Return: None + *------------------------------------------------------------------------- + */ +void +h5tools_error_report(void) +{ + if (h5tools_init_g) { + if (enable_error_stack > 0) { + H5Eset_auto2(H5E_DEFAULT, lib_func, lib_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + } + } } /*------------------------------------------------------------------------- @@ -137,16 +173,11 @@ h5tools_init(void) void h5tools_close(void) { - H5E_auto2_t tools_func; - void *tools_edata; - if (h5tools_init_g) { /* special case where only data is output to stdout */ if ((rawoutstream == NULL) && rawdatastream && (rawdatastream == stdout)) HDfprintf(rawdatastream, "\n"); - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - if (tools_func) H5Eprint2(H5tools_ERR_STACK_g, rawerrorstream); @@ -184,6 +215,10 @@ h5tools_close(void) /* Clean up the reference path table, if it's been used */ term_ref_path_table(); + /* Restore error stacks from init */ + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + H5Eset_auto2(H5E_DEFAULT, lib_func, lib_edata); + H5TOOLS_CLOSE_ERROR(); /* Shut down the library */ @@ -1090,8 +1125,8 @@ done: *------------------------------------------------------------------------- */ void -h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hsize_t elmtno, int secnum) +h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hsize_t elmtno, int secnum) { h5tools_str_t prefix; h5tools_str_t str; /*temporary for indentation */ @@ -1119,7 +1154,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, H5TOOLS_DEBUG("after CR elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); /* Calculate new prefix */ - h5tools_str_prefix(&prefix, info, elmtno, ctx->ndims, ctx); + h5tools_str_prefix(&prefix, info, elmtno, ctx); H5TOOLS_DEBUG("prefix=%s - str=%s", prefix.s, str.s); /* Write new prefix to output */ @@ -1186,8 +1221,8 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, *------------------------------------------------------------------------- */ void -h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum) +h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hsize_t elmtno, hsize_t *ptdata, int secnum) { h5tools_str_t prefix; h5tools_str_t str; /*temporary for indentation */ @@ -1211,7 +1246,7 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, } /* Calculate new prefix */ - h5tools_str_region_prefix(&prefix, info, elmtno, ptdata, ctx->ndims, ctx->p_max_idx, ctx); + h5tools_str_region_prefix(&prefix, info, elmtno, ptdata, ctx); /* Write new prefix to output */ if (ctx->indent_level > 0) @@ -1284,9 +1319,8 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, *------------------------------------------------------------------------- */ hbool_t -h5tools_render_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, h5tools_str_t *buffer, hsize_t *curr_pos, - size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter) +h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter) { hbool_t dimension_break = TRUE; char *s = NULL; @@ -1455,9 +1489,8 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, *------------------------------------------------------------------------- */ hbool_t -h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, h5tools_str_t *buffer, hsize_t *curr_pos, - size_t ncols, hsize_t *ptdata, hsize_t local_elmt_counter, hsize_t elmt_counter) +h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t *ptdata, hsize_t local_elmt_counter, hsize_t elmt_counter) { hbool_t dimension_break = TRUE; char *s = NULL; @@ -1474,8 +1507,10 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, * If the element would split on multiple lines if printed at our * current location... */ - if (info->line_multi_new == 1 && (ctx->cur_column + h5tools_count_ncols(s) + - HDstrlen(OPT(info->elmt_suf2, " ")) + HDstrlen(OPT(info->line_suf, ""))) > ncols) { + if (info->line_multi_new == 1 && + (ctx->cur_column + h5tools_count_ncols(s) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) { if (ctx->prev_multiline) { /* * ... and the previous element also occupied more than one @@ -1484,7 +1519,8 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; } else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + - HDstrlen(OPT(info->elmt_suf2, " ")) + HDstrlen(OPT(info->line_suf, ""))) <= ncols) { + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) <= ncols) { /* * ...but *could* fit on one line otherwise, then we * should end the current line and start this element on its @@ -1515,7 +1551,9 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, * beginning of the line. */ if (info->line_multi_new == 1 && ctx->prev_multiline && - (ctx->cur_column + h5tools_count_ncols(s) + HDstrlen(OPT(info->elmt_suf2, " ")) + HDstrlen(OPT(info->line_suf, ""))) > ncols) + (ctx->cur_column + h5tools_count_ncols(s) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = TRUE; /* @@ -1543,7 +1581,9 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, * this check to happen for the first line */ if ((!info->skip_first || local_elmt_counter) && - (ctx->cur_column + HDstrlen(section) + HDstrlen(OPT(info->elmt_suf2, " ")) + HDstrlen(OPT(info->line_suf, ""))) > ncols) + (ctx->cur_column + HDstrlen(section) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = 1; /* @@ -1589,27 +1629,65 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, *------------------------------------------------------------------------- */ void -init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) +init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx) { int i; unsigned j; H5TOOLS_START_DEBUG(""); - if(ctx->ndims > 0) { - ctx->acc[ctx->ndims - 1] = 1; - for (i = ((int)ctx->ndims - 2); i >= 0; i--) { - ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; - H5TOOLS_DEBUG("ctx->acc[%d]=%ld", i, ctx->acc[i]); + for (i = 0; (unsigned)i < ndims; i++) + p_min_idx[i] = 0; + + if(ndims > 0) { + acc[ndims - 1] = 1; + for (i = ((int)ndims - 2); i >= 0; i--) { + acc[i] = acc[i + 1] * dims[i + 1]; + H5TOOLS_DEBUG("acc[%d]=%ld", i, acc[i]); } - for (j = 0; j < ctx->ndims; j++) - ctx->pos[j] = 0; + for (j = 0; j < ndims; j++) + pos[j] = 0; } H5TOOLS_ENDDEBUG(""); } /*------------------------------------------------------------------------- + * Function: calc_acc_pos + * + * Purpose: Calculate the number of elements represented by a unit change + * in a certain index position. + * + * Return: void + *------------------------------------------------------------------------- + */ +hsize_t +calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos) +{ + int i; + hsize_t curr_pos = elmtno; + + H5TOOLS_START_DEBUG(""); + + if(ndims > 0) { + for(i = 0; i < (size_t) ndims; i++) { + if(curr_pos > 0) { + H5TOOLS_DEBUG("curr_pos=%ld - ctx->acc[%d]=%ld", curr_pos, i, acc[i]); + pos[i] = curr_pos / acc[i]; + curr_pos -= acc[i] * pos[i]; + } + else + pos[i] = 0; + H5TOOLS_DEBUG("curr_pos=%ld - pos[%d]=%ld - acc[%d]=%ld", curr_pos, i, pos[i], i, acc[i]); + } + } + + H5TOOLS_ENDDEBUG(""); + + return curr_pos; +} + +/*------------------------------------------------------------------------- * Function: render_bin_output * * Purpose: Write one element of memory buffer to a binary file stream diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 2b6fffb..152ec1a 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -570,9 +570,6 @@ typedef struct h5tools_vfd_info_t { const char *name; } h5tools_vfd_info_t; -H5TOOLS_DLLVAR const char *volnames[]; -H5TOOLS_DLLVAR const char *drivernames[]; - /* This enum should match the entries in the above 'volnames' * since they are indices into the 'volnames' array. */ typedef enum { @@ -603,14 +600,22 @@ typedef enum { #include "h5tools_str.h" -H5TOOLS_DLLVAR h5tool_format_t h5tools_dataformat; -H5TOOLS_DLLVAR const h5tools_dump_header_t h5tools_standardformat; -H5TOOLS_DLLVAR const h5tools_dump_header_t* h5tools_dump_header_format; #ifdef __cplusplus extern "C" { #endif +H5TOOLS_DLLVAR const char *volnames[]; +H5TOOLS_DLLVAR const char *drivernames[]; + +H5TOOLS_DLLVAR h5tool_format_t h5tools_dataformat; +H5TOOLS_DLLVAR const h5tools_dump_header_t h5tools_standardformat; +H5TOOLS_DLLVAR const h5tools_dump_header_t* h5tools_dump_header_format; +H5TOOLS_DLLVAR H5E_auto2_t lib_func; +H5TOOLS_DLLVAR H5E_auto2_t tools_func; +H5TOOLS_DLLVAR void *lib_edata; +H5TOOLS_DLLVAR void *tools_edata; + H5TOOLS_DLLVAR unsigned packed_bits_num; /* number of packed bits to display */ H5TOOLS_DLLVAR unsigned packed_data_offset; /* offset of packed bits to display */ H5TOOLS_DLLVAR unsigned packed_data_length; /* length of packed bits to display */ @@ -644,14 +649,17 @@ H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack; disable=0 e /* Definitions of useful routines */ H5TOOLS_DLL void h5tools_init(void); H5TOOLS_DLL void h5tools_close(void); + +H5TOOLS_DLL void h5tools_error_report(void); H5TOOLS_DLL int h5tools_set_data_output_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_attr_output_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_input_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_output_file(const char *fname, int is_bin); H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); -H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info, - h5tools_vfd_info_t *vfd_info); -H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size); + +H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info, h5tools_vfd_info_t *vfd_info); +H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fapl_id, + char *drivername, size_t drivername_size); H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specific_driver, char *drivername, size_t drivername_size); H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); @@ -659,36 +667,29 @@ H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid); H5TOOLS_DLL htri_t h5tools_detect_vlen_str(hid_t tid); H5TOOLS_DLL hbool_t h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2); -H5TOOLS_DLL void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims); +H5TOOLS_DLL void init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx); +H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, hsize_t *acc, hsize_t *pos); H5TOOLS_DLL hbool_t h5tools_is_zero(const void *_mem, size_t size); H5TOOLS_DLL int h5tools_canreadf(const char* name, hid_t dcpl_id); H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn); -H5TOOLS_DLL void h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hsize_t elmtno, int secnum); -H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum); +H5TOOLS_DLL void h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hsize_t elmtno, int secnum); +H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hsize_t elmtno, hsize_t *ptdata, int secnum); H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts); -H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, - hid_t container, unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata); -H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container); -H5TOOLS_DLL int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, - FILE* stream, hid_t container, unsigned ndims, hid_t type_id, hsize_t npoints); -H5TOOLS_DLL hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container); - -H5TOOLS_DLL hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, h5tools_str_t *buffer, hsize_t *curr_pos, - size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter); -H5TOOLS_DLL hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, /*in,out*/ - h5tools_str_t *buffer, /*string into which to render */ - hsize_t *curr_pos, /*total data element position*/ - size_t ncols, hsize_t *ptdata, - hsize_t local_elmt_counter, /*element counter*/ - hsize_t elmt_counter); +H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, + unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata); +H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, hid_t container); +H5TOOLS_DLL int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE* stream, hid_t container, + unsigned ndims, hid_t type_id, hsize_t npoints); +H5TOOLS_DLL hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *stream, hid_t container); + +H5TOOLS_DLL hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter); +H5TOOLS_DLL hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, hsize_t *ptdata, hsize_t local_elmt_counter, hsize_t elmt_counter); #ifdef __cplusplus } diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index b59ae93..187ba18 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -253,9 +253,8 @@ h5tools_dump_init(void) *------------------------------------------------------------------------- */ int -h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, - h5tools_context_t *ctx, /* in,out */ - unsigned flags, hsize_t nelmts, hid_t type, void *_mem) +h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, /* in,out */ + hid_t container, unsigned flags, hsize_t nelmts, hid_t type, void *_mem) { unsigned char *mem = (unsigned char*) _mem; hsize_t i; /* element counter */ @@ -568,9 +567,11 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for ctx.indent_level++; if(H5Sget_simple_extent_dims(mem_space, total_size, NULL) >= 0) { /* assume entire data space to be printed */ + init_acc_pos(ctx.ndims, total_size, ctx.acc, ctx.pos, ctx.p_min_idx); + + /* reset data space to be printed */ for (indx = 0; indx < (unsigned)ctx.ndims; indx++) ctx.p_min_idx[indx] = start[indx]; - init_acc_pos(&ctx, total_size); /* print the data */ region_flags = START_OF_DATA; @@ -939,9 +940,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, if(H5Sget_simple_extent_dims(mem_space, total_size, NULL) >= 0) { /* assume entire data space to be printed */ - for (indx = 0; indx < ctx.ndims; indx++) - ctx.p_min_idx[indx] = 0; - init_acc_pos(&ctx, total_size); + init_acc_pos(ctx.ndims, total_size, ctx.acc, ctx.pos, ctx.p_min_idx); /* print the data */ region_flags = START_OF_DATA; @@ -1274,9 +1273,6 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c if ((size_t) ctx->ndims > NELMTS(sm_size)) H5TOOLS_THROW(FAIL, "ndims and sm_size comparision failed"); - if (ctx->ndims > 0) - init_acc_pos(ctx, total_size); - size_row_block = ctx->sset->block.data[row_dim]; /* Check if we have VL data in the dataset's datatype */ @@ -1347,27 +1343,25 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c for (i = 0; i < ctx->ndims; i++) ctx->p_max_idx[i] = ctx->p_min_idx[i] + MIN(total_size[i], sm_size[i]); - /* print array indices. get the lower bound of the hyperslab and calulate - the element position at the start of hyperslab */ + /* print array indices. get the lower bound of the hyperslab and calculate + the element position at the start of hyperslab */ if(H5Sget_select_bounds(f_space, low, high) < 0) H5TOOLS_THROW(FAIL, "H5Sget_select_bounds failed"); - elmtno = 0; + /* initialize the current stripmine position; this is necessary to print the array indices */ + ctx->sm_pos = 0; for (i = 0; i < (size_t) ctx->ndims - 1; i++) { hsize_t offset = 1; /* accumulation of the previous dimensions */ for (j = i + 1; j < (size_t) ctx->ndims; j++) offset *= total_size[j]; - elmtno += low[i] * offset; + ctx->sm_pos += low[i] * offset; } - elmtno += low[ctx->ndims - 1]; + ctx->sm_pos += low[ctx->ndims - 1]; - /* initialize the current stripmine position; this is necessary to print the array - indices */ - ctx->sm_pos = elmtno; ctx->need_prefix = TRUE; - if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf) < 0) + if(h5tools_dump_simple_data(stream, info, ctx, dset, flags, sm_nelmts, p_type, sm_buf) < 0) H5TOOLS_THROW(FAIL, "h5tools_dump_simple_data failed"); /* Reclaim any VL memory, if necessary */ @@ -1586,12 +1580,10 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co ctx->ndims = (unsigned)sndims; /* assume entire data space to be printed */ - if (ctx->ndims > 0) - for (i = 0; i < (size_t) ctx->ndims; i++) - ctx->p_min_idx[i] = 0; - if(H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) H5TOOLS_THROW(FAIL, "H5Sget_simple_extent_dims failed"); + init_acc_pos(ctx->ndims, total_size, ctx->acc, ctx->pos, ctx->p_min_idx); + ctx->size_last_dim = total_size[ctx->ndims - 1]; /* Set the compound datatype field list for display */ @@ -1623,38 +1615,37 @@ CATCH *------------------------------------------------------------------------- */ static int -h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - hid_t dset, hid_t p_type) +h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, hid_t p_type) { - hid_t f_space = H5I_INVALID_HID; /* file data space */ - hsize_t elmtno; /* counter */ - size_t i; /* counter */ - int sndims; /* rank of dataspace */ - int carry; /* counter carry value */ - hsize_t zero[8]; /* vector of zeros */ - unsigned int flags; /* buffer extent flags */ - hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ - hbool_t past_catch = FALSE; + hid_t f_space = H5I_INVALID_HID; /* file data space */ + hsize_t elmtno; /* counter */ + size_t i = 0; /* counter */ + int sndims; /* rank of dataspace */ + int carry; /* counter carry value */ + hsize_t zero[8]; /* vector of zeros */ + unsigned int flags; /* buffer extent flags */ + hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ + hbool_t past_catch = FALSE; /* Print info */ - size_t p_type_nbytes; /* size of memory type */ - hsize_t p_nelmts; /* total selected elmts */ + size_t p_type_nbytes; /* size of memory type */ + hsize_t p_nelmts; /* total selected elmts */ /* Stripmine info */ - hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ - hsize_t sm_nbytes; /* bytes per stripmine */ - hsize_t sm_nelmts; /* elements per stripmine*/ - unsigned char *sm_buf = NULL; /* buffer for raw data */ - hid_t sm_space = H5I_INVALID_HID; /* stripmine data space */ + hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ + hsize_t sm_nbytes; /* bytes per stripmine */ + hsize_t sm_nelmts; /* elements per stripmine*/ + unsigned char *sm_buf = NULL; /* buffer for raw data */ + hid_t sm_space = H5I_INVALID_HID; /* stripmine data space */ /* Hyperslab info */ - hsize_t hs_offset[H5S_MAX_RANK]; /* starting offset */ - hsize_t hs_size[H5S_MAX_RANK]; /* size this pass */ - hsize_t hs_nelmts; /* elements in request */ + hsize_t hs_offset[H5S_MAX_RANK]; /* starting offset */ + hsize_t hs_size[H5S_MAX_RANK]; /* size this pass */ + hsize_t hs_nelmts; /* elements in request */ /* VL data special information */ - unsigned int vl_data = 0; /* contains VL datatypes */ - int ret_value = 0; + unsigned int vl_data = 0; /* contains VL datatypes */ + int ret_value = 0; H5TOOLS_START_DEBUG(""); if (H5I_INVALID_HID == (f_space = H5Dget_space(dset))) @@ -1670,11 +1661,8 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont H5TOOLS_GOTO_ERROR((-1), "ctx->ndims > NELMTS(sm_size) failed"); /* Assume entire data space to be printed */ - if (ctx->ndims > 0) - for (i = 0; i < (size_t)ctx->ndims; i++) - ctx->p_min_idx[i] = 0; - H5Sget_simple_extent_dims(f_space, total_size, NULL); + init_acc_pos(ctx->ndims, total_size, ctx->acc, ctx->pos, ctx->p_min_idx); /* calculate the number of elements we're going to print */ p_nelmts = 1; @@ -1720,8 +1708,6 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont sm_space = H5Screate_simple(1, &sm_nelmts, NULL); H5TOOLS_DEBUG("sm_nelmts size:%ld", sm_nelmts); - if (ctx->ndims > 0) - init_acc_pos(ctx, total_size); H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims); /* The stripmine loop */ @@ -1762,7 +1748,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont indices */ ctx->sm_pos = elmtno; - if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf) < 0) + if(h5tools_dump_simple_data(stream, info, ctx, dset, flags, hs_nelmts, p_type, sm_buf) < 0) H5TOOLS_ERROR((-1), "h5tools_dump_simple_data failed"); /* Reclaim any VL memory, if necessary */ @@ -1841,11 +1827,8 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte H5TOOLS_THROW((-1), "ctx->ndims > NELMTS(ctx->p_min_idx) failed"); /* Assume entire data space to be printed */ - if (ctx->ndims > 0) - for (i = 0; i < (size_t)ctx->ndims; i++) - ctx->p_min_idx[i] = 0; - H5Sget_simple_extent_dims(f_space, total_size, NULL); + init_acc_pos(ctx->ndims, total_size, ctx->acc, ctx->pos, ctx->p_min_idx); /* calculate the number of elements we're going to print */ p_nelmts = 1; @@ -1868,14 +1851,12 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte alloc_size = p_nelmts * H5Tget_size(p_type); HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) { - if (ctx->ndims > 0) - init_acc_pos(ctx, total_size); H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims); H5TOOLS_DEBUG("Read the data"); /* Read the data */ if (H5Aread(attr_id, p_type, buf) >= 0) { - if(h5tools_dump_simple_data(stream, info, attr_id, ctx, START_OF_DATA | END_OF_DATA, p_nelmts, p_type, buf) < 0) + if(h5tools_dump_simple_data(stream, info, ctx, attr_id, START_OF_DATA | END_OF_DATA, p_nelmts, p_type, buf) < 0) H5TOOLS_ERROR((-1), "h5tools_dump_simple_data failed"); /* Reclaim any VL memory, if necessary */ @@ -3987,6 +3968,226 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool } /*------------------------------------------------------------------------- + * Function: dump_reference + * + * Purpose: Dump reference data + * + * Return: void + *------------------------------------------------------------------------- + */ +void +h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t container, H5R_ref_t *ref_buf, int ndims) +{ + hid_t new_obj_id = H5I_INVALID_HID; + hid_t new_obj_sid = H5I_INVALID_HID; + hsize_t elmt_counter = 0; /*counts the # elements printed. */ + size_t ncols = 80; /* available output width */ + int i; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t datactx; /* print context */ + + H5TOOLS_START_DEBUG(""); + + datactx = *ctx; /* print context */ + /* Assume entire data space to be printed */ + datactx.need_prefix = TRUE; + + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + for(i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { + H5O_type_t obj_type = -1; /* Object type */ + H5R_type_t ref_type; /* Reference type */ + + H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos); + + datactx.need_prefix = TRUE; + h5tools_str_reset(&buffer); + H5TOOLS_DEBUG("reference loop - h5tools_str_sprint with H5T_STD_REF:%d", i); + h5tools_str_sprint(&buffer, info, container, H5T_STD_REF, &ref_buf[i], &datactx); + h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)i, (hsize_t)ndims); + + ref_type = H5Rget_type((const H5R_ref_t *)&ref_buf[i]); + switch (ref_type) { + case H5R_OBJECT1: + H5TOOLS_DEBUG("ref_type is H5R_OBJECT1"); + if (H5Rget_obj_type3(&ref_buf[i], H5P_DEFAULT, &obj_type) >= 0) { + switch (obj_type) { + case H5O_TYPE_DATASET: + if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + datactx.indent_level++; + h5tools_dump_data(stream, info, &datactx, new_obj_id, TRUE); + //h5tools_dump_dset(stream, info, &datactx, new_obj_id); + datactx.indent_level--; + if(H5Dclose(new_obj_id) < 0) + H5TOOLS_INFO("H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed"); + } + else + H5TOOLS_INFO("H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed"); + break; + + case H5O_TYPE_GROUP: + case H5O_TYPE_NAMED_DATATYPE: + case H5O_TYPE_MAP: + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + break; + } /* end switch */ + } + else + H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT1 failed"); + break; + case H5R_DATASET_REGION1: + H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION1"); + if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + datactx.indent_level++; + h5tools_dump_data(stream, info, &datactx, new_obj_id, TRUE); + //h5tools_dump_dset(stream, info, &datactx, new_obj_id); + datactx.indent_level--; + if(H5Dclose(new_obj_id) < 0) + H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION1 failed"); + } + else + H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION1 failed"); + break; + case H5R_OBJECT2: + H5TOOLS_DEBUG("ref_type is H5R_OBJECT2"); + if (H5Rget_obj_type3(&ref_buf[i], H5P_DEFAULT, &obj_type) >= 0) { + switch (obj_type) { + case H5O_TYPE_GROUP: + break; + + case H5O_TYPE_DATASET: + if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + datactx.indent_level++; + h5tools_dump_data(stream, info, &datactx, new_obj_id, TRUE); + //h5tools_dump_dset(stream, info, &datactx, new_obj_id); + datactx.indent_level--; + if(H5Oclose(new_obj_id) < 0) + H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed"); + } + else + H5TOOLS_INFO("H5Ropen_object H5R_OBJECT2 failed"); + break; + + case H5O_TYPE_NAMED_DATATYPE: + break; + + case H5O_TYPE_MAP: + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + break; + } /* end switch */ + } + else + H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT2 failed"); + break; + case H5R_DATASET_REGION2: + H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION2"); + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + /* if (new_obj_id < 0) - could mean that no reference was written do not throw failure */ + if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) < 0) + H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 failed"); + else { + if((new_obj_sid = H5Ropen_region(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (h5tools_is_zero(&ref_buf[i], H5Tget_size(H5T_STD_REF))) { + H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2"); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " {"); + h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + datactx.need_prefix = TRUE; + datactx.indent_level++; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "NULL"); + h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + datactx.indent_level--; + datactx.need_prefix = TRUE; + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "}"); + h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + } + else { + H5S_sel_type region_type; + + region_type = H5Sget_select_type(new_obj_sid); + if(region_type == H5S_SEL_POINTS) { + /* Print point information */ + H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION2"); + h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, info, &datactx, + &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); + } + else if(region_type == H5S_SEL_HYPERSLABS) { + /* Print block information */ + H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION2"); + h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, info, &datactx, + &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); + } + else + H5TOOLS_INFO("invalid region type"); + } /* end else to if (h5tools_is_zero(... */ + if(H5Sclose(new_obj_sid) < 0) + H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION2 failed"); + } + else + H5TOOLS_INFO("H5Ropen_region H5R_DATASET_REGION2 failed"); + if(H5Dclose(new_obj_id) < 0) + H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed"); + } + break; + case H5R_ATTR: + H5TOOLS_DEBUG("ref_type is H5R_ATTR"); + if((new_obj_id = H5Ropen_attr(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + h5tools_dump_region_attribute(new_obj_id, stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + if(H5Aclose(new_obj_id) < 0) + H5TOOLS_INFO("H5Aclose H5R_ATTR failed"); + } + else { + H5TOOLS_DEBUG("NULL H5R_ATTR"); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " {"); + h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + datactx.need_prefix = TRUE; + datactx.indent_level++; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "NULL"); + h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + datactx.indent_level--; + datactx.need_prefix = TRUE; + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "}"); + h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + H5TOOLS_INFO("H5Ropen_attr H5R_ATTR failed"); + } + break; + case H5R_BADTYPE: + case H5R_MAXTYPE: + default: + break; + } /* end switch */ + + if(H5Rdestroy(&ref_buf[i]) < 0) + H5TOOLS_INFO("H5Rdestroy failed"); + + H5TOOLS_DEBUG("finished reference loop:%d",i); + } /* end for(i = 0; i < ndims; i++, ctx->cur_elmt++, elmt_counter++) */ + + h5tools_str_close(&buffer); + + H5TOOLS_ENDDEBUG(""); +} + +/*------------------------------------------------------------------------- * Function: dump_data * * Purpose: Dump attribute, obj_data is FALSE, or dataset data, obj_data is TRUE @@ -3999,13 +4200,9 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * { H5S_class_t space_type; int ndims; - size_t i; hid_t space = H5I_INVALID_HID; hid_t f_type = H5I_INVALID_HID; - hid_t new_obj_id = H5I_INVALID_HID; - hid_t new_obj_sid = H5I_INVALID_HID; hsize_t total_size[H5S_MAX_RANK]; - hsize_t elmt_counter = 0; /*counts the # elements printed. */ int status = -1; h5tools_context_t datactx; /* print context */ h5tools_str_t buffer; /* string into which to render */ @@ -4070,13 +4267,9 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * H5TOOLS_DEBUG("ndims=%d - datactx.ndims=%d", ndims, datactx.ndims); /* Assume entire data space to be printed */ - if (datactx.ndims > 0) - for (i = 0; i < (size_t)datactx.ndims; i++) - datactx.p_min_idx[i] = 0; - H5Sget_simple_extent_dims(space, total_size, NULL); - if (datactx.ndims > 0) - init_acc_pos(&datactx, total_size); + init_acc_pos(datactx.ndims, total_size, datactx.acc, datactx.pos, datactx.p_min_idx); + datactx.need_prefix = TRUE; if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { @@ -4094,197 +4287,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * H5TOOLS_GOTO_DONE_NO_RET(); } } - for (i = 0; i < (size_t)ndims; i++, datactx.cur_elmt++, elmt_counter++) { - H5O_type_t obj_type = -1; /* Object type */ - H5R_type_t ref_type; /* Reference type */ - - H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos); - - datactx.need_prefix = TRUE; - h5tools_str_reset(&buffer); - H5TOOLS_DEBUG("reference loop - h5tools_str_sprint with H5T_STD_REF:%d", i); - h5tools_str_sprint(&buffer, &outputformat, obj_id, H5T_STD_REF, &ref_buf[i], &datactx); - h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)i, (hsize_t)ndims); - - ref_type = H5Rget_type((const H5R_ref_t *)&ref_buf[i]); - switch (ref_type) { - case H5R_OBJECT1: - H5TOOLS_DEBUG("ref_type is H5R_OBJECT1"); - if (H5Rget_obj_type3(&ref_buf[i], H5P_DEFAULT, &obj_type) >= 0) { - switch (obj_type) { - case H5O_TYPE_DATASET: - if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - datactx.indent_level++; - h5tools_dump_data(stream, &outputformat, &datactx, new_obj_id, TRUE); - datactx.indent_level--; - if(H5Dclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed"); - } - else - H5TOOLS_INFO("H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed"); - break; - - case H5O_TYPE_GROUP: - case H5O_TYPE_NAMED_DATATYPE: - case H5O_TYPE_MAP: - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - break; - } /* end switch */ - } - else - H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT1 failed"); - break; - case H5R_DATASET_REGION1: - H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION1"); - if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - datactx.indent_level++; - h5tools_dump_data(stream, &outputformat, &datactx, new_obj_id, TRUE); - datactx.indent_level--; - if(H5Dclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION1 failed"); - } - else - H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION1 failed"); - break; - case H5R_OBJECT2: - H5TOOLS_DEBUG("ref_type is H5R_OBJECT2"); - if (H5Rget_obj_type3(&ref_buf[i], H5P_DEFAULT, &obj_type) >= 0) { - switch (obj_type) { - case H5O_TYPE_GROUP: - break; - - case H5O_TYPE_DATASET: - if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - datactx.indent_level++; - h5tools_dump_data(stream, &outputformat, &datactx, new_obj_id, TRUE); - datactx.indent_level--; - if(H5Oclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed"); - } - else - H5TOOLS_INFO("H5Ropen_object H5R_OBJECT2 failed"); - break; - - case H5O_TYPE_NAMED_DATATYPE: - break; - - case H5O_TYPE_MAP: - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - break; - } /* end switch */ - } - else - H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT2 failed"); - break; - case H5R_DATASET_REGION2: - H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION2"); - - if (outputformat.line_ncols > 0) - ncols = outputformat.line_ncols; - - /* if (new_obj_id < 0) - could mean that no reference was written do not throw failure */ - if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) < 0) - H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 failed"); - else { - if((new_obj_sid = H5Ropen_region(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - if (h5tools_is_zero(&ref_buf[i], H5Tget_size(H5T_STD_REF))) { - H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2"); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, " {"); - h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - - datactx.indent_level++; - datactx.need_prefix = TRUE; - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "NULL"); - h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - - datactx.indent_level--; - datactx.need_prefix = TRUE; - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "}"); - h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - else { - H5S_sel_type region_type; - - region_type = H5Sget_select_type(new_obj_sid); - if(region_type == H5S_SEL_POINTS) { - /* Print point information */ - H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION2"); - h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, &outputformat, &datactx, - &buffer, &curr_pos, ncols, i, elmt_counter); - } - else if(region_type == H5S_SEL_HYPERSLABS) { - /* Print block information */ - H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION2"); - h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, &outputformat, &datactx, - &buffer, &curr_pos, ncols, i, elmt_counter); - } - else - H5TOOLS_INFO("invalid region type"); - } /* end else to if (h5tools_is_zero(... */ - if(H5Sclose(new_obj_sid) < 0) - H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION2 failed"); - } - else - H5TOOLS_INFO("H5Ropen_region H5R_DATASET_REGION2 failed"); - if(H5Dclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed"); - } - break; - case H5R_ATTR: - H5TOOLS_DEBUG("ref_type is H5R_ATTR"); - if((new_obj_id = H5Ropen_attr(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - h5tools_dump_region_attribute(new_obj_id, stream, &outputformat, &datactx, - &buffer, &curr_pos, ncols, i, elmt_counter); - if(H5Aclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Aclose H5R_ATTR failed"); - } - else { - H5TOOLS_DEBUG("NULL H5R_ATTR"); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, " {"); - h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - - datactx.indent_level++; - datactx.need_prefix = TRUE; - - datactx.indent_level++; - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "NULL"); - h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - datactx.indent_level--; - - datactx.indent_level--; - datactx.need_prefix = TRUE; - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "}"); - h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - - H5TOOLS_INFO("H5Ropen_attr H5R_ATTR failed"); - } - break; - case H5R_BADTYPE: - case H5R_MAXTYPE: - default: - break; - } /* end switch */ - - if(H5Rdestroy(&ref_buf[i]) < 0) - H5TOOLS_INFO("H5Rdestroy failed"); - - H5TOOLS_DEBUG("finished reference loop:%d",i); - } /* end for(i = 0; i < ndims; i++, datactx->cur_elmt++, elmt_counter++) */ + h5tools_dump_reference(stream, &outputformat, &datactx, obj_id, ref_buf, ndims); HDfree(ref_buf); } ctx->indent_level--; diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index 2cd0bc1..add2e46 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -36,63 +36,53 @@ H5TOOLS_DLLVAR table_t *h5dump_type_table; /*type table reference for datatype /* Definitions of useful routines */ H5TOOLS_DLL void h5tools_dump_init(void); -H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t dset); -H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t obj_id); -H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, - h5tools_context_t *ctx/*in,out*/, unsigned flags, - hsize_t nelmts, hid_t type, void *_mem); -H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t type); -H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t space); -H5TOOLS_DLL void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, const char *attr_name, hid_t attr_id); -H5TOOLS_DLL void h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t oid); -H5TOOLS_DLL void h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id); -H5TOOLS_DLL void h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t obj_id); -H5TOOLS_DLL void h5tools_dump_data(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hid_t obj_id, int obj_data); +H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t dset); +H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t obj_id); +H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t container, unsigned flags, hsize_t nelmts, hid_t type, void *_mem); +H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t type); +H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t space); +H5TOOLS_DLL void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + const char *attr_name, hid_t attr_id); +H5TOOLS_DLL void h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t oid); +H5TOOLS_DLL void h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t dcpl, hid_t type_id, hid_t obj_id); +H5TOOLS_DLL void h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t obj_id); +H5TOOLS_DLL void h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t obj_id, int obj_data); +H5TOOLS_DLL void h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t container, H5R_ref_t *ref_buf, int ndims); H5TOOLS_DLL hbool_t h5tools_dump_region_attribute(hid_t region_id, - FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t region_elmt_counter/*element counter*/, - hsize_t elmt_counter); + FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, hsize_t elmt_counter); H5TOOLS_DLL hbool_t h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, - FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t region_elmt_counter/*element counter*/, - hsize_t elmt_counter); + FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, hsize_t elmt_counter); H5TOOLS_DLL hbool_t h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, - FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t region_elmt_counter/*element counter*/, - hsize_t elmt_counter); + FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, hsize_t elmt_counter); -H5TOOLS_DLL int h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer/*in,out*/, - const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, +H5TOOLS_DLL int h5tools_print_datatype(FILE *stream, + h5tools_str_t *buffer/*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t type, int object_search); H5TOOLS_DLL int h5tools_print_dataspace(h5tools_str_t *buffer/*in,out*/, hid_t space); -H5TOOLS_DLL int h5tools_print_enum(FILE *stream, h5tools_str_t *buffer/*in,out*/, - const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, +H5TOOLS_DLL int h5tools_print_enum(FILE *stream, + h5tools_str_t *buffer/*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t type); -H5TOOLS_DLL void h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, - const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, +H5TOOLS_DLL void h5tools_print_fill_value( + h5tools_str_t *buffer/*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id); H5TOOLS_DLL void h5tools_print_packed_bits(h5tools_str_t *buffer/*in,out*/, hid_t type); + #ifdef __cplusplus } #endif diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 5c777a9..d612fbd 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -278,16 +278,12 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) * Purpose: Renders the line prefix value into string STR. * * Return: Success: Pointer to the prefix. - * * Failure: NULL - * - * Programmer: Robb Matzke - * Thursday, July 23, 1998 *------------------------------------------------------------------------- */ char * -h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, - hsize_t elmtno, unsigned ndims, h5tools_context_t *ctx) +h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, hsize_t elmtno, + h5tools_context_t *ctx) { size_t i = 0; hsize_t curr_pos = elmtno; @@ -297,28 +293,16 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); h5tools_str_reset(str); - H5TOOLS_DEBUG("ndims=%d", ndims); - if(ndims > 0) { - /* - * Calculate the number of elements represented by a unit change in a - * certain index position. - */ - for(i = 0; i < (size_t) ndims; i++) { - H5TOOLS_DEBUG("curr_pos=%ld - ctx->acc[%d]=%ld", curr_pos, i, ctx->acc[i]); - ctx->pos[i] = curr_pos / ctx->acc[i]; - curr_pos -= ctx->acc[i] * ctx->pos[i]; - H5TOOLS_DEBUG("curr_pos=%ld - ctx->pos[%d]=%ld - ctx->acc[%d]=%ld", curr_pos, i, ctx->pos[i], i, ctx->acc[i]); - } + curr_pos = calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos); + if(ctx->ndims > 0) { HDassert(curr_pos == 0); /* Print the index values */ - for(i = 0; i < (size_t) ndims; i++) { + for(i = 0; i < (size_t) ctx->ndims; i++) { if (i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); - h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), - (hsize_t) ctx->pos[i]); - + h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) ctx->pos[i]); } } else /* Scalar */ @@ -338,52 +322,38 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, * * Return: Success: Pointer to the prefix. * Failure: NULL - * - * In/Out: - * h5tools_context_t *ctx - * h5tools_str_t *str *------------------------------------------------------------------------- */ char * -h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, - hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t max_idx[], - h5tools_context_t *ctx) +h5tools_str_region_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, hsize_t elmtno, + hsize_t *ptdata, h5tools_context_t *ctx) { size_t i = 0; hsize_t curr_pos = elmtno; - hsize_t p_prod[H5S_MAX_RANK]; - h5tools_str_reset(str); + H5TOOLS_START_DEBUG(""); - if(ndims > 0) { - /* - * Calculate the number of elements represented by a unit change in a - * certain index position. - */ - for(i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i) - p_prod[i - 1] = (max_idx[i]) * p_prod[i]; + H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); + h5tools_str_reset(str); - for(i = 0; i < (size_t) ndims; i++) { - if(curr_pos > 0) { - ctx->pos[i] = curr_pos / p_prod[i]; - curr_pos -= p_prod[i] * ctx->pos[i]; - } - else - ctx->pos[i] = 0; - ctx->pos[i] += (unsigned long) ptdata[ctx->sm_pos+i]; - } + curr_pos = calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos); + if(ctx->ndims > 0) { + HDassert(curr_pos == 0); /* Print the index values */ - for(i = 0; i < (size_t) ndims; i++) { - if(i) + for(i = 0; i < (size_t) ctx->ndims; i++) { + ctx->pos[i] += (unsigned long) ptdata[ctx->sm_pos+i]; + if (i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) ctx->pos[i]); - } - } /* if (ndims > 0) */ + } else /* Scalar */ - h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) 0); + h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)0); + H5TOOLS_DEBUG("str=%s", str->s); + + H5TOOLS_ENDDEBUG(""); /* Add prefix and suffix to the index */ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: ")); diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index 02bfe40..074e86d 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -31,13 +31,12 @@ H5TOOLS_DLL char *h5tools_str_reset(h5tools_str_t *str); H5TOOLS_DLL char *h5tools_str_trunc(h5tools_str_t *str, size_t size); H5TOOLS_DLL char *h5tools_str_fmt(h5tools_str_t *str, size_t start, const char *fmt); H5TOOLS_DLL char *h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t *info, - hsize_t elmtno, unsigned ndims, h5tools_context_t *ctx); + hsize_t elmtno, h5tools_context_t *ctx); /* * new functions needed to display region reference data */ H5TOOLS_DLL char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, - hsize_t elmtno, hsize_t *ptdata, unsigned ndims, - hsize_t max_idx[], h5tools_context_t *ctx); + hsize_t elmtno, hsize_t *ptdata, h5tools_context_t *ctx); H5TOOLS_DLL void h5tools_str_dump_space_slabs(h5tools_str_t *, hid_t, const h5tool_format_t *, h5tools_context_t *ctx); H5TOOLS_DLL void h5tools_str_dump_space_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *); H5TOOLS_DLL void h5tools_str_dump_space_points(h5tools_str_t *, hid_t, const h5tool_format_t *); diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index 472824b..5c0c31d 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -23,7 +23,6 @@ */ #include "H5private.h" -#include "hdf5.h" #include "io_timer.h" diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 8805d08..5b19ae7 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -207,10 +207,6 @@ static int parse_flag(const char* s_flag, unsigned *flag) int main (int argc, const char *argv[]) { - H5E_auto2_t func; - H5E_auto2_t tools_func; - void *edata; - void *tools_edata; hid_t fid_src = H5I_INVALID_HID; hid_t fid_dst = H5I_INVALID_HID; unsigned flag = 0; @@ -226,17 +222,9 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /* init linkinfo struct */ HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); @@ -330,10 +318,8 @@ main (int argc, const char *argv[]) leave(EXIT_FAILURE); } - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } + /* enable error reporting if command line option */ + h5tools_error_report(); /*------------------------------------------------------------------------- * open output file diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index e0e6f8c..a02ad5a 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -25,7 +25,7 @@ static int check_d_input(const char*); * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVrv:qn:d:p:NcelxE:S"; +static const char *s_opts = "hVrv:qn:d:p:NcelxE:A:S"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -41,6 +41,7 @@ static struct long_options l_opts[] = { { "follow-symlinks", no_arg, 'l' }, { "no-dangling-links", no_arg, 'x' }, { "exclude-path", require_arg, 'E' }, + { "exclude-attribute", require_arg, 'A' }, { "enable-error-stack", no_arg, 'S' }, { "vol-value-1", require_arg, '1' }, { "vol-name-1", require_arg, '2' }, @@ -55,7 +56,6 @@ static struct long_options l_opts[] = { * Function: check_options * * Purpose: parse command line input - * *------------------------------------------------------------------------- */ static void check_options(diff_opt_t* opts) @@ -67,7 +67,7 @@ static void check_options(diff_opt_t* opts) /* check between -d , -p, --use-system-epsilon. * These options are mutually exclusive. */ - if ((opts->d + opts->p + opts->use_system_epsilon) > 1) { + if ((opts->delta_bool + opts->percent_bool + opts->use_system_epsilon) > 1) { HDprintf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); HDprintf("use no more than one.\n"); HDprintf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 Reference Manual'.\n", PROGRAMNAME); @@ -75,27 +75,138 @@ static void check_options(diff_opt_t* opts) } } +/*------------------------------------------------------------------------- + * Function: parse_hsize_list + * + * Purpose: Parse a list of comma or space separated integers and return + * them in a list. The string being passed into this function + * should be at the start of the list you want to parse. You are + * responsible for freeing the array returned from here. + * + * Lists in the so-called "terse" syntax are separated by + * semicolons (;). The lists themselves can be separated by + * either commas (,) or white spaces. + * + * Return: + *------------------------------------------------------------------------- + */ +static void +parse_hsize_list(const char *h_list, subset_d *d) +{ + hsize_t *p_list; + const char *ptr; + unsigned int size_count = 0; + unsigned int i = 0; + unsigned int last_digit = 0; + + if (!h_list || !*h_list || *h_list == ';') + return; + + H5TOOLS_START_DEBUG(" - h_list:%s", h_list); + /* count how many integers do we have */ + for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) + if (HDisdigit(*ptr)) { + if (!last_digit) + /* the last read character wasn't a digit */ + size_count++; + + last_digit = 1; + } + else + last_digit = 0; + + if (size_count == 0) { + /* there aren't any integers to read */ + H5TOOLS_ENDDEBUG("No integers to read"); + return; + } + H5TOOLS_DEBUG("Number integers to read=%ld", size_count); + + /* allocate an array for the integers in the list */ + if((p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t))) == NULL) + H5TOOLS_INFO("Unable to allocate space for subset data"); + + for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) + if(HDisdigit(*ptr)) { + /* we should have an integer now */ + p_list[i++] = (hsize_t)HDstrtoull(ptr, NULL, 0); + + while (HDisdigit(*ptr)) + /* scroll to end of integer */ + ptr++; + } + d->data = p_list; + d->len = size_count; + H5TOOLS_ENDDEBUG(""); +} + +/*------------------------------------------------------------------------- + * Function: parse_subset_params + * + * Purpose: Parse the so-called "terse" syntax for specifying subsetting parameters. + * + * Return: Success: struct subset_t object + * Failure: NULL + *------------------------------------------------------------------------- + */ +static struct subset_t * +parse_subset_params(const char *dset) +{ + struct subset_t *s = NULL; + char *brace; + + H5TOOLS_START_DEBUG(" - dset:%s", dset); + if ((brace = HDstrrchr(dset, '[')) != NULL) { + *brace++ = '\0'; + + s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); + parse_hsize_list(brace, &s->start); + + while (*brace && *brace != ';') + brace++; + + if (*brace) + brace++; + + parse_hsize_list(brace, &s->stride); + + while (*brace && *brace != ';') + brace++; + + if (*brace) + brace++; + + parse_hsize_list(brace, &s->count); + + while (*brace && *brace != ';') + brace++; + + if (*brace) + brace++; + + parse_hsize_list(brace, &s->block); + } + H5TOOLS_ENDDEBUG(""); + + return s; +} + /*------------------------------------------------------------------------- * Function: parse_command_line * * Purpose: parse command line input - * *------------------------------------------------------------------------- */ -void parse_command_line(int argc, - const char* argv[], - const char** fname1, - const char** fname2, - const char** objname1, - const char** objname2, - diff_opt_t* opts) +void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* opts) { int i; int opt; struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node; + struct exclude_path_list *exclude_attr_head, *exclude_attr_prev, *exclude_attr_node; + H5TOOLS_START_DEBUG(""); /* process the command-line */ HDmemset(opts, 0, sizeof (diff_opt_t)); @@ -106,15 +217,18 @@ void parse_command_line(int argc, opts->do_nans = 1; /* not Listing objects that are not comparable */ - opts->m_list_not_cmp = 0; + opts->mode_list_not_cmp = 0; /* initially no not-comparable. */ /**this is bad in mixing option with results**/ - opts->not_cmp=0; + opts->not_cmp = 0; /* init for exclude-path option */ exclude_head = NULL; + /* init for exclude-attribute option */ + exclude_attr_head = NULL; + /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { @@ -134,7 +248,7 @@ void parse_command_line(int argc, break; case 'v': - opts->m_verbose = 1; + opts->mode_verbose = 1; /* This for loop is for handling style like * -v, -v1, --verbose, --verbose=1. */ @@ -144,11 +258,11 @@ void parse_command_line(int argc, */ if (!strcmp (argv[i], "-v")) { /* no arg */ opt_ind--; - opts->m_verbose_level = 0; + opts->mode_verbose_level = 0; break; } else if (!strncmp (argv[i], "-v", (size_t)2)) { - opts->m_verbose_level = atoi(&argv[i][2]); + opts->mode_verbose_level = atoi(&argv[i][2]); break; } @@ -156,11 +270,11 @@ void parse_command_line(int argc, * long opt */ if (!strcmp (argv[i], "--verbose")) { /* no arg */ - opts->m_verbose_level = 0; + opts->mode_verbose_level = 0; break; } - else if ( !strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') { - opts->m_verbose_level = atoi(&argv[i][10]); + else if (!strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') { + opts->mode_verbose_level = atoi(&argv[i][10]); break; } } @@ -168,11 +282,11 @@ void parse_command_line(int argc, case 'q': /* use quiet mode; supress the message "0 differences found" */ - opts->m_quiet = 1; + opts->mode_quiet = 1; break; case 'r': - opts->m_report = 1; + opts->mode_report = 1; break; case 'l': @@ -214,23 +328,47 @@ void parse_command_line(int argc, } break; + case 'A': + opts->exclude_attr_path = 1; + + /* create linked list of excluding objects */ + if( (exclude_attr_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) { + HDprintf("Error: lack of memory!\n"); + h5diff_exit(EXIT_FAILURE); + } + + /* init */ + exclude_attr_node->obj_path = opt_arg; + exclude_attr_node->obj_type = H5TRAV_TYPE_UNKNOWN; + exclude_attr_prev = exclude_attr_head; + + if (NULL == exclude_attr_head) { + exclude_attr_head = exclude_attr_node; + exclude_attr_head->next = NULL; + } + else { + while(NULL != exclude_attr_prev->next) + exclude_attr_prev = exclude_attr_prev->next; + + exclude_attr_node->next = NULL; + exclude_attr_prev->next = exclude_attr_node; + } + break; + case 'd': - opts->d = 1; + opts->delta_bool = 1; - if (check_d_input(opt_arg) == - 1) { + if (check_d_input(opt_arg) == -1) { HDprintf("<-d %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } opts->delta = HDatof(opt_arg); - - /* -d 0 is the same as default */ - if (H5_DBL_ABS_EQUAL(opts->delta, (double)0.0F)) - opts->d=0; + /* do not check against default, the DBL_EPSILON is being replaced by user */ break; case 'p': - opts->p = 1; + opts->percent_bool = 1; if (check_p_input(opt_arg) == -1) { HDprintf("<-p %s> is not a valid option\n", opt_arg); usage(); @@ -240,12 +378,12 @@ void parse_command_line(int argc, /* -p 0 is the same as default */ if (H5_DBL_ABS_EQUAL(opts->percent, (double)0.0F)) - opts->p = 0; + opts->percent_bool = 0; break; case 'n': - opts->n = 1; - if ( check_n_input(opt_arg) == -1) { + opts->count_bool = 1; + if (check_n_input(opt_arg) == -1) { HDprintf("<-n %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); @@ -258,7 +396,7 @@ void parse_command_line(int argc, break; case 'c': - opts->m_list_not_cmp = 1; + opts->mode_list_not_cmp = 1; break; case 'e': @@ -266,35 +404,35 @@ void parse_command_line(int argc, break; case '1': - opts->vol_info_1.type = VOL_BY_VALUE; - opts->vol_info_1.u.value = (H5VL_class_value_t)HDatoi(opt_arg); - opts->custom_vol_1 = TRUE; + opts->vol_info[0].type = VOL_BY_VALUE; + opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(opt_arg); + opts->custom_vol[0] = TRUE; break; case '2': - opts->vol_info_1.type = VOL_BY_NAME; - opts->vol_info_1.u.name = opt_arg; - opts->custom_vol_1 = TRUE; + opts->vol_info[0].type = VOL_BY_NAME; + opts->vol_info[0].u.name = opt_arg; + opts->custom_vol[0] = TRUE; break; case '3': - opts->vol_info_1.info_string = opt_arg; + opts->vol_info[0].info_string = opt_arg; break; case '4': - opts->vol_info_2.type = VOL_BY_VALUE; - opts->vol_info_2.u.value = (H5VL_class_value_t)HDatoi(opt_arg); - opts->custom_vol_2 = TRUE; + opts->vol_info[1].type = VOL_BY_VALUE; + opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(opt_arg); + opts->custom_vol[1] = TRUE; break; case '5': - opts->vol_info_2.type = VOL_BY_NAME; - opts->vol_info_2.u.name = opt_arg; - opts->custom_vol_2 = TRUE; + opts->vol_info[1].type = VOL_BY_NAME; + opts->vol_info[1].u.name = opt_arg; + opts->custom_vol[1] = TRUE; break; case '6': - opts->vol_info_2.info_string = opt_arg; + opts->vol_info[1].info_string = opt_arg; break; } } @@ -306,30 +444,46 @@ void parse_command_line(int argc, if (opts->exclude_path) opts->exclude = exclude_head; + /* if exclude-attribute option is used, keep the exclude attr list */ + if (opts->exclude_attr_path) + opts->exclude_attr = exclude_attr_head; + /* check for file names to be processed */ - if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) { + if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { error_msg("missing file names\n"); usage(); h5diff_exit(EXIT_FAILURE); } - *fname1 = argv[ opt_ind ]; - *fname2 = argv[ opt_ind + 1 ]; - *objname1 = argv[ opt_ind + 2 ]; + *fname1 = argv[opt_ind]; + *fname2 = argv[opt_ind + 1]; + *objname1 = argv[opt_ind + 2]; + H5TOOLS_DEBUG("file1 = %s", *fname1); + H5TOOLS_DEBUG("file2 = %s", *fname2); if (*objname1 == NULL) { *objname2 = NULL; + H5TOOLS_ENDDEBUG("No obj names"); return; } + H5TOOLS_DEBUG("objname1 = %s", *objname1); - if (argv[ opt_ind + 3 ] != NULL) { - *objname2 = argv[ opt_ind + 3 ]; + if (argv[opt_ind + 3] != NULL) { + *objname2 = argv[opt_ind + 3]; } else { *objname2 = *objname1; } + H5TOOLS_DEBUG("objname2 = %s", *objname2); + /* + * TRILABS-227 is complete except for an issue with printing indices + * the following calls will enable subsetting + opts->sset[0] = parse_subset_params(*objname1); + opts->sset[1] = parse_subset_params(*objname2); + */ + H5TOOLS_ENDDEBUG(""); } @@ -337,26 +491,25 @@ void parse_command_line(int argc, * Function: print_info * * Purpose: print several information messages after h5diff call - * *------------------------------------------------------------------------- */ void print_info(diff_opt_t* opts) { - if (opts->m_quiet || opts->err_stat) + if (opts->mode_quiet || opts->err_stat) return; if (opts->cmn_objs == 0) { HDprintf("No common objects found. Files are not comparable.\n"); - if (!opts->m_verbose) + if (!opts->mode_verbose) HDprintf("Use -v for a list of objects.\n"); } if (opts->not_cmp == 1) { - if (opts->m_list_not_cmp == 0) { + if (opts->mode_list_not_cmp == 0) { HDprintf("--------------------------------\n"); HDprintf("Some objects are not comparable\n"); HDprintf("--------------------------------\n"); - if (opts->m_verbose) + if (opts->mode_verbose) HDprintf("Use -c for a list of objects without details of differences.\n"); else HDprintf("Use -c for a list of objects.\n"); @@ -370,19 +523,10 @@ void print_info(diff_opt_t* opts) * Purpose: check for valid input * * Return: 1 for ok, -1 for fail - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ H5_ATTR_PURE static int -check_n_input( const char *str ) +check_n_input(const char *str) { unsigned i; char c; @@ -406,24 +550,17 @@ check_n_input( const char *str ) * Purpose: check for a valid p option input * * Return: 1 for ok, -1 for fail - * - * Date: May 9, 2003 - * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ static int -check_p_input( const char *str ) +check_p_input(const char *str) { double x; /* - the atof return value on a hexadecimal input is different - on some systems; we do a character check for this - */ + * the atof return value on a hexadecimal input is different + * on some systems; we do a character check for this + */ if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; @@ -440,24 +577,17 @@ check_p_input( const char *str ) * Purpose: check for a valid d option input * * Return: 1 for ok, -1 for fail - * - * Date: November 11, 2007 - * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ static int -check_d_input( const char *str ) +check_d_input(const char *str) { double x; /* - the atof return value on a hexadecimal input is different - on some systems; we do a character check for this - */ + * the atof return value on a hexadecimal input is different + * on some systems; we do a character check for this + */ if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; @@ -474,7 +604,6 @@ check_d_input( const char *str ) * Purpose: print a usage message * * Return: void - * *------------------------------------------------------------------------- */ @@ -499,10 +628,9 @@ void usage(void) PRINTVALSTREAM(rawoutstream, " Verbose mode with level. Print differences and list of objects.\n"); PRINTVALSTREAM(rawoutstream, " Level of detail depends on value of N:\n"); PRINTVALSTREAM(rawoutstream, " 0 : Identical to '-v' or '--verbose'.\n"); - PRINTVALSTREAM(rawoutstream, " 1 : All level 0 information plus one-line attribute\n"); - PRINTVALSTREAM(rawoutstream, " status summary.\n"); - PRINTVALSTREAM(rawoutstream, " 2 : All level 1 information plus extended attribute\n"); - PRINTVALSTREAM(rawoutstream, " status report.\n"); + PRINTVALSTREAM(rawoutstream, " 1 : All level 0 information plus one-line attribute status summary.\n"); + PRINTVALSTREAM(rawoutstream, " 2 : All level 1 information plus extended attribute status report.\n"); + PRINTVALSTREAM(rawoutstream, " 3 : All level 2 information plus file names.\n"); PRINTVALSTREAM(rawoutstream, " -q, --quiet\n"); PRINTVALSTREAM(rawoutstream, " Quiet mode. Do not produce output.\n"); PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); @@ -591,7 +719,14 @@ void usage(void) PRINTVALSTREAM(rawoutstream, " excluded.\n"); PRINTVALSTREAM(rawoutstream, " This option can be used repeatedly to exclude multiple paths.\n"); PRINTVALSTREAM(rawoutstream, "\n"); - + PRINTVALSTREAM(rawoutstream, " --exclude-attribute \"path/to/object/with/attribute\"\n"); + PRINTVALSTREAM(rawoutstream, " Exclude attributes on the specified path to an object when comparing files or groups.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " If there are multiple paths to an object, only the specified path(s)\n"); + PRINTVALSTREAM(rawoutstream, " will be excluded; the comparison will include any path not explicitly\n"); + PRINTVALSTREAM(rawoutstream, " excluded.\n"); + PRINTVALSTREAM(rawoutstream, " This option can be used repeatedly to exclude multiple paths.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Modes of output:\n"); PRINTVALSTREAM(rawoutstream, " Default mode: print the number of differences found and where they occured\n"); PRINTVALSTREAM(rawoutstream, " -r Report mode: print the above plus the differences\n"); @@ -622,7 +757,22 @@ void usage(void) PRINTVALSTREAM(rawoutstream, " (The option --follow-symlinks overrides the default behavior when\n"); PRINTVALSTREAM(rawoutstream, " symbolic links are compared.).\n"); PRINTVALSTREAM(rawoutstream, "\n"); - + /* + * TRILABS-227 is complete except for an issue with printing indices + * the following will be needed for subsetting + PRINTVALSTREAM(rawoutstream, " Subsetting options:\n"); + PRINTVALSTREAM(rawoutstream, " Subsetting is available by using the fcompact form of subsetting, as follows:\n"); + PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]\n"); + PRINTVALSTREAM(rawoutstream, " It is not required to use all parameters, but until the last parameter value used,\n"); + PRINTVALSTREAM(rawoutstream, " all of the semicolons (;) are required, even when a parameter value is not specified. Example:\n"); + PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START;;COUNT;BLOCK]\n"); + PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START]\n"); + PRINTVALSTREAM(rawoutstream, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n"); + PRINTVALSTREAM(rawoutstream, " each dimension. START is optional and will default to 0 in each dimension.\n"); + PRINTVALSTREAM(rawoutstream, " Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with\n"); + PRINTVALSTREAM(rawoutstream, " one integer for each dimension of the dataset.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); +*/ PRINTVALSTREAM(rawoutstream, " Exit code:\n"); PRINTVALSTREAM(rawoutstream, " 0 if no differences, 1 if differences found, 2 if error\n"); PRINTVALSTREAM(rawoutstream, "\n"); diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index c5a0cbf..33d6570 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -69,10 +69,7 @@ int main(int argc, const char *argv[]) { int ret; - H5E_auto2_t func; - H5E_auto2_t tools_func; - void *edata; - void *tools_edata; + int i; const char *fname1 = NULL; const char *fname2 = NULL; const char *objname1 = NULL; @@ -83,27 +80,17 @@ int main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /*------------------------------------------------------------------------- * process the command-line *------------------------------------------------------------------------- */ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } + /* enable error reporting if command line option */ + h5tools_error_report(); /*------------------------------------------------------------------------- * do the diff @@ -130,6 +117,23 @@ int main(int argc, const char *argv[]) if (opts.err_stat) ret = 2; + /* free any buffers */ + for (i = 0; i < 2; i++) { + if (opts.sset[i]) { + if(opts.sset[i]->start.data) + HDfree(opts.sset[i]->start.data); + if(opts.sset[i]->stride.data) + HDfree(opts.sset[i]->stride.data); + if(opts.sset[i]->count.data) + HDfree(opts.sset[i]->count.data); + if(opts.sset[i]->block.data) + HDfree(opts.sset[i]->block.data); + + HDfree(opts.sset[i]); + opts.sset[i]=NULL; + } + } + h5diff_exit(ret); } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index dfaff17..2b21b1c 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -655,12 +655,12 @@ parse_hsize_list(const char *h_list, subset_d *d) *------------------------------------------------------------------------- */ static struct subset_t * -parse_subset_params(char *dset) +parse_subset_params(const char *dset) { struct subset_t *s = NULL; char *brace; - if (!disable_compact_subset && ((brace = HDstrrchr(dset, '[')) != NULL)) { + if (!dump_opts.disable_compact_subset && ((brace = HDstrrchr(dset, '[')) != NULL)) { *brace++ = '\0'; s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); @@ -891,50 +891,50 @@ parse_command_line(int argc, const char *argv[]) parse_start: switch ((char)opt) { case 'R': - display_region = TRUE; + dump_opts.display_region = TRUE; region_output = TRUE; break; case 'B': - display_bb = TRUE; + dump_opts.display_bb = TRUE; last_was_dset = FALSE; break; case 'n': - display_fi = TRUE; + dump_opts.display_fi = TRUE; last_was_dset = FALSE; if (opt_arg != NULL) h5trav_set_verbose(HDatoi(opt_arg)); break; case 'p': - display_dcpl = TRUE; + dump_opts.display_dcpl = TRUE; break; case 'y': - display_ai = FALSE; + dump_opts.display_ai = FALSE; break; case 'e': - display_escape = TRUE; + dump_opts.display_escape = TRUE; break; case 'H': - display_data = FALSE; - display_attr_data = FALSE; + dump_opts.display_data = FALSE; + dump_opts.display_attr_data = FALSE; last_was_dset = FALSE; break; case 'A': if (opt_arg != NULL) { if(0 == HDatoi(opt_arg)) - include_attrs = FALSE; + dump_opts.include_attrs = FALSE; } else { - display_data = FALSE; - display_attr_data = TRUE; + dump_opts.display_data = FALSE; + dump_opts.display_attr_data = TRUE; last_was_dset = FALSE; } break; case 'i': - display_oid = TRUE; + dump_opts.display_oid = TRUE; last_was_dset = FALSE; break; case 'r': - display_char = TRUE; + dump_opts.display_char = TRUE; break; case 'V': print_version(h5tools_getprogname()); @@ -955,7 +955,7 @@ parse_start: } break; case 'N': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -967,7 +967,7 @@ parse_start: last_was_dset = FALSE; break; case 'a': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -979,7 +979,7 @@ parse_start: last_was_dset = FALSE; break; case 'd': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -996,7 +996,7 @@ parse_start: driver_name_g = opt_arg; break; case 'g': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -1008,7 +1008,7 @@ parse_start: last_was_dset = FALSE; break; case 'l': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -1020,7 +1020,7 @@ parse_start: last_was_dset = FALSE; break; case 't': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -1047,13 +1047,13 @@ parse_start: } } else { - if(display_attr_data && !display_data) { + if(dump_opts.display_attr_data && !dump_opts.display_data) { if (h5tools_set_attr_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; } } - if(display_data || display_all) { + if(dump_opts.display_data || dump_opts.display_all) { if (h5tools_set_data_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; @@ -1061,7 +1061,7 @@ parse_start: } } - usingdasho = TRUE; + dump_opts.usingdasho = TRUE; last_was_dset = FALSE; outfname_g = opt_arg; break; @@ -1111,14 +1111,14 @@ parse_start: usage(h5tools_getprogname()); goto error; } - display_packed_bits = TRUE; + dump_opts.display_packed_bits = TRUE; break; case 'v': - display_vds_first = TRUE; + dump_opts.display_vds_first = TRUE; break; case 'G': - vds_gap_size = HDatoi(opt_arg); - if (vds_gap_size < 0) { + dump_opts.vds_gap_size = HDatoi(opt_arg); + if (dump_opts.vds_gap_size < 0) { usage(h5tools_getprogname()); goto error; } @@ -1255,7 +1255,7 @@ end_collect: enable_error_stack = 1; break; case 'C': - disable_compact_subset = TRUE; + dump_opts.disable_compact_subset = TRUE; break; case 'h': usage(h5tools_getprogname()); @@ -1357,14 +1357,10 @@ main(int argc, const char *argv[]) hid_t fid = H5I_INVALID_HID; hid_t gid = H5I_INVALID_HID; hid_t fapl_id = H5P_DEFAULT; - H5E_auto2_t func; - H5E_auto2_t tools_func; H5O_info2_t oi; struct handler_t *hand = NULL; int i; unsigned u; - void *edata; - void *tools_edata; char *fname = NULL; h5tools_setprogname(PROGRAMNAME); @@ -1373,17 +1369,9 @@ main(int argc, const char *argv[]) dump_function_table = &ddl_function_table; dump_indent = 0; - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - if((hand = parse_command_line(argc, argv))==NULL) { goto done; } @@ -1394,34 +1382,29 @@ main(int argc, const char *argv[]) goto done; } - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } - /* Check for conflicting options */ if (doxml_g) { - if (!display_all) { + if (!dump_opts.display_all) { error_msg("option \"%s\" not available for XML\n", "to display selected objects"); h5tools_setstatus(EXIT_FAILURE); goto done; } - else if (display_bb) { + else if (dump_opts.display_bb) { error_msg("option \"%s\" not available for XML\n", "--boot-block"); h5tools_setstatus(EXIT_FAILURE); goto done; } - else if (display_oid == 1) { + else if (dump_opts.display_oid == 1) { error_msg("option \"%s\" not available for XML\n", "--object-ids"); h5tools_setstatus(EXIT_FAILURE); goto done; } - else if (display_char == TRUE) { + else if (dump_opts.display_char == TRUE) { error_msg("option \"%s\" not available for XML\n", "--string"); h5tools_setstatus(EXIT_FAILURE); goto done; } - else if (usingdasho) { + else if (dump_opts.usingdasho) { error_msg("option \"%s\" not available for XML\n", "--output"); h5tools_setstatus(EXIT_FAILURE); goto done; @@ -1439,6 +1422,10 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } + + /* enable error reporting if command line option */ + h5tools_error_report(); + /* Initialize indexing options */ h5trav_set_index(sort_by, sort_order); @@ -1584,7 +1571,7 @@ main(int argc, const char *argv[]) } if (!doxml_g) { - if (display_fi) { + if (dump_opts.display_fi) { PRINTVALSTREAM(rawoutstream, "\n"); dump_fcontents(fid); end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend); @@ -1592,11 +1579,11 @@ main(int argc, const char *argv[]) goto done; } - if (display_bb) + if (dump_opts.display_bb) dump_fcpl(fid); } - if(display_all) { + if(dump_opts.display_all) { if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) { error_msg("unable to open root group\n"); h5tools_setstatus(EXIT_FAILURE); @@ -1661,9 +1648,6 @@ main(int argc, const char *argv[]) /* To Do: clean up XML table */ - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - leave(h5tools_getstatus()); done: @@ -1693,9 +1677,6 @@ done: /* To Do: clean up XML table */ - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - leave(h5tools_getstatus()); } /* main */ diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h index ca1fef6..548af09 100644 --- a/tools/src/h5dump/h5dump.h +++ b/tools/src/h5dump/h5dump.h @@ -52,8 +52,8 @@ typedef struct h5dump_table_list_t { h5dump_table_list_t table_list = {0, 0, NULL}; table_t *group_table = NULL, *dset_table = NULL, *type_table = NULL; -unsigned dump_indent = 0; /*how far in to indent the line */ +unsigned dump_indent = 0; /* how far in to indent the line */ int unamedtype = 0; /* shared datatype with no name */ hbool_t hit_elink = FALSE; /* whether we have traversed an external link */ size_t prefix_len = 1024; @@ -61,23 +61,26 @@ char *prefix = NULL; const char *fp_format = NULL; /* things to display or which are set via command line parameters */ -int display_all = TRUE; -int display_oid = FALSE; -int display_data = TRUE; -int display_attr_data = TRUE; -int display_char = FALSE; /*print 1-byte numbers as ASCII */ -int usingdasho = FALSE; -int display_bb = FALSE; /*superblock */ -int display_dcpl = FALSE; /*dcpl */ -int display_fi = FALSE; /*file index */ -int display_ai = TRUE; /*array index */ -int display_escape = FALSE; /*escape non printable characters */ -int display_region = FALSE; /*print region reference data */ -int disable_compact_subset= FALSE; /* disable compact form of subset notation */ -int display_packed_bits = FALSE; /*print 1-8 byte numbers as packed bits*/ -int include_attrs = TRUE; /* Display attributes */ -int display_vds_first = FALSE; /* vds display to all by default*/ -int vds_gap_size = 0; /* vds skip missing files default is none */ +typedef struct { + int display_all; + int display_oid; + int display_data; + int display_attr_data; + int display_char; /* print 1-byte numbers as ASCII */ + int usingdasho; + int display_bb; /* superblock */ + int display_dcpl; /* dcpl */ + int display_fi; /* file index */ + int display_ai; /* array index */ + int display_escape; /* escape non printable characters */ + int display_region; /* print region reference data */ + int disable_compact_subset; /* disable compact form of subset notation */ + int display_packed_bits; /* print 1-8 byte numbers as packed bits */ + int include_attrs; /* Display attributes */ + int display_vds_first; /* vds display to all by default */ + int vds_gap_size; /* vds skip missing files default is none */ +} dump_opt_t; +dump_opt_t dump_opts = {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0}; #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX (8*sizeof(long long)) /* Maximum bits size of integer types of packed-bits */ diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index 1df205c..b50ce52 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -103,13 +103,13 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - ctx.display_index = display_ai; - ctx.display_char = display_char; + ctx.display_index = dump_opts.display_ai; + ctx.display_char = dump_opts.display_char; attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT); - oid_output = display_oid; - data_output = display_data; - attr_data_output = display_attr_data; + oid_output = dump_opts.display_oid; + data_output = dump_opts.display_data; + attr_data_output = dump_opts.display_attr_data; string_dataformat = *outputformat; @@ -125,7 +125,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; h5dump_type_table = type_table; @@ -185,7 +185,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; /* Build the object's path name */ @@ -242,16 +242,16 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT break; case H5O_TYPE_DATASET: - if(display_data) { + if(dump_opts.display_data) { if ((dapl_id = H5Pcreate(H5P_DATASET_ACCESS)) < 0) { error_msg("error in creating default access property list ID\n"); } - if (display_vds_first) { + if (dump_opts.display_vds_first) { if(H5Pset_virtual_view(dapl_id, H5D_VDS_FIRST_MISSING) < 0) error_msg("error in setting access property list ID, virtual_view\n"); } - if (vds_gap_size > 0) { - if(H5Pset_virtual_printf_gap(dapl_id, (hsize_t)vds_gap_size) < 0) + if (dump_opts.vds_gap_size > 0) { + if(H5Pset_virtual_printf_gap(dapl_id, (hsize_t)dump_opts.vds_gap_size) < 0) error_msg("error in setting access property list ID, virtual_printf_gap\n"); } } @@ -565,7 +565,7 @@ attr_iteration(hid_t gid, unsigned attr_crt_order_flags) { /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group for attributes, then, sort by creation order, otherwise by name */ - if(include_attrs) { + if(dump_opts.include_attrs) { if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { error_msg("error getting attribute information\n"); @@ -642,7 +642,7 @@ dump_named_datatype(hid_t tid, const char *name) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; if ((tcpl_id = H5Tget_create_plist(tid)) < 0) { @@ -795,7 +795,7 @@ dump_group(hid_t gid, const char *name) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.need_prefix = TRUE; @@ -831,7 +831,7 @@ dump_group(hid_t gid, const char *name) } } /* end if */ - if(display_oid) + if(dump_opts.display_oid) h5tools_dump_oid(rawoutstream, outputformat, &ctx, gid); h5tools_dump_comment(rawoutstream, outputformat, &ctx, gid); @@ -926,7 +926,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; if ((dcpl_id = H5Dget_create_plist(did)) < 0) { @@ -967,11 +967,11 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) h5tools_dump_dataspace(rawoutstream, outputformat, &ctx, space); H5Sclose(space); - if(display_oid) { + if(dump_opts.display_oid) { h5tools_dump_oid(rawoutstream, outputformat, &ctx, did); } - if(display_dcpl) { + if(dump_opts.display_dcpl) { h5dump_type_table = type_table; h5tools_dump_dcpl(rawoutstream, outputformat, &ctx, dcpl_id, type, did); h5dump_type_table = NULL; @@ -979,16 +979,16 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) H5Pclose(dcpl_id); ctx.sset = sset; - ctx.display_index = display_ai; - ctx.display_char = display_char; - if(display_data) { + ctx.display_index = dump_opts.display_ai; + ctx.display_char = dump_opts.display_char; + if(dump_opts.display_data) { unsigned data_loop = 1; unsigned u; - if(display_packed_bits) + if(dump_opts.display_packed_bits) data_loop = packed_bits_num; for(u = 0; u < data_loop; u++) { - if(display_packed_bits) { + if(dump_opts.display_packed_bits) { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ @@ -1091,7 +1091,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; HDmemset(&ctx, 0, sizeof(ctx)); @@ -1099,7 +1099,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) ctx.cur_column = dump_indent; ctx.sset = sset; ctx.display_index = display_index; - ctx.display_char = display_char; + ctx.display_char = dump_opts.display_char; if(obj_data == DATASET_DATA) print_dataset = TRUE; @@ -1527,8 +1527,8 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - ctx.display_index = display_ai; - ctx.display_char = display_char; + ctx.display_index = dump_opts.display_ai; + ctx.display_char = dump_opts.display_char; string_dataformat = *outputformat; @@ -1544,7 +1544,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/"); @@ -1583,9 +1583,9 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 } /* end if */ attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT); - oid_output = display_oid; - data_output = display_data; - attr_data_output = display_attr_data; + oid_output = dump_opts.display_oid; + data_output = dump_opts.display_data; + attr_data_output = dump_opts.display_attr_data; h5dump_type_table = type_table; h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id); @@ -1637,16 +1637,16 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis struct subset_t *sset = (struct subset_t *)data; const char *real_name = display_name ? display_name : dset; - if(display_data) { + if(dump_opts.display_data) { if ((dapl_id = H5Pcreate(H5P_DATASET_ACCESS)) < 0) { error_msg("error in creating default access property list ID\n"); } - if (display_vds_first) { + if (dump_opts.display_vds_first) { if(H5Pset_virtual_view(dapl_id, H5D_VDS_FIRST_MISSING) < 0) error_msg("error in setting access property list ID, virtual_view\n"); } - if (vds_gap_size > 0) { - if(H5Pset_virtual_printf_gap(dapl_id, (hsize_t)vds_gap_size) < 0) + if (dump_opts.vds_gap_size > 0) { + if(H5Pset_virtual_printf_gap(dapl_id, (hsize_t)dump_opts.vds_gap_size) < 0) error_msg("error in setting access property list ID, virtual_printf_gap\n"); } } diff --git a/tools/src/h5dump/h5dump_extern.h b/tools/src/h5dump/h5dump_extern.h index 00d3bd2..c615621 100644 --- a/tools/src/h5dump/h5dump_extern.h +++ b/tools/src/h5dump/h5dump_extern.h @@ -50,32 +50,35 @@ typedef struct h5dump_table_list_t { extern h5dump_table_list_t table_list; extern table_t *group_table, *dset_table, *type_table; -extern unsigned dump_indent; /*how far in to indent the line */ -extern int unamedtype; /* shared datatype with no name */ -extern hbool_t hit_elink; /* whether we have traversed an external link */ +extern unsigned dump_indent; /* how far in to indent the line */ +extern int unamedtype; /* shared datatype with no name */ +extern hbool_t hit_elink; /* whether we have traversed an external link */ extern size_t prefix_len; extern char *prefix; extern const char *fp_format; /* things to display or which are set via command line parameters */ -extern int display_all; -extern int display_oid; -extern int display_data; -extern int display_attr_data; -extern int display_char; /*print 1-byte numbers as ASCII */ -extern int usingdasho; -extern int display_bb; /*superblock */ -extern int display_dcpl; /*dcpl */ -extern int display_fi; /*file index */ -extern int display_ai; /*array index */ -extern int display_escape; /*escape non printable characters */ -extern int display_region; /*print region reference data */ -extern int disable_compact_subset; /* disable compact form of subset notation */ -extern int display_packed_bits; /*print 1-8 byte numbers as packed bits*/ -extern int include_attrs; /* Display attributes */ -extern int display_vds_first; /* vds display to first missing */ -extern int vds_gap_size; /* vds skip missing files */ +typedef struct { + int display_all; + int display_oid; + int display_data; + int display_attr_data; + int display_char; /* print 1-byte numbers as ASCII */ + int usingdasho; + int display_bb; /* superblock */ + int display_dcpl; /* dcpl */ + int display_fi; /* file index */ + int display_ai; /* array index */ + int display_escape; /* escape non printable characters */ + int display_region; /* print region reference data */ + int disable_compact_subset; /* disable compact form of subset notation */ + int display_packed_bits; /* print 1-8 byte numbers as packed bits */ + int include_attrs; /* Display attributes */ + int display_vds_first; /* vds display to all by default */ + int vds_gap_size; /* vds skip missing files default is none */ +} dump_opt_t; +extern dump_opt_t dump_opts; #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX 8*sizeof(long long) /* Maximum bits size of integer types of packed-bits */ diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 95aff48..bb47f77 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -162,7 +162,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; /* Build the object's path name */ @@ -888,7 +888,7 @@ xml_print_datatype(hid_t type, unsigned in_group) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; if(!in_group && H5Tcommitted(type) > 0) { @@ -1538,7 +1538,7 @@ xml_dump_datatype(hid_t type) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.indent_level++; @@ -1669,7 +1669,7 @@ xml_dump_dataspace(hid_t space) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.indent_level++; @@ -1992,7 +1992,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.need_prefix = TRUE; @@ -2014,7 +2014,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level++; dump_indent += COL; - if (display_attr_data && space_type != H5S_NULL) { + if (dump_opts.display_attr_data && space_type != H5S_NULL) { switch (H5Tget_class(type)) { case H5T_INTEGER: case H5T_FLOAT: @@ -2293,7 +2293,7 @@ xml_dump_named_datatype(hid_t type, const char *name) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; dtxid = (char *)HDmalloc((size_t)100); @@ -2506,7 +2506,7 @@ xml_dump_group(hid_t gid, const char *name) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; if(HDstrcmp(name, "/") == 0) { @@ -2889,7 +2889,7 @@ xml_print_refs(hid_t did, int source) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; for (i = 0; i < (hsize_t)ssiz; i++) { @@ -3039,7 +3039,7 @@ xml_print_strs(hid_t did, int source) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; for (i = 0; i < (hsize_t)ssiz; i++) { @@ -3151,7 +3151,7 @@ check_filters(hid_t dcpl) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; nfilt = H5Pget_nfilters(dcpl); @@ -3287,7 +3287,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.indent_level++; @@ -3627,7 +3627,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; xml_name_to_XID(did, tmp, rstr, 100, 1); @@ -3916,7 +3916,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss dump_indent -= COL; tempi = H5Dget_storage_size(did); - if (display_data && (tempi > 0)) { + if (dump_opts.display_data && (tempi > 0)) { switch (H5Tget_class(type)) { case H5T_INTEGER: case H5T_FLOAT: @@ -4172,7 +4172,7 @@ xml_print_enum(hid_t type) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; nmembs = (unsigned)H5Tget_nmembers(type); diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index 2c4cf41..d63f36f 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -64,7 +64,7 @@ static struct long_options l_opts[] = { { NULL, 0, '\0' } }; - + /*------------------------------------------------------------------------- * Function: usage * @@ -109,7 +109,7 @@ static void usage(const char *prog) * Purpose: parse command line input * * Return: Success: 0 - * Failure: 1 + * Failure: 1 * *------------------------------------------------------------------------- */ @@ -127,47 +127,47 @@ parse_command_line(int argc, const char **argv) /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch((char) opt) { - case 'h': - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - goto error; - - case 'V': - print_version(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - goto error; - - case 'v': - verbose_g = TRUE; - break; - - case 'd': /* -d dname */ - if(opt_arg != NULL && *opt_arg) - dname_g = HDstrdup(opt_arg); - if(dname_g == NULL) { - h5tools_setstatus(EXIT_FAILURE); - error_msg("No dataset name\n", opt_arg); - usage(h5tools_getprogname()); - goto error; - } - dset_g = TRUE; - break; - - case 'n': /* -n */ - noop_g = TRUE; - break; - - case 'E': - enable_error_stack = 1; - break; - - default: - h5tools_setstatus(EXIT_FAILURE); - usage(h5tools_getprogname()); - goto error; - break; - } /* switch */ + switch((char) opt) { + case 'h': + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + goto error; + + case 'V': + print_version(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + goto error; + + case 'v': + verbose_g = TRUE; + break; + + case 'd': /* -d dname */ + if(opt_arg != NULL && *opt_arg) + dname_g = HDstrdup(opt_arg); + if(dname_g == NULL) { + h5tools_setstatus(EXIT_FAILURE); + error_msg("No dataset name\n", opt_arg); + usage(h5tools_getprogname()); + goto error; + } + dset_g = TRUE; + break; + + case 'n': /* -n */ + noop_g = TRUE; + break; + + case 'E': + enable_error_stack = 1; + break; + + default: + h5tools_setstatus(EXIT_FAILURE); + usage(h5tools_getprogname()); + goto error; + break; + } /* switch */ } /* while */ if (argc <= opt_ind) { @@ -185,7 +185,7 @@ error: return(-1); ; } /* parse_command_line() */ - + /*------------------------------------------------------------------------- * Function: leave * @@ -207,17 +207,17 @@ leave(int ret) * Function: convert() * * Purpose: To downgrade a dataset's indexing type or layout version: - * For chunked: - * Downgrade the chunk indexing type to version 1 B-tree - * If type is already version 1 B-tree, no further action - * For compact/contiguous: - * Downgrade the layout version from 4 to 3 - * If version is already <= 3, no further action - * For virtual: - * No further action + * For chunked: + * Downgrade the chunk indexing type to version 1 B-tree + * If type is already version 1 B-tree, no further action + * For compact/contiguous: + * Downgrade the layout version from 4 to 3 + * If version is already <= 3, no further action + * For virtual: + * No further action * * Return: Success: 0 - * Failure: 1 + * Failure: 1 * *------------------------------------------------------------------------- */ @@ -312,7 +312,7 @@ convert(hid_t fid, const char *dname) } if(verbose_g) - HDfprintf(stdout, "Converting the dataset...\n"); + HDfprintf(stdout, "Converting the dataset...\n"); /* Downgrade the dataset */ if(H5Dformat_convert(did) < 0) { @@ -377,7 +377,7 @@ convert_dsets_cb(const char *path, const H5O_info2_t *oi, const char *already_vi if(verbose_g) HDfprintf(stdout, "Going to process dataset:%s...\n", path); if(convert(fid, path) < 0) - goto error; + goto error; } /* end if */ } /* end if */ @@ -387,62 +387,61 @@ error: return -1; } /* end convert_dsets_cb() */ - + /*------------------------------------------------------------------------- * Function: main * * Purpose: To convert the chunk indexing type of a dataset in a file to - * version 1 B-tree. + * version 1 B-tree. * * Return: Success: 0 - * Failure: 1 + * Failure: 1 * *------------------------------------------------------------------------- */ int main(int argc, const char *argv[]) { - H5E_auto2_t func; - void *edata; hid_t fid = H5I_INVALID_HID; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); /* Parse command line options */ if(parse_command_line(argc, argv) < 0) - goto done; + goto done; else if(verbose_g) - HDfprintf(stdout, "Process command line options\n"); + HDfprintf(stdout, "Process command line options\n"); if(noop_g && verbose_g) - HDfprintf(stdout, "It is noop...\n"); + HDfprintf(stdout, "It is noop...\n"); + + /* enable error reporting if command line option */ + h5tools_error_report(); /* Open the HDF5 file */ if((fid = h5tools_fopen(fname_g, H5F_ACC_RDWR, H5P_DEFAULT, FALSE, NULL, 0)) < 0) { - error_msg("unable to open file \"%s\"\n", fname_g); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } else if(verbose_g) - HDfprintf(stdout, "Open the file %s\n", fname_g); + error_msg("unable to open file \"%s\"\n", fname_g); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + else if(verbose_g) + HDfprintf(stdout, "Open the file %s\n", fname_g); if(dset_g) { /* Convert a specified dataset in the file */ - if(verbose_g) - HDfprintf(stdout, "Going to process dataset: %s...\n", dname_g); - if(convert(fid, dname_g) < 0) - goto done; - } else { /* Convert all datasets in the file */ - if(verbose_g) - HDfprintf(stdout, "Processing all datasets in the file...\n"); - if(h5trav_visit(fid, "/", TRUE, TRUE, convert_dsets_cb, NULL, &fid, H5O_INFO_BASIC) < 0) - goto done; + if(verbose_g) + HDfprintf(stdout, "Going to process dataset: %s...\n", dname_g); + if(convert(fid, dname_g) < 0) + goto done; + } + else { /* Convert all datasets in the file */ + if(verbose_g) + HDfprintf(stdout, "Processing all datasets in the file...\n"); + if(h5trav_visit(fid, "/", TRUE, TRUE, convert_dsets_cb, NULL, &fid, H5O_INFO_BASIC) < 0) + goto done; } /* end else */ if(verbose_g) { @@ -464,19 +463,20 @@ main(int argc, const char *argv[]) done: /* Close the file */ if(fid >= 0) { - if(H5Fclose(fid) < 0) { - error_msg("unable to close file \"%s\"\n", fname_g); - h5tools_setstatus(EXIT_FAILURE); - } else if(verbose_g) - HDfprintf(stdout, "Close the file\n"); + if(H5Fclose(fid) < 0) { + error_msg("unable to close file \"%s\"\n", fname_g); + h5tools_setstatus(EXIT_FAILURE); + } + else if(verbose_g) { + HDfprintf(stdout, "Close the file\n"); + } } /* end if */ if(fname_g) - HDfree(fname_g); + HDfree(fname_g); if(dname_g) - HDfree(dname_g); + HDfree(dname_g); - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(h5tools_getstatus()); } /* end main() */ diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 009e527..8b61112 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -120,13 +120,6 @@ usage (const char *prog) static void leave(int ret) { - if (ub_file) - HDfree (ub_file); - if (input_file) - HDfree (input_file); - if (output_file) - HDfree (output_file); - h5tools_close(); HDexit(ret); @@ -195,8 +188,6 @@ main (int argc, const char *argv[]) int ufid = -1; int h5fid = -1; int ofid = -1; - void *edata; - H5E_auto2_t func; hid_t ifile = H5I_INVALID_HID; hid_t plist = H5I_INVALID_HID; herr_t status; @@ -214,20 +205,20 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); parse_command_line(argc, argv); + /* enable error reporting if command line option */ + h5tools_error_report(); + if (ub_file == NULL) { /* no user block */ error_msg("missing argument for -u .\n"); help_ref_msg(stderr); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } testval = H5Fis_accessible(ub_file, H5P_DEFAULT); @@ -235,13 +226,15 @@ main (int argc, const char *argv[]) if (testval > 0) { error_msg("-u cannot be HDF5 file, but it appears to be an HDF5 file.\n"); help_ref_msg(stderr); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } if (input_file == NULL) { error_msg("missing argument for -i .\n"); help_ref_msg(stderr); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } testval = H5Fis_accessible(input_file, H5P_DEFAULT); @@ -249,45 +242,49 @@ main (int argc, const char *argv[]) if (testval <= 0) { error_msg("Input HDF5 file \"%s\" is not HDF5 format.\n", input_file); help_ref_msg(stderr); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } ifile = H5Fopen(input_file, H5F_ACC_RDONLY, H5P_DEFAULT); if (ifile < 0) { error_msg("Can't open input HDF5 file \"%s\"\n", input_file); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } plist = H5Fget_create_plist(ifile); if (plist < 0) { error_msg("Can't get file creation plist for file \"%s\"\n", input_file); - H5Fclose(ifile); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } status = H5Pget_userblock(plist, &usize); if (status < 0) { error_msg("Can't get user block for file \"%s\"\n", input_file); - H5Pclose(plist); - H5Fclose(ifile); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } H5Pclose(plist); + plist = H5I_INVALID_HID; H5Fclose(ifile); + ifile = H5I_INVALID_HID; ufid = HDopen(ub_file, O_RDONLY); if(ufid < 0) { error_msg("unable to open user block file \"%s\"\n", ub_file); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } res = HDfstat(ufid, &sbuf); if(res < 0) { error_msg("Can't stat file \"%s\"\n", ub_file); - HDclose (ufid); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } fsize = (off_t)sbuf.st_size; @@ -295,16 +292,15 @@ main (int argc, const char *argv[]) h5fid = HDopen(input_file, O_RDONLY); if(h5fid < 0) { error_msg("unable to open HDF5 file for read \"%s\"\n", input_file); - HDclose (ufid); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } res = HDfstat(h5fid, &sbuf2); if(res < 0) { error_msg("Can't stat file \"%s\"\n", input_file); - HDclose (h5fid); - HDclose (ufid); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } h5fsize = (hsize_t)sbuf2.st_size; @@ -314,9 +310,8 @@ main (int argc, const char *argv[]) if (ofid < 0) { error_msg("unable to open output file \"%s\"\n", output_file); - HDclose (h5fid); - HDclose (ufid); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } } else { @@ -324,9 +319,8 @@ main (int argc, const char *argv[]) if (ofid < 0) { error_msg("unable to create output file \"%s\"\n", output_file); - HDclose (h5fid); - HDclose (ufid); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } } @@ -365,12 +359,11 @@ main (int argc, const char *argv[]) /* pad the ub */ if(write_pad(ofid, where, &where) < 0) { error_msg("Can't pad file \"%s\"\n", output_file); - HDclose (h5fid); - HDclose (ufid); - HDclose (ofid); - leave (EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } /* end if */ +done: if(ub_file) HDfree(ub_file); if(input_file) @@ -378,6 +371,11 @@ main (int argc, const char *argv[]) if(output_file) HDfree(output_file); + if(plist >= 0) + H5Pclose(plist); + if(ifile >= 0) + H5Fclose(ifile); + if(ufid >= 0) HDclose(ufid); if(h5fid >= 0) @@ -385,7 +383,7 @@ main (int argc, const char *argv[]) if(ofid >= 0) HDclose(ofid); - return h5tools_getstatus(); + leave(h5tools_getstatus()); } /*------------------------------------------------------------------------- diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 203522b..b48e2c1 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -185,6 +185,13 @@ done: return EXIT_FAILURE; } +static void +leave(int ret) +{ + h5tools_close(); + HDexit(ret); +} + /*------------------------------------------------------------------------- * Function: main * @@ -197,8 +204,6 @@ done: int main(int argc, const char *argv[]) { - void *edata; - H5E_auto2_t func; hid_t ifile = H5I_INVALID_HID; hid_t plist = H5I_INVALID_HID; off_t fsize; @@ -211,16 +216,15 @@ main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); if(EXIT_FAILURE == parse_command_line(argc, argv)) goto done; + /* enable error reporting if command line option */ + h5tools_error_report(); + if (input_file == NULL) { /* no user block */ error_msg("missing argument for HDF5 file input.\n"); @@ -319,9 +323,7 @@ done: HDfree(ub_file); } - h5tools_close(); - - return h5tools_getstatus(); + leave(h5tools_getstatus()); } /*------------------------------------------------------------------------- diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 765ab63..fef7aa9 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1298,230 +1298,6 @@ print_type(h5tools_str_t *buffer, hid_t type, int ind) h5tools_str_append(buffer,"%lu-byte class-%u unknown", (unsigned long)H5Tget_size(type), (unsigned)data_class); } -/* - * - */ -static void -dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t container, H5R_ref_t *ref_buf, int ndims) -{ - hid_t new_obj_id = H5I_INVALID_HID; - hid_t new_obj_sid = H5I_INVALID_HID; - hsize_t elmt_counter = 0; /*counts the # elements printed. */ - size_t ncols = 80; /* available output width */ - int i; - hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t datactx; /* print context */ - - H5TOOLS_START_DEBUG(""); - - datactx = *ctx; /* print context */ - /* Assume entire data space to be printed */ - if (datactx.ndims > 0) - for (i = 0; (unsigned)i < datactx.ndims; i++) - datactx.p_min_idx[i] = 0; - datactx.need_prefix = TRUE; - - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); - for(i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { - H5O_type_t obj_type = -1; /* Object type */ - H5R_type_t ref_type; /* Reference type */ - - H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos); - - datactx.need_prefix = TRUE; - h5tools_str_reset(&buffer); - H5TOOLS_DEBUG("reference loop - h5tools_str_sprint with H5T_STD_REF:%d", i); - h5tools_str_sprint(&buffer, info, container, H5T_STD_REF, &ref_buf[i], &datactx); - h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)i, (hsize_t)ndims); - - ref_type = H5Rget_type((const H5R_ref_t *)&ref_buf[i]); - switch (ref_type) { - case H5R_OBJECT1: - H5TOOLS_DEBUG("ref_type is H5R_OBJECT1"); - if (H5Rget_obj_type3(&ref_buf[i], H5P_DEFAULT, &obj_type) >= 0) { - switch (obj_type) { - case H5O_TYPE_DATASET: - if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - datactx.indent_level++; - h5tools_dump_dset(stream, info, &datactx, new_obj_id); - datactx.indent_level--; - if(H5Dclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed"); - if(H5Rdestroy(&ref_buf[i]) < 0) - H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1:H5O_TYPE_DATASET failed"); - } - else - H5TOOLS_INFO("H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed"); - break; - - case H5O_TYPE_GROUP: - case H5O_TYPE_NAMED_DATATYPE: - case H5O_TYPE_MAP: - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - break; - } /* end switch */ - } - else - H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT1 failed"); - break; - case H5R_DATASET_REGION1: - H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION1"); - if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - datactx.indent_level++; - h5tools_dump_dset(stream, info, &datactx, new_obj_id); - datactx.indent_level--; - if(H5Dclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION1 failed"); - if(H5Rdestroy(&ref_buf[i]) < 0) - H5TOOLS_INFO("H5Rdestroy H5R_DATASET_REGION1 failed"); - } - else - H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION1 failed"); - break; - case H5R_OBJECT2: - H5TOOLS_DEBUG("ref_type is H5R_OBJECT2"); - if (H5Rget_obj_type3(&ref_buf[i], H5P_DEFAULT, &obj_type) >= 0) { - switch (obj_type) { - case H5O_TYPE_GROUP: - break; - - case H5O_TYPE_DATASET: - if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - datactx.indent_level++; - h5tools_dump_dset(stream, info, &datactx, new_obj_id); - datactx.indent_level--; - if(H5Oclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed"); - if(H5Rdestroy(&ref_buf[i]) < 0) - H5TOOLS_INFO("H5Rdestroy H5R_OBJECT2 failed"); - } - else - H5TOOLS_INFO("H5Ropen_object H5R_OBJECT2 failed"); - break; - - case H5O_TYPE_NAMED_DATATYPE: - break; - - case H5O_TYPE_MAP: - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - break; - } /* end switch */ - } - else - H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT2 failed"); - break; - case H5R_DATASET_REGION2: - H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION2"); - - if (info->line_ncols > 0) - ncols = info->line_ncols; - - /* if (new_obj_id < 0) - could mean that no reference was written do not throw failure */ - if((new_obj_id = H5Ropen_object(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) < 0) - H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 failed"); - else { - if((new_obj_sid = H5Ropen_region(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - if (h5tools_is_zero(&ref_buf[i], H5Tget_size(H5T_STD_REF))) { - H5TOOLS_DEBUG("NULL H5R_DATASET_REGION2"); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, " {"); - h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - - datactx.need_prefix = TRUE; - datactx.indent_level++; - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "NULL"); - h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - datactx.indent_level--; - datactx.need_prefix = TRUE; - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "}"); - h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - else { - H5S_sel_type region_type; - - region_type = H5Sget_select_type(new_obj_sid); - if(region_type == H5S_SEL_POINTS) { - /* Print point information */ - H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION2"); - h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, info, &datactx, - &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); - } - else if(region_type == H5S_SEL_HYPERSLABS) { - /* Print block information */ - H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION2"); - h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, info, &datactx, - &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); - } - else - H5TOOLS_INFO("invalid region type"); - } /* end else to if (h5tools_is_zero(... */ - if(H5Sclose(new_obj_sid) < 0) - H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION2 failed"); - } - else - H5TOOLS_INFO("H5Ropen_region H5R_DATASET_REGION2 failed"); - if(H5Dclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed"); - if(H5Rdestroy(&ref_buf[i]) < 0) - H5TOOLS_INFO("H5Rdestroy H5R_DATASET_REGION2 failed"); - } - break; - case H5R_ATTR: - H5TOOLS_DEBUG("ref_type is H5R_ATTR"); - if((new_obj_id = H5Ropen_attr(&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - h5tools_dump_region_attribute(new_obj_id, stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - if(H5Aclose(new_obj_id) < 0) - H5TOOLS_INFO("H5Aclose H5R_ATTR failed"); - if(H5Rdestroy(&ref_buf[i]) < 0) - H5TOOLS_INFO("H5Rdestroy H5R_ATTR failed"); - } - else { - H5TOOLS_DEBUG("NULL H5R_ATTR"); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, " {"); - h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - - datactx.need_prefix = TRUE; - datactx.indent_level++; - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "NULL"); - h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - datactx.indent_level--; - datactx.need_prefix = TRUE; - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "}"); - h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - - H5TOOLS_INFO("H5Ropen_attr H5R_ATTR failed"); - } - break; - case H5R_BADTYPE: - case H5R_MAXTYPE: - default: - break; - } /* end switch */ - - H5TOOLS_DEBUG("finished reference loop:%d",i); - } /* end for(i = 0; i < ndims; i++, ctx->cur_elmt++, elmt_counter++) */ - - h5tools_str_close(&buffer); - - PRINTVALSTREAM(stream, "\n"); - - H5TOOLS_ENDDEBUG(""); -} - /*------------------------------------------------------------------------- * Function: dump_dataset_values * @@ -1653,13 +1429,9 @@ dump_dataset_values(hid_t dset) H5TOOLS_DEBUG("ndims=%d - ctx.ndims=%d", ndims, ctx.ndims); /* Assume entire data space to be printed */ - if (ctx.ndims > 0) - for (i = 0; i < (size_t)ctx.ndims; i++) - ctx.p_min_idx[i] = 0; - H5Sget_simple_extent_dims(space, total_size, NULL); - if (ctx.ndims > 0) - init_acc_pos(&ctx, total_size); + init_acc_pos(ctx.ndims, total_size, ctx.acc, ctx.pos, ctx.p_min_idx); + ctx.need_prefix = TRUE; if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { @@ -1669,7 +1441,9 @@ dump_dataset_values(hid_t dset) H5TOOLS_INFO("H5Dread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } - dump_reference(rawoutstream, info, &ctx, dset, ref_buf, ndims); + h5tools_dump_reference(rawoutstream, info, &ctx, dset, ref_buf, ndims); + + PRINTVALSTREAM(rawoutstream, "\n"); HDfree(ref_buf); } } @@ -1824,13 +1598,9 @@ dump_attribute_values(hid_t attr) H5TOOLS_DEBUG("ndims=%d - ctx.ndims=%d", ndims, ctx.ndims); /* Assume entire data space to be printed */ - if (ctx.ndims > 0) - for (i = 0; i < (size_t)ctx.ndims; i++) - ctx.p_min_idx[i] = 0; - H5Sget_simple_extent_dims(space, total_size, NULL); - if (ctx.ndims > 0) - init_acc_pos(&ctx, total_size); + init_acc_pos(ctx.ndims, total_size, ctx.acc, ctx.pos, ctx.p_min_idx); + ctx.need_prefix = TRUE; if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { @@ -1841,7 +1611,9 @@ dump_attribute_values(hid_t attr) H5TOOLS_GOTO_DONE_NO_RET(); } ctx.indent_level++; - dump_reference(rawoutstream, info, &ctx, attr, ref_buf, ndims); + h5tools_dump_reference(rawoutstream, info, &ctx, attr, ref_buf, ndims); + + PRINTVALSTREAM(rawoutstream, "\n"); ctx.indent_level--; HDfree(ref_buf); } @@ -2856,10 +2628,6 @@ main(int argc, const char *argv[]) const char *preferred_driver = NULL; int err_exit = 0; hid_t fapl_id = H5P_DEFAULT; - H5E_auto2_t func; - H5E_auto2_t tools_func; - void *edata; - void *tools_edata; hbool_t custom_vol_fapl = FALSE; h5tools_vol_info_t vol_info; @@ -2889,17 +2657,9 @@ main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /* Initialize fapl info struct */ HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t)); @@ -3158,6 +2918,9 @@ main(int argc, const char *argv[]) } } /* end for */ + /* enable error reporting if command line option */ + h5tools_error_report(); + /* If no arguments remain then print a usage message (instead of doing * absolutely nothing ;-) */ if (argno >= argc) { @@ -3208,11 +2971,6 @@ main(int argc, const char *argv[]) } } - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } - /* Each remaining argument is an hdf5 file followed by an optional slash * and object name. * @@ -3271,7 +3029,6 @@ main(int argc, const char *argv[]) x = oname; if (NULL == (oname = HDstrdup(oname))) { HDfprintf(rawerrorstream, "memory allocation failed\n"); - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(EXIT_FAILURE); } *x = '\0'; @@ -3316,7 +3073,6 @@ main(int argc, const char *argv[]) h5tools_str_reset(&buffer); print_obj_name(&buffer, &iter, oname, "**NOT FOUND**"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(EXIT_FAILURE); } /* end if */ } /* end if */ @@ -3326,7 +3082,6 @@ main(int argc, const char *argv[]) /* Open the object and display it's information */ if (li.type == H5L_TYPE_HARD) { if (visit_obj(file_id, oname, &iter) < 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(EXIT_FAILURE); } } /* end if(li.type == H5L_TYPE_HARD) */ @@ -3357,12 +3112,10 @@ main(int argc, const char *argv[]) if (fapl_id != H5P_DEFAULT) { if (0 < H5Pclose(fapl_id)) { HDfprintf(rawerrorstream, "Error: Unable to set close fapl entry\n\n"); - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(EXIT_FAILURE); } } - H5Eset_auto2(H5E_DEFAULT, func, edata); if (err_exit) leave(EXIT_FAILURE); else diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index f7822ca..0ad61c0 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -804,10 +804,6 @@ done: int main(int argc, const char **argv) { pack_opt_t options; /*the global options */ - H5E_auto2_t func; - H5E_auto2_t tools_func; - void *edata; - void *tools_edata; int parse_ret; HDmemset(&options, 0, sizeof(pack_opt_t)); @@ -818,14 +814,6 @@ int main(int argc, const char **argv) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /* update hyperslab buffer size from H5TOOLS_BUFSIZE env if exist */ if (h5tools_getenv_update_hyperslab_bufsize() < 0) { HDprintf("Error occurred while retrieving H5TOOLS_BUFSIZE value\n"); @@ -855,10 +843,8 @@ int main(int argc, const char **argv) goto done; } - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } + /* enable error reporting if command line option */ + h5tools_error_report(); /* pack it */ if (h5repack(infile, outfile, &options) < 0) { diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index fb3d50d7..ec4b5ab 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -1786,32 +1786,23 @@ main(int argc, const char *argv[]) iter_t iter; const char *fname = NULL; hid_t fid = H5I_INVALID_HID; - H5E_auto2_t func; - H5E_auto2_t tools_func; - void *edata; - void *tools_edata; struct handler_t *hand = NULL; hid_t fapl_id = H5P_DEFAULT; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - HDmemset(&iter, 0, sizeof(iter)); if(parse_command_line(argc, argv, &hand) < 0) goto done; + /* enable error reporting if command line option */ + h5tools_error_report(); + if (drivername) { h5tools_vfd_info_t vfd_info; @@ -1843,11 +1834,6 @@ main(int argc, const char *argv[]) fname = argv[opt_ind]; - if(enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } - /* Check for filename given */ if(fname) { hid_t fcpl; @@ -1952,8 +1938,6 @@ done: h5tools_setstatus(EXIT_FAILURE); } /* end if */ - H5Eset_auto2(H5E_DEFAULT, func, edata); - leave(h5tools_getstatus()); } /* end main() */ diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index f95d1bc..96cbf9c 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -266,14 +266,9 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable the HDF5 library's error reporting */ - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* initialize h5tools lib */ h5tools_init(); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /* Parse command line options */ if(parse_command_line(argc, argv) < 0) goto done; @@ -281,6 +276,9 @@ main (int argc, const char *argv[]) if(fname_g == NULL) goto done; + /* enable error reporting if command line option */ + h5tools_error_report(); + /* Print usage/exit if not using at least one of the options */ if(!clear_status_flags && !remove_cache_image && !increment_eoa_eof && !print_filesize) { @@ -387,7 +385,6 @@ main (int argc, const char *argv[]) warn_msg("No cache image in the file\n"); } - h5tools_setstatus(EXIT_SUCCESS); done: diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index cbd6e6d..4d2d2b8 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -49,7 +49,7 @@ typedef struct mkgrp_opt_t { mkgrp_opt_t params_g; /* Command line parameter settings */ - + /*------------------------------------------------------------------------- * Function: leave * @@ -81,7 +81,7 @@ leave(int ret) HDexit(ret); } /* end leave() */ - + /*------------------------------------------------------------------------- * Function: usage * @@ -113,7 +113,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, "\n"); } /* end usage() */ - + /*------------------------------------------------------------------------- * Function: parse_command_line * @@ -248,7 +248,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) return 0; } /* parse_command_line() */ - + /*------------------------------------------------------------------------- * Function: main * @@ -268,9 +268,6 @@ main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable the HDF5 library's error reporting */ - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); @@ -289,6 +286,9 @@ main(int argc, const char *argv[]) leave(EXIT_FAILURE); } + /* enable error reporting if command line option */ + h5tools_error_report(); + /* Check for creating groups with new format version */ if(params_g.latest) { /* Set the "use the latest version of the format" bounds */ diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 3d9c6f5..43c8c15 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -68,6 +68,8 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_eps1.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_eps2.h5 # tools/testfiles/vds ${HDF5_TOOLS_DIR}/testfiles/vds/1_a.h5 ${HDF5_TOOLS_DIR}/testfiles/vds/1_b.h5 @@ -302,6 +304,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v2.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v3.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_vlstr.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_eps.txt ) set (LIST_WIN_TEST_FILES @@ -541,6 +544,9 @@ # strings set (STRINGS1 diff_strings1.h5) set (STRINGS2 diff_strings2.h5) + # epsilon + set (EPS1 diff_eps1.h5) + set (EPS2 diff_eps2.h5) # VDS tests set (FILEV1 1_vds.h5) @@ -926,6 +932,8 @@ h5diff_v3.out.err h5diff_vlstr.out h5diff_vlstr.out.err + h5diff_eps.out + h5diff_eps.out.err ) set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (last_test) @@ -1107,6 +1115,9 @@ ADD_H5_TEST (h5diff_609 0 -d 200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) # 6.10: number smaller than smallest difference ADD_H5_TEST (h5diff_610 1 -d 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) +# eps: number smaller than epsilon +ADD_H5_TEST (h5diff_eps 0 -v3 -d 1e-16 ${EPS1} ${EPS2}) + # ############################################################################## # # -p # ############################################################################## @@ -1492,9 +1503,9 @@ ADD_H5_TEST (h5diff_484 0 -v --exclude-path "/dset3" ${EXCLUDE_FILE1_1} ${EXCLUD # Only one file contains unique objs. Common objs are same. # (HDFFV-7837) # -ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) -ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5) -ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) +ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" ${EXCLUDE_FILE3_1} ${EXCLUDE_FILE3_2}) +ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" ${EXCLUDE_FILE3_2} ${EXCLUDE_FILE3_1}) +ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" ${EXCLUDE_FILE3_1} ${EXCLUDE_FILE3_2}) # ############################################################################## # # diff various multiple vlen and fixed strings in a compound type dataset @@ -1528,8 +1539,6 @@ ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/ # ############################################################################## # # Test array variances # ############################################################################## -# -# Test with -d , -p and --use-system-epsilon. ADD_H5_TEST (h5diff_800 1 -v ${FILE7} ${FILE8} /g1/array /g1/array) ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 1d5354f..df79aa1 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -96,6 +96,9 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /* string dataset and attribute */ #define DIFF_STRINGS1 "diff_strings1.h5" #define DIFF_STRINGS2 "diff_strings2.h5" +/* double dataset and epsilon */ +#define DIFF_EPS1 "diff_eps1.h5" +#define DIFF_EPS2 "diff_eps2.h5" #define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */ #define STR_SIZE 3 @@ -110,7 +113,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /* Error macros */ #define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); -#define PROGRAM_ERROR {AT(); goto error;} +#define PROGRAM_ERROR do {AT(); goto error;} while(0) /* A UD link traversal function. Shouldn't actually be called. */ static hid_t @@ -172,6 +175,7 @@ static void test_comps_vlen_arry(const char *fname, const char *dset, static void test_data_nocomparables(const char *fname, int diff); static void test_objs_nocomparables(const char *fname1, const char *fname2); static void test_objs_strings(const char *fname, const char *fname2); +static void test_double_epsilon(const char *fname1, const char *fname2); /* called by test_attributes() and test_datasets() */ static void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make_diffs); @@ -288,6 +292,9 @@ int main(void) /* string dataset and attribute. HDFFV-10028 */ test_objs_strings(DIFF_STRINGS1, DIFF_STRINGS2); + /* double dataset and epsilion. HDFFV-10897 */ + test_double_epsilon(DIFF_EPS1, DIFF_EPS2); + return EXIT_SUCCESS; } @@ -4928,73 +4935,73 @@ test_objs_nocomparables(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file1 */ if((fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* file2 */ if((fid2 = H5Fopen(fname2, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /*----------------------------------------------------------------------- * in file1 : add member objects *------------------------------------------------------------------------*/ /* parent group */ if((topgid1 = H5Gcreate2(fid1, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* dataset */ if(write_dset(topgid1, 1, dims, "obj1", H5T_NATIVE_INT, data1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* group */ if((gid1 = H5Gcreate2(topgid1, "obj2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* committed type */ if((tid1 = H5Tcopy(H5T_NATIVE_INT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Tcommit2(topgid1, "obj3", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /*----------------------------------------------------------------------- * in file2 : add member objects *------------------------------------------------------------------------*/ /* parent group */ if((topgid2 = H5Gcreate2(fid2, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* group */ if((gid2 = H5Gcreate2(topgid2, "obj1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* committed type */ if((tid2 = H5Tcopy(H5T_NATIVE_INT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Tcommit2(topgid2, "obj2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* dataset */ if(write_dset(topgid2, 1, dims, "obj3", H5T_NATIVE_INT, data2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ if(H5Fclose(fid1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Fclose(fid2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Gclose(topgid1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Gclose(topgid2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Gclose(gid1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Gclose(gid2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Tclose(tid1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Tclose(tid2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; return; @@ -8018,6 +8025,60 @@ out: return -1; } +/* + * Function: test_double_epsilion + * + * Purpose: Create test files to compare data with epsilion + */ +static +void test_double_epsilon(const char *fname1, const char *fname2) +{ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; + hsize_t dims1[2] = { 4, 7 }; + hsize_t dims2[2] = { 4, 7 }; + double wdata[4][7]; + int i, j; + + /*------------------------------------------------------------------------- + * create two files + *------------------------------------------------------------------------- + */ + if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + PROGRAM_ERROR; + if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + PROGRAM_ERROR; + + /* + * Initialize data. + */ + for (i=0; i<4; i++) + for (j=0; j<7; j++) + wdata[i][j] = 0.0; + + /* dataset */ + if(write_dset(fid1, 2, dims1, "dataset", H5T_IEEE_F64LE, wdata) < 0) + PROGRAM_ERROR; + + /* + * Initialize data. + */ + for (i=0; i<4; i++) + for (j=0; j<7; j++) + wdata[i][j] = (double)1.e-19; + + /* dataset */ + if(write_dset(fid2, 2, dims1, "dataset", H5T_IEEE_F64LE, wdata) < 0) + PROGRAM_ERROR; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid1); + H5Fclose(fid2); + } H5E_END_TRY; + + return; +} + /*------------------------------------------------------------------------- * Function: write_attr * @@ -8073,22 +8134,22 @@ write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, v /* create a space */ if((sid = H5Screate_simple(rank, dims, NULL)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* create the dataset */ if((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* write */ if(buf) if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* close */ if(H5Dclose(did) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if(H5Sclose(sid) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; return SUCCEED; diff --git a/tools/test/h5diff/testfiles/diff_eps1.h5 b/tools/test/h5diff/testfiles/diff_eps1.h5 new file mode 100644 index 0000000..2803a1d Binary files /dev/null and b/tools/test/h5diff/testfiles/diff_eps1.h5 differ diff --git a/tools/test/h5diff/testfiles/diff_eps2.h5 b/tools/test/h5diff/testfiles/diff_eps2.h5 new file mode 100644 index 0000000..4acf27a Binary files /dev/null and b/tools/test/h5diff/testfiles/diff_eps2.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt index 0a2fd12..b5ff01a 100644 --- a/tools/test/h5diff/testfiles/h5diff_10.txt +++ b/tools/test/h5diff/testfiles/h5diff_10.txt @@ -17,10 +17,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -109,6 +108,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_58_ref.txt b/tools/test/h5diff/testfiles/h5diff_58_ref.txt index 6fa2299..48a4b33 100644 --- a/tools/test/h5diff/testfiles/h5diff_58_ref.txt +++ b/tools/test/h5diff/testfiles/h5diff_58_ref.txt @@ -1,32 +1,32 @@ dataset: and size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt index 55b8da7..f52d8cc 100644 --- a/tools/test/h5diff/testfiles/h5diff_600.txt +++ b/tools/test/h5diff/testfiles/h5diff_600.txt @@ -17,10 +17,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -109,6 +108,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt index 36cd0ef..84111b3 100644 --- a/tools/test/h5diff/testfiles/h5diff_603.txt +++ b/tools/test/h5diff/testfiles/h5diff_603.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -110,6 +109,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt index c2e9ac1..d915d36 100644 --- a/tools/test/h5diff/testfiles/h5diff_606.txt +++ b/tools/test/h5diff/testfiles/h5diff_606.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -110,6 +109,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt index 2e09432..1ef8cdf 100644 --- a/tools/test/h5diff/testfiles/h5diff_612.txt +++ b/tools/test/h5diff/testfiles/h5diff_612.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -110,6 +109,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt index a07de54..881362e 100644 --- a/tools/test/h5diff/testfiles/h5diff_615.txt +++ b/tools/test/h5diff/testfiles/h5diff_615.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -110,6 +109,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt index 5f44dd7..ba39a99 100644 --- a/tools/test/h5diff/testfiles/h5diff_621.txt +++ b/tools/test/h5diff/testfiles/h5diff_621.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -110,6 +109,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt index 2e28a42..70421fc 100644 --- a/tools/test/h5diff/testfiles/h5diff_622.txt +++ b/tools/test/h5diff/testfiles/h5diff_622.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -110,6 +109,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt index 21cb90a..0d74268 100644 --- a/tools/test/h5diff/testfiles/h5diff_623.txt +++ b/tools/test/h5diff/testfiles/h5diff_623.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -110,6 +109,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt index 92c98d9..cb8b8b4 100644 --- a/tools/test/h5diff/testfiles/h5diff_624.txt +++ b/tools/test/h5diff/testfiles/h5diff_624.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -110,6 +109,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/test/h5diff/testfiles/h5diff_70.txt b/tools/test/h5diff/testfiles/h5diff_70.txt index efa34ea..b0b8bf6 100644 --- a/tools/test/h5diff/testfiles/h5diff_70.txt +++ b/tools/test/h5diff/testfiles/h5diff_70.txt @@ -1183,10 +1183,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_700.txt b/tools/test/h5diff/testfiles/h5diff_700.txt index 851a407..6cf9893 100644 --- a/tools/test/h5diff/testfiles/h5diff_700.txt +++ b/tools/test/h5diff/testfiles/h5diff_700.txt @@ -1187,10 +1187,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_701.txt b/tools/test/h5diff/testfiles/h5diff_701.txt index 33f1a0f..4187754 100644 --- a/tools/test/h5diff/testfiles/h5diff_701.txt +++ b/tools/test/h5diff/testfiles/h5diff_701.txt @@ -1254,10 +1254,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_702.txt b/tools/test/h5diff/testfiles/h5diff_702.txt index 851a407..6cf9893 100644 --- a/tools/test/h5diff/testfiles/h5diff_702.txt +++ b/tools/test/h5diff/testfiles/h5diff_702.txt @@ -1187,10 +1187,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_703.txt b/tools/test/h5diff/testfiles/h5diff_703.txt index 33f1a0f..4187754 100644 --- a/tools/test/h5diff/testfiles/h5diff_703.txt +++ b/tools/test/h5diff/testfiles/h5diff_703.txt @@ -1254,10 +1254,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/test/h5diff/testfiles/h5diff_80.txt b/tools/test/h5diff/testfiles/h5diff_80.txt index b223eed..11dccd8 100644 --- a/tools/test/h5diff/testfiles/h5diff_80.txt +++ b/tools/test/h5diff/testfiles/h5diff_80.txt @@ -528,166 +528,166 @@ position opaque3D opaque3D difference 24 differences found dataset: and size: [2] [2] -position difference +position reference reference difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference reference difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 4 differences found dataset: and size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 12 differences found dataset: and size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 diff --git a/tools/test/h5diff/testfiles/h5diff_eps.txt b/tools/test/h5diff/testfiles/h5diff_eps.txt new file mode 100644 index 0000000..ef48cb6 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_eps.txt @@ -0,0 +1,17 @@ +file1: diff_eps1.h5 +file2: diff_eps2.h5 + +file1 file2 +--------------------------------------- + x x / + x x /DS1 + + +group : and +0 differences found +Attributes status: 0 common, 0 only in obj1, 0 only in obj2 + +dataset: and +0 differences found +Attributes status: 0 common, 0 only in obj1, 0 only in obj2 +EXIT CODE: 0 diff --git a/tools/test/h5diff/testfiles/h5diff_reg.txt b/tools/test/h5diff/testfiles/h5diff_reg.txt index d4f5415..ecb6275 100644 --- a/tools/test/h5diff/testfiles/h5diff_reg.txt +++ b/tools/test/h5diff/testfiles/h5diff_reg.txt @@ -1,12 +1,11 @@ dataset: and -attribute: > and > +attribute: > and > 0 differences found -Warning: Cannot open referenced attribute: attribute 1 -Warning: Cannot open referenced attribute: attribute 2 -attribute: > and > +Warning: Cannot open referenced attribute1 +attribute: > and > 0 differences found -attribute: > and > +attribute: > and > 0 differences found 0 differences found obj1 obj2 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 2d490a8..1ac3100 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -85,6 +85,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr2.h5 $SRC_H5DIFF_TESTFILES/h5diff_attr3.h5 $SRC_H5DIFF_TESTFILES/h5diff_dset1.h5 $SRC_H5DIFF_TESTFILES/h5diff_dset2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_dset3.h5 $SRC_H5DIFF_TESTFILES/h5diff_hyper1.h5 $SRC_H5DIFF_TESTFILES/h5diff_hyper2.h5 $SRC_H5DIFF_TESTFILES/h5diff_empty.h5 @@ -121,6 +122,8 @@ $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 $SRC_H5DIFF_TESTFILES/diff_strings1.h5 $SRC_H5DIFF_TESTFILES/diff_strings2.h5 +$SRC_H5DIFF_TESTFILES/diff_eps1.h5 +$SRC_H5DIFF_TESTFILES/diff_eps2.h5 $SRC_TOOLS_TESTFILES/tvlstr.h5 " @@ -349,6 +352,8 @@ $SRC_H5DIFF_TESTFILES/h5diff_708.txt $SRC_H5DIFF_TESTFILES/h5diff_709.txt $SRC_H5DIFF_TESTFILES/h5diff_710.txt $SRC_H5DIFF_TESTFILES/h5diff_80.txt +$SRC_H5DIFF_TESTFILES/h5diff_800.txt +$SRC_H5DIFF_TESTFILES/h5diff_801.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt $SRC_H5DIFF_TESTFILES/h5diff_8625.txt $SRC_H5DIFF_TESTFILES/h5diff_8639.txt @@ -357,6 +362,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_v1.txt $SRC_H5DIFF_TESTFILES/h5diff_v2.txt $SRC_H5DIFF_TESTFILES/h5diff_v3.txt $SRC_H5DIFF_TESTFILES/h5diff_vlstr.txt +$SRC_H5DIFF_TESTFILES/h5diff_eps.txt " # @@ -763,6 +769,9 @@ TOOLTEST h5diff_609.txt -d 200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dse # 6.10: number smaller than smallest difference TOOLTEST h5diff_610.txt -d 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 +# eps: number smaller than epsilon +TOOLTEST h5diff_eps.txt -v3 -d 1e-16 h5diff_eps1.h5 h5diff_eps2.h5 + # ############################################################################## # # -p @@ -1184,6 +1193,12 @@ TOOLTEST h5diff_645.txt -v -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_ TOOLTEST h5diff_646.txt -v --use-system-epsilon -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 # ############################################################################## +# # Test array variances +# ############################################################################## +TOOLTEST h5diff_800 -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array /g1/array +TOOLTEST h5diff_801 -v h5diff_dset1.h5 h5diff_dset3.h5 /g1/array /g1/array + +# ############################################################################## # VDS tests # ############################################################################## TOOLTEST h5diff_v1.txt -v 1_vds.h5 2_vds.h5 diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index 559c677..e7bb561 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -70,11 +70,11 @@ parse_command_line (int argc, const char *argv[]) switch ((char) opt) { case 'h': usage (h5tools_getprogname()); - HDexit(EXIT_SUCCESS); + h5tools_setstatus(EXIT_SUCCESS); case '?': default: usage (h5tools_getprogname()); - HDexit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); } } @@ -82,10 +82,17 @@ parse_command_line (int argc, const char *argv[]) if (argc <= opt_ind) { error_msg("missing file name\n"); usage (h5tools_getprogname()); - HDexit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); } } /* end parse_command_line() */ +static void +leave(int ret) +{ + h5tools_close(); + HDexit(ret); +} + /*------------------------------------------------------------------------- * Function: main * @@ -98,8 +105,6 @@ int main (int argc, const char *argv[]) { char *ifname; - void *edata; - H5E_auto2_t func; hid_t ifile; hsize_t usize; htri_t testval; @@ -112,16 +117,16 @@ main (int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - parse_command_line(argc, argv); + /* enable error reporting if command line option */ + h5tools_error_report(); + if(argc <= (opt_ind)) { error_msg("missing file name\n"); usage (h5tools_getprogname()); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } ifname = HDstrdup(argv[opt_ind]); @@ -130,33 +135,38 @@ main (int argc, const char *argv[]) if(testval <= 0) { error_msg("Input HDF5 file is not HDF \"%s\"\n", ifname); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } ifile = H5Fopen(ifname, H5F_ACC_RDONLY, H5P_DEFAULT); if(ifile < 0) { error_msg("Can't open input HDF5 file \"%s\"\n", ifname); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } plist = H5Fget_create_plist(ifile); if(plist < 0) { error_msg("Can't get file creation plist for file \"%s\"\n", ifname); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } status = H5Pget_userblock(plist, &usize); if(status < 0) { error_msg("Can't get user block for file \"%s\"\n", ifname); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } HDprintf("%ld\n", (long) usize); +done: H5Pclose (plist); H5Fclose (ifile); - return EXIT_SUCCESS; + leave(h5tools_getstatus()); } /* end main() */ diff --git a/tools/testfiles/trefer_attrR.ddl b/tools/testfiles/trefer_attrR.ddl index e64c8e6..118e7bf 100644 --- a/tools/testfiles/trefer_attrR.ddl +++ b/tools/testfiles/trefer_attrR.ddl @@ -12,16 +12,16 @@ GROUP "/" { } } ATTRIBUTE "trefer_attr.h5/Group1/Dataset2/Attr1" { - NULL + NULL } - ATTRIBUTE "trefer_attr.h5/Group1/Attr2" { + ATTRIBUTE "trefer_attr.h5/Group1/Attr2" { DATATYPE H5T_STD_U32LE DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { (0): 1, 4, 7, 10 } } - ATTRIBUTE "trefer_attr.h5/Group1/Datatype1/Attr3" { + ATTRIBUTE "trefer_attr.h5/Group1/Datatype1/Attr3" { DATATYPE H5T_STD_U32LE DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { diff --git a/tools/testfiles/trefer_extR.ddl b/tools/testfiles/trefer_extR.ddl index 3d4647d..a96e5fd 100644 --- a/tools/testfiles/trefer_extR.ddl +++ b/tools/testfiles/trefer_extR.ddl @@ -12,16 +12,16 @@ GROUP "/" { } } ATTRIBUTE "trefer_ext1.h5/Group1/Dataset2/Attr1" { - NULL + NULL } - ATTRIBUTE "trefer_ext1.h5/Group1/Attr2" { + ATTRIBUTE "trefer_ext1.h5/Group1/Attr2" { DATATYPE H5T_STD_U32LE DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { (0): 1, 4, 7, 10 } } - ATTRIBUTE "trefer_ext1.h5/Group1/Datatype1/Attr3" { + ATTRIBUTE "trefer_ext1.h5/Group1/Datatype1/Attr3" { DATATYPE H5T_STD_U32LE DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { -- cgit v0.12 From aa9d2bd9bcce7a1a53c9d9cf519df5401041bb74 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Tue, 14 Jul 2020 20:00:47 -0500 Subject: H5R: fix type conversion of references within vlen type Update trefer.c with vlen test case --- src/H5Rint.c | 8 ++ src/H5Tconv.c | 20 ++++- src/H5Tref.c | 63 +++++++++----- test/trefer.c | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 336 insertions(+), 25 deletions(-) diff --git a/src/H5Rint.c b/src/H5Rint.c index 30f3dbb..6dfbf2b 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -423,6 +423,10 @@ H5R__destroy(H5R_ref_priv_t *ref) HDassert(ref != NULL); + H5R_LOG_DEBUG("Destroying reference, filename=%s, obj_addr=%s, encode size=%u", + ref->info.obj.filename, H5R__print_token(ref->info.obj.token), + ref->encode_size); + H5MM_xfree(ref->info.obj.filename); ref->info.obj.filename = NULL; @@ -1028,6 +1032,10 @@ H5R__encode(const char *filename, const H5R_ref_priv_t *ref, unsigned char *buf, HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ + H5R_LOG_DEBUG("Encoded reference, filename=%s, obj_addr=%s, encode size=%u", + ref->info.obj.filename, H5R__print_token(ref->info.obj.token), + encode_size); + *nalloc = encode_size; done: diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 06eb44e..15658cc 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -3110,8 +3110,24 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent))) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes") else if(!H5T_path_noop(tpath)) { - if((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), FALSE)) < 0 || - (tdst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->shared->parent, H5T_COPY_ALL), FALSE)) < 0) + H5T_t *tsrc_cpy = NULL, *tdst_cpy = NULL; + + if(NULL == (tsrc_cpy = H5T_copy(src->shared->parent, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy src type for conversion") + /* References need to know about the src file */ + if(tsrc_cpy->shared->type == H5T_REFERENCE) + if(H5T_set_loc(tsrc_cpy, src->shared->u.vlen.file, H5T_LOC_MEMORY) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set datatype location"); + + if(NULL == (tdst_cpy = H5T_copy(dst->shared->parent, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy dst type for conversion") + /* References need to know about the dst file */ + if(tdst_cpy->shared->type == H5T_REFERENCE) + if(H5T_set_loc(tdst_cpy, dst->shared->u.vlen.file, H5T_LOC_MEMORY) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set datatype location"); + + if(((tsrc_id = H5I_register(H5I_DATATYPE, tsrc_cpy, FALSE)) < 0) + || ((tdst_id = H5I_register(H5I_DATATYPE, tdst_cpy, FALSE)) < 0)) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") } /* end else-if */ else diff --git a/src/H5Tref.c b/src/H5Tref.c index b357baa..7c59e75 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -144,7 +144,9 @@ H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) switch(loc) { case H5T_LOC_MEMORY: /* Memory based reference datatype */ - HDassert(NULL == file); + + /* NB. We allow for the file to be non-NULL when doing + * memory-to-memory conversion */ /* Mark this type as being stored in memory */ dt->shared->u.atomic.u.r.loc = H5T_LOC_MEMORY; @@ -364,9 +366,8 @@ static size_t H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, size_t H5_ATTR_UNUSED src_size, H5VL_object_t *dst_file, hbool_t *dst_copy) { - H5VL_object_t *vol_obj; /* VOL object for src ref's location */ + H5VL_object_t *vol_obj = NULL; /* VOL object for src ref's location */ const H5R_ref_priv_t *src_ref = (const H5R_ref_priv_t *)src_buf; - hbool_t files_equal = FALSE; /* Whether src & dst references are in same file */ char *file_name_buf_dyn = NULL; /* Pointer to dynamically allocated buffer for file name, if static buffer is too small */ unsigned flags = 0; /* References flags */ size_t ret_value = 0; /* Return value */ @@ -377,14 +378,18 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf HDassert(src_buf); HDassert(src_size == H5T_REF_MEM_SIZE); - /* Retrieve VOL object */ - if(NULL == (vol_obj = H5VL_vol_object(src_ref->loc_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "invalid location identifier") + if(NULL != dst_file) { + hbool_t files_equal = TRUE; /* Whether src & dst references are in same file */ - /* Set external flag if referenced file is not destination file */ - if(H5VL_file_is_same(vol_obj, dst_file, &files_equal) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOMPARE, 0, "can't check if files are equal") - flags |= !files_equal ? H5R_IS_EXTERNAL : 0; + /* Retrieve VOL object */ + if(NULL == (vol_obj = H5VL_vol_object(src_ref->loc_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "invalid location identifier") + + /* Set external flag if referenced file is not destination file */ + if(H5VL_file_is_same(vol_obj, dst_file, &files_equal) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOMPARE, 0, "can't check if files are equal") + flags |= !files_equal ? H5R_IS_EXTERNAL : 0; + } /* Force re-calculating encoding size if any flags are set */ if(flags || !src_ref->encode_size) { @@ -458,8 +463,8 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, { H5VL_object_t *vol_obj; /* VOL object for src ref's location */ const H5R_ref_priv_t *src_ref = (const H5R_ref_priv_t *)src_buf; - hbool_t files_equal = FALSE; /* Whether src & dst references are in same file */ - char file_name_buf_static[256]; /* File name */ + hbool_t files_equal = TRUE; /* Whether src & dst references are in same file */ + char file_name_buf_static[256] = {'\0'}; /* File name */ char *file_name_buf_dyn = NULL; /* Pointer to dynamically allocated buffer for file name, if static buffer is too small */ ssize_t file_name_len; /* Size of file name buffer */ unsigned flags = 0; /* References flags */ @@ -470,10 +475,15 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, /* Sanity check */ HDassert(src_buf); HDassert(src_size == H5T_REF_MEM_SIZE); - HDassert(dst_file); HDassert(dst_buf); HDassert(dst_size); + /* Memory-to-memory conversion to support vlen conversion */ + if(NULL == dst_file) { + HDmemcpy(dst_buf, src_buf, dst_size); + HGOTO_DONE(ret_value); + } + /* Retrieve VOL object */ if(NULL == (vol_obj = H5VL_vol_object(src_ref->loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "invalid location identifier") @@ -504,14 +514,16 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, H5CX_set_libver_bounds(NULL); } /* end if */ - /* Get file name */ - if(H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, NULL, H5I_FILE, sizeof(file_name_buf_static), file_name_buf_static, &file_name_len) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't get file name") - if(file_name_len >= (ssize_t)sizeof(file_name_buf_static)) { - if(NULL == (file_name_buf_dyn = (char *)H5MM_malloc((size_t)file_name_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, 0, "can't allocate space for file name") - if(H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, NULL, H5I_FILE, (size_t)file_name_len + 1, file_name_buf_dyn, &file_name_len) < 0) + /* Get file name (if external reference) */ + if(flags) { + if(H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, NULL, H5I_FILE, sizeof(file_name_buf_static), file_name_buf_static, &file_name_len) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't get file name") + if(file_name_len >= (ssize_t)sizeof(file_name_buf_static)) { + if(NULL == (file_name_buf_dyn = (char *)H5MM_malloc((size_t)file_name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, 0, "can't allocate space for file name") + if(H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, NULL, H5I_FILE, (size_t)file_name_len + 1, file_name_buf_dyn, &file_name_len) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't get file name") + } /* end if */ } /* end if */ /* Encode reference */ @@ -539,7 +551,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size H5R_type_t src_type, H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, size_t dst_size, void H5_ATTR_UNUSED *bg_buf) { - H5F_t *src_f; + H5F_t *src_f = NULL; hid_t file_id = H5I_INVALID_HID; H5R_ref_priv_t *dst_ref = (H5R_ref_priv_t *)dst_buf; herr_t ret_value = SUCCEED; @@ -547,14 +559,19 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size FUNC_ENTER_STATIC /* Sanity check */ - HDassert(src_file); HDassert(src_buf); HDassert(src_size); HDassert(dst_buf); HDassert(dst_size == H5T_REF_MEM_SIZE); + /* Memory-to-memory conversion to support vlen conversion */ + if(NULL == src_file) { + HDmemcpy(dst_buf, src_buf, src_size); + HGOTO_DONE(ret_value); + } + #ifndef NDEBUG - { + if((src_type == H5R_OBJECT1) || (src_type == H5R_DATASET_REGION1)) { hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ /* Check if using native VOL connector */ diff --git a/test/trefer.c b/test/trefer.c index 12651c7..fd97239 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -23,6 +23,7 @@ #define FILE_REF_PARAM "trefer_param.h5" #define FILE_REF_OBJ "trefer_obj.h5" +#define FILE_REF_VL_OBJ "trefer_vl_obj.h5" #define FILE_REF_REG "trefer_reg.h5" #define FILE_REF_REG_1D "trefer_reg_1d.h5" #define FILE_REF_OBJ_DEL "trefer_obj_del.h5" @@ -538,6 +539,273 @@ test_reference_obj(void) /**************************************************************** ** +** test_reference_vlen_obj(): Test basic H5R (reference) object reference +** within a vlen type. +** Tests references to various kinds of objects +** +****************************************************************/ +static void +test_reference_vlen_obj(void) +{ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t vl_dims[] = {1}; + hid_t dapl_id; /* Dataset access property list */ + H5R_ref_t *wbuf, /* buffer to write to disk */ + *rbuf; /* buffer read from disk */ + unsigned *ibuf, *obuf; + unsigned i, j; /* Counters */ + H5O_type_t obj_type; /* Object type */ + herr_t ret; /* Generic return value */ + hvl_t vl_wbuf = {0, NULL}, vl_rbuf = {0, NULL}; + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Object Reference Functions within VLEN type\n")); + + /* Allocate write & read buffers */ + wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); + ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + + for (i = 0; i < SPACE1_DIM1; i++) + obuf[i] = i * 3; + + /* Create file */ + fid1 = H5Fcreate(FILE_REF_VL_OBJ, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid1, H5I_INVALID_HID, "H5Fcreate"); + + /* Create dataspace for datasets */ + sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); + CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple"); + + /* Create dataset access property list */ + dapl_id = H5Pcreate(H5P_DATASET_ACCESS); + CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate"); + + /* Create a group */ + group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(group, H5I_INVALID_HID, "H5Gcreate2"); + + /* Create a dataset (inside Group1) */ + dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); + + /* Write selection to disk */ + ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Create another dataset (inside Group1) */ + dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close disk dataspace */ + ret = H5Sclose(sid1); + CHECK(ret, FAIL, "H5Sclose"); + + /* Create a datatype to refer to */ + tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)); + CHECK(tid1, H5I_INVALID_HID, "H5Tcreate"); + + /* Insert fields */ + ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT); + CHECK(ret, FAIL, "H5Tinsert"); + + /* Save datatype for later */ + ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close group */ + ret = H5Gclose(group); + CHECK(ret, FAIL, "H5Gclose"); + + /* Create vlen type */ + tid1 = H5Tvlen_create(H5T_STD_REF); + CHECK(tid1, H5I_INVALID_HID, "H5Tvlen_create"); + + /* Create dataspace for datasets */ + sid1 = H5Screate_simple(SPACE1_RANK, vl_dims, NULL); + CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple"); + + /* Create a dataset */ + dataset = H5Dcreate2(fid1, "Dataset3", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); + + /* Create reference to dataset */ + ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3"); + + /* Create reference to dataset */ + ret = H5Rcreate_object(fid1, "/Group1/Dataset2", H5P_DEFAULT, &wbuf[1]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[1], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3"); + + /* Create reference to group */ + ret = H5Rcreate_object(fid1, "/Group1", H5P_DEFAULT, &wbuf[2]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[2], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3"); + + /* Create reference to named datatype */ + ret = H5Rcreate_object(fid1, "/Group1/Datatype1", H5P_DEFAULT, &wbuf[3]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[3], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3"); + + /* Store references into vlen */ + vl_wbuf.len = SPACE1_DIM1; + vl_wbuf.p = wbuf; + + /* Write selection to disk */ + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &vl_wbuf); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Close disk dataspace */ + ret = H5Sclose(sid1); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close file */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + + /* Re-open the file */ + fid1 = H5Fopen(FILE_REF_VL_OBJ, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid1, H5I_INVALID_HID, "H5Fopen"); + + /* Open the dataset */ + dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dopen2"); + + tid1 = H5Dget_type(dataset); + CHECK(tid1, H5I_INVALID_HID, "H5Dget_type"); + + /* Read selection from disk */ + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &vl_rbuf); + CHECK(ret, FAIL, "H5Dread"); + + VERIFY(vl_rbuf.len, SPACE1_DIM1, "H5Dread"); + rbuf = vl_rbuf.p; + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open dataset object */ + dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id); + CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object"); + + /* Check information in referenced dataset */ + sid1 = H5Dget_space(dset2); + CHECK(sid1, H5I_INVALID_HID, "H5Dget_space"); + + ret = (int)H5Sget_simple_extent_npoints(sid1); + VERIFY(ret, SPACE1_DIM1, "H5Sget_simple_extent_npoints"); + + /* Read from disk */ + ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf); + CHECK(ret, FAIL, "H5Dread"); + + for(i = 0; i < SPACE1_DIM1; i++) + VERIFY(ibuf[i], i * 3, "Data"); + + /* Close dereferenced Dataset */ + ret = H5Dclose(dset2); + CHECK(ret, FAIL, "H5Dclose"); + + /* Open group object. GAPL isn't supported yet. But it's harmless to pass in */ + group = H5Ropen_object(&rbuf[2], H5P_DEFAULT, H5P_DEFAULT); + CHECK(group, H5I_INVALID_HID, "H5Ropen_object"); + + /* Close group */ + ret = H5Gclose(group); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */ + tid1 = H5Ropen_object(&rbuf[3], H5P_DEFAULT, H5P_DEFAULT); + CHECK(tid1, H5I_INVALID_HID, "H5Ropen_object"); + + /* Verify correct datatype */ + { + H5T_class_t tclass; + + tclass = H5Tget_class(tid1); + VERIFY(tclass, H5T_COMPOUND, "H5Tget_class"); + + ret= H5Tget_nmembers(tid1); + VERIFY(ret, 3, "H5Tget_nmembers"); + } + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close dataset access property list */ + ret = H5Pclose(dapl_id); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close file */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + + /* Destroy references */ + for(j = 0; j < SPACE1_DIM1; j++) { + ret = H5Rdestroy(&wbuf[j]); + CHECK(ret, FAIL, "H5Rdestroy"); + ret = H5Rdestroy(&rbuf[j]); + CHECK(ret, FAIL, "H5Rdestroy"); + } + + /* Free memory buffers */ + HDfree(wbuf); + HDfree(rbuf); + HDfree(ibuf); + HDfree(obuf); +} /* test_reference_vlen_obj() */ + +/**************************************************************** +** ** test_reference_region(): Test basic H5R (reference) object reference code. ** Tests references to various kinds of objects ** @@ -2862,6 +3130,7 @@ test_reference(void) test_reference_params(); /* Test for correct parameter checking */ test_reference_obj(); /* Test basic H5R object reference code */ + test_reference_vlen_obj(); /* Test reference within vlen */ /* Loop through all the combinations of low/high version bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { @@ -2907,6 +3176,7 @@ cleanup_reference(void) { HDremove(FILE_REF_PARAM); HDremove(FILE_REF_OBJ); + HDremove(FILE_REF_VL_OBJ); HDremove(FILE_REF_REG); HDremove(FILE_REF_REG_1D); HDremove(FILE_REF_OBJ_DEL); -- cgit v0.12 From e5145030a4ada243a1ced9e10b87cfff5ccdfff4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Jul 2020 08:31:48 -0500 Subject: Correct file name in test --- tools/test/h5diff/testh5diff.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 1ac3100..27b6ffa 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -770,7 +770,7 @@ TOOLTEST h5diff_609.txt -d 200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dse TOOLTEST h5diff_610.txt -d 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # eps: number smaller than epsilon -TOOLTEST h5diff_eps.txt -v3 -d 1e-16 h5diff_eps1.h5 h5diff_eps2.h5 +TOOLTEST h5diff_eps.txt -v3 -d 1e-16 diff_eps1.h5 diff_eps2.h5 # ############################################################################## -- cgit v0.12 From 3023b34272cc6ada84aebfa7441a6a55afa3621c Mon Sep 17 00:00:00 2001 From: vchoi Date: Thu, 16 Jul 2020 16:40:11 -0500 Subject: Update MANIFEST. Add new test to Cmake. --- MANIFEST | 1 + test/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/MANIFEST b/MANIFEST index a20b248..870768e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1249,6 +1249,7 @@ ./test/ttsafe.c ./test/ttsafe.h ./test/ttsafe_acreate.c +./test/ttsafe_attr_vlen.c ./test/ttsafe_cancel.c ./test/ttsafe_dcreate.c ./test/ttsafe_error.c diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 009a071..311d753 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -222,6 +222,7 @@ set (ttsafe_SOURCES ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c + ${HDF5_TEST_SOURCE_DIR}/ttsafe_attr_vlen.c ) set (H5_TESTS -- cgit v0.12 From 6388a6750ff1dc476b8631d26cd1742730df9fe8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 17 Jul 2020 05:17:48 -0700 Subject: Minor normalization with 1.10 --- src/H5Dchunk.c | 4 ++-- src/H5Shyper.c | 39 +++++++++++++++++++-------------------- src/H5Spoint.c | 16 ++++++++-------- src/H5Sselect.c | 2 +- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 62e3ec5..ee83564 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -3147,8 +3147,8 @@ done: /*------------------------------------------------------------------------- * Function: H5D__chunk_hash_val * - * Purpose: To calculate an index based on the dataset's scaled - * coordinates and sizes of the faster dimensions. + * Purpose: To calculate an index based on the dataset's scaled + * coordinates and sizes of the faster dimensions. * * Return: Hash value index * diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 7d99f39..9f75785 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, June 18, 1998 * * Purpose: Hyperslab selection dataspace I/O functions. @@ -1756,7 +1756,7 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max /* Work back up through the dimensions */ while(curr_dim >= 0) { /* Reset the current span */ - curr_span = ispan[curr_dim]; + curr_span = ispan[curr_dim]; /* Increment absolute position */ abs_arr[curr_dim]++; @@ -2110,15 +2110,15 @@ H5S__hyper_iter_get_seq_list_opt(H5S_sel_iter_t *iter, size_t maxseq, size_t max /* Read in data until an entire sequence can't be written out any longer */ while(curr_rows > 0) { -#define DUFF_GUTS \ -/* Store the sequence information */ \ -off[curr_seq] = loc; \ -len[curr_seq] = actual_bytes; \ - \ -/* Increment sequence count */ \ -curr_seq++; \ - \ -/* Increment information to reflect block just processed */ \ +#define DUFF_GUTS \ +/* Store the sequence information */ \ +off[curr_seq] = loc; \ +len[curr_seq] = actual_bytes; \ + \ +/* Increment sequence count */ \ +curr_seq++; \ + \ +/* Increment information to reflect block just processed */ \ loc += fast_dim_buf_off; #ifdef NO_DUFFS_DEVICE @@ -2574,7 +2574,6 @@ H5S__hyper_iter_get_seq_list_single(H5S_sel_iter_t *iter, size_t maxseq, size_t USAGE herr_t H5S__hyper_iter_get_seq_list(iter,maxseq,maxelem,nseq,nelem,off,len) H5S_t *space; IN: Dataspace containing selection to use. - unsigned flags; IN: Flags for extra information about operation H5S_sel_iter_t *iter; IN/OUT: Selection iterator describing last position of interest in selection. size_t maxseq; IN: Maximum number of sequences to generate @@ -2808,7 +2807,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_new_span() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_new_span_info @@ -4285,7 +4284,7 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p) /* Check for unknown flags */ if(flags & ~H5S_SELECT_FLAG_BITS) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTLOAD, FAIL, "unknown flag for selection") - } /* end if */ + } else { /* Skip over the remainder of the header */ pp += 8; @@ -4301,7 +4300,7 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p) if(!*space) { /* Patch the rank of the allocated dataspace */ - (void)HDmemset(dims, 0, (size_t)rank * sizeof(dims[0])); + HDmemset(dims, 0, (size_t)rank * sizeof(dims[0])); if(H5S_set_extent_simple(tmp_space, rank, dims, NULL) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions") } /* end if */ @@ -4316,7 +4315,7 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p) /* Sanity checks */ HDassert(H5S_UNLIMITED == HSIZE_UNDEF); - HDassert(version >= 2); + HDassert(version >= H5S_HYPER_VERSION_2); /* Decode start/stride/block/count */ switch(enc_size) { @@ -4462,7 +4461,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_deserialize() */ - + /*-------------------------------------------------------------------------- NAME H5S__hyper_span_blocklist @@ -4567,7 +4566,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_span_blocklist() */ - + /*-------------------------------------------------------------------------- NAME H5S__get_select_hyper_blocklist @@ -7061,7 +7060,7 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) * simultaneous operations */ H5S__hyper_adjust_s_helper(space->select.sel_info.hslab->span_lst, space->extent.rank, offset, 0, op_gen); } /* end if */ - } /* end if */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -12175,7 +12174,7 @@ H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, hbool_t *partial) { H5S_hyper_sel_t *hslab; /* Convenience pointer to hyperslab info */ - H5S_hyper_dim_t *diminfo; /* Convenience pointer to diminfo.opt in unlimited dimension */ + H5S_hyper_dim_t *diminfo; /* Convenience pointer to diminfo in unlimited dimension */ hsize_t ret_value = 0; FUNC_ENTER_NOAPI(0) diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 60e810d..be9015f 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -78,7 +78,7 @@ static htri_t H5S__point_shape_same(const H5S_t *space1, const H5S_t *space2); static htri_t H5S__point_intersect_block(const H5S_t *space, const hsize_t *start, const hsize_t *end); static herr_t H5S__point_adjust_u(H5S_t *space, const hsize_t *offset); static herr_t H5S__point_adjust_s(H5S_t *space, const hssize_t *offset); -static herr_t H5S__point_project_scalar(const H5S_t *spasce, hsize_t *offset); +static herr_t H5S__point_project_scalar(const H5S_t *space, hsize_t *offset); static herr_t H5S__point_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset); static herr_t H5S__point_iter_init(const H5S_t *space, H5S_sel_iter_t *iter); static herr_t H5S__point_get_version_enc_size(const H5S_t *space, uint32_t *version, uint8_t *enc_size); @@ -538,7 +538,7 @@ H5S__point_iter_get_seq_list(H5S_sel_iter_t *iter, size_t maxseq, size_t maxelem FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_iter_get_seq_list() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_iter_release @@ -873,7 +873,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__copy_pnt_list() */ - + /*-------------------------------------------------------------------------- NAME H5S__free_pnt_list @@ -915,7 +915,7 @@ H5S__free_pnt_list(H5S_pnt_list_t *pnt_lst) FUNC_LEAVE_NOAPI_VOID } /* end H5S__free_pnt_list() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_copy @@ -943,7 +943,7 @@ H5S__point_copy(H5S_t *dst, const H5S_t *src, hbool_t H5_ATTR_UNUSED share_selec FUNC_ENTER_STATIC - /* Sanity check */ + /* Sanity checks */ HDassert(src); HDassert(dst); @@ -1189,7 +1189,7 @@ H5S__point_serial_size(const H5S_t *space) /* Determine the version and encoded size for point selection */ if(H5S__point_get_version_enc_size(space, &version, &enc_size) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine version and enc_size") /* Basic number of bytes required to serialize point selection: */ if(version >= H5S_POINT_VERSION_2) @@ -1259,7 +1259,7 @@ H5S__point_serialize(const H5S_t *space, uint8_t **p) /* Determine the version and encoded size for point selection info */ if(H5S__point_get_version_enc_size(space, &version, &enc_size) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine version and enc_size") /* Store the preamble information */ UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ @@ -1997,7 +1997,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__point_shape_same() */ - + /*-------------------------------------------------------------------------- NAME H5S__point_intersect_block diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 901dec1..c9d7fc0 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -1171,7 +1171,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, if(sel_iter->rank > 0) { H5MM_memcpy(sel_iter->dims, space->extent.size, sizeof(hsize_t) * space->extent.rank); H5MM_memcpy(sel_iter->sel_off, space->select.offset, sizeof(hsize_t) * space->extent.rank); - } /* end if */ + } /* Save the element size */ sel_iter->elmt_size = elmt_size; -- cgit v0.12 From a2f2887675c2371570cc7084eb7589ecf06ce41c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Jul 2020 13:22:26 -0500 Subject: add test file ext --- .github/workflows/main.yml | 4 ++-- tools/test/h5diff/testh5diff.sh.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3fdadb..60e21c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,8 +4,8 @@ name: hdf5 dev CI on: push: branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ] -# pull_request: -# branches: [ develop ] + pull_request: + branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 27b6ffa..84330ec 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -1195,8 +1195,8 @@ TOOLTEST h5diff_646.txt -v --use-system-epsilon -p 0.05 h5diff_basic1.h5 h5diff_ # ############################################################################## # # Test array variances # ############################################################################## -TOOLTEST h5diff_800 -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array /g1/array -TOOLTEST h5diff_801 -v h5diff_dset1.h5 h5diff_dset3.h5 /g1/array /g1/array +TOOLTEST h5diff_800.txt -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array /g1/array +TOOLTEST h5diff_801.txt -v h5diff_dset1.h5 h5diff_dset3.h5 /g1/array /g1/array # ############################################################################## # VDS tests -- cgit v0.12 From bae81076214de5b168a2582c0bf88a57b69f99f0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 20 Jul 2020 10:26:17 -0500 Subject: Add release notes for tools --- release_docs/RELEASE.txt | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 84f339a..42ce5e4 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -659,7 +659,7 @@ Bug Fixes since HDF5-1.10.3 release - Fixed the segmentation fault when reading attributes with multiple threads It was reported that the reading of attributes with variable length string - datatype will crash with segmentation fault particularly when the number of + datatype will crash with segmentation fault particularly when the number of threads is high (>16 threads). The problem was due to the file pointer that was set in the variable length string datatype for the attribute. That file pointer was already closed when the attribute was accessed. @@ -1028,7 +1028,43 @@ Bug Fixes since HDF5-1.10.3 release Tools ----- - - + - The tools library was updated by standardizing the error stack process. + + General sequence is: + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + h5tools_init(); + ... process the command-line (check for error-stack enable) ... + h5tools_error_report(); + ... (do work) ... + h5diff_exit(ret); + + (ADB - 2020/07/20, HDFFV-11066) + + - h5diff fixed a command line parsing error. + + h5diff would ignore the argument to -d (delta) if it is smaller than DBL_EPSILON. + The macro H5_DBL_ABS_EQUAL was removed and a direct value comparision was used. + + (ADB - 2020/07/20, HDFFV-10897) + + - h5diff added a command line option to ignore attributes. + + h5diff would ignore all objects with a supplied path if the exclude-path argument is used. + Adding the exclude-attribute argument will only eclude attributes, with the supplied path, + from comparision. + + (ADB - 2020/07/20, HDFFV-5935) + + - h5diff added another level to the verbose argument to print filenames. + + Added verbose level 3 that is level 2 plus the filenames. The levels are: + 0 : Identical to '-v' or '--verbose' + 1 : All level 0 information plus one-line attribute status summary + 2 : All level 1 information plus extended attribute status report + 3 : All level 2 information plus file names + + (ADB - 2020/07/20, HDFFV-10005) High-Level APIs: ------ -- cgit v0.12 From 242459231b40a88741cbc85df4272914b5d8bed3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 20 Jul 2020 11:50:10 -0700 Subject: Minor normalization with 1.10. --- src/H5B2pkg.h | 2 +- src/H5B2private.h | 2 +- src/H5Bmodule.h | 2 +- src/H5Bpkg.h | 2 +- src/H5Bprivate.h | 4 +- src/H5CXmodule.h | 2 +- src/H5Cmpio.c | 256 ++++++++++++++++++++++++++-------------------------- src/H5Dmodule.h | 2 +- src/H5Dpkg.h | 2 +- src/H5EAmodule.h | 2 +- src/H5EApkg.h | 2 +- src/H5EAprivate.h | 2 +- src/H5EAsblock.c | 8 +- src/H5Glink.c | 8 +- src/H5Gloc.c | 2 +- src/H5Gname.c | 23 ++--- src/H5Gnode.c | 19 +--- src/H5HLmodule.h | 2 +- src/H5HLpkg.h | 2 +- src/H5HLprivate.h | 2 +- src/H5Zfletcher32.c | 2 +- src/H5Ztrans.c | 47 +--------- src/H5dbg.c | 3 +- 23 files changed, 162 insertions(+), 236 deletions(-) diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 338db5a..7d73752 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, January 31, 2005 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5B2private.h b/src/H5B2private.h index 0b64381..9303d4f 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -15,7 +15,7 @@ * * Created: H5B2private.h * Jan 31 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible B-tree routines. * diff --git a/src/H5Bmodule.h b/src/H5Bmodule.h index bc46752..c8e1546 100644 --- a/src/H5Bmodule.h +++ b/src/H5Bmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index a451cab..a57584e 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 15, 2003 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index 5aa3628..55bf5b3 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -15,12 +15,10 @@ * * Created: H5Bprivate.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Private non-prototype header. * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/src/H5CXmodule.h b/src/H5CXmodule.h index f6a8f29..186f8aa 100644 --- a/src/H5CXmodule.h +++ b/src/H5CXmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, February 25, 2018 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 0ac4c4f..199c494 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -18,7 +18,7 @@ * Quincey Koziol * * Purpose: Functions in this file implement support for parallel I/O for - * generic cache code. + * generic cache code. * *------------------------------------------------------------------------- */ @@ -28,20 +28,20 @@ /****************/ #include "H5Cmodule.h" /* This source code file is part of the H5C module */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ -#include "H5Cpkg.h" /* Cache */ +#include "H5Cpkg.h" /* Cache */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* Files */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* Files */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_PARALLEL @@ -87,74 +87,74 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * Purpose: Apply the supplied candidate list. * - * We used to do this by simply having each process write - * every mpi_size-th entry in the candidate list, starting - * at index mpi_rank, and mark all the others clean. + * We used to do this by simply having each process write + * every mpi_size-th entry in the candidate list, starting + * at index mpi_rank, and mark all the others clean. * - * However, this can cause unnecessary contention in a file - * system by increasing the number of processes writing to - * adjacent locations in the HDF5 file. + * However, this can cause unnecessary contention in a file + * system by increasing the number of processes writing to + * adjacent locations in the HDF5 file. * - * To attempt to minimize this, we now arange matters such - * that each process writes n adjacent entries in the - * candidate list, and marks all others clean. We must do - * this in such a fashion as to guarantee that each entry - * on the candidate list is written by exactly one process, - * and marked clean by all others. + * To attempt to minimize this, we now arange matters such + * that each process writes n adjacent entries in the + * candidate list, and marks all others clean. We must do + * this in such a fashion as to guarantee that each entry + * on the candidate list is written by exactly one process, + * and marked clean by all others. * - * To do this, first construct a table mapping mpi_rank - * to the index of the first entry in the candidate list to - * be written by the process of that mpi_rank, and then use - * the table to control which entries are written and which - * are marked as clean as a function of the mpi_rank. + * To do this, first construct a table mapping mpi_rank + * to the index of the first entry in the candidate list to + * be written by the process of that mpi_rank, and then use + * the table to control which entries are written and which + * are marked as clean as a function of the mpi_rank. * - * Note that the table must be identical on all processes, as - * all see the same candidate list, mpi_size, and mpi_rank -- - * the inputs used to construct the table. + * Note that the table must be identical on all processes, as + * all see the same candidate list, mpi_size, and mpi_rank -- + * the inputs used to construct the table. * - * We construct the table as follows. Let: + * We construct the table as follows. Let: * - * n = num_candidates / mpi_size; + * n = num_candidates / mpi_size; * - * m = num_candidates % mpi_size; + * m = num_candidates % mpi_size; * - * Now allocate an array of integers of length mpi_size + 1, - * and call this array candidate_assignment_table. + * Now allocate an array of integers of length mpi_size + 1, + * and call this array candidate_assignment_table. * - * Conceptually, if the number of candidates is a multiple - * of the mpi_size, we simply pass through the candidate list - * and assign n entries to each process to flush, with the - * index of the first entry to flush in the location in - * the candidate_assignment_table indicated by the mpi_rank - * of the process. + * Conceptually, if the number of candidates is a multiple + * of the mpi_size, we simply pass through the candidate list + * and assign n entries to each process to flush, with the + * index of the first entry to flush in the location in + * the candidate_assignment_table indicated by the mpi_rank + * of the process. * - * In the more common case in which the candidate list isn't - * isn't a multiple of the mpi_size, we pretend it is, and - * give num_candidates % mpi_size processes one extra entry - * each to make things work out. + * In the more common case in which the candidate list isn't + * isn't a multiple of the mpi_size, we pretend it is, and + * give num_candidates % mpi_size processes one extra entry + * each to make things work out. * - * Once the table is constructed, we determine the first and - * last entry this process is to flush as follows: + * Once the table is constructed, we determine the first and + * last entry this process is to flush as follows: * - * first_entry_to_flush = candidate_assignment_table[mpi_rank] + * first_entry_to_flush = candidate_assignment_table[mpi_rank] * - * last_entry_to_flush = - * candidate_assignment_table[mpi_rank + 1] - 1; + * last_entry_to_flush = + * candidate_assignment_table[mpi_rank + 1] - 1; * - * With these values determined, we simply scan through the - * candidate list, marking all entries in the range - * [first_entry_to_flush, last_entry_to_flush] for flush, - * and all others to be cleaned. + * With these values determined, we simply scan through the + * candidate list, marking all entries in the range + * [first_entry_to_flush, last_entry_to_flush] for flush, + * and all others to be cleaned. * - * Finally, we scan the LRU from tail to head, flushing - * or marking clean the candidate entries as indicated. - * If necessary, we scan the pinned list as well. + * Finally, we scan the LRU from tail to head, flushing + * or marking clean the candidate entries as indicated. + * If necessary, we scan the pinned list as well. * - * Note that this function will fail if any protected or - * clean entries appear on the candidate list. + * Note that this function will fail if any protected or + * clean entries appear on the candidate list. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -176,20 +176,20 @@ H5C_apply_candidate_list(H5F_t * f, int i; int m; unsigned n; - unsigned first_entry_to_flush; - unsigned last_entry_to_flush; - unsigned total_entries_to_clear = 0; - unsigned total_entries_to_flush = 0; + unsigned first_entry_to_flush; + unsigned last_entry_to_flush; + unsigned total_entries_to_clear = 0; + unsigned total_entries_to_flush = 0; unsigned * candidate_assignment_table = NULL; unsigned entries_to_flush[H5C_RING_NTYPES]; unsigned entries_to_clear[H5C_RING_NTYPES]; - haddr_t addr; - H5C_cache_entry_t * entry_ptr = NULL; + haddr_t addr; + H5C_cache_entry_t * entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - haddr_t last_addr; + haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG - char tbl_buf[1024]; + char tbl_buf[1024]; #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -413,10 +413,10 @@ done: * Function: H5C_construct_candidate_list__clean_cache * * Purpose: Construct the list of entries that should be flushed to - * clean all entries in the cache. + * clean all entries in the cache. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -457,7 +457,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) H5C_cache_entry_t *entry_ptr; unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; - haddr_t nominated_addr; + haddr_t nominated_addr; HDassert( cache_ptr->slist_len > 0 ); @@ -522,10 +522,10 @@ done: * Function: H5C_construct_candidate_list__min_clean * * Purpose: Construct the list of entries that should be flushed to - * get the cache back within its min clean constraints. + * get the cache back within its min clean constraints. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -582,7 +582,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) (nominated_entries_count < cache_ptr->slist_len) && (entry_ptr != NULL) && (!entry_ptr->flush_me_last)) { - haddr_t nominated_addr; + haddr_t nominated_addr; HDassert( ! (entry_ptr->is_protected) ); HDassert( ! (entry_ptr->is_read_only) ); @@ -612,24 +612,24 @@ done: * Function: H5C_mark_entries_as_clean * * Purpose: When the H5C code is used to implement the metadata caches - * in PHDF5, only the cache with MPI_rank 0 is allowed to - * actually write entries to disk -- all other caches must - * retain dirty entries until they are advised that the - * entries are clean. + * in PHDF5, only the cache with MPI_rank 0 is allowed to + * actually write entries to disk -- all other caches must + * retain dirty entries until they are advised that the + * entries are clean. * - * This function exists to allow the H5C code to receive these - * notifications. + * This function exists to allow the H5C code to receive these + * notifications. * - * The function receives a list of entry base addresses - * which must refer to dirty entries in the cache. If any - * of the entries are either clean or don't exist, the - * function flags an error. + * The function receives a list of entry base addresses + * which must refer to dirty entries in the cache. If any + * of the entries are either clean or don't exist, the + * function flags an error. * - * The function scans the list of entries and flushes all - * those that are currently unprotected with the - * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently - * protected are flagged for clearing when they are - * unprotected. + * The function scans the list of entries and flushes all + * those that are currently unprotected with the + * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently + * protected are flagged for clearing when they are + * unprotected. * * Return: Non-negative on success/Negative on failure * @@ -644,22 +644,22 @@ H5C_mark_entries_as_clean(H5F_t * f, haddr_t * ce_array_ptr) { H5C_t * cache_ptr; - unsigned entries_cleared; + unsigned entries_cleared; unsigned pinned_entries_cleared; hbool_t progress; - unsigned entries_examined; - unsigned initial_list_len; - haddr_t addr; - unsigned pinned_entries_marked = 0; + unsigned entries_examined; + unsigned initial_list_len; + haddr_t addr; + unsigned pinned_entries_marked = 0; #if H5C_DO_SANITY_CHECKS - unsigned protected_entries_marked = 0; - unsigned other_entries_marked = 0; - haddr_t last_addr; + unsigned protected_entries_marked = 0; + unsigned other_entries_marked = 0; + haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ - H5C_cache_entry_t * clear_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * clear_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; unsigned u; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -706,7 +706,7 @@ H5C_mark_entries_as_clean(H5F_t * f, if(entry_ptr == NULL) { #if H5C_DO_SANITY_CHECKS - HDfprintf(stdout, + HDfprintf(stdout, "H5C_mark_entries_as_clean: entry[%u] = %a not in cache.\n", u, addr); @@ -715,7 +715,7 @@ H5C_mark_entries_as_clean(H5F_t * f, } /* end if */ else if(!entry_ptr->is_dirty) { #if H5C_DO_SANITY_CHECKS - HDfprintf(stdout, + HDfprintf(stdout, "H5C_mark_entries_as_clean: entry %a is not dirty!?!\n", addr); #endif /* H5C_DO_SANITY_CHECKS */ @@ -735,13 +735,13 @@ H5C_mark_entries_as_clean(H5F_t * f, } /* end if */ entry_ptr->clear_on_unprotect = TRUE; - if(entry_ptr->is_pinned) - pinned_entries_marked++; + if(entry_ptr->is_pinned) + pinned_entries_marked++; #if H5C_DO_SANITY_CHECKS - else if(entry_ptr->is_protected) - protected_entries_marked++; - else - other_entries_marked++; + else if(entry_ptr->is_protected) + protected_entries_marked++; + else + other_entries_marked++; #endif /* H5C_DO_SANITY_CHECKS */ } } @@ -769,7 +769,7 @@ H5C_mark_entries_as_clean(H5F_t * f, * of the pre_serialize / serialize routines, this may * cease to be the case -- requiring a review of this * point. - * JRM -- 4/7/15 + * JRM -- 4/7/15 */ entries_cleared = 0; entries_examined = 0; @@ -873,9 +873,9 @@ done: herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) { - uint32_t clear_cnt; - H5C_cache_entry_t * entry_ptr = NULL; - herr_t ret_value = SUCCEED; + uint32_t clear_cnt; + H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -1084,7 +1084,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__flush_candidate_entries * - * Purpose: Flush or clear (as indicated) the candidate entries that + * Purpose: Flush or clear (as indicated) the candidate entries that * have been marked in the metadata cache. In so doing, * observe rings and flush dependencies. * @@ -1113,9 +1113,9 @@ done: * Return: Non-negative on success/Negative on failure. * * Programmer: John Mainzer - * 2/10/17 + * 2/10/17 * - * Changes: None. + * Changes: None. * *------------------------------------------------------------------------- */ @@ -1124,17 +1124,17 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES unsigned entries_to_clear[H5C_RING_NTYPES]) { #if H5C_DO_SANITY_CHECKS - int i; - uint32_t index_len = 0; - size_t index_size = (size_t)0; - size_t clean_index_size = (size_t)0; - size_t dirty_index_size = (size_t)0; - size_t slist_size = (size_t)0; - uint32_t slist_len = 0; + int i; + uint32_t index_len = 0; + size_t index_size = (size_t)0; + size_t clean_index_size = (size_t)0; + size_t dirty_index_size = (size_t)0; + size_t slist_size = (size_t)0; + uint32_t slist_len = 0; #endif /* H5C_DO_SANITY_CHECKS */ - H5C_ring_t ring; + H5C_ring_t ring; H5C_t * cache_ptr; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1164,7 +1164,7 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES clean_index_size += cache_ptr->clean_index_ring_size[i]; dirty_index_size += cache_ptr->dirty_index_ring_size[i]; - slist_len += cache_ptr->slist_ring_len[i]; + slist_len += cache_ptr->slist_ring_len[i]; slist_size += cache_ptr->slist_ring_size[i]; } /* end for */ @@ -1206,7 +1206,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__flush_candidates_in_ring * - * Purpose: Flush or clear (as indicated) the candidate entries + * Purpose: Flush or clear (as indicated) the candidate entries * contained in the specified cache and ring. All candidate * entries in rings outside the specified ring must have been * flushed (or cleared) on entry. @@ -1235,7 +1235,7 @@ done: * Return: Non-negative on success/Negative on failure. * * Programmer: John Mainzer - * 2/10/17 + * 2/10/17 * *------------------------------------------------------------------------- */ diff --git a/src/H5Dmodule.h b/src/H5Dmodule.h index b259b69..27ccf54 100644 --- a/src/H5Dmodule.h +++ b/src/H5Dmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index c46e38b6..37a27d3 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 14, 2003 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5EAmodule.h b/src/H5EAmodule.h index d3e06b7..c3a4c7c 100644 --- a/src/H5EAmodule.h +++ b/src/H5EAmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5EApkg.h b/src/H5EApkg.h index bb3f39c..b70231d 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 17, 2008 * * Purpose: This file contains declarations which are visible only diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h index 1195256..af0ef3a 100644 --- a/src/H5EAprivate.h +++ b/src/H5EAprivate.h @@ -15,7 +15,7 @@ * * Created: H5EAprivate.h * Jun 17 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible extensible * array routines. diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index b4671f8..fb7c458 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -15,7 +15,7 @@ * * Created: H5EAsblock.c * Sep 30 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Super block routines for extensible arrays. * @@ -98,7 +98,6 @@ H5FL_BLK_DEFINE(page_init); * Return: Non-NULL pointer to super block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 30 2008 * *------------------------------------------------------------------------- @@ -179,7 +178,6 @@ END_FUNC(PKG) /* end H5EA__sblock_alloc() */ * Return: Valid file address on success/HADDR_UNDEF on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 30 2008 * *------------------------------------------------------------------------- @@ -267,7 +265,6 @@ END_FUNC(PKG) /* end H5EA__sblock_create() */ * Return: Non-NULL pointer to data block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 30 2008 * *------------------------------------------------------------------------- @@ -328,7 +325,6 @@ END_FUNC(PKG) /* end H5EA__sblock_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 30 2008 * *------------------------------------------------------------------------- @@ -359,7 +355,6 @@ END_FUNC(PKG) /* end H5EA__sblock_unprotect() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 30 2008 * *------------------------------------------------------------------------- @@ -408,7 +403,6 @@ END_FUNC(PKG) /* end H5EA__sblock_delete() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 30 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Glink.c b/src/H5Glink.c index 6c42f1d..cbe5307 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -15,7 +15,7 @@ * * Created: H5Glink.c * Nov 13 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for handling links in groups. * @@ -98,7 +98,6 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); * (i.e. same as strcmp()) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 5 2005 * *------------------------------------------------------------------------- @@ -125,7 +124,6 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) * (i.e. opposite strcmp()) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 25 2006 * *------------------------------------------------------------------------- @@ -151,7 +149,6 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) * as equal, their order in the sorted array is undefined. * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 6 2006 * *------------------------------------------------------------------------- @@ -186,7 +183,6 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) * as equal, their order in the sorted array is undefined. * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 6 2006 * *------------------------------------------------------------------------- @@ -217,7 +213,6 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 16 2006 * *------------------------------------------------------------------------- @@ -561,7 +556,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 13 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 4d89abb..0243b41 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -15,7 +15,7 @@ * * Created: H5Gloc.c * Sep 13 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for working with group "locations" * diff --git a/src/H5Gname.c b/src/H5Gname.c index 4b0f04c..e1004de 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -15,7 +15,7 @@ * * Created: H5Gname.c * Sep 12 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for handling group hierarchy paths. * @@ -123,7 +123,6 @@ H5FL_BLK_EXTERN(str_buf); * Failure: Ptr to the null terminator of NAME. * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 11 1997 * *------------------------------------------------------------------------- @@ -216,7 +215,7 @@ done: * Return: TRUE for valid prefix, FALSE for not a valid prefix, FAIL * on error * - * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu + * Programmer: Quincey Koziol * * Date: September 24, 2002 * @@ -281,7 +280,7 @@ done: * * Return: Pointer to reference counted string on success, NULL on error * - * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu + * Programmer: Quincey Koziol * * Date: August 19, 2005 * @@ -343,7 +342,7 @@ done: * Return: Success: Non-NULL, combined path * Failure: NULL * - * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu + * Programmer: Quincey Koziol * Tuesday, October 11, 2005 * *------------------------------------------------------------------------- @@ -379,7 +378,7 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) * * Return: Pointer to reference counted string on success, NULL on error * - * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu + * Programmer: Quincey Koziol * * Date: August 19, 2005 * @@ -448,7 +447,7 @@ H5G__name_init(H5G_name_t *name, const char *path) * Return: Success: Non-negative * Failure: Negative * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * Thursday, August 22, 2002 * *------------------------------------------------------------------------- @@ -552,10 +551,6 @@ H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth) * Programmer: Quincey Koziol * Tuesday, December 13, 2005 * - * Modifications: Leon Arber - * Oct. 18, 2006 - * Added functionality to get the name for a reference. - * *------------------------------------------------------------------------- */ ssize_t @@ -639,7 +634,7 @@ H5G_name_reset(H5G_name_t *name) * * Return: Success * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: August 22, 2002 * @@ -777,7 +772,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: June 5, 2002 * @@ -1060,7 +1055,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: June 11, 2002 * diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 9faa0b5..2e7b367 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -15,7 +15,7 @@ * * Created: H5Gnode.c * Jun 26 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Functions for handling symbol table nodes. A * symbol table node is a small collection of symbol @@ -145,8 +145,6 @@ H5FL_SEQ_DEFINE(H5G_entry_t); * Programmer: Robb Matzke * Wednesday, October 8, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5UC_t * @@ -169,7 +167,6 @@ H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 8 1997 * *------------------------------------------------------------------------- @@ -199,7 +196,6 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 8 1997 * *------------------------------------------------------------------------- @@ -270,7 +266,6 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 15 2003 * *------------------------------------------------------------------------- @@ -310,7 +305,6 @@ H5G__node_free(H5G_node_t *sym) * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -382,11 +376,8 @@ done: * Failure: FAIL (same as LT_KEY + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 44a2cfb..9891e10 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: This file contains declarations which are visible diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 7a53b25..60505ee 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -15,7 +15,7 @@ * * Created: H5HLprivate.h * Jul 16 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Private declarations for the H5HL (local heap) package. * diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 4d75d14..c40e9b4 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Jan 3, 2003 */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index dfc984a..1c8d415 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -400,8 +400,6 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); * Return: Always succeeds. * Programmer: Bill Wendling * 26. August 2003 - * Modifications: - * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs * *------------------------------------------------------------------------- */ @@ -565,8 +563,6 @@ done: * Return: Nothing * Programmer: Bill Wendling * 25. August 2003 - * Modifications: - * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs * *------------------------------------------------------------------------- */ @@ -634,8 +630,6 @@ done: * NULLure: NULL * Programmer: Bill Wendling * 26. August 2003 - * Modifications: - * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs * *------------------------------------------------------------------------- */ @@ -728,8 +722,6 @@ done: * NULLure: NULL * Programmer: Bill Wendling * 26. August 2003 - * Modifications: - * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs * *------------------------------------------------------------------------- */ @@ -828,8 +820,6 @@ done: * NULLure: NULL * Programmer: Bill Wendling * 26. August 2003 - * Modifications: - * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs * *------------------------------------------------------------------------- */ @@ -972,8 +962,6 @@ done: * NULLure: NULL * Programmer: Bill Wendling * 26. August 2003 - * Modifications: - * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs * *------------------------------------------------------------------------- */ @@ -1002,7 +990,6 @@ done: * Return: SUCCEED if transform applied successfully, FAIL otherwise * Programmer: Leon Arber * 5/1/04 - * Modifications: * *------------------------------------------------------------------------- */ @@ -1115,8 +1102,6 @@ done: * Return: Nothing * Programmer: Leon Arber * 5/1/04 - * Modifications: - * * * Notes: In the case of a polynomial data transform (ie, the left and right subtree * are both of type H5Z_XFORM_SYMBOL), the convention is that the left hand side @@ -1213,8 +1198,6 @@ done: * Function: H5Z_find_type * Return: Native type of datatype that is passed in * Programmer: Leon Arber, 4/20/04 - * Modifications: - * * *------------------------------------------------------------------------- */ @@ -1301,7 +1284,6 @@ done: * of the one passed in. * Programmer: Leon Arber * April 1, 2004. - * Modifications: * *------------------------------------------------------------------------- */ @@ -1375,7 +1357,6 @@ done: * Return: TRUE or FALSE * Programmer: Raymond Lu * 15 March 2012 - * Modifications: * *------------------------------------------------------------------------- */ @@ -1404,7 +1385,6 @@ H5Z_op_is_numbs(H5Z_node* _tree) * Return: TRUE or FALSE * Programmer: Raymond Lu * 15 March 2012 - * Modifications: * *------------------------------------------------------------------------- */ @@ -1490,11 +1470,6 @@ H5Z_xform_reduce_tree(H5Z_node* tree) * Return: None. * Programmer: Leon Arber * April 1, 2004. - * Modifications: - * Raymond Lu - * 15 March 2012 - * I added a new macro H5Z_XFORM_DO_OP6 to handle the special - * operations like -x or +x when the left operand is empty. * *------------------------------------------------------------------------- */ @@ -1525,14 +1500,10 @@ H5Z_do_op(H5Z_node* tree) * Success: SUCCEED * Failure: FAIL * - * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu + * Programmer: Quincey Koziol * * Date: May 4, 2004 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ H5Z_data_xform_t * @@ -1616,14 +1587,10 @@ done: * Success: SUCCEED * Failure: FAIL * - * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu + * Programmer: Quincey Koziol * * Date: May 4, 2004 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1662,7 +1629,7 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop) * Success: SUCCEED * Failure: FAIL * - * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu + * Programmer: Quincey Koziol * * Date: May 4, 2004 * @@ -1742,14 +1709,12 @@ done: * * Return: TRUE for no data transform, FALSE for a data transform * - * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu + * Programmer: Quincey Koziol * * Date: May 4, 2004 * * Comments: Can't fail * - * Modifications: - * *------------------------------------------------------------------------- */ hbool_t @@ -1773,12 +1738,10 @@ H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop) * Return: * Pointer to a copy of the string in the data_xform property. * - * Programmer: Leon Arber, larber@ncsa.uiuc.edu + * Programmer: Leon Arber * * Date: Sept. 4, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ const char * diff --git a/src/H5dbg.c b/src/H5dbg.c index 4939bca..c01ad88 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -15,7 +15,7 @@ * * Created: H5dbg.c * Mar 4 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Generic debugging routines * @@ -70,7 +70,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 4 2006 * *------------------------------------------------------------------------- -- cgit v0.12 From e0b86594c25c7372720ec4b3fff0add7a122f18c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 20 Jul 2020 16:46:49 -0500 Subject: revert error-stack enable --- tools/test/h5format_convert/testh5fc.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in index d780a3d..2cdd445 100644 --- a/tools/test/h5format_convert/testh5fc.sh.in +++ b/tools/test/h5format_convert/testh5fc.sh.in @@ -483,7 +483,7 @@ TOOLTEST_OUT h5fc_v_n_all.ddl h5fc_non_v3.h5 -v -n # # # h5format_convert -v h5fc_err_level.h5 (error encountered in converting the dataset) -TOOLTEST_MASK_OUT h5fc_v_err.ddl h5fc_err_level.h5 -v --enable-error-stack +TOOLTEST_MASK_OUT h5fc_v_err.ddl h5fc_err_level.h5 -v # # # -- cgit v0.12 From 88e458ac435340f327f252b82ad9b6c1c1f4f618 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 22 Jul 2020 16:13:26 -0500 Subject: Fix HDFFV-11120 and HDFFV-11121 (CVE-2018-13870 and CVE-2018-13869) Description: When a buffer overflow occurred because a name length was corrupted and became very large, h5dump produced a segfault on one file and a memcpy parameter overlap on another file. This commit added checks that detect a read pass the end of the buffer to prevent these error conditions. Platforms tested: Linux/64 (jelly) SunOS 5.11 (emu) --- release_docs/RELEASE.txt | 11 +++++++++++ src/H5Olink.c | 19 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 84f339a..ba8eabe 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -656,6 +656,17 @@ Bug Fixes since HDF5-1.10.3 release Library ------- + - Fixed issues CVE-2018-13870 and CVE-2018-13869 + + When a buffer overflow occurred because a name length was corrupted + and became very large, h5dump crashed on memory access violation. + + A check for reading pass the end of the buffer was added to multiple + locations to prevent the crashes and h5dump now simply fails with an + error message when this error condition occurs. + + (BMR - 2020/7/22, HDFFV-11120 and HDFFV-11121) + - Fixed the segmentation fault when reading attributes with multiple threads It was reported that the reading of attributes with variable length string diff --git a/src/H5Olink.c b/src/H5Olink.c index 1f0c6c7..8aaf2d2 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -119,11 +119,12 @@ H5FL_DEFINE_STATIC(H5O_link_t); static void * H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, - size_t H5_ATTR_UNUSED p_size, const uint8_t *p) + size_t p_size, const uint8_t *p) { H5O_link_t *lnk = NULL; /* Pointer to link message */ size_t len = 0; /* Length of a string in the message */ unsigned char link_flags; /* Flags for encoding link info */ + const uint8_t *p_end = p + p_size; /* End of the p buffer */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -199,6 +200,11 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, if(len == 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid name length") + /* Make sure that length doesn't exceed buffer size, which could occur + when the file is corrupted */ + if(p + len > p_end) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read pass end of buffer") + /* Get the link's name */ if(NULL == (lnk->name = (char *)H5MM_malloc(len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -218,6 +224,12 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, UINT16DECODE(p, len) if(len == 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid link length") + + /* Make sure that length doesn't exceed buffer size, which could occur + when the file is corrupted */ + if(p + len > p_end) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read pass end of buffer") + if(NULL == (lnk->u.soft.name = (char *)H5MM_malloc((size_t)len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") H5MM_memcpy(lnk->u.soft.name, p, len); @@ -238,6 +250,11 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, lnk->u.ud.size = len; if(len > 0) { + /* Make sure that length doesn't exceed buffer size, which could + occur when the file is corrupted */ + if(p + len > p_end) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read pass end of buffer") + if(NULL == (lnk->u.ud.udata = H5MM_malloc((size_t)len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") H5MM_memcpy(lnk->u.ud.udata, p, len); -- cgit v0.12 From 6e740457cc338a7c4db95be4458c76828da7a872 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Jul 2020 11:09:05 -0700 Subject: Minor normalization with 1.10 branch --- src/H5Adense.c | 80 +++++++++------------- src/H5Aint.c | 207 ++++++++++++++++++++++++++------------------------------- src/H5B2.c | 17 +---- src/H5B2hdr.c | 11 +-- src/H5EAdbg.c | 58 ++++++++-------- src/H5Eint.c | 3 +- src/H5F.c | 134 +++++++++++++++---------------------- src/H5Gloc.c | 4 +- src/H5Ochunk.c | 11 +-- src/H5Ocont.c | 6 +- src/H5TS.c | 1 + 11 files changed, 220 insertions(+), 312 deletions(-) diff --git a/src/H5Adense.c b/src/H5Adense.c index a73fcc6..fd92e8f 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -171,7 +171,6 @@ typedef struct H5A_bt2_ud_rmbi_t { * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 4 2006 * *------------------------------------------------------------------------- @@ -290,9 +289,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -351,9 +349,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -440,9 +437,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 4 2006 + * Programmer: Quincey Koziol + * Dec 4 2006 * *------------------------------------------------------------------------- */ @@ -598,7 +594,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, February 20, 2007 * *------------------------------------------------------------------------- @@ -632,7 +628,7 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, December 5, 2006 * *------------------------------------------------------------------------- @@ -743,9 +739,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 4 2006 + * Programmer: Quincey Koziol + * Dec 4 2006 * *------------------------------------------------------------------------- */ @@ -840,9 +835,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 5 2006 + * Programmer: Quincey Koziol + * Dec 5 2006 * *------------------------------------------------------------------------- */ @@ -883,9 +877,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jan 3 2007 + * Programmer: Quincey Koziol + * Jan 3 2007 * *------------------------------------------------------------------------- */ @@ -1065,9 +1058,8 @@ done: * * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 5 2006 + * Programmer: Quincey Koziol + * Dec 5 2006 * *------------------------------------------------------------------------- */ @@ -1161,9 +1153,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 5 2006 + * Programmer: Quincey Koziol + * Dec 5 2006 * *------------------------------------------------------------------------- */ @@ -1296,9 +1287,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -1360,9 +1350,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -1448,9 +1437,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Feb 14 2007 + * Programmer: Quincey Koziol + * Feb 14 2007 * *------------------------------------------------------------------------- */ @@ -1574,9 +1562,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Feb 14 2007 + * Programmer: Quincey Koziol + * Feb 14 2007 * *------------------------------------------------------------------------- */ @@ -1702,9 +1689,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -1788,9 +1774,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jan 3 2007 + * Programmer: Quincey Koziol + * Jan 3 2007 * *------------------------------------------------------------------------- */ @@ -1852,9 +1837,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 6 2006 + * Programmer: Quincey Koziol + * Dec 6 2006 * *------------------------------------------------------------------------- */ diff --git a/src/H5Aint.c b/src/H5Aint.c index cd0ab80..d6ea1f4 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -122,10 +122,10 @@ const unsigned H5O_attr_ver_bounds[] = { /* Local Variables */ /*******************/ -typedef H5A_t* H5A_t_ptr; +typedef H5A_t* H5A_t_ptr; H5FL_SEQ_DEFINE(H5A_t_ptr); - + /*------------------------------------------------------------------------- * Function: H5A__create * @@ -288,16 +288,16 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5A__create() */ - + /*------------------------------------------------------------------------- * Function: H5A__create_by_name * - * Purpose: Create an attribute on object, according to it's name + * Purpose: Create an attribute on object, according to it's name * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * December 6, 2017 + * Programmer: Quincey Koziol + * December 6, 2017 * *------------------------------------------------------------------------- */ @@ -306,8 +306,8 @@ H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr const H5T_t *type, const H5S_t *space, hid_t acpl_id) { H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ @@ -349,22 +349,21 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__create_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5A__open_common * - * Purpose: - * Finishes initializing an attributes the open + * Purpose: Finishes initializing an attributes the open * * Usage: * herr_t H5A__open_common(loc, name) * const H5G_loc_t *loc; IN: Pointer to group location for object * H5A_t *attr; IN/OUT: Pointer to attribute to initialize * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * December 18, 2006 + * Programmer: Quincey Koziol + * December 18, 2006 * *------------------------------------------------------------------------- */ @@ -406,7 +405,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__open_common() */ - + /*------------------------------------------------------------------------- * Function: H5A__open * @@ -451,13 +450,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__open() */ - + /*------------------------------------------------------------------------- * Function: H5A__open_by_idx * * Purpose: Open an attribute according to its index order * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * April 2, 1998 @@ -515,7 +514,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__open_by_idx() */ - + /*------------------------------------------------------------------------- * Function: H5A__open_by_name * @@ -579,7 +578,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__open_by_name() */ - + /*-------------------------------------------------------------------------- NAME H5A__read @@ -681,12 +680,12 @@ done: if(tconv_buf) tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); if(bkg_buf) - bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); + bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5A__read() */ - + /*-------------------------------------------------------------------------- NAME H5A__write @@ -800,7 +799,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5A__write() */ - + /*-------------------------------------------------------------------------- NAME H5A__get_name @@ -821,7 +820,7 @@ ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) { size_t copy_len, nbytes; - ssize_t ret_value = -1; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -846,7 +845,7 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) FUNC_LEAVE_NOAPI(ret_value) } /* H5A__get_name() */ - + /*------------------------------------------------------------------------- * Function: H5A_get_space * @@ -883,14 +882,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_get_space() */ - + /*------------------------------------------------------------------------- * Function: H5A__get_type * * Purpose: Returns an ID for the datatype of an attribute * * Return: Success: A valid ID for the datatype of an attribute - * * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- @@ -946,7 +944,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_type() */ - + /*-------------------------------------------------------------------------- NAME H5A__get_create_plist @@ -978,7 +976,7 @@ H5A__get_create_plist(H5A_t* attr) /* Create the property list object to return */ if((new_plist_id = H5P_copy_plist(plist, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy attribute creation properties") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy attribute creation properties") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_plist_id))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list") @@ -992,7 +990,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_create_plist() */ - + /*------------------------------------------------------------------------- * Function: H5A__get_info * @@ -1033,14 +1031,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_info() */ - + /*------------------------------------------------------------------------- * Function: H5A__copy * * Purpose: Copies attribute OLD_ATTR. * * Return: Success: Pointer to a new copy of the OLD_ATTR argument. - * * Failure: NULL * * Programmer: Robb Matzke @@ -1096,7 +1093,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__copy() */ - + /*------------------------------------------------------------------------- * Function: H5A__shared_free * @@ -1148,7 +1145,7 @@ H5A__shared_free(H5A_t *attr) FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__shared_free() */ - + /*------------------------------------------------------------------------- * Function: H5A__close_cb * @@ -1180,7 +1177,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__close_cb() */ - + /*------------------------------------------------------------------------- * Function: H5A__close * @@ -1231,7 +1228,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__close() */ - + /*------------------------------------------------------------------------- * Function: H5A_oloc * @@ -1263,7 +1260,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_oloc() */ - + /*------------------------------------------------------------------------- * Function: H5A_nameof * @@ -1295,7 +1292,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_nameof() */ - + /*------------------------------------------------------------------------- * Function: H5A_type * @@ -1325,7 +1322,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_type() */ - + /*------------------------------------------------------------------------- * Function: H5A__exists_by_name * @@ -1371,7 +1368,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__exists_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5A__compact_build_table_cb * @@ -1381,7 +1378,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * * Modification:Raymond Lu @@ -1432,7 +1428,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__compact_build_table_cb() */ - + /*------------------------------------------------------------------------- * Function: H5A__compact_build_table * @@ -1444,8 +1440,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * Dec 18, 2006 + * Programmer: Quincey Koziol + * Dec 18, 2006 * *------------------------------------------------------------------------- */ @@ -1495,18 +1491,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__compact_build_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__dense_build_table_cb * * Purpose: Callback routine for building table of attributes from dense * attribute storage. * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -1539,7 +1533,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_build_table_cb() */ - + /*------------------------------------------------------------------------- * Function: H5A__dense_build_table * @@ -1624,21 +1618,20 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_build_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_cmp_name_inc * - * Purpose: Callback routine for comparing two attribute names, in + * Purpose: Callback routine for comparing two attribute names, in * increasing alphabetic order * - * Return: An integer less than, equal to, or greater than zero if the + * Return: An integer less than, equal to, or greater than zero if the * first argument is considered to be respectively less than, * equal to, or greater than the second. If two members compare * as equal, their order in the sorted array is undefined. * (i.e. same as strcmp()) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -1652,7 +1645,7 @@ H5A__attr_cmp_name_inc(const void *attr1, const void *attr2) (*(const H5A_t * const *)attr2)->shared->name)) } /* end H5A__attr_cmp_name_inc() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_cmp_name_dec * @@ -1666,7 +1659,6 @@ H5A__attr_cmp_name_inc(const void *attr1, const void *attr2) * (i.e. opposite of strcmp()) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 8 2007 * *------------------------------------------------------------------------- @@ -1680,7 +1672,7 @@ H5A__attr_cmp_name_dec(const void *attr1, const void *attr2) (*(const H5A_t * const *)attr1)->shared->name)) } /* end H5A__attr_cmp_name_dec() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_cmp_corder_inc * @@ -1693,7 +1685,6 @@ H5A__attr_cmp_name_dec(const void *attr1, const void *attr2) * as equal, their order in the sorted array is undefined. * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 8 2007 * *------------------------------------------------------------------------- @@ -1715,21 +1706,20 @@ H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2) FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__attr_cmp_corder_inc() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_cmp_corder_dec * - * Purpose: Callback routine for comparing two attributes, in + * Purpose: Callback routine for comparing two attributes, in * decreasing creation order * - * Return: An integer less than, equal to, or greater than zero if the + * Return: An integer less than, equal to, or greater than zero if the * second argument is considered to be respectively less than, * equal to, or greater than the first. If two members compare * as equal, their order in the sorted array is undefined. * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Feb 8 2007 + * Programmer: Quincey Koziol + * Feb 8 2007 * *------------------------------------------------------------------------- */ @@ -1750,17 +1740,16 @@ H5A__attr_cmp_corder_dec(const void *attr1, const void *attr2) FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__attr_cmp_corder_dec() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_sort_table * * Purpose: Sort table containing a list of attributes for an object * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * Dec 11, 2006 + * Programmer: Quincey Koziol + * Dec 11, 2006 * *------------------------------------------------------------------------- */ @@ -1795,7 +1784,7 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5A__attr_sort_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_iterate_table * @@ -1804,8 +1793,8 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * Dec 18, 2006 + * Programmer: Quincey Koziol + * Dec 18, 2006 * *------------------------------------------------------------------------- */ @@ -1877,7 +1866,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__attr_iterate_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_release_table * @@ -1885,7 +1874,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Dec 11, 2006 * *------------------------------------------------------------------------- @@ -1893,7 +1882,7 @@ done: herr_t H5A__attr_release_table(H5A_attr_table_t *atable) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1918,18 +1907,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__attr_release_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__get_ainfo * * Purpose: Retrieves the "attribute info" message for an object. Also * sets the number of attributes correctly, if it isn't set up yet. * - * Return: Success: TRUE/FALSE whether message was found & retrieved - * Failure: FAIL if error occurred + * Return: TRUE/FALSE/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 11 2007 * *------------------------------------------------------------------------- @@ -1949,11 +1936,11 @@ H5A__get_ainfo(H5F_t *f, H5O_t *oh, H5O_ainfo_t *ainfo) /* Check if the "attribute info" message exists */ if((ret_value = H5O_msg_exists_oh(oh, H5O_AINFO_ID)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "unable to check object header") + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "unable to check object header") if(ret_value > 0) { /* Retrieve the "attribute info" structure */ if(NULL == H5O_msg_read_oh(f, oh, H5O_AINFO_ID, ainfo)) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't read AINFO message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't read AINFO message") /* Check if we don't know how many attributes there are */ if(ainfo->nattrs == HSIZET_MAX) { @@ -1982,7 +1969,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5A__get_ainfo() */ - + /*------------------------------------------------------------------------- * Function: H5A__set_version * @@ -1993,7 +1980,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 17 2007 * *------------------------------------------------------------------------- @@ -2044,7 +2030,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__set_version() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_copy_file * @@ -2254,10 +2240,10 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s H5MM_memcpy(buf, attr_src->shared->data, attr_src->shared->data_size); - /* Allocate background memory */ - if(H5T_path_bkg(tpath_src_mem) || H5T_path_bkg(tpath_mem_dst)) - if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, NULL, "memory allocation failed") + /* Allocate background memory */ + if(H5T_path_bkg(tpath_src_mem) || H5T_path_bkg(tpath_mem_dst)) + if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Convert from source file to memory */ if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) @@ -2265,9 +2251,9 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s H5MM_memcpy(reclaim_buf, buf, buf_size); - /* Set background buffer to all zeros */ - if(bkg_buf) - HDmemset(bkg_buf, 0, buf_size); + /* Set background buffer to all zeros */ + if(bkg_buf) + HDmemset(bkg_buf, 0, buf_size); /* Convert from memory to destination file */ if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) @@ -2327,7 +2313,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__attr_copy_file() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_post_copy_file * @@ -2420,7 +2406,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__attr_post_copy_file() */ - + /*------------------------------------------------------------------------- * Function: H5A__dense_post_copy_file_cb * @@ -2478,7 +2464,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_post_copy_file_cb() */ - + /*------------------------------------------------------------------------- * Function: H5A__dense_post_copy_file_all * @@ -2487,7 +2473,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Peter Cao - * xcao@hdfgroup.org * July 20, 2007 * *------------------------------------------------------------------------- @@ -2525,7 +2510,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_post_copy_file_all */ - + /*------------------------------------------------------------------------- * Function: H5A__rename_by_name * @@ -2533,7 +2518,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * February 20, 2007 * *------------------------------------------------------------------------- @@ -2543,10 +2528,10 @@ H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_na const char *new_attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2575,7 +2560,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__rename_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5A__iterate_common * @@ -2583,7 +2568,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * December 6, 2017 * *------------------------------------------------------------------------- @@ -2610,7 +2595,7 @@ H5A__iterate_common(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, FUNC_LEAVE_NOAPI(ret_value) } /* H5A__iterate_common() */ - + /*------------------------------------------------------------------------- * Function: H5A__iterate * @@ -2675,7 +2660,7 @@ done: } /* end H5A__iterate() */ #ifndef H5_NO_DEPRECATED_SYMBOLS - + /*------------------------------------------------------------------------- * Function: H5A__iterate_old * @@ -2683,7 +2668,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * December 6, 2017 * *------------------------------------------------------------------------- @@ -2725,7 +2710,7 @@ H5A__iterate_old(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * December 6, 2017 * *------------------------------------------------------------------------- @@ -2734,8 +2719,8 @@ herr_t H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2763,7 +2748,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__delete_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5A__delete_by_idx * @@ -2771,7 +2756,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * December 6, 2017 * *------------------------------------------------------------------------- @@ -2781,8 +2766,8 @@ H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_ty H5_iter_order_t order, hsize_t n) { H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5B2.c b/src/H5B2.c index c9ed303..5c83de2 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -15,7 +15,7 @@ * * Created: H5B2.c * Jan 31 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements a B-tree, with several modifications from * the "standard" methods. @@ -129,7 +129,6 @@ H5FL_DEFINE_STATIC(H5B2_t); * filled in), negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 31 2005 * *------------------------------------------------------------------------- @@ -200,7 +199,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 15 2009 * *------------------------------------------------------------------------- @@ -264,7 +262,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -307,7 +304,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 23 2015 * *------------------------------------------------------------------------- @@ -379,7 +375,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 5 2009 * *------------------------------------------------------------------------- @@ -414,7 +409,6 @@ H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p) * Return: Value from callback: non-negative on success, negative on error * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 11 2005 * *------------------------------------------------------------------------- @@ -465,7 +459,6 @@ H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data) * Return: Non-negative (TRUE/FALSE) on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 23 2005 * *------------------------------------------------------------------------- @@ -705,7 +698,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 23 2005 * *------------------------------------------------------------------------- @@ -894,7 +886,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 25 2005 * *------------------------------------------------------------------------- @@ -968,7 +959,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -1051,7 +1041,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 25 2005 * *------------------------------------------------------------------------- @@ -1092,7 +1081,6 @@ H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec) * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 8 2005 * *------------------------------------------------------------------------- @@ -1150,7 +1138,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 10 2005 * *------------------------------------------------------------------------- @@ -1384,7 +1371,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 15 2009 * *------------------------------------------------------------------------- @@ -1493,7 +1479,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 9 2005 * *------------------------------------------------------------------------- diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 68669e8..9ba8235 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -15,7 +15,7 @@ * * Created: H5B2int.c * Feb 27 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal routines for managing v2 B-trees. * @@ -101,7 +101,6 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -230,7 +229,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- @@ -276,7 +274,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- @@ -355,7 +352,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 13 2009 * *------------------------------------------------------------------------- @@ -391,7 +387,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 13 2009 * *------------------------------------------------------------------------- @@ -428,7 +423,6 @@ done: * Return: SUCCEED (Can't fail) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- @@ -456,7 +450,6 @@ H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr) * Return: The file's reference count after the decrement. (Can't fail) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- @@ -485,7 +478,6 @@ H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 13 2009 * *------------------------------------------------------------------------- @@ -517,7 +509,6 @@ done: * Return: Non-NULL pointer to header on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2015 * *------------------------------------------------------------------------- diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index eb3624b..20c6a4d 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -174,15 +174,14 @@ END_FUNC(PKG) /* end H5EA__hdr_debug() */ /*------------------------------------------------------------------------- - * Function: H5EA__iblock_debug + * Function: H5EA__iblock_debug * - * Purpose: Prints debugging info about a extensible array index block. + * Purpose: Prints debugging info about a extensible array index block. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -214,7 +213,7 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde /* Load the extensible array header */ if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) - H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") + H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Sanity check */ HDassert(H5F_addr_eq(hdr->idx_blk_addr, addr)); @@ -228,16 +227,16 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Array class ID:", hdr->cparam.cls->name); + "Array class ID:", hdr->cparam.cls->name); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Index Block size:", - iblock->size); + "Index Block size:", + iblock->size); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "# of data block addresses in index block:", - iblock->ndblk_addrs); + "# of data block addresses in index block:", + iblock->ndblk_addrs); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "# of super block addresses in index block:", - iblock->nsblk_addrs); + "# of super block addresses in index block:", + iblock->nsblk_addrs); /* Check if there are any elements in index block */ if(hdr->cparam.idx_blk_elmts > 0) { @@ -292,21 +291,20 @@ CATCH if(iblock && H5EA__iblock_unprotect(iblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") + H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__iblock_debug() */ - + /*------------------------------------------------------------------------- - * Function: H5EA__sblock_debug + * Function: H5EA__sblock_debug * - * Purpose: Prints debugging info about a extensible array super block. + * Purpose: Prints debugging info about a extensible array super block. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 30 2008 + * Programmer: Quincey Koziol + * Sep 30 2008 * *------------------------------------------------------------------------- */ @@ -338,7 +336,7 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Load the extensible array header */ if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) - H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") + H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect super block */ /* (Note: setting parent of super block to 'hdr' for this operation should be OK -QAK) */ @@ -350,16 +348,16 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Array class ID:", hdr->cparam.cls->name); + "Array class ID:", hdr->cparam.cls->name); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Super Block size:", - sblock->size); + "Super Block size:", + sblock->size); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "# of data block addresses in super block:", - sblock->ndblks); + "# of data block addresses in super block:", + sblock->ndblks); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "# of elements in data blocks from this super block:", - sblock->dblk_nelmts); + "# of elements in data blocks from this super block:", + sblock->dblk_nelmts); /* Check if there are any data block addresses in super block */ if(sblock->ndblks > 0) { diff --git a/src/H5Eint.c b/src/H5Eint.c index fe72449..2371a5f 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -33,7 +33,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Epkg.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -576,7 +575,7 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o ret_value = (op->u.func2)((unsigned)(estack->nused - (size_t)(i + 1)), estack->slot + i, client_data); } /* end else */ - if(ret_value < 0) + if(ret_value < 0) HERROR(H5E_ERROR, H5E_CANTLIST, "can't walk error stack"); } /* end if */ } /* end else */ diff --git a/src/H5F.c b/src/H5F.c index 3dbd292..9d426ac 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -549,8 +549,8 @@ done: * Purpose: Returns a pointer to the file handle of the low-level file * driver. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -637,9 +637,7 @@ done: * the list of file creation and file access properties. * * Return: Success: A file ID - * * Failure: H5I_INVALID_HID - * *------------------------------------------------------------------------- */ hid_t @@ -739,9 +737,7 @@ done: * See Also: H5Fpublic.h for a list of possible values for FLAGS. * * Return: Success: A file ID - * * Failure: H5I_INVALID_HID - * *------------------------------------------------------------------------- */ hid_t @@ -820,7 +816,8 @@ done: * not remove them from the cache. The OBJECT_ID can be a file, * dataset, group, attribute, or named data type. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1008,7 +1005,8 @@ done: * Purpose: Public API to retrieve the file's 'intent' flags passed * during H5Fopen() * - * Return: Non-negative on success/negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1079,9 +1077,7 @@ done: * Purpose: Retrieves the amount of free space in the file. * * Return: Success: Amount of free space for type - * * Failure: -1 - * *------------------------------------------------------------------------- */ hssize_t @@ -1175,9 +1171,7 @@ done: * this now. * * Return: Success: Bytes copied / number of bytes needed - * * Failure: -1 - * *------------------------------------------------------------------------- */ ssize_t @@ -1212,8 +1206,8 @@ done: * filled in by the caller. This allows us to adapt for * obsolete versions of the structure. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1249,8 +1243,8 @@ done: * configuration, using the contents of the instance of * H5AC_cache_config_t pointed to by config_ptr. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1283,8 +1277,8 @@ done: * the hit rate statistics were reset either manually or * automatically. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1320,8 +1314,8 @@ done: * the ptr parameters are NULL, the associated datum is * not returned. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1360,8 +1354,8 @@ done: * you are controlling cache size from your program instead * of using our cache size control code. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1402,9 +1396,7 @@ done: * not the actual name after resolving symlinks, etc. * * Return: Success: The length of the file name - * * Failure: -1 - * *------------------------------------------------------------------------- */ ssize_t @@ -1444,8 +1436,8 @@ done: * in the SOHM table if there is one. * 3. The amount of free space tracked in the file. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1486,8 +1478,8 @@ done: * Purpose: To retrieve the collection of read retries for metadata * items with checksum. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1525,9 +1517,7 @@ done: * sections. * * Return: Success: The total # of free space sections - * * Failure: -1 - * *------------------------------------------------------------------------- */ ssize_t @@ -1562,8 +1552,8 @@ done: * provided file, potentially closing any cached files * unless they are held open from somewhere\ else. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1618,8 +1608,8 @@ done: * set up flush dependency/proxy even for file opened without * SWMR to resolve issues with opened objects. * - * Return: Non-negative on success/negative on failure - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1654,7 +1644,8 @@ done: * Purpose: Start metadata cache logging operations for a file. * - Logging must have been set up via the fapl. * - * Return: Non-negative on success/Negative on errors + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1686,7 +1677,8 @@ done: * - Does not close the log file. * - Logging must have been set up via the fapl. * - * Return: Non-negative on success/Negative on errors + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1718,7 +1710,8 @@ done: * set up via the fapl. is_currently_logging determines if * log messages are being recorded at this time. * - * Return: Non-negative on success/Negative on errors + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1752,7 +1745,8 @@ done: * H5Fset_latest_format() starting release 1.10.2. * See explanation for H5Fset_latest_format() in H5Fdeprec.c. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1788,7 +1782,8 @@ done: * downgrade persistent file space to non-persistent * for 1.8 library. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1822,7 +1817,8 @@ done: * * Purpose: Resets statistics for the page buffer layer. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1852,7 +1848,8 @@ done: * * Purpose: Retrieves statistics for the page buffer layer. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1890,7 +1887,8 @@ done: * image_len: --size of the on disk metadata cache image * --zero if no cache image * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1918,14 +1916,12 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_eoa * - * Purpose: Returns the address of the first byte after the last + * Purpose: Gets the address of the first byte after the last * allocated memory in the file. * (See H5FDget_eoa() in H5FD.c) * - * Return: Success: First byte after allocated memory. - * Failure: HADDR_UNDEF - * - * Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1958,7 +1954,8 @@ done: * * Purpose: Set the EOA for the file to the maximum of (EOA, EOF) + increment * - * Return: Non-negative on success/Negative on errors + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1984,24 +1981,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_dset_no_attrs_hint - * - * Purpose: - * - * Get the file-level setting to create minimized dataset object headers. - * Result is stored at pointer `minimize`. - * - * Return: + * Function: H5Fget_dset_no_attrs_hint * - * Success: SUCCEED (0) (non-negative value) - * Failure: FAIL (-1) (negative value) + * Purpose: Get the file-level setting to create minimized dataset object headers. + * Result is stored at pointer `minimize`. * - * Programmer: - * - * Jacob Smith - * 15 August 2018 - * - * Changes: None. + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -2029,23 +2015,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fset_dset_no_attrs_hint - * - * Purpose: - * - * Set the file-level setting to create minimized dataset object headers. + * Function: H5Fset_dset_no_attrs_hint * - * Return: + * Purpose: Set the file-level setting to create minimized dataset object + * headers. * - * Success: SUCCEED (0) (non-negative value) - * Failure: FAIL (-1) (negative value) - * - * Programmer: - * - * Jacob Smith - * 15 August 2018 - * - * Changes: None. + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 0243b41..2461c51 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -809,9 +809,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_info + * Function: H5G_loc_info * - * Purpose: Retrieve the data model information for an object from a group location + * Purpose: Retrieve the data model information for an object from a group location * and path to that object * * Return: Non-negative on success/Negative on failure diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index 72402e4..cb31cec 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -15,7 +15,7 @@ * * Created: H5Ochunk.c * Jul 13 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header chunk routines. * @@ -84,7 +84,6 @@ H5FL_DEFINE(H5O_chunk_proxy_t); * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -146,14 +145,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_chunk_protect + * Function: H5O__chunk_protect * * Purpose: Protect an object header chunk for modifications * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 17 2008 * *------------------------------------------------------------------------- @@ -227,7 +225,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 17 2008 * *------------------------------------------------------------------------- @@ -278,7 +275,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 6 2010 * *------------------------------------------------------------------------- @@ -319,7 +315,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -370,7 +365,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -415,7 +409,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 13, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Ocont.c b/src/H5Ocont.c index ad54272..68a88e2 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -15,7 +15,7 @@ * * Created: H5Ocont.c * Aug 6 1997 - * Robb Matzke + * Robb Matzke * * Purpose: The object header continuation message. This * message is only generated and read from within @@ -83,7 +83,6 @@ H5FL_DEFINE(H5O_cont_t); * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -127,7 +126,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 7 1997 * *------------------------------------------------------------------------- @@ -166,7 +164,6 @@ H5O__cont_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co * Failure: zero * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -253,7 +250,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- diff --git a/src/H5TS.c b/src/H5TS.c index 3643ed5..ee3b219 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -678,3 +678,4 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) } /* H5TS_create_thread */ #endif /* H5_HAVE_THREADSAFE */ + -- cgit v0.12 From 799f2891c2b305ad30eae53b758d96a083e4699e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Jul 2020 15:47:10 -0500 Subject: Revert err file --- tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err index d85a999..e69de29 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err +++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err @@ -1,8 +0,0 @@ -h5format_convert error: unable to downgrade dataset "/DSET_ERR" -H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5trav_visit(): traverse failed - major: Failure in tools library - minor: error in function - #001: (file name) line (number) in traverse(): H5Lvisit_by_name failed - major: Failure in tools library - minor: error in function -- cgit v0.12 From 5857bb817019b8513f796c9564de3f1845f9a44a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Jul 2020 16:15:50 -0500 Subject: Only one line needed to compare --- tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err index e69de29..e72892d 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err +++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err @@ -0,0 +1 @@ +h5format_convert error: unable to downgrade dataset "/DSET_ERR" -- cgit v0.12 From 91f5320ff0e9579d47f5d91bcd80de40c30c166f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Jul 2020 17:32:01 -0700 Subject: Updates H5Sset_extent_none() to set H5S_NULL The API call used to set the internal H5S_NO_CLASS value which produced errors when such a dataspace was passed to many other API calls. Fixes HDFFV-11027 --- release_docs/RELEASE.txt | 15 +++++++++ src/H5S.c | 7 +++-- test/tselect.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 98 insertions(+), 4 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 84f339a..9dd54fa 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -951,6 +951,21 @@ Bug Fixes since HDF5-1.10.3 release (DER - 2019/12/09, HDFFV-10945) + - H5Sset_extent_none() sets the dataspace class to H5S_NO_CLASS which + causes asserts/errors when passed to other dataspace API calls. + + H5S_NO_CLASS is an internal class value that should not have been + exposed via a public API call. + + In debug builds of the library, this can cause asserts to trip. In + non-debug builds, it will produce normal library errors. + + The new library behavior is for H5Sset_extent_none() to convert + the dataspace into one of type H5S_NULL, which is better handled + by the library and easier for developers to reason about. + + (DER - 2020/07/27, HDFFV-11027) + Java Library: ---------------- diff --git a/src/H5S.c b/src/H5S.c index bea86ca..7e48076 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -437,6 +437,9 @@ H5S__extent_release(H5S_extent_t *extent) extent->max = H5FL_ARR_FREE(hsize_t, extent->max); } /* end if */ + extent->rank = 0; + extent->nelem = 0; + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__extent_release() */ @@ -1832,7 +1835,7 @@ done: RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function resets the type of a dataspace back to "none" with no + This function resets the type of a dataspace to H5S_NULL with no extent information stored for the dataspace. --------------------------------------------------------------------------*/ herr_t @@ -1852,7 +1855,7 @@ H5Sset_extent_none(hid_t space_id) if(H5S__extent_release(&space->extent) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTDELETE, FAIL, "can't release previous dataspace") - space->extent.type = H5S_NO_CLASS; + space->extent.type = H5S_NULL; done: FUNC_LEAVE_API(ret_value) diff --git a/test/tselect.c b/test/tselect.c index aa0ab11..607212b 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -15442,14 +15442,14 @@ test_hyper_io_1d(void) /* Get the dataset's dataspace */ sid = H5Dget_space(did); - CHECK(sid, H5I_INVALID_HID, "H5Pcreate"); + CHECK(sid, H5I_INVALID_HID, "H5Dget_space"); ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Set up contiguous memory dataspace for the selected elements */ dimsm[0] = count[0]; mid = H5Screate_simple(RANK, dimsm, NULL); - CHECK(mid, H5I_INVALID_HID, "H5Screate"); + CHECK(mid, H5I_INVALID_HID, "H5Screate_simple"); /* Read all the selected 10th elements in the dataset into "rdata" */ ret = H5Dread(did, H5T_NATIVE_INT, mid, sid, H5P_DEFAULT, rdata); @@ -15476,6 +15476,77 @@ test_hyper_io_1d(void) /**************************************************************** ** +** test_get_extent_no_class: +** Test to verify the behavior of dataspace code when passed +** a dataspace modified by H5Sset_extent_none(). +** +****************************************************************/ +static void +test_h5s_set_extent_none(void) +{ + hid_t sid = H5I_INVALID_HID; + hid_t dst_sid = H5I_INVALID_HID; + hid_t null_sid = H5I_INVALID_HID; + int rank = 1; + hsize_t current_dims = 123; + H5S_class_t cls; + int out_rank; + hsize_t out_dims; + hsize_t out_maxdims; + hssize_t out_points; + htri_t equal; + herr_t ret; + + /* Specific values here don't matter as we're just going to reset */ + sid = H5Screate_simple(rank, ¤t_dims, NULL); + CHECK(sid, H5I_INVALID_HID, "H5Screate_simple"); + + /* Dataspace class will be H5S_NULL after this. + * In versions prior to 1.10.7 / 1.12.1 this would produce a + * dataspace with the internal H5S_NO_SPACE class. + */ + ret = H5Sset_extent_none(sid); + CHECK(ret, FAIL, "H5Sset_extent_none"); + cls = H5Sget_simple_extent_type(sid); + VERIFY(cls, H5S_NULL, "H5Sget_simple_extent_type"); + + /* Extent getters should generate normal results and not segfault. + */ + out_rank = H5Sget_simple_extent_dims(sid, &out_dims, &out_maxdims); + VERIFY(out_rank, 0, "H5Sget_simple_extent_dims"); + out_rank = H5Sget_simple_extent_ndims(sid); + VERIFY(out_rank, 0, "H5Sget_simple_extent_ndims"); + out_points = H5Sget_simple_extent_npoints(sid); + VERIFY(out_points, 0, "H5Sget_simple_extent_npoints"); + + /* Check that copying the new (non-)extent works. + */ + dst_sid = H5Screate_simple(rank, ¤t_dims, NULL); + CHECK(dst_sid, H5I_INVALID_HID, "H5Screate_simple"); + ret = H5Sextent_copy(dst_sid, sid); + CHECK(ret, FAIL, "H5Sextent_copy"); + + /* Check that H5Sset_extent_none() produces the same extent as + * H5Screate(H5S_NULL). + */ + null_sid = H5Screate(H5S_NULL); + CHECK(null_sid, H5I_INVALID_HID, "H5Screate"); + equal = H5Sextent_equal(sid, null_sid); + VERIFY(equal, TRUE, "H5Sextent_equal"); + + /* Close */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(dst_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(null_sid); + CHECK(ret, FAIL, "H5Sclose"); + +} /* test_get_extent_no_class() */ + + +/**************************************************************** +** ** test_select(): Main H5S selection testing routine. ** ****************************************************************/ @@ -15660,6 +15731,11 @@ test_select(void) /* Test reading of 1-d disjoint file space to 1-d single block memory space */ test_hyper_io_1d(); + /* Test H5Sset_extent_none() functionality after we updated it to set + * the class to H5S_NULL instead of H5S_NO_CLASS. + */ + test_h5s_set_extent_none(); + } /* test_select() */ -- cgit v0.12 From dbba42c306a16f174d1dbbfb75795db13433eaad Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Jul 2020 17:38:41 -0700 Subject: Fixes typo in tselect.c --- test/tselect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tselect.c b/test/tselect.c index 607212b..8c5a0f2 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -15503,7 +15503,7 @@ test_h5s_set_extent_none(void) /* Dataspace class will be H5S_NULL after this. * In versions prior to 1.10.7 / 1.12.1 this would produce a - * dataspace with the internal H5S_NO_SPACE class. + * dataspace with the internal H5S_NO_CLASS class. */ ret = H5Sset_extent_none(sid); CHECK(ret, FAIL, "H5Sset_extent_none"); -- cgit v0.12 From c78326eb92d7e0d2087b306d7d216083ce95f3c4 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Jul 2020 17:40:25 -0700 Subject: Fixed additional typos in tselect.c comments. --- test/tselect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tselect.c b/test/tselect.c index 8c5a0f2..c98db5d 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -15476,7 +15476,7 @@ test_hyper_io_1d(void) /**************************************************************** ** -** test_get_extent_no_class: +** test_h5s_set_extent_none: ** Test to verify the behavior of dataspace code when passed ** a dataspace modified by H5Sset_extent_none(). ** @@ -15542,7 +15542,7 @@ test_h5s_set_extent_none(void) ret = H5Sclose(null_sid); CHECK(ret, FAIL, "H5Sclose"); -} /* test_get_extent_no_class() */ +} /* test_h5s_set_extent_none() */ /**************************************************************** -- cgit v0.12 From e4603ff8a171e82de6373ba6eddcf59d5eeab5aa Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 28 Jul 2020 08:28:38 -0700 Subject: Updated the Java tests to deal with H5Sset_extent_none changes --- java/test/TestH5S.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/test/TestH5S.java b/java/test/TestH5S.java index 985342b..97c0b68 100644 --- a/java/test/TestH5S.java +++ b/java/test/TestH5S.java @@ -171,7 +171,7 @@ public class TestH5S { try { H5.H5Sset_extent_none(H5sid); read_type = H5.H5Sget_simple_extent_type(H5sid); - assertTrue("H5.H5Sget_simple_extent_type: "+read_type, HDF5Constants.H5S_NO_CLASS == read_type); + assertTrue("H5.H5Sget_simple_extent_type: "+read_type, HDF5Constants.H5S_NULL == read_type); } catch (Throwable err) { err.printStackTrace(); -- cgit v0.12 From 707e30c6be1954c0027374124207e46caae68cbc Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 28 Jul 2020 12:20:13 -0500 Subject: Fixed typos in error messages. --- src/H5Olink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5Olink.c b/src/H5Olink.c index 8aaf2d2..c27b51f 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -203,7 +203,7 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Make sure that length doesn't exceed buffer size, which could occur when the file is corrupted */ if(p + len > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read pass end of buffer") + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read past end of buffer") /* Get the link's name */ if(NULL == (lnk->name = (char *)H5MM_malloc(len + 1))) @@ -228,7 +228,7 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Make sure that length doesn't exceed buffer size, which could occur when the file is corrupted */ if(p + len > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read pass end of buffer") + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read past end of buffer") if(NULL == (lnk->u.soft.name = (char *)H5MM_malloc((size_t)len + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -253,7 +253,7 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Make sure that length doesn't exceed buffer size, which could occur when the file is corrupted */ if(p + len > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read pass end of buffer") + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "name length causes read past end of buffer") if(NULL == (lnk->u.ud.udata = H5MM_malloc((size_t)len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") -- cgit v0.12 From ef6db167a86e6c065d46963dbd75cd325fe83813 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Tue, 28 Jul 2020 16:26:20 -0500 Subject: H5R: fix encoding of references that are part of compound types Add corresponding test and some debug information --- src/H5Rint.c | 2 +- src/H5T.c | 4 +- src/H5Tpkg.h | 2 +- src/H5Tref.c | 31 ++++++ test/trefer.c | 303 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 338 insertions(+), 4 deletions(-) diff --git a/src/H5Rint.c b/src/H5Rint.c index 6dfbf2b..0acc887 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -86,7 +86,7 @@ } while(0) /* Debug */ -//#define H5R_DEBUG +// #define H5R_DEBUG #ifdef H5R_DEBUG #define H5R_LOG_DEBUG(...) do { \ HDfprintf(stdout, " # %s(): ", __func__); \ diff --git a/src/H5T.c b/src/H5T.c index 25c1f75..991095d 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -5718,9 +5718,9 @@ H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) break; case H5T_VLEN: /* Recurse on the VL information if it's VL, compound or array, then free VL sequence */ - /* Recurse if it's VL, compound, enum or array */ + /* Recurse if it's VL, compound, enum or array (ignore references here so that we can encode them as part of the same blob)*/ /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ - if(dt->shared->parent->shared->force_conv && H5T_IS_COMPLEX(dt->shared->parent->shared->type)) { + if(dt->shared->parent->shared->force_conv && H5T_IS_COMPLEX(dt->shared->parent->shared->type) && (dt->shared->parent->shared->type != H5T_REFERENCE)) { if((changed = H5T_set_loc(dt->shared->parent, file, loc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed > 0) diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 600d7aa..3eaec8c 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -49,7 +49,7 @@ #define H5T_NAMELEN 32 /* Macro to ease detecting "complex" datatypes (i.e. those with base types or fields) */ -#define H5T_IS_COMPLEX(t) ((t) == H5T_COMPOUND || (t) == H5T_ENUM || (t) == H5T_VLEN || (t) == H5T_ARRAY) +#define H5T_IS_COMPLEX(t) ((t) == H5T_COMPOUND || (t) == H5T_ENUM || (t) == H5T_VLEN || (t) == H5T_ARRAY || (t) == H5T_REFERENCE) /* Macro to ease detecting fixed "string" datatypes */ #define H5T_IS_FIXED_STRING(dt) (H5T_STRING == (dt)->type) diff --git a/src/H5Tref.c b/src/H5Tref.c index 7c59e75..42e3da2 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -40,6 +40,19 @@ #define H5T_REF_OBJ_DISK_SIZE(f) (H5F_SIZEOF_ADDR(f)) #define H5T_REF_DSETREG_DISK_SIZE(f) (H5HG_HEAP_ID_SIZE(f)) +/* Debug */ +// #define H5T_REF_DEBUG +#ifdef H5T_REF_DEBUG +#define H5T_REF_LOG_DEBUG(...) do { \ + HDfprintf(stdout, " # %s(): ", __func__); \ + HDfprintf(stdout, __VA_ARGS__); \ + HDfprintf(stdout, "\n"); \ + HDfflush(stdout); \ + } while (0) +#else +#define H5T_REF_LOG_DEBUG(...) do { } while (0) +#endif + /******************/ /* Local Typedefs */ /******************/ @@ -133,6 +146,7 @@ H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) htri_t ret_value = FALSE; /* Indicate success, but no location change */ FUNC_ENTER_PACKAGE + H5T_REF_LOG_DEBUG("loc=%d", (int)loc); HDassert(dt); /* f is NULL when loc == H5T_LOC_MEMORY */ @@ -319,6 +333,7 @@ H5T__ref_mem_isnull(const H5VL_object_t H5_ATTR_UNUSED *src_file, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC_NOERR + H5T_REF_LOG_DEBUG(""); /* Check parameters */ HDassert(src_buf); @@ -346,6 +361,7 @@ H5T__ref_mem_setnull(H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC_NOERR + H5T_REF_LOG_DEBUG(""); HDmemset(dst_buf, 0, H5T_REF_MEM_SIZE); @@ -373,6 +389,7 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf size_t ret_value = 0; /* Return value */ FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Sanity check */ HDassert(src_buf); @@ -471,6 +488,7 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Sanity check */ HDassert(src_buf); @@ -557,6 +575,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Sanity check */ HDassert(src_buf); @@ -670,6 +689,7 @@ H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Check parameters */ HDassert(src_file); @@ -712,6 +732,7 @@ H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf) herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(dst_file); HDassert(dst_buf); @@ -761,6 +782,7 @@ H5T__ref_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_bu size_t ret_value = 0; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_buf); @@ -810,6 +832,7 @@ H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_file); HDassert(src_buf); @@ -856,6 +879,7 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_buf); HDassert(src_size); @@ -915,6 +939,7 @@ static herr_t H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Check parameters */ HDassert(src_file); @@ -967,6 +992,7 @@ H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void H5_ATTR_UNUSED *sr size_t ret_value = 0; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_file); HDassert(src_buf); @@ -1014,6 +1040,7 @@ H5T__ref_obj_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_file); HDassert(src_buf); @@ -1068,6 +1095,7 @@ H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Check parameters */ HDassert(src_file); @@ -1123,6 +1151,7 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, #else FUNC_ENTER_STATIC_NOERR #endif + H5T_REF_LOG_DEBUG(""); HDassert(src_buf); @@ -1171,6 +1200,7 @@ H5T__ref_dsetreg_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_file); HDassert(src_buf); @@ -1221,6 +1251,7 @@ H5T_ref_reclaim(void *elem, const H5T_t *dt) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT + H5T_REF_LOG_DEBUG(""); /* Sanity checks */ HDassert(elem); diff --git a/test/trefer.c b/test/trefer.c index fd97239..f9a6863 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -24,6 +24,7 @@ #define FILE_REF_PARAM "trefer_param.h5" #define FILE_REF_OBJ "trefer_obj.h5" #define FILE_REF_VL_OBJ "trefer_vl_obj.h5" +#define FILE_REF_CMPND_OBJ "trefer_cmpnd_obj.h5" #define FILE_REF_REG "trefer_reg.h5" #define FILE_REF_REG_1D "trefer_reg_1d.h5" #define FILE_REF_OBJ_DEL "trefer_obj_del.h5" @@ -56,6 +57,15 @@ typedef struct s1_t { float c; } s1_t; +/* Compound datatype with reference */ +typedef struct s2_t { + H5R_ref_t ref0; /* reference */ + H5R_ref_t ref1; /* reference */ + H5R_ref_t ref2; /* reference */ + H5R_ref_t ref3; /* reference */ + unsigned int dim_idx; /* dimension index of the dataset */ +} s2_t; + #define GROUPNAME "/group" #define GROUPNAME2 "group2" #define GROUPNAME3 "group3" @@ -806,6 +816,297 @@ test_reference_vlen_obj(void) /**************************************************************** ** +** test_reference_cmpnd_obj(): Test basic H5R (reference) object reference +** within a compound type. +** Tests references to various kinds of objects +** +****************************************************************/ +static void +test_reference_cmpnd_obj(void) +{ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t cmpnd_dims[] = {1}; + hid_t dapl_id; /* Dataset access property list */ + H5R_ref_t *wbuf, /* buffer to write to disk */ + *rbuf; /* buffer read from disk */ + unsigned *ibuf, *obuf; + unsigned i, j; /* Counters */ + H5O_type_t obj_type; /* Object type */ + herr_t ret; /* Generic return value */ + s2_t cmpnd_wbuf, cmpnd_rbuf; + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Object Reference Functions within compound type\n")); + + /* Allocate write & read buffers */ + wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); + ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + + for (i = 0; i < SPACE1_DIM1; i++) + obuf[i] = i * 3; + + /* Create file */ + fid1 = H5Fcreate(FILE_REF_CMPND_OBJ, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid1, H5I_INVALID_HID, "H5Fcreate"); + + /* Create dataspace for datasets */ + sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); + CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple"); + + /* Create dataset access property list */ + dapl_id = H5Pcreate(H5P_DATASET_ACCESS); + CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate"); + + /* Create a group */ + group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(group, H5I_INVALID_HID, "H5Gcreate2"); + + /* Create a dataset (inside Group1) */ + dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); + + /* Write selection to disk */ + ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Create another dataset (inside Group1) */ + dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close disk dataspace */ + ret = H5Sclose(sid1); + CHECK(ret, FAIL, "H5Sclose"); + + /* Create a datatype to refer to */ + tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)); + CHECK(tid1, H5I_INVALID_HID, "H5Tcreate"); + + /* Insert fields */ + ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT); + CHECK(ret, FAIL, "H5Tinsert"); + + /* Save datatype for later */ + ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close group */ + ret = H5Gclose(group); + CHECK(ret, FAIL, "H5Gclose"); + + /* Create compound type */ + tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s2_t)); + CHECK(tid1, H5I_INVALID_HID, "H5Tcreate"); + + /* Insert fields */ + ret = H5Tinsert(tid1, "ref0", HOFFSET(s2_t, ref0), H5T_STD_REF); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "ref1", HOFFSET(s2_t, ref1), H5T_STD_REF); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "ref2", HOFFSET(s2_t, ref2), H5T_STD_REF); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "ref3", HOFFSET(s2_t, ref3), H5T_STD_REF); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "dim_idx", HOFFSET(s2_t, dim_idx), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); + + /* Create dataspace for datasets */ + sid1 = H5Screate_simple(SPACE1_RANK, cmpnd_dims, NULL); + CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple"); + + /* Create a dataset */ + dataset = H5Dcreate2(fid1, "Dataset3", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); + + /* Create reference to dataset */ + ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3"); + + /* Create reference to dataset */ + ret = H5Rcreate_object(fid1, "/Group1/Dataset2", H5P_DEFAULT, &wbuf[1]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[1], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3"); + + /* Create reference to group */ + ret = H5Rcreate_object(fid1, "/Group1", H5P_DEFAULT, &wbuf[2]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[2], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3"); + + /* Create reference to named datatype */ + ret = H5Rcreate_object(fid1, "/Group1/Datatype1", H5P_DEFAULT, &wbuf[3]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[3], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3"); + + /* Store dimensions */ + cmpnd_wbuf.ref0 = wbuf[0]; + cmpnd_wbuf.ref1 = wbuf[1]; + cmpnd_wbuf.ref2 = wbuf[2]; + cmpnd_wbuf.ref3 = wbuf[3]; + cmpnd_wbuf.dim_idx = SPACE1_DIM1; + + /* Write selection to disk */ + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &cmpnd_wbuf); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Close disk dataspace */ + ret = H5Sclose(sid1); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close file */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + + /* Re-open the file */ + fid1 = H5Fopen(FILE_REF_CMPND_OBJ, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid1, H5I_INVALID_HID, "H5Fopen"); + + /* Open the dataset */ + dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dopen2"); + + tid1 = H5Dget_type(dataset); + CHECK(tid1, H5I_INVALID_HID, "H5Dget_type"); + + /* Read selection from disk */ + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &cmpnd_rbuf); + CHECK(ret, FAIL, "H5Dread"); + + VERIFY(cmpnd_rbuf.dim_idx, SPACE1_DIM1, "H5Dread"); + rbuf[0] = cmpnd_rbuf.ref0; + rbuf[1] = cmpnd_rbuf.ref1; + rbuf[2] = cmpnd_rbuf.ref2; + rbuf[3] = cmpnd_rbuf.ref3; + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open dataset object */ + dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id); + CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object"); + + /* Check information in referenced dataset */ + sid1 = H5Dget_space(dset2); + CHECK(sid1, H5I_INVALID_HID, "H5Dget_space"); + + ret = (int)H5Sget_simple_extent_npoints(sid1); + VERIFY(ret, SPACE1_DIM1, "H5Sget_simple_extent_npoints"); + + /* Read from disk */ + ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf); + CHECK(ret, FAIL, "H5Dread"); + + for(i = 0; i < SPACE1_DIM1; i++) + VERIFY(ibuf[i], i * 3, "Data"); + + /* Close dereferenced Dataset */ + ret = H5Dclose(dset2); + CHECK(ret, FAIL, "H5Dclose"); + + /* Open group object. GAPL isn't supported yet. But it's harmless to pass in */ + group = H5Ropen_object(&rbuf[2], H5P_DEFAULT, H5P_DEFAULT); + CHECK(group, H5I_INVALID_HID, "H5Ropen_object"); + + /* Close group */ + ret = H5Gclose(group); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */ + tid1 = H5Ropen_object(&rbuf[3], H5P_DEFAULT, H5P_DEFAULT); + CHECK(tid1, H5I_INVALID_HID, "H5Ropen_object"); + + /* Verify correct datatype */ + { + H5T_class_t tclass; + + tclass = H5Tget_class(tid1); + VERIFY(tclass, H5T_COMPOUND, "H5Tget_class"); + + ret= H5Tget_nmembers(tid1); + VERIFY(ret, 3, "H5Tget_nmembers"); + } + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close dataset access property list */ + ret = H5Pclose(dapl_id); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close file */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + + /* Destroy references */ + for(j = 0; j < SPACE1_DIM1; j++) { + ret = H5Rdestroy(&wbuf[j]); + CHECK(ret, FAIL, "H5Rdestroy"); + } + for(j = 0; j < SPACE1_DIM1; j++) { + ret = H5Rdestroy(&rbuf[j]); + CHECK(ret, FAIL, "H5Rdestroy"); + } + + /* Free memory buffers */ + HDfree(wbuf); + HDfree(rbuf); + HDfree(ibuf); + HDfree(obuf); +} /* test_reference_cmpnd_obj() */ + +/**************************************************************** +** ** test_reference_region(): Test basic H5R (reference) object reference code. ** Tests references to various kinds of objects ** @@ -3131,6 +3432,7 @@ test_reference(void) test_reference_params(); /* Test for correct parameter checking */ test_reference_obj(); /* Test basic H5R object reference code */ test_reference_vlen_obj(); /* Test reference within vlen */ + test_reference_cmpnd_obj(); /* Test reference within compound type */ /* Loop through all the combinations of low/high version bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { @@ -3177,6 +3479,7 @@ cleanup_reference(void) HDremove(FILE_REF_PARAM); HDremove(FILE_REF_OBJ); HDremove(FILE_REF_VL_OBJ); + HDremove(FILE_REF_CMPND_OBJ); HDremove(FILE_REF_REG); HDremove(FILE_REF_REG_1D); HDremove(FILE_REF_OBJ_DEL); -- cgit v0.12 From 1f7fa50137a66eeda1e2ee2f46ee1cc11c2001f5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 29 Jul 2020 08:23:51 -0500 Subject: Correct h5diff filenames --- MANIFEST | 8 ++++---- tools/test/h5diff/CMakeTests.cmake | 16 ++++++++-------- tools/test/h5diff/h5diffgentest.c | 8 ++++---- tools/test/h5diff/testfiles/diff_eps1.h5 | Bin 2272 -> 0 bytes tools/test/h5diff/testfiles/diff_eps2.h5 | Bin 2272 -> 0 bytes tools/test/h5diff/testfiles/diff_strings1.h5 | Bin 4640 -> 0 bytes tools/test/h5diff/testfiles/diff_strings2.h5 | Bin 4640 -> 0 bytes tools/test/h5diff/testfiles/h5diff_eps.txt | 8 ++++---- tools/test/h5diff/testfiles/h5diff_eps1.h5 | Bin 0 -> 2272 bytes tools/test/h5diff/testfiles/h5diff_eps2.h5 | Bin 0 -> 2272 bytes tools/test/h5diff/testfiles/h5diff_strings1.h5 | Bin 0 -> 4640 bytes tools/test/h5diff/testfiles/h5diff_strings2.h5 | Bin 0 -> 4640 bytes tools/test/h5diff/testh5diff.sh.in | 18 +++++++++--------- 13 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 tools/test/h5diff/testfiles/diff_eps1.h5 delete mode 100644 tools/test/h5diff/testfiles/diff_eps2.h5 delete mode 100644 tools/test/h5diff/testfiles/diff_strings1.h5 delete mode 100644 tools/test/h5diff/testfiles/diff_strings2.h5 create mode 100644 tools/test/h5diff/testfiles/h5diff_eps1.h5 create mode 100644 tools/test/h5diff/testfiles/h5diff_eps2.h5 create mode 100644 tools/test/h5diff/testfiles/h5diff_strings1.h5 create mode 100644 tools/test/h5diff/testfiles/h5diff_strings2.h5 diff --git a/MANIFEST b/MANIFEST index f2c8318..9720ebf 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2400,8 +2400,6 @@ #test files for h5diff -./tools/test/h5diff/testfiles/diff_eps1.txt -./tools/test/h5diff/testfiles/diff_eps2.txt ./tools/test/h5diff/testfiles/h5diff_10.txt ./tools/test/h5diff/testfiles/h5diff_11.txt ./tools/test/h5diff/testfiles/h5diff_12.txt @@ -2609,6 +2607,8 @@ ./tools/test/h5diff/testfiles/h5diff_dset3.h5 ./tools/test/h5diff/testfiles/h5diff_dtypes.h5 ./tools/test/h5diff/testfiles/h5diff_empty.h5 +./tools/test/h5diff/testfiles/h5diff_eps1.h5 +./tools/test/h5diff/testfiles/h5diff_eps2.h5 ./tools/test/h5diff/testfiles/h5diff_hyper1.h5 ./tools/test/h5diff/testfiles/h5diff_hyper2.h5 ./tools/test/h5diff/testfiles/h5diff_types.h5 @@ -2649,8 +2649,8 @@ ./tools/test/h5diff/testfiles/h5diff_ud.txt ./tools/test/h5diff/testfiles/h5diff_udfail.err ./tools/test/h5diff/testfiles/h5diff_udfail.txt -./tools/test/h5diff/testfiles/diff_strings1.h5 -./tools/test/h5diff/testfiles/diff_strings2.h5 +./tools/test/h5diff/testfiles/h5diff_strings1.h5 +./tools/test/h5diff/testfiles/h5diff_strings2.h5 ./tools/test/h5diff/testfiles/h5diff_vlstr.txt #vds ./tools/test/h5diff/testfiles/h5diff_v1.txt diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 43c8c15..74e3929 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -66,10 +66,10 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_strings2.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_eps1.h5 - ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/diff_eps2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_strings1.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_strings2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_eps1.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_eps2.h5 # tools/testfiles/vds ${HDF5_TOOLS_DIR}/testfiles/vds/1_a.h5 ${HDF5_TOOLS_DIR}/testfiles/vds/1_b.h5 @@ -542,11 +542,11 @@ set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) # strings - set (STRINGS1 diff_strings1.h5) - set (STRINGS2 diff_strings2.h5) + set (STRINGS1 h5diff_strings1.h5) + set (STRINGS2 h5diff_strings2.h5) # epsilon - set (EPS1 diff_eps1.h5) - set (EPS2 diff_eps2.h5) + set (EPS1 h5diff_eps1.h5) + set (EPS2 h5diff_eps2.h5) # VDS tests set (FILEV1 1_vds.h5) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index df79aa1..bdc2ddc 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -94,11 +94,11 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define NON_COMPARBLES1 "non_comparables1.h5" #define NON_COMPARBLES2 "non_comparables2.h5" /* string dataset and attribute */ -#define DIFF_STRINGS1 "diff_strings1.h5" -#define DIFF_STRINGS2 "diff_strings2.h5" +#define DIFF_STRINGS1 "h5diff_strings1.h5" +#define DIFF_STRINGS2 "h5diff_strings2.h5" /* double dataset and epsilon */ -#define DIFF_EPS1 "diff_eps1.h5" -#define DIFF_EPS2 "diff_eps2.h5" +#define DIFF_EPS1 "h5diff_eps1.h5" +#define DIFF_EPS2 "h5diff_eps2.h5" #define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */ #define STR_SIZE 3 diff --git a/tools/test/h5diff/testfiles/diff_eps1.h5 b/tools/test/h5diff/testfiles/diff_eps1.h5 deleted file mode 100644 index 2803a1d..0000000 Binary files a/tools/test/h5diff/testfiles/diff_eps1.h5 and /dev/null differ diff --git a/tools/test/h5diff/testfiles/diff_eps2.h5 b/tools/test/h5diff/testfiles/diff_eps2.h5 deleted file mode 100644 index 4acf27a..0000000 Binary files a/tools/test/h5diff/testfiles/diff_eps2.h5 and /dev/null differ diff --git a/tools/test/h5diff/testfiles/diff_strings1.h5 b/tools/test/h5diff/testfiles/diff_strings1.h5 deleted file mode 100644 index 0f8b380..0000000 Binary files a/tools/test/h5diff/testfiles/diff_strings1.h5 and /dev/null differ diff --git a/tools/test/h5diff/testfiles/diff_strings2.h5 b/tools/test/h5diff/testfiles/diff_strings2.h5 deleted file mode 100644 index e8520ae..0000000 Binary files a/tools/test/h5diff/testfiles/diff_strings2.h5 and /dev/null differ diff --git a/tools/test/h5diff/testfiles/h5diff_eps.txt b/tools/test/h5diff/testfiles/h5diff_eps.txt index ef48cb6..00514e6 100644 --- a/tools/test/h5diff/testfiles/h5diff_eps.txt +++ b/tools/test/h5diff/testfiles/h5diff_eps.txt @@ -1,10 +1,10 @@ -file1: diff_eps1.h5 -file2: diff_eps2.h5 +file1: h5diff_eps1.h5 +file2: h5diff_eps2.h5 file1 file2 --------------------------------------- - x x / - x x /DS1 + x x / + x x /DS1 group : and diff --git a/tools/test/h5diff/testfiles/h5diff_eps1.h5 b/tools/test/h5diff/testfiles/h5diff_eps1.h5 new file mode 100644 index 0000000..2803a1d Binary files /dev/null and b/tools/test/h5diff/testfiles/h5diff_eps1.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_eps2.h5 b/tools/test/h5diff/testfiles/h5diff_eps2.h5 new file mode 100644 index 0000000..4acf27a Binary files /dev/null and b/tools/test/h5diff/testfiles/h5diff_eps2.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_strings1.h5 b/tools/test/h5diff/testfiles/h5diff_strings1.h5 new file mode 100644 index 0000000..0f8b380 Binary files /dev/null and b/tools/test/h5diff/testfiles/h5diff_strings1.h5 differ diff --git a/tools/test/h5diff/testfiles/h5diff_strings2.h5 b/tools/test/h5diff/testfiles/h5diff_strings2.h5 new file mode 100644 index 0000000..e8520ae Binary files /dev/null and b/tools/test/h5diff/testfiles/h5diff_strings2.h5 differ diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 84330ec..4e622ee 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -120,10 +120,10 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5 $SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5 $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 -$SRC_H5DIFF_TESTFILES/diff_strings1.h5 -$SRC_H5DIFF_TESTFILES/diff_strings2.h5 -$SRC_H5DIFF_TESTFILES/diff_eps1.h5 -$SRC_H5DIFF_TESTFILES/diff_eps2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_strings1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_strings2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_eps1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_eps2.h5 $SRC_TOOLS_TESTFILES/tvlstr.h5 " @@ -723,10 +723,10 @@ TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b # Strings # ( HDFFV-10128 ) -TOOLTEST h5diff_60.txt -v diff_strings1.h5 diff_strings2.h5 string1 string1 -TOOLTEST h5diff_61.txt -v diff_strings1.h5 diff_strings2.h5 string2 string2 -TOOLTEST h5diff_62.txt -v diff_strings1.h5 diff_strings2.h5 string3 string3 -TOOLTEST h5diff_63.txt -v diff_strings1.h5 diff_strings2.h5 string4 string4 +TOOLTEST h5diff_60.txt -v h5diff_strings1.h5 h5diff_strings2.h5 string1 string1 +TOOLTEST h5diff_61.txt -v h5diff_strings1.h5 h5diff_strings2.h5 string2 string2 +TOOLTEST h5diff_62.txt -v h5diff_strings1.h5 h5diff_strings2.h5 string3 string3 +TOOLTEST h5diff_63.txt -v h5diff_strings1.h5 h5diff_strings2.h5 string4 string4 # ############################################################################## # # Error messages @@ -770,7 +770,7 @@ TOOLTEST h5diff_609.txt -d 200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dse TOOLTEST h5diff_610.txt -d 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # eps: number smaller than epsilon -TOOLTEST h5diff_eps.txt -v3 -d 1e-16 diff_eps1.h5 diff_eps2.h5 +TOOLTEST h5diff_eps.txt -v3 -d 1e-16 h5diff_eps1.h5 h5diff_eps2.h5 # ############################################################################## -- cgit v0.12 From 6a1cf090c6a2f970084c714a2f75a31d68a0a6a8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 29 Jul 2020 12:56:03 -0500 Subject: Correct reference file --- tools/test/h5diff/testfiles/h5diff_eps.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test/h5diff/testfiles/h5diff_eps.txt b/tools/test/h5diff/testfiles/h5diff_eps.txt index 00514e6..3a71366 100644 --- a/tools/test/h5diff/testfiles/h5diff_eps.txt +++ b/tools/test/h5diff/testfiles/h5diff_eps.txt @@ -3,8 +3,8 @@ file2: h5diff_eps2.h5 file1 file2 --------------------------------------- - x x / - x x /DS1 + x x / + x x /DS1 group : and -- cgit v0.12 From ff4a9d0ec2e85cf15f769006e92e756a79869ab8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Jul 2020 11:25:24 -0500 Subject: Warnings reduction in tools --- tools/lib/h5diff.c | 2 +- tools/lib/h5diff.h | 1 + tools/lib/h5diff_array.c | 201 +++++++++++++++++++++--------------------- tools/lib/h5diff_attr.c | 12 ++- tools/lib/h5diff_dset.c | 14 ++- tools/lib/h5tools.c | 2 +- tools/lib/h5tools_dump.c | 6 +- tools/lib/h5tools_str.c | 16 ++-- tools/src/h5import/h5import.c | 4 +- tools/src/h5ls/h5ls.c | 2 - 10 files changed, 126 insertions(+), 134 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 96c2d32..87a3b11 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -234,7 +234,7 @@ done: * 0 - not excluded path *------------------------------------------------------------------------*/ static int -is_exclude_attr (char *path, h5trav_type_t type, diff_opt_t *opts) +is_exclude_attr (const char *path, h5trav_type_t type, diff_opt_t *opts) { struct exclude_path_list *exclude_ptr; int ret_cmp; diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index c3c111f..f44f653 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -57,6 +57,7 @@ typedef struct { int mode_list_not_cmp; /* list not comparable messages */ int print_header; /* print header */ int print_percentage; /* print percentage */ + int print_dims; /* print dimension index */ int delta_bool; /* delta, absolute value to compare */ double delta; /* delta value */ int use_system_epsilon; /* flag to use system epsilon (1 or 0) */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 9b680ec..1a4c727 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -134,7 +134,7 @@ typedef struct mcomp_t { */ static hbool_t all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); -static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, ssize_t u, diff_opt_t *opts); +static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t *opts); static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, diff_opt_t *opts); static hbool_t equal_float(float value, float expected, diff_opt_t *opts); static hbool_t equal_double(double value, double expected, diff_opt_t *opts); @@ -143,7 +143,7 @@ static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t #endif static int print_data(diff_opt_t *opts); -static void print_pos(diff_opt_t *opts, hsize_t elemtno, ssize_t u); +static void print_pos(diff_opt_t *opts, hsize_t elemtno, size_t u); static void h5diff_print_char(char ch); static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *opts); @@ -210,7 +210,6 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_ unsigned char *mem1 = (unsigned char*) _mem1; unsigned char *mem2 = (unsigned char*) _mem2; hsize_t i; - int j; mcomp_t members; H5T_class_t type_class; @@ -680,7 +679,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co */ nfound += 1; opts->print_percentage = 0; - print_pos(opts, elemtno, -1); + print_pos(opts, elemtno, 0); if (print_data(opts)) { parallel_print(S_FORMAT, enum_name1, enum_name2); } @@ -690,7 +689,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co if (HDstrcmp(enum_name1, enum_name2) != 0) { nfound = 1; opts->print_percentage = 0; - print_pos(opts, elemtno, -1); + print_pos(opts, elemtno, 0); if (print_data(opts)) { parallel_print(S_FORMAT, enum_name1, enum_name2); } @@ -1528,7 +1527,7 @@ done: *------------------------------------------------------------------------- */ -static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, ssize_t u, diff_opt_t *opts) +static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t *opts) { hsize_t nfound = 0; /* differences found */ char temp1_uchar; @@ -1541,6 +1540,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, ssize_ if (temp1_uchar != temp2_uchar) { if (print_data(opts)) { opts->print_percentage = 0; + opts->print_dims = 1; print_pos(opts, elemtno, u); parallel_print(" "); h5diff_print_char(temp1_uchar); @@ -1580,7 +1580,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elemtno, -1); + print_pos(opts, elemtno, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1592,7 +1592,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elemtno, -1); + print_pos(opts, elemtno, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } @@ -1604,7 +1604,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elemtno, -1); + print_pos(opts, elemtno, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } @@ -1613,7 +1613,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h } else if (temp1_uchar != temp2_uchar) { opts->print_percentage = 0; - print_pos(opts, elemtno, -1); + print_pos(opts, elemtno, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1668,7 +1668,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz if (!isnan1 && !isnan2) { if ((double) ABS(temp1_float - temp2_float) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1678,7 +1678,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1704,7 +1704,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1712,7 +1712,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); @@ -1723,7 +1723,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1750,7 +1750,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1758,7 +1758,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); @@ -1769,7 +1769,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1783,7 +1783,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz else { if (equal_float(temp1_float, temp2_float, opts) == FALSE) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } @@ -1836,7 +1836,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi if (!isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1846,7 +1846,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1873,7 +1873,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1881,7 +1881,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1892,7 +1892,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1919,7 +1919,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1927,7 +1927,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi } else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1938,7 +1938,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -1952,7 +1952,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi else { if (equal_double(temp1_double, temp2_double, opts) == FALSE) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2009,7 +2009,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs if (!isnan1 && !isnan2) { if (ABS(temp1_double-temp2_double) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2019,7 +2019,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2046,7 +2046,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2054,7 +2054,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } @@ -2064,7 +2064,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2091,7 +2091,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2099,7 +2099,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs } else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } @@ -2109,7 +2109,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2122,7 +2122,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs */ else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2159,7 +2159,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz if (opts->delta_bool && !opts->percent_bool) { if (ABS(temp1_char-temp2_char) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -2172,7 +2172,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -2180,7 +2180,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } @@ -2193,7 +2193,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -2201,7 +2201,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } @@ -2210,7 +2210,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (temp1_char != temp2_char) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -2246,7 +2246,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -2259,7 +2259,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -2267,7 +2267,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } @@ -2280,7 +2280,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -2288,7 +2288,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } @@ -2297,7 +2297,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (temp1_uchar != temp2_uchar) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -2333,7 +2333,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz if (opts->delta_bool && !opts->percent_bool) { if (ABS(temp1_short - temp2_short) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -2346,7 +2346,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -2354,7 +2354,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } @@ -2367,7 +2367,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -2375,7 +2375,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } @@ -2384,7 +2384,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (temp1_short != temp2_short) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -2420,7 +2420,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -2433,7 +2433,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -2441,7 +2441,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } @@ -2454,7 +2454,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -2462,7 +2462,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi } else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } @@ -2471,7 +2471,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi } else if (temp1_ushort != temp2_ushort) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -2507,7 +2507,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_ if (opts->delta_bool && !opts->percent_bool) { if (ABS(temp1_int-temp2_int) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } @@ -2520,7 +2520,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_ if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } @@ -2528,7 +2528,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_ } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } @@ -2541,7 +2541,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_ if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } @@ -2549,7 +2549,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_ } else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } @@ -2558,7 +2558,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_ } else if (temp1_int != temp2_int) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } @@ -2594,7 +2594,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } @@ -2607,7 +2607,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } @@ -2615,7 +2615,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } @@ -2628,7 +2628,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } @@ -2636,7 +2636,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize } else if (per > opts->percent && PDIFF(temp1_uint,temp2_uint) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } @@ -2645,7 +2645,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize } else if (temp1_uint != temp2_uint) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } @@ -2681,7 +2681,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize if (opts->delta_bool && !opts->percent_bool) { if (ABS(temp1_long-temp2_long) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } @@ -2694,7 +2694,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } @@ -2702,7 +2702,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } @@ -2715,7 +2715,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } @@ -2723,7 +2723,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize } else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } @@ -2732,7 +2732,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize } else if (temp1_long != temp2_long) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } @@ -2768,7 +2768,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } @@ -2781,7 +2781,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } @@ -2789,7 +2789,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } @@ -2802,7 +2802,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } @@ -2810,7 +2810,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } @@ -2819,7 +2819,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (temp1_ulong != temp2_ulong) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } @@ -2856,7 +2856,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz if (opts->delta_bool && !opts->percent_bool) { if (ABS( temp1_llong-temp2_llong) > opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } @@ -2869,7 +2869,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } @@ -2877,7 +2877,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); } @@ -2890,7 +2890,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } @@ -2898,7 +2898,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz } else if (per > opts->percent && ABS(temp1_llong-temp2_llong) > opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); } @@ -2908,7 +2908,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz else { if (temp1_llong != temp2_llong) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } @@ -2947,7 +2947,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } @@ -2962,7 +2962,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } @@ -2970,7 +2970,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi } else if (per > opts->percent) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong,temp2_ullong), per); } @@ -2985,7 +2985,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi if (not_comparable && !both_zero) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } @@ -2993,7 +2993,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi } else if (per > opts->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { opts->print_percentage = 1; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong), per); } @@ -3003,7 +3003,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi else { if (temp1_ullong != temp2_ullong) { opts->print_percentage = 0; - print_pos(opts, elem_idx, -1); + print_pos(opts, elem_idx, 0); if (print_data(opts)) { parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } @@ -3254,7 +3254,7 @@ void print_header(diff_opt_t *opts) *------------------------------------------------------------------------- */ static -void print_pos(diff_opt_t *opts, hsize_t idx, ssize_t u) +void print_pos(diff_opt_t *opts, hsize_t idx, size_t u) { int i,j; @@ -3317,7 +3317,7 @@ void print_pos(diff_opt_t *opts, hsize_t idx, ssize_t u) * Calculate the number of elements represented by a unit change in a * certain index position. */ - calc_acc_pos(opts->rank, curr_pos, opts->acc, opts->pos); + calc_acc_pos((unsigned)opts->rank, curr_pos, opts->acc, opts->pos); for (i = 0; i < opts->rank; i++) { H5TOOLS_DEBUG("pos loop:%d with opts->pos=%ld opts->sm_pos=%ld", i, opts->pos[i], opts->sm_pos[i]); @@ -3329,10 +3329,11 @@ void print_pos(diff_opt_t *opts, hsize_t idx, ssize_t u) parallel_print("]"); } else { - if (u >= 0) { + if (opts->print_dims) { parallel_print("[ "); parallel_print("%zu", u); parallel_print("]"); + opts->print_dims = 0; } else parallel_print(" "); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 774859b..b7ec2e8 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -387,18 +387,16 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, j = (int)HDstrlen(name1); H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j); if (j > 0) { - opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDstrncpy(opts->obj_name[0], name1, (size_t)j); - opts->obj_name[0][j] = '\0'; + opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1); + HDstrncpy(opts->obj_name[0], name1, (size_t)j + 1); } } if (name2) { j = (int)HDstrlen(name2); H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j); if (j > 0) { - opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDstrncpy(opts->obj_name[1], name2, (size_t)j); - opts->obj_name[1][j] = '\0'; + opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1); + HDstrncpy(opts->obj_name[1], name2, (size_t)j + 1); } } H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); @@ -424,7 +422,7 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, opts->nelmts *= dims1[j]; } opts->rank = rank1; - init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); /*--------------------------------------------------------------------- * read diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 602255e..944440e 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -277,9 +277,8 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n j = (int)HDstrlen(obj1_name); H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j); if (j > 0) { - opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j ); - opts->obj_name[0][j] = '\0'; + opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1); + HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); } } @@ -289,9 +288,8 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n j = (int)HDstrlen(obj2_name); H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j); if (j > 0) { - opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j); - opts->obj_name[1][j] = '\0'; + opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1); + HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); } } @@ -451,7 +449,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n } /* end if */ /* Assume entire data space to be printed */ - init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); for(i = 0; i < opts->rank; i++) { opts->p_max_idx[i] = opts->dims[i]; @@ -792,7 +790,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n opts->sm_pos[j] = low[j]; /* Assume entire data space to be printed */ - init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index d9c6715..55c69a7 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1670,7 +1670,7 @@ calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos) H5TOOLS_START_DEBUG(""); if(ndims > 0) { - for(i = 0; i < (size_t) ndims; i++) { + for(i = 0; i < (int)ndims; i++) { if(curr_pos > 0) { H5TOOLS_DEBUG("curr_pos=%ld - ctx->acc[%d]=%ld", curr_pos, i, acc[i]); pos[i] = curr_pos / acc[i]; diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 187ba18..b1be577 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -1252,7 +1252,6 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c size_t j; /* counters */ hsize_t zero[1] = {0}; /* vector of zeros */ unsigned int flags; /* buffer extent flags */ - hsize_t elmtno; /* elemnt index */ hsize_t low[H5S_MAX_RANK]; /* low bound of hyperslab */ hsize_t high[H5S_MAX_RANK]; /* higher bound of hyperslab */ size_t p_type_nbytes; /* size of memory type */ @@ -1565,9 +1564,8 @@ static herr_t h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, hid_t p_type) { int sndims; - hid_t f_space = H5I_INVALID_HID; /* file data space */ - size_t i; /* counters */ - hsize_t total_size[H5S_MAX_RANK];/* total size of dataset*/ + hid_t f_space = H5I_INVALID_HID; /* file data space */ + hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ hbool_t past_catch = FALSE; herr_t ret_value = SUCCEED; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index d612fbd..1c573a7 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -286,17 +286,14 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, hs h5tools_context_t *ctx) { size_t i = 0; - hsize_t curr_pos = elmtno; H5TOOLS_START_DEBUG(""); H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); h5tools_str_reset(str); - curr_pos = calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos); + calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos); if(ctx->ndims > 0) { - HDassert(curr_pos == 0); - /* Print the index values */ for(i = 0; i < (size_t) ctx->ndims; i++) { if (i) @@ -329,17 +326,14 @@ h5tools_str_region_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *i hsize_t *ptdata, h5tools_context_t *ctx) { size_t i = 0; - hsize_t curr_pos = elmtno; H5TOOLS_START_DEBUG(""); H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); h5tools_str_reset(str); - curr_pos = calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos); + calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos); if(ctx->ndims > 0) { - HDassert(curr_pos == 0); - /* Print the index values */ for(i = 0; i < (size_t) ctx->ndims; i++) { ctx->pos[i] += (unsigned long) ptdata[ctx->sm_pos+i]; @@ -678,6 +672,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai if(info->raw) { size_t i; + H5TOOLS_DEBUG("info->raw"); if(1 == nsize) h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); else @@ -688,8 +683,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } } else { - if((type_class = H5Tget_class(type)) < 0) + H5TOOLS_DEBUG("H5Tget_class(type)"); + if((type_class = H5Tget_class(type)) < 0) { + H5TOOLS_ENDDEBUG(" with %s", "NULL"); return NULL; + } switch (type_class) { case H5T_FLOAT: H5TOOLS_DEBUG("H5T_FLOAT"); diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index b11fe7f..4a642e0 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -3735,8 +3735,8 @@ static int getExternalFilename(struct Input *in, FILE *strm) return (-1); } - in->externFilename = (char *) HDmalloc ((size_t) (HDstrlen(temp)) * sizeof(char)); - (void) HDstrcpy(in->externFilename, temp); + in->externFilename = (char *) HDmalloc ((size_t) (HDstrlen(temp) + 1) * sizeof(char)); + (void) HDstrncpy(in->externFilename, temp, HDstrlen(temp) + 1); return (0); } diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index fef7aa9..e239cbc 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1313,7 +1313,6 @@ dump_dataset_values(hid_t dset) hid_t space = H5I_INVALID_HID; hsize_t total_size[H5S_MAX_RANK]; int ndims; - size_t i; char string_prefix[64]; static char fmt_double[16]; static char fmt_float[16]; @@ -1481,7 +1480,6 @@ dump_attribute_values(hid_t attr) hid_t space = H5I_INVALID_HID; hsize_t total_size[H5S_MAX_RANK]; int ndims; - size_t i; char string_prefix[64]; static char fmt_double[16]; static char fmt_float[16]; -- cgit v0.12 From fc57490e02835ddfce644135e93e893f77b379d3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 31 Jul 2020 07:49:48 -0500 Subject: Mingw copy disabled --- tools/test/h5diff/CMakeTests.cmake | 7 ++++--- tools/test/h5jam/tellub.c | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 74e3929..5aa1d1a 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -341,9 +341,10 @@ # Overwrite system dependent files (Windows) and not VS2015 # set (COPY_WINDOWS_FILES false) - if (MINGW) - set (COPY_WINDOWS_FILES true) - endif () + # MinGW tests may depend on host system + #if (MINGW) + # set (COPY_WINDOWS_FILES true) + #endif () if (WIN32 AND MSVC_VERSION LESS 1900) set (COPY_WINDOWS_FILES true) endif () diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index e7bb561..453444d 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -71,6 +71,7 @@ parse_command_line (int argc, const char *argv[]) case 'h': usage (h5tools_getprogname()); h5tools_setstatus(EXIT_SUCCESS); + break; case '?': default: usage (h5tools_getprogname()); @@ -105,7 +106,7 @@ int main (int argc, const char *argv[]) { char *ifname; - hid_t ifile; + hid_t ifile = H5I_INVALID_HID; hsize_t usize; htri_t testval; herr_t status; @@ -165,7 +166,8 @@ main (int argc, const char *argv[]) done: H5Pclose (plist); - H5Fclose (ifile); + if(ifile >= 0) + H5Fclose (ifile); leave(h5tools_getstatus()); } /* end main() */ -- cgit v0.12 From 08dca47475f41e93348cf0c2ea708e787c232014 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 31 Jul 2020 11:40:29 -0700 Subject: Minor normalizations with hdf5_1_10 --- test/chunk_info.c | 28 +-- test/dtypes.c | 598 ++++++++++++++++++++++----------------------------- test/gen_new_super.c | 34 ++- test/gen_nullspace.c | 27 ++- test/links.c | 19 +- test/th5o.c | 22 +- test/trefer.c | 8 +- test/vds_swmr.h | 2 - test/vfd.c | 7 +- 9 files changed, 331 insertions(+), 414 deletions(-) diff --git a/test/chunk_info.c b/test/chunk_info.c index 0afff66..3ed1d56 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -685,7 +685,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) /* Verify that the number of chunks is NUM_CHUNKS */ if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR - VERIFY(nchunks, NUM_CHUNKS, "H5Dget_num_chunks, number of chunks"); + if(nchunks != NUM_CHUNKS) TEST_ERROR /* Attempt to get info of a chunk from an empty dataset, verify the returned address and size in the case of H5D_ALLOC_TIME_EARLY */ @@ -693,11 +693,12 @@ test_get_chunk_info_highest_v18(hid_t fapl) reinit_vars(&read_flt_msk, &addr, &size); ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); if(ret < 0) TEST_ERROR + /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ if(addr == HADDR_UNDEF) - FAIL_PUTS_ERROR(MSG_CHK_ADDR); + TEST_ERROR if(size == EMPTY_CHK_SIZE) - FAIL_PUTS_ERROR(MSG_CHK_SIZE); + TEST_ERROR chk_index = 10; reinit_vars(&read_flt_msk, &addr, &size); @@ -705,9 +706,9 @@ test_get_chunk_info_highest_v18(hid_t fapl) if(ret < 0) TEST_ERROR /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ if(addr == HADDR_UNDEF) - FAIL_PUTS_ERROR(MSG_CHK_ADDR); + TEST_ERROR if(size == EMPTY_CHK_SIZE) - FAIL_PUTS_ERROR(MSG_CHK_SIZE); + TEST_ERROR /* Attempt to get info of a chunk given its coords from an empty dataset, verify the returned address and size */ @@ -717,9 +718,9 @@ test_get_chunk_info_highest_v18(hid_t fapl) TEST_ERROR /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ if(addr == HADDR_UNDEF) - FAIL_PUTS_ERROR(MSG_CHK_ADDR); + TEST_ERROR if(size == 0) - FAIL_PUTS_ERROR(MSG_CHK_SIZE); + TEST_ERROR if(H5Dclose(dset) < 0) TEST_ERROR @@ -819,7 +820,7 @@ test_chunk_info_single_chunk(const char *filename, hid_t fapl) /* Get the number of chunks and verify that no chunk has been written */ if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR - VERIFY(nchunks, NO_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + if(nchunks != NO_CHUNK_WRITTEN) TEST_ERROR /* Initialize the array of chunk data for the single chunk */ for(ii = 0; ii < NX; ii++) @@ -832,7 +833,7 @@ test_chunk_info_single_chunk(const char *filename, hid_t fapl) /* Get and verify that one chunk had been written */ if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR - VERIFY(nchunks, ONE_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + if(nchunks != ONE_CHUNK_WRITTEN) TEST_ERROR /* Offset of the only chunk */ offset[0] = 0; @@ -1937,8 +1938,7 @@ error: * * Purpose: Tests functions related to chunk information * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Binh-Minh Ribler * November 5, 2018 @@ -1969,19 +1969,19 @@ main(void) nerrors += test_flt_msk_with_skip_compress(fapl) < 0 ? 1 : 0; if(nerrors) - TEST_ERROR + goto error; HDprintf("All chunk query tests passed.\n"); h5_cleanup(FILENAME, fapl); - return SUCCEED; + return EXIT_SUCCESS; error: nerrors = MAX(1, nerrors); HDprintf("***** %d QUERY CHUNK INFO TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - return FAIL; + return EXIT_FAILURE; } /**************************************************************************** diff --git a/test/dtypes.c b/test/dtypes.c index 0f95830..6dfc47d 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -134,10 +134,8 @@ typedef enum { static int num_opaque_conversions_g = 0; static int opaque_check(int tag_it); -static herr_t convert_opaque(hid_t st, hid_t dt, - H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, +static herr_t convert_opaque(hid_t st, hid_t dt, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plid); static int opaque_long(void); static int opaque_funcs(void); @@ -146,16 +144,13 @@ static int opaque_funcs(void); /*------------------------------------------------------------------------- * Function: reset_hdf5 * - * Purpose: Reset the hdf5 library. This causes statistics to be printed - * and counters to be reset. + * Purpose: Reset the hdf5 library. This causes statistics to be printed + * and counters to be reset. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 16, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -189,14 +184,10 @@ reset_hdf5(void) * Purpose: Test type classes * * Return: Success: 0 - * * Failure: number of errors * * Programmer: Robb Matzke * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -290,20 +281,16 @@ test_classes(void) * Purpose: Are we able to copy a datatype? * * Return: Success: 0 - * * Failure: number of errors * * Programmer: Robb Matzke * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_copy(void) { - hid_t a_copy; + hid_t a_copy; herr_t status; TESTING("H5Tcopy()"); @@ -313,12 +300,12 @@ test_copy(void) /* We should not be able to close a built-in byte */ H5E_BEGIN_TRY { - status = H5Tclose (H5T_NATIVE_SCHAR); + status = H5Tclose (H5T_NATIVE_SCHAR); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - HDputs (" Should not be able to close a predefined type!"); - goto error; + H5_FAILED(); + HDputs (" Should not be able to close a predefined type!"); + goto error; } PASSED(); @@ -336,7 +323,6 @@ test_copy(void) * in nested types) * * Return: Success: 0 - * * Failure: number of errors * * Programmer: Quincey Koziol @@ -512,14 +498,10 @@ error: * Purpose: Tests various things about compound datatypes. * * Return: Success: 0 - * * Failure: number of errors * * Programmer: Robb Matzke * Wednesday, January 7, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -673,38 +655,34 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_2 * - * Purpose: Tests a compound type conversion where the source and - * destination are the same except for the order of the - * elements. - * - * Return: Success: 0 + * Purpose: Tests a compound type conversion where the source and + * destination are the same except for the order of the + * elements. * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_compound_2(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; struct dt { - int e, d, c[4], b, a; + int e, d, c[4], b, a; } *d_ptr; const size_t nelmts = NTESTELEM; - const hsize_t four = 4; - unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; - hid_t st=-1, dt=-1; - hid_t array_dt; - int64_t nmembs; - int i; + const hsize_t four = 4; + unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; + hid_t st=-1, dt=-1; + hid_t array_dt; + int64_t nmembs; + int i; TESTING("compound element reordering"); @@ -716,15 +694,15 @@ test_compound_2(void) bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt)); orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st)); for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - s_ptr->a = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; + s_ptr = ((struct st*)((void *)orig)) + i; + s_ptr->a = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; } HDmemcpy(buf, orig, nelmts*sizeof(struct st)); @@ -754,26 +732,26 @@ test_compound_2(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - HDprintf(" i=%d\n", i); - HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->d, d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->d, d_ptr->e); + goto error; + } } /* Release resources */ @@ -804,29 +782,25 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_3 * - * Purpose: Tests compound conversions where the source and destination - * are the same except the destination is missing a couple - * members which appear in the source. + * Purpose: Tests compound conversions where the source and destination + * are the same except the destination is missing a couple + * members which appear in the source. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_compound_3(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; - struct dt { - int a, c[4], e; + struct dt { + int a, c[4], e; } *d_ptr; const size_t nelmts = NTESTELEM; @@ -884,24 +858,24 @@ test_compound_3(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - HDprintf(" i=%d\n", i); - HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", - d_ptr->a, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", + d_ptr->a, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->e); + goto error; + } } /* Release resources */ @@ -931,19 +905,15 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_4 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * smaller. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * smaller. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -951,13 +921,13 @@ test_compound_4(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; struct dt { - short b; - int a, c[4]; - short d; - int e; + short b; + int a, c[4]; + short d; + int e; } *d_ptr; const size_t nelmts = NTESTELEM; @@ -1017,26 +987,26 @@ test_compound_4(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - HDprintf(" i=%d\n", i); - HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->d, d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->d, d_ptr->e); + goto error; + } } /* Release resources */ @@ -1066,20 +1036,16 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_5 * - * Purpose: Many versions of HDF5 have a bug in the optimized compound + * Purpose: Many versions of HDF5 have a bug in the optimized compound * datatype conversion function, H5T_conv_struct_opt(), which * is triggered when the top-level type contains a struct * which must undergo a conversion. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1156,7 +1122,8 @@ test_compound_5(void) src[1].coll_ids[2]!=dst[1].coll_ids[2] || src[1].coll_ids[3]!=dst[1].coll_ids[3]) { H5_FAILED(); - } else { + } + else { PASSED(); retval = 0; } @@ -1171,19 +1138,15 @@ test_compound_5(void) /*------------------------------------------------------------------------- * Function: test_compound_6 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * larger. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * larger. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, December 13, 2000 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1244,18 +1207,18 @@ test_compound_6(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->b != d_ptr->b || - s_ptr->d != d_ptr->d) { - H5_FAILED(); - HDprintf(" i=%d\n", i); - HDprintf(" src={b=%d, d=%d\n", - (int)s_ptr->b, (int)s_ptr->d); - HDprintf(" dst={b=%ld, d=%ld\n", - d_ptr->b, d_ptr->d); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->b != d_ptr->b || + s_ptr->d != d_ptr->d) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={b=%d, d=%d\n", + (int)s_ptr->b, (int)s_ptr->d); + HDprintf(" dst={b=%ld, d=%ld\n", + d_ptr->b, d_ptr->d); + goto error; + } } /* Release resources */ @@ -1284,15 +1247,14 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_7 * - * Purpose: Tests inserting fields into compound datatypes when the field + * Purpose: Tests inserting fields into compound datatypes when the field * overlaps the end of the compound datatype. Also, tests * increasing compound type size. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, December 18, 2001 * * Modifications: @@ -1686,9 +1648,6 @@ test_compound_8(void) * * Programmer: Raymond Lu * Wednesday, June 9, 2004 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4758,17 +4717,13 @@ test_conv_enum_2(void) /*------------------------------------------------------------------------- * Function: test_conv_bitfield * - * Purpose: Test bitfield conversions. - * - * Return: Success: 0 + * Purpose: Test bitfield conversions. * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 20, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4790,10 +4745,9 @@ test_conv_bitfield(void) buf[2] = buf[3] = 0x55; /*irrelevant*/ if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0xAA || buf[1]!=0xAA || buf[2]!=0 || buf[3]!=0) { - H5_FAILED(); - printf(" s=0xaaaa, d=0x%02x%02x%02x%02x (test 1)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + HDprintf(" s=0xaaaa, d=0x%02x%02x%02x%02x (test 1)\n", buf[3], buf[2], buf[1], buf[0]); + goto error; } /* @@ -4809,10 +4763,9 @@ test_conv_bitfield(void) buf[0] = 0xA8; buf[1] = 0x2A; buf[2] = buf[3] = 0; if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0 || buf[1]!=0xA8 || buf[2]!=0x2A || buf[3]!=0) { - H5_FAILED(); - printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 2)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + HDprintf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 2)\n", buf[3], buf[2], buf[1], buf[0]); + goto error; } /* @@ -4823,10 +4776,9 @@ test_conv_bitfield(void) buf[0] = 0xA8; buf[1] = 0x2A; buf[2] = buf[3] = 0; if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0xff || buf[1]!=0xAB || buf[2]!=0xEA || buf[3]!=0xff) { - H5_FAILED(); - printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 3)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + HDprintf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 3)\n", buf[3], buf[2], buf[1], buf[0]); + goto error; } H5Tclose(st); @@ -4855,18 +4807,14 @@ error: /*------------------------------------------------------------------------- * Function: test_bitfield_funcs * - * Purpose: Test some datatype functions that are and aren't supposed + * Purpose: Test some datatype functions that are and aren't supposed * work for bitfield type. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, April 5, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4984,17 +4932,13 @@ error: /*------------------------------------------------------------------------- * Function: convert_opaque * - * Purpose: A fake opaque conversion functions - * - * Return: Success: 0 + * Purpose: A fake opaque conversion functions * - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, June 4, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -5003,7 +4947,8 @@ convert_opaque(hid_t H5_ATTR_UNUSED st, hid_t H5_ATTR_UNUSED dt, H5T_cdata_t *cd size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *_buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dset_xfer_plid) { - if (H5T_CONV_CONV==cdata->command) num_opaque_conversions_g++; + if (H5T_CONV_CONV==cdata->command) + num_opaque_conversions_g++; return 0; } @@ -5011,17 +4956,13 @@ convert_opaque(hid_t H5_ATTR_UNUSED st, hid_t H5_ATTR_UNUSED dt, H5T_cdata_t *cd /*------------------------------------------------------------------------- * Function: test_opaque * - * Purpose: Driver function to test opaque datatypes - * - * Return: Success: 0 + * Purpose: Driver function to test opaque datatypes * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * June 2, 2004 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -5054,25 +4995,23 @@ test_opaque(void) /*------------------------------------------------------------------------- * Function: opaque_check * - * Purpose: Test opaque datatypes - * - * Return: Success: 0 + * Purpose: Test opaque datatypes * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 20, 1999 - * *------------------------------------------------------------------------- */ static int opaque_check(int tag_it) { #define OPAQUE_NELMTS 1000 - hid_t st=-1, dt=-1; + hid_t st=-1, dt=-1; herr_t status; - char buf[1]; /*not really used*/ - int saved; + char buf[1]; /*not really used*/ + int saved; saved = num_opaque_conversions_g = 0; @@ -5088,29 +5027,29 @@ opaque_check(int tag_it) /* Make sure that we can't convert between the types yet */ H5E_BEGIN_TRY { - status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); + status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - printf(" opaque conversion should have failed but succeeded\n"); - goto error; + H5_FAILED(); + HDprintf(" opaque conversion should have failed but succeeded\n"); + goto error; } /* Register a conversion function */ if (H5Tregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque) < 0) - goto error; + goto error; /* Try the conversion again, this time it should work */ if (H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT) < 0) goto error; if (saved+1 != num_opaque_conversions_g) { - H5_FAILED(); - printf(" unexpected number of opaque conversions\n"); - goto error; + H5_FAILED(); + HDprintf(" unexpected number of opaque conversions\n"); + goto error; } /* Unregister conversion function */ if (H5Tunregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque) < 0) - goto error; + goto error; H5Tclose(st); H5Tclose(dt); @@ -5127,12 +5066,12 @@ opaque_check(int tag_it) /*------------------------------------------------------------------------- * Function: opaque_long * - * Purpose: Test named (committed) opaque datatypes w/very long tags + * Purpose: Test named (committed) opaque datatypes w/very long tags * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 14, 2005 * *------------------------------------------------------------------------- @@ -5142,7 +5081,7 @@ opaque_long(void) { char *long_tag = NULL; hid_t dt = -1; - herr_t ret; + herr_t ret; /* Build opaque type */ if((dt=H5Tcreate(H5T_OPAQUE, (size_t)4)) < 0) TEST_ERROR @@ -5154,7 +5093,7 @@ opaque_long(void) /* Set opaque type's tag */ H5E_BEGIN_TRY { - ret = H5Tset_tag(dt, long_tag); + ret = H5Tset_tag(dt, long_tag); } H5E_END_TRY; if(ret != FAIL) TEST_ERROR @@ -5179,24 +5118,20 @@ error: /*------------------------------------------------------------------------- * Function: opaque_funcs * - * Purpose: Test some type functions that are and aren't supposed to + * Purpose: Test some type functions that are and aren't supposed to * work with opaque type. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, April 5, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int opaque_funcs(void) { - hid_t type = -1, super=-1; + hid_t type = -1, super=-1; size_t size; H5T_pad_t inpad; H5T_cset_t cset; @@ -5803,7 +5738,7 @@ test_encode(void) } H5E_BEGIN_TRY { - ret = H5Tclose(decoded_tid3); + ret = H5Tclose(decoded_tid3); } H5E_END_TRY; if(ret!=FAIL) { H5_FAILED(); @@ -6102,14 +6037,13 @@ static int test_int_float_except(void) { #if H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 - float buf[CONVERT_SIZE] = {(float)INT_MIN - 172.0f, (float)INT_MAX - 32.0f, - (float)INT_MAX - 68.0f, (float)4.5f}; - int buf_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX-127, 4}; + float buf[CONVERT_SIZE] = {(float)INT_MIN - 172.0f, (float)INT_MAX - 32.0f, (float)INT_MAX - 68.0f, (float)4.5f}; + int buf_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX-127, 4}; float buf_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX + 1.0f, (float)INT_MAX - 127.0f, 4}; - int *intp; /* Pointer to buffer, as integers */ - int buf2[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 72, 0}; + int *intp; /* Pointer to buffer, as integers */ + int buf2[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 72, 0}; float buf2_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX, (float)INT_MAX - 127.0f, (float)0.0f}; - int buf2_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 127, 0}; + int buf2_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 127, 0}; float *floatp; /* Pointer to buffer #2, as floats */ hid_t dxpl; /* Dataset transfer property list */ except_info_t e; /* Exception information */ @@ -6165,8 +6099,8 @@ test_int_float_except(void) /* Convert second buffer */ HDmemset(&e, 0, sizeof(except_info_t)); - if(H5Tconvert(H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (size_t)CONVERT_SIZE, - buf2, NULL, dxpl) < 0) TEST_ERROR + if(H5Tconvert(H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (size_t)CONVERT_SIZE, buf2, NULL, dxpl) < 0) + TEST_ERROR /* Check the buffer after conversion, as floats */ for(u = 0; u < CONVERT_SIZE; u++) { @@ -6183,8 +6117,8 @@ test_int_float_except(void) /* Convert buffer */ HDmemset(&e, 0, sizeof(except_info_t)); - if(H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)CONVERT_SIZE, - buf2, NULL, dxpl) < 0) TEST_ERROR + if(H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)CONVERT_SIZE, buf2, NULL, dxpl) < 0) + TEST_ERROR /* Check the buffer after conversion, as integers */ for(u = 0; u < CONVERT_SIZE; u++) { @@ -6415,7 +6349,7 @@ test_set_order_compound(hid_t fapl) hid_t cmpd = -1, memb_cmpd = -1, memb_array1 = -1, memb_array2 = -1, cmpd_array = -1; hid_t vl_id = -1; hsize_t dims[2] = {3, 4}; /* Array dimenstions */ - char filename[1024]; + char filename[1024]; herr_t ret; /* Generic return value */ TESTING("H5Tset/get_order for compound type"); @@ -6521,18 +6455,14 @@ error: /*------------------------------------------------------------------------- * Function: test_named_indirect_reopen * - * Purpose: Tests that open named datatypes can be reopened indirectly + * Purpose: Tests that open named datatypes can be reopened indirectly * through H5Dget_type without causing problems. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, June 4, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6540,11 +6470,11 @@ test_named_indirect_reopen(hid_t fapl) { hid_t file=-1, type=-1, reopened_type=-1, strtype=-1, dset=-1, space=-1; static hsize_t dims[1] = {3}; - size_t dt_size; - int enum_value; - const char *tag = "opaque_tag"; - char *tag_ret = NULL; - char filename[1024]; + size_t dt_size; + int enum_value; + const char *tag = "opaque_tag"; + char *tag_ret = NULL; + char filename[1024]; TESTING("indirectly reopening committed datatypes"); @@ -6708,11 +6638,11 @@ test_named_indirect_reopen(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(type); - H5Tclose(strtype); - H5Tclose(reopened_type); - H5Sclose(space); - H5Dclose(dset); + H5Tclose(type); + H5Tclose(strtype); + H5Tclose(reopened_type); + H5Sclose(space); + H5Dclose(dset); H5Fclose(file); } H5E_END_TRY; if(tag_ret) @@ -6912,12 +6842,12 @@ test_delete_obj_named(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(attr); - H5Dclose(dset); - H5Pclose(fapl2); - H5Fclose(filea1); - H5Fclose(filea2); - H5Fclose(fileb); + H5Tclose(attr); + H5Dclose(dset); + H5Pclose(fapl2); + H5Fclose(filea1); + H5Fclose(filea2); + H5Fclose(fileb); } H5E_END_TRY; return 1; } /* end test_delete_obj_named() */ @@ -7075,15 +7005,15 @@ test_delete_obj_named_fileid(hid_t fapl) error: H5E_BEGIN_TRY { - H5Aclose(attr); - H5Tclose(type); - H5Dclose(dset); - H5Pclose(fapl2); - H5Fclose(filea1); - H5Fclose(filea2); - H5Fclose(fileb); - H5Fclose(attr_fid); - H5Fclose(type_fid); + H5Aclose(attr); + H5Tclose(type); + H5Dclose(dset); + H5Pclose(fapl2); + H5Fclose(filea1); + H5Fclose(filea2); + H5Fclose(fileb); + H5Fclose(attr_fid); + H5Fclose(type_fid); } H5E_END_TRY; return 1; } /* end test_delete_obj_named_fileid() */ @@ -7092,12 +7022,12 @@ error: /*------------------------------------------------------------------------- * Function: test_deprec * - * Purpose: Tests deprecated API routines for datatypes. + * Purpose: Tests deprecated API routines for datatypes. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 27, 2007 * *------------------------------------------------------------------------- @@ -7167,31 +7097,31 @@ test_deprec(hid_t fapl) /* Predefined types cannot be committed */ H5E_BEGIN_TRY { - status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); + status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Predefined types should not be committable!") + FAIL_PUTS_ERROR(" Predefined types should not be committable!") /* Copy a predefined datatype and commit the copy */ if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR if(H5Tcommit1(file, "native-int", type) < 0) FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR if(0 == status) - FAIL_PUTS_ERROR(" H5Tcommitted() returned false!") + FAIL_PUTS_ERROR(" H5Tcommitted() returned false!") /* We should not be able to modify a type after it has been committed. */ H5E_BEGIN_TRY { - status = H5Tset_precision(type, (size_t)256); + status = H5Tset_precision(type, (size_t)256); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Committed type is not constant!") + FAIL_PUTS_ERROR(" Committed type is not constant!") /* We should not be able to re-commit a committed type */ H5E_BEGIN_TRY { - status = H5Tcommit1(file, "test_named_2 (should not exist)", type); + status = H5Tcommit1(file, "test_named_2 (should not exist)", type); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Committed types should not be recommitted!") + FAIL_PUTS_ERROR(" Committed types should not be recommitted!") /* * Close the committed type and reopen it. It should return a named type. @@ -7200,7 +7130,7 @@ test_deprec(hid_t fapl) if((type = H5Topen1(file, "native-int")) < 0) FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR if(!status) - FAIL_PUTS_ERROR(" Opened named types should be named types!") + FAIL_PUTS_ERROR(" Opened named types should be named types!") /* Close */ if(H5Tclose(type) < 0) FAIL_STACK_ERROR @@ -7230,8 +7160,8 @@ test_deprec(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(type); - H5Fclose(file); + H5Tclose(type); + H5Fclose(file); } H5E_END_TRY; return 1; } /* end test_deprec() */ @@ -7241,13 +7171,13 @@ error: /*------------------------------------------------------------------------- * Function: test_utf_ascii_conv * - * Purpose: Make sure the library doesn't conversion strings between + * Purpose: Make sure the library doesn't conversion strings between * ASCII and UTF8. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 10 November 2011 *------------------------------------------------------------------------- */ @@ -7437,13 +7367,13 @@ test_utf_ascii_conv(void) error: H5E_BEGIN_TRY { - H5Tclose(utf8_vtid); - H5Tclose(ascii_vtid); - H5Tclose(utf8_tid); - H5Tclose(ascii_tid); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid); + H5Tclose(utf8_vtid); + H5Tclose(ascii_vtid); + H5Tclose(utf8_tid); + H5Tclose(ascii_tid); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); } H5E_END_TRY; return 1; } @@ -7827,16 +7757,13 @@ error: * * Programmer: Robb Matzke * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ int main(void) { long nerrors = 0; - hid_t fapl = -1; + hid_t fapl = H5I_INVALID_HID; /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -7845,7 +7772,7 @@ main(void) fapl = h5_fileaccess(); if(ALIGNMENT) - printf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); + HDprintf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); /* Do the tests */ nerrors += test_classes(); @@ -7900,8 +7827,7 @@ main(void) nerrors += test_versionbounds(); if(nerrors) { - HDprintf("***** %lu FAILURE%s! *****\n", - nerrors, 1==nerrors?"":"S"); + HDprintf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); HDexit(EXIT_FAILURE); } diff --git a/test/gen_new_super.c b/test/gen_new_super.c index ed43a39..d371f5f 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -23,26 +23,22 @@ * put into the 'test' directory in the 1.4+ branch of the library. */ -#include -#include "testhdf5.h" +#include "h5test.h" #define TESTFILE "tsupern.h5" #define ISTORE_IK 64 /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Create a file with a new version (>0) of the superblock + * Purpose: Create a file with a new version (>0) of the superblock * - * Return: Success: - * Failure: + * Return: EXIT_SUCCESS * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 15, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -54,27 +50,27 @@ main(void) /* Create a file creation property list */ fcpl = H5Pcreate(H5P_FILE_CREATE); - assert(fcpl>=0); + HDassert(fcpl >= 0); - ret=H5Pset_istore_k(fcpl,ISTORE_IK); - assert(ret>=0); + ret = H5Pset_istore_k(fcpl,ISTORE_IK); + HDassert(ret >= 0); /* Creating a file with the non-default file creation property list should * create a version 1 superblock */ /* Create file with custom file creation property list */ - file= H5Fcreate(TESTFILE, H5F_ACC_TRUNC , fcpl, H5P_DEFAULT); - assert(file>=0); + file = H5Fcreate(TESTFILE, H5F_ACC_TRUNC , fcpl, H5P_DEFAULT); + HDassert(file >= 0); /* Close FCPL */ - ret=H5Pclose(fcpl); - assert(ret>=0); + ret = H5Pclose(fcpl); + HDassert(ret >= 0); /* Close file */ - ret=H5Fclose(file); - assert(ret>=0); + ret = H5Fclose(file); + HDassert(ret >= 0); - return 0; + return EXIT_SUCCESS; } diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index e4e75ac..26df3f1 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 17, 2004 * * Purpose: Create a dataset with a null dataspace and an attribute @@ -24,8 +24,7 @@ * put into the 'test' directory in the 1.6.x branch of the library. */ -#include -#include "testhdf5.h" +#include "h5test.h" #define NULLFILE "tnullspace.h5" #define NULLDATASET "null_dataset" @@ -43,44 +42,44 @@ main(void) /* Create the file */ fid = H5Fcreate(NULLFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>0); + HDassert(fid > 0); sid = H5Screate(H5S_NULL); - assert(sid>0); + HDassert(sid > 0); /* Create dataset */ did = H5Dcreate2(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(did>0); + HDassert(did > 0); /* Close the dataset */ ret = H5Dclose(did); - assert(ret>=0); + HDassert(ret >= 0); /* Open the root group */ gid = H5Gopen2(fid, "/", H5P_DEFAULT); - assert(gid > 0); + HDassert(gid > 0); /* Create an attribute for the group */ attr = H5Acreate2(gid, NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); - assert(attr > 0); + HDassert(attr > 0); /* Close attribute */ ret = H5Aclose(attr); - assert(ret>=0); + HDassert(ret >= 0); /* Close the group */ ret = H5Gclose(gid); - assert(ret>=0); + HDassert(ret >= 0); /* Close the dataspace */ ret = H5Sclose(sid); - assert(ret>=0); + HDassert(ret >= 0); /* Close the file */ ret = H5Fclose(fid); - assert(ret>=0); + HDassert(ret >= 0); - return 0; + return EXIT_SUCCESS; } diff --git a/test/links.c b/test/links.c index 60d3152..cd9f05c 100644 --- a/test/links.c +++ b/test/links.c @@ -9037,15 +9037,15 @@ error: static int external_link_query(hid_t fapl, hbool_t new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ - const char *file_name; /* Name of the file the external link points to */ - const char *object_name; /* Name of the object the external link points to */ - H5O_info2_t oi; /* Object information */ - H5L_info2_t li; /* Link information */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ - query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + const char *file_name; /* Name of the file the external link points to */ + const char *object_name; /* Name of the object the external link points to */ + H5O_info2_t oi; /* Object information */ + H5L_info2_t li; /* Link information */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ + query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */ if(new_format) TESTING("query aspects of external link (w/new group format)") @@ -18286,7 +18286,6 @@ main(void) nerrors += test_deprec(my_fapl, new_format); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* tests for external link */ /* Test external file cache first, so it sees the default efc setting on the fapl */ diff --git a/test/th5o.c b/test/th5o.c index ab4a8de..4bc2096 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -243,17 +243,17 @@ test_h5o_close(void) static void test_h5o_open_by_addr(void) { - hid_t fid; /* HDF5 File ID */ - hid_t grp, dset, dtype, dspace; /* Object identifiers */ - H5L_info2_t li; /* Buffer for H5Lget_info */ - haddr_t grp_addr; /* Addresses for objects */ - haddr_t dset_addr; - haddr_t dtype_addr; - hsize_t dims[RANK]; - H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ - H5G_info_t ginfo; /* Group info struct */ - H5T_class_t type_class; /* Class of the datatype */ - herr_t ret; /* Value returned from API calls */ + hid_t fid; /* HDF5 File ID */ + hid_t grp, dset, dtype, dspace; /* Object identifiers */ + H5L_info2_t li; /* Buffer for H5Lget_info2 */ + haddr_t grp_addr; /* Addresses for objects */ + haddr_t dset_addr; + haddr_t dtype_addr; + hsize_t dims[RANK]; + H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ + H5G_info_t ginfo; /* Group info struct */ + H5T_class_t type_class; /* Class of the datatype */ + herr_t ret; /* Value returned from API calls */ /* Create a new HDF5 file */ fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); diff --git a/test/trefer.c b/test/trefer.c index fd97239..68fef09 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -87,12 +87,12 @@ test_reference_params(void) hid_t aapl_id; /* Attribute access property list */ hid_t dapl_id; /* Dataset access property list */ hsize_t dims1[] = {SPACE1_DIM1}; - H5R_ref_t *wbuf, /* buffer to write to disk */ + H5R_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temp. buffer read from disk */ unsigned *obuf; H5R_type_t type; /* Reference type */ - unsigned int i; /* Counters */ + unsigned int i; /* Counters */ const char *write_comment = "Foo!"; /* Comments for group */ hid_t ret_id; /* Generic hid_t return value */ ssize_t name_size; /* Size of reference name */ @@ -320,10 +320,10 @@ test_reference_obj(void) hid_t tid1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; hid_t dapl_id; /* Dataset access property list */ - H5R_ref_t *wbuf, /* buffer to write to disk */ + H5R_ref_t *wbuf, /* buffer to write to disk */ *rbuf; /* buffer read from disk */ unsigned *ibuf, *obuf; - unsigned i, j; /* Counters */ + unsigned i, j; /* Counters */ H5O_type_t obj_type; /* Object type */ herr_t ret; /* Generic return value */ diff --git a/test/vds_swmr.h b/test/vds_swmr.h index edb01bc..0a194ff 100644 --- a/test/vds_swmr.h +++ b/test/vds_swmr.h @@ -95,7 +95,5 @@ H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN]; /* Dataset names */ H5TEST_DLLVAR char SOURCE_DSET_PATH[NAME_LEN]; H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN]; - -/* Fill values */ #endif /* VDS_SWMR_H */ diff --git a/test/vfd.c b/test/vfd.c index 038c967..bb04e97 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -3286,8 +3286,7 @@ error: * * Purpose: Tests the basic features of Virtual File Drivers * - * Return: Success: 0 - * Failure: 1 + * Return: EXIT_SUCCESS/EXIT_FAILURE * *------------------------------------------------------------------------- */ @@ -3317,11 +3316,11 @@ main(void) if(nerrors) { HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); - return 1; + return EXIT_FAILURE; } /* end if */ HDprintf("All Virtual File Driver tests passed.\n"); - return 0; + return EXIT_SUCCESS; } /* end main() */ -- cgit v0.12 From 64ffb37ff6e43966d570bc737b6fa7f96acded56 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 31 Jul 2020 12:23:57 -0700 Subject: Fixed bad parens in H5trace.c --- src/H5trace.c | 86 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/H5trace.c b/src/H5trace.c index 91019a4..db33673 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -311,7 +311,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -764,7 +764,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(D%c)", type[1]); + HDfprintf(out, "BADTYPE(D%c)", type[1]); goto error; } /* end switch */ break; @@ -1149,7 +1149,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -1226,7 +1226,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(H%c)", type[1]); + HDfprintf(out, "BADTYPE(H%c)", type[1]); goto error; } /* end switch */ break; @@ -1414,7 +1414,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5I_NTYPES: - HDfprintf (out, "%ld (ntypes - error)", (long)obj); + HDfprintf(out, "%ld (ntypes - error)", (long)obj); break; default: @@ -1518,7 +1518,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { int is = HDva_arg(ap, int); - HDfprintf (out, "%d", is); + HDfprintf(out, "%d", is); asize[argno] = is; } /* end else */ break; @@ -1638,7 +1638,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(I%c)", type[1]); + HDfprintf(out, "BADTYPE(I%c)", type[1]); goto error; } /* end switch */ break; @@ -1664,7 +1664,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -1808,7 +1808,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { off_t offset = HDva_arg(ap, off_t); - HDfprintf (out, "%ld", (long)offset); + HDfprintf(out, "%ld", (long)offset); } /* end else */ break; @@ -2517,7 +2517,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(T%c)", type[1]); + HDfprintf(out, "BADTYPE(T%c)", type[1]); goto error; } /* end switch */ break; @@ -2533,9 +2533,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) htri_t tri_var = HDva_arg (ap, htri_t); if(tri_var>0) - HDfprintf (out, "TRUE"); + HDfprintf(out, "TRUE"); else if(!tri_var) - HDfprintf (out, "FALSE"); + HDfprintf(out, "FALSE"); else HDfprintf(out, "FAIL(%d)", (int)tri_var); } /* end else */ @@ -2592,7 +2592,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(U%c)", type[1]); + HDfprintf(out, "BADTYPE(U%c)", type[1]); goto error; } /* end switch */ break; @@ -2602,7 +2602,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2638,7 +2638,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'A': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2656,7 +2656,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'b': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2686,7 +2686,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'B': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2716,7 +2716,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'C': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2733,7 +2733,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2769,7 +2769,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'd': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2796,7 +2796,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'e': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2820,7 +2820,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'f': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2844,7 +2844,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'g': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2886,7 +2886,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'h': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2925,7 +2925,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2949,7 +2949,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'j': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2973,7 +2973,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'k': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3000,7 +3000,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3027,7 +3027,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'L': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3051,7 +3051,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'm': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3078,7 +3078,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'n': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3108,7 +3108,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3144,7 +3144,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'r': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3171,7 +3171,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3194,7 +3194,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'S': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3251,7 +3251,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3299,7 +3299,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'u': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3317,7 +3317,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'v': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3422,7 +3422,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'w': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3448,7 +3448,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'x': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3466,7 +3466,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'y': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3502,7 +3502,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'z': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3712,7 +3712,7 @@ error: HDfprintf(out, ";\n"); else { last_call_depth = current_depth++; - HDfprintf (out, ")"); + HDfprintf(out, ")"); } /* end else */ HDfflush(out); -- cgit v0.12 From b9de162eae800a9459f0f1f07d2b043f73f8a907 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 1 Aug 2020 10:26:22 -0700 Subject: Minor normalizations with 1.12 branch --- bin/release | 216 +++++++++++++------------- src/H5AC.c | 2 +- src/H5EAdbg.c | 2 +- src/H5FD.c | 2 +- src/H5I.c | 120 +++++++------- src/H5Ofsinfo.c | 2 +- src/H5Spoint.c | 2 +- src/H5Tdbg.c | 12 +- src/H5Z.c | 126 +++++++-------- src/H5public.h | 16 +- src/H5system.c | 8 +- test/H5srcdir.h | 4 +- test/gen_bogus.c | 2 +- test/gen_specmetaread.c | 3 +- tools/src/h5format_convert/h5format_convert.c | 6 +- tools/src/misc/h5mkgrp.c | 8 +- 16 files changed, 265 insertions(+), 266 deletions(-) diff --git a/bin/release b/bin/release index a34191e..95f58ea 100755 --- a/bin/release +++ b/bin/release @@ -39,7 +39,7 @@ USAGE() { cat << EOF Usage: $0 -d [--docver BRANCHNAME] [-h] [--nocheck] [--private] ... - -d DIR The name of the directory where the releas(es) should be + -d DIR The name of the directory where the releas(es) should be placed. --docver BRANCHNAME This is added for 1.8 and beyond to get the correct version of documentation files from the hdf5docs @@ -53,10 +53,10 @@ The other command-line options are the names of the programs to use for compressing the resulting tar archive (if none are given then "tar" is assumed): - tar -- use tar and don't do any compressing. - gzip -- use gzip with "-9" and append ".gz" to the output name. + tar -- use tar and don't do any compressing. + gzip -- use gzip with "-9" and append ".gz" to the output name. bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name. - zip -- convert all text files to DOS style and form a zip file for Windows use. + zip -- convert all text files to DOS style and form a zip file for Windows use. cmake-tgz -- create a tar file using the gzip default level with a build-unix.sh command file and all other CMake files needed to build HDF5 source using CMake on unix machines. @@ -122,8 +122,8 @@ EOF tar2zip() { if [ $# -ne 3 ]; then - echo "usage: tar2zip " - return 1 + echo "usage: tar2zip " + return 1 fi ztmpdir=/tmp/ztmpdir$$ mkdir -p $ztmpdir @@ -135,10 +135,10 @@ tar2zip() (cd $ztmpdir; tar xf -) < $tarfile # sanity check if [ ! -d $ztmpdir/$version ]; then - echo "untar did not create $ztmpdir/$version source dir" - # cleanup - rm -rf $ztmpdir - return 1 + echo "untar did not create $ztmpdir/$version source dir" + # cleanup + rm -rf $ztmpdir + return 1 fi # step 2: convert text files # There maybe a simpler way to do this. @@ -147,11 +147,11 @@ tar2zip() # -q quiet mode # grep redirect output to /dev/null because -q or -s are not portable. find $ztmpdir/$version | \ - while read inf; do \ - if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ - unix2dos -q -k $inf; \ - fi\ - done + while read inf; do \ + if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ + unix2dos -q -k $inf; \ + fi\ + done # step 3: make zipball # -9 maximum compression # -y Store symbolic links as such in the zip archive @@ -202,8 +202,8 @@ tar2zip() tar2cmakezip() { if [ $# -ne 3 ]; then - echo "usage: tar2cmakezip " - return 1 + echo "usage: tar2cmakezip " + return 1 fi cmziptmpdir=/tmp/cmziptmpdir$$ cmziptmpsubdir=$cmziptmpdir/CMake-$HDF5_VERS @@ -216,10 +216,10 @@ tar2cmakezip() (cd $cmziptmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmziptmpsubdir/$version ]; then - echo "untar did not create $cmziptmpsubdir/$version source dir" - # cleanup - rm -rf $cmziptmpdir - return 1 + echo "untar did not create $cmziptmpsubdir/$version source dir" + # cleanup + rm -rf $cmziptmpdir + return 1 fi # step 2: add batch file for building CMake on window @@ -245,11 +245,11 @@ tar2cmakezip() # -q quiet mode # grep redirect output to /dev/null because -q or -s are not portable. find $cmziptmpsubdir/$version | \ - while read inf; do \ - if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ - unix2dos -q -k $inf; \ - fi\ - done + while read inf; do \ + if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ + unix2dos -q -k $inf; \ + fi\ + done # step 3: make zipball # -9 maximum compression @@ -301,8 +301,8 @@ tar2cmakezip() tar2cmaketgz() { if [ $# -ne 3 ]; then - echo "usage: tar2cmaketgz " - return 1 + echo "usage: tar2cmaketgz " + return 1 fi cmgztmpdir=/tmp/cmgztmpdir$$ cmgztmpsubdir=$cmgztmpdir/CMake-$HDF5_VERS @@ -315,10 +315,10 @@ tar2cmaketgz() (cd $cmgztmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmgztmpsubdir/$version ]; then - echo "untar did not create $cmgztmpsubdir/$version source dir" - # cleanup - rm -rf $cmgztmpdir - return 1 + echo "untar did not create $cmgztmpsubdir/$version source dir" + # cleanup + rm -rf $cmgztmpdir + return 1 fi @@ -384,8 +384,8 @@ tar2cmaketgz() tar2hpccmaketgz() { if [ $# -ne 3 ]; then - echo "usage: tar2hpccmaketgz " - return 1 + echo "usage: tar2hpccmaketgz " + return 1 fi cmgztmpdir=/tmp/cmgztmpdir$$ cmgztmpsubdir=$cmgztmpdir/HPC-CMake-$HDF5_VERS @@ -398,10 +398,10 @@ tar2hpccmaketgz() (cd $cmgztmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmgztmpsubdir/$version ]; then - echo "untar did not create $cmgztmpsubdir/$version source dir" - # cleanup - rm -rf $cmgztmpdir - return 1 + echo "untar did not create $cmgztmpsubdir/$version source dir" + # cleanup + rm -rf $cmgztmpdir + return 1 fi @@ -442,7 +442,7 @@ check=yes release_date=`date +%F` today=`date +%Y%m%d` pmode='no' -tmpdir="../#release_tmp.$$" # tmp work directory +tmpdir="../#release_tmp.$$" # tmp work directory DOC_URL=https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5doc.git CPPLUS_RM_NAME=cpplus_RM MAINT_MODE_ENABLED="" @@ -459,11 +459,11 @@ fi RESTORE_VERSION() { if [ X-${VERS_OLD} != X- ]; then - echo restoring version information back to $VERS_OLD - rm -f config/lt_vers.am - cp $tmpdir/lt_vers.am config/lt_vers.am - bin/h5vers -s $VERS_OLD - VERS_OLD= + echo restoring version information back to $VERS_OLD + rm -f config/lt_vers.am + cp $tmpdir/lt_vers.am config/lt_vers.am + bin/h5vers -s $VERS_OLD + VERS_OLD= fi } @@ -473,32 +473,32 @@ while [ -n "$1" ]; do arg=$1 shift case "$arg" in - -d) - DEST=$1 - shift - ;; - --nocheck) - check=no - ;; - -h) - USAGE - exit 0 - ;; - --private) - pmode=yes - ;; + -d) + DEST=$1 + shift + ;; + --nocheck) + check=no + ;; + -h) + USAGE + exit 0 + ;; + --private) + pmode=yes + ;; --docver) DOCVERSION=$1 shift ;; - -*) - echo "Unknown switch: $arg" 1>&2 - USAGE - exit 1 - ;; - *) - methods="$methods $arg" - ;; + -*) + echo "Unknown switch: $arg" 1>&2 + USAGE + exit 1 + ;; + *) + methods="$methods $arg" + ;; esac done @@ -553,7 +553,7 @@ if [ "X$fail" = "Xyes" ]; then echo "--nocheck argument to the bin/release command." exit 1 else - echo "Continuing anyway..." + echo "Continuing anyway..." fi fi @@ -595,61 +595,61 @@ MD5file=$HDF5_VERS.md5 cp /dev/null $DEST/$MD5file for comp in $methods; do case $comp in - tar) - cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar - (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file) - ;; - gzip) - test "$verbose" && echo " Running gzip..." 1>&2 - gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz - (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) - ;; + tar) + cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar + (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file) + ;; + gzip) + test "$verbose" && echo " Running gzip..." 1>&2 + gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz + (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) + ;; cmake-tgz) - test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2 - tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2 - (cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file) + test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2 + tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2 + (cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file) ;; hpc-cmake-tgz) - test "$verbose" && echo " Creating HPC-CMake tar.gz file..." 1>&2 - tar2hpccmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/HPC-CMake-$HDF5_VERS.tar.gz 1>&2 - (cd $DEST; md5sum HPC-CMake-$HDF5_VERS.tar.gz >> $MD5file) + test "$verbose" && echo " Creating HPC-CMake tar.gz file..." 1>&2 + tar2hpccmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/HPC-CMake-$HDF5_VERS.tar.gz 1>&2 + (cd $DEST; md5sum HPC-CMake-$HDF5_VERS.tar.gz >> $MD5file) + ;; + bzip2) + test "$verbose" && echo " Running bzip2..." 1>&2 + bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 + (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file) + ;; + zip) + test "$verbose" && echo " Creating zip ball..." 1>&2 + tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 + (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) ;; - bzip2) - test "$verbose" && echo " Running bzip2..." 1>&2 - bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 - (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file) - ;; - zip) - test "$verbose" && echo " Creating zip ball..." 1>&2 - tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 - (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) - ;; cmake-zip) test "$verbose" && echo " Creating CMake-zip ball..." 1>&2 tar2cmakezip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.zip 1>&2 (cd $DEST; md5sum CMake-$HDF5_VERS.zip >> $MD5file) ;; - doc) + doc) if [ "${DOCVERSION}" = "" ]; then DOCVERSION=master fi - test "$verbose" && echo " Creating docs..." 1>&2 - # Check out docs from git repo - (cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1 + test "$verbose" && echo " Creating docs..." 1>&2 + # Check out docs from git repo + (cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1 # Create doxygen C++ RM - (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 - # Replace version of C++ RM with just-created version - rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 - mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 + (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 + # Replace version of C++ RM with just-created version + rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 + mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 # Compress the docs and move them to the release area - mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1 - (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1 - mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1 - ;; - *) - echo "***Error*** Unknown method $comp" - exit 1 - ;; + mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1 + (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1 + mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1 + ;; + *) + echo "***Error*** Unknown method $comp" + exit 1 + ;; esac done diff --git a/src/H5AC.c b/src/H5AC.c index f8805b3..6972a31 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -138,7 +138,7 @@ static const H5AC_class_t *const H5AC_class_s[] = { /*------------------------------------------------------------------------- * Function: H5AC_init * - * Purpose: Initialize the interface from some other layer. + * Purpose: Initialize the interface from some other layer. * * Return: Success: non-negative * Failure: negative diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 20c6a4d..e5b68be 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -295,7 +295,7 @@ CATCH END_FUNC(PKG) /* end H5EA__iblock_debug() */ - + /*------------------------------------------------------------------------- * Function: H5EA__sblock_debug * diff --git a/src/H5FD.c b/src/H5FD.c index 2e80c7f..2cd69df 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1436,7 +1436,7 @@ done: * constant H5P_DEFAULT). The bytes to be written come from the * buffer BUF. * - * Return: SNon-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ diff --git a/src/H5I.c b/src/H5I.c index 11209d6..a739c4e 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -33,9 +33,9 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Gprivate.h" /* Groups */ #include "H5Ipkg.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -145,7 +145,7 @@ static int H5I__iterate_pub_cb(void *obj, hid_t id, void *udata); static int H5I__find_id_cb(void *_item, void *_key, void *_udata); static int H5I__id_dump_cb(void *_item, void *_key, void *_udata); - + /*------------------------------------------------------------------------- * Function: H5I_term_package * @@ -197,7 +197,7 @@ H5I_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5I_term_package() */ - + /*------------------------------------------------------------------------- * Function: H5Iregister_type * @@ -278,7 +278,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iregister_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_register_type * @@ -339,7 +339,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_type() */ - + /*------------------------------------------------------------------------- * Function: H5Itype_exists * @@ -371,7 +371,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Itype_exists() */ - + /*------------------------------------------------------------------------- * Function: H5Inmembers * @@ -421,7 +421,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Inmembers() */ - + /*------------------------------------------------------------------------- * Function: H5I_nmembers * @@ -458,7 +458,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_nmembers() */ - + /*------------------------------------------------------------------------- * Function: H5I__unwrap * @@ -502,7 +502,7 @@ H5I__unwrap(void *obj_ptr, H5I_type_t type) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__unwrap() */ - + /*------------------------------------------------------------------------- * Function: H5Iclear_type * @@ -535,7 +535,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iclear_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_clear_type * @@ -577,7 +577,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_clear_type() */ - + /*------------------------------------------------------------------------- * Function: H5I__clear_type_cb * @@ -643,7 +643,7 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__clear_type_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Idestroy_type * @@ -677,7 +677,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idestroy_type() */ - + /*------------------------------------------------------------------------- * Function: H5I__destroy_type * @@ -729,7 +729,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__destroy_type() */ - + /*------------------------------------------------------------------------- * Function: H5Iregister * @@ -757,7 +757,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iregister() */ - + /*------------------------------------------------------------------------- * Function: H5I_register * @@ -819,7 +819,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register() */ - + /*------------------------------------------------------------------------- * Function: H5I_register_using_existing_id * @@ -890,7 +890,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_using_existing_id() */ - + /*------------------------------------------------------------------------- * Function: H5I_subst * @@ -927,7 +927,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_subst() */ - + /*------------------------------------------------------------------------- * Function: H5I_object * @@ -957,7 +957,7 @@ H5I_object(hid_t id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_object() */ - + /*------------------------------------------------------------------------- * Function: H5Iobject_verify * @@ -991,7 +991,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iobject_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I_object_verify * @@ -1026,7 +1026,7 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) FUNC_LEAVE_NOAPI(ret_value) } /* H5I_object_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I_get_type * @@ -1060,7 +1060,7 @@ H5I_get_type(hid_t id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_type() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_type * @@ -1087,13 +1087,13 @@ H5Iget_type(hid_t id) ret_value = H5I_get_type(id); if(ret_value <= H5I_BADID || (int)ret_value >= H5I_next_type || NULL == H5I_object(id)) - HGOTO_DONE(H5I_BADID); + HGOTO_DONE(H5I_BADID); done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_is_file_object * @@ -1144,7 +1144,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* H5I_is_file_object() */ - + /*------------------------------------------------------------------------- * Function: H5Iremove_verify * @@ -1180,7 +1180,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iremove_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I__remove_verify * @@ -1213,7 +1213,7 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__remove_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I__remove_common * @@ -1258,7 +1258,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__remove_common() */ - + /*------------------------------------------------------------------------- * Function: H5I_remove * @@ -1298,7 +1298,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_remove() */ - + /*------------------------------------------------------------------------- * Function: H5Idec_ref * @@ -1334,7 +1334,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idec_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_ref * @@ -1404,7 +1404,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_app_ref * @@ -1452,7 +1452,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_app_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_app_ref_always_close * @@ -1494,7 +1494,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_app_ref_always_close() */ - + /*------------------------------------------------------------------------- * Function: H5Iinc_ref * @@ -1525,7 +1525,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iinc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_inc_ref * @@ -1563,7 +1563,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_inc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_ref * @@ -1594,7 +1594,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_get_ref * @@ -1627,7 +1627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iinc_type_ref * @@ -1660,7 +1660,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iinc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I__inc_type_ref * @@ -1694,14 +1694,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__inc_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Idec_type_ref * * Purpose: Decrements the reference count on an entire type of IDs. * If the type reference count becomes zero then the type is * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling + * their reference counts. Destroying IDs involves calling * the free-func for each ID's object and then adding the ID * struct to the ID free list. Public interface to * H5I_dec_type_ref. @@ -1736,14 +1736,14 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idec_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_type_ref * * Purpose: Decrements the reference count on an entire type of IDs. * If the type reference count becomes zero then the type is * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling + * their reference counts. Destroying IDs involves calling * the free-func for each ID's object and then adding the ID * struct to the ID free list. * Returns the number of references to the type on success; a @@ -1789,7 +1789,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_type_ref * @@ -1822,7 +1822,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I__get_type_ref * @@ -1857,7 +1857,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__get_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iis_valid * @@ -1887,7 +1887,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iis_valid() */ - + /*------------------------------------------------------------------------- * Function: H5I__search_cb * @@ -1922,7 +1922,7 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__search_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Isearch * @@ -1973,7 +1973,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Isearch() */ - + /*------------------------------------------------------------------------- * Function: H5I__iterate_pub_cb * @@ -2013,7 +2013,7 @@ H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__iterate_pub_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Iiterate * @@ -2060,7 +2060,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iiterate() */ - + /*------------------------------------------------------------------------- * Function: H5I__iterate_cb * @@ -2108,7 +2108,7 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__iterate_cb() */ - + /*------------------------------------------------------------------------- * Function: H5I_iterate * @@ -2167,7 +2167,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_iterate() */ - + /*------------------------------------------------------------------------- * Function: H5I__find_id * @@ -2212,7 +2212,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__find_id() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_name * @@ -2263,7 +2263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_name() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_file_id * @@ -2307,7 +2307,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_file_id() */ - + /*------------------------------------------------------------------------- * Function: H5I__find_id_cb * @@ -2345,7 +2345,7 @@ H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__find_id_cb() */ - + /*------------------------------------------------------------------------- * Function: H5I_find_id * @@ -2394,7 +2394,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_find_id() */ - + /*------------------------------------------------------------------------- * Function: H5I__id_dump_cb * @@ -2482,7 +2482,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(H5_ITER_CONT) } /* end H5I__id_dump_cb() */ - + /*------------------------------------------------------------------------- * Function: H5I_dump_ids_for_type * diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 78e8e19..e2fa4e5 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -110,7 +110,7 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Allocate space for message */ if(NULL == (fsinfo = H5FL_CALLOC(H5O_fsinfo_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) fsinfo->fs_addr[ptype - 1] = HADDR_UNDEF; diff --git a/src/H5Spoint.c b/src/H5Spoint.c index be9015f..f53033b 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * * Purpose: Point selection dataspace I/O functions. diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 7af736a..6188138 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5Tdbg.c - * Jul 19 2007 - * Quincey Koziol + * Created: H5Tdbg.c + * Jul 19 2007 + * Quincey Koziol * - * Purpose: Dump debugging information about a datatype + * Purpose: Dump debugging information about a datatype * *------------------------------------------------------------------------- */ @@ -72,7 +72,7 @@ /*******************/ - + /*------------------------------------------------------------------------- * Function: H5T__print_stats * @@ -137,7 +137,7 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T__print_stats() */ - + /*------------------------------------------------------------------------- * Function: H5T_debug * diff --git a/src/H5Z.c b/src/H5Z.c index af5b888..3bd4bcb 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -35,10 +35,10 @@ #ifdef H5Z_DEBUG typedef struct H5Z_stats_t { struct { - hsize_t total; /* total number of bytes processed */ - hsize_t errors; /* bytes of total attributable to errors */ + hsize_t total; /* total number of bytes processed */ + hsize_t errors; /* bytes of total attributable to errors */ H5_timevals_t times; /* execution time including errors */ - } stats[2]; /* 0 = output, 1 = input */ + } stats[2]; /* 0 = output, 1 = input */ } H5Z_stats_t; #endif /* H5Z_DEBUG */ @@ -132,9 +132,9 @@ H5Z_term_package(void) if(H5_PKG_INIT_VAR) { #ifdef H5Z_DEBUG - char comment[16], bandwidth[32]; - int dir, nprint = 0; - size_t i; + char comment[16], bandwidth[32]; + int dir, nprint = 0; + size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -142,33 +142,34 @@ H5Z_term_package(void) if(0 == H5Z_stat_table_g[i].stats[dir].total) continue; - if(0 == nprint++) { - /* Print column headers */ - HDfprintf(H5DEBUG(Z), "H5Z: filter statistics " - "accumulated over life of library:\n"); - HDfprintf(H5DEBUG(Z), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "Filter", "Total", "Errors", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(Z), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "------", "-----", "------", "----", - "------", "-------", "---------"); - } /* end if */ - - /* Truncate the comment to fit in the field */ - HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); - comment[sizeof(comment) - 1] = '\0'; - - /* - * Format bandwidth to have four significant digits and - * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or - * the word `Inf' if the elapsed time is zero. - */ - H5_bandwidth(bandwidth, (double)(H5Z_stat_table_g[i].stats[dir].total), + if(0 == nprint++) { + /* Print column headers */ + HDfprintf(H5DEBUG(Z), "H5Z: filter statistics " + "accumulated over life of library:\n"); + HDfprintf(H5DEBUG(Z), + " %-16s %10s %10s %8s %8s %8s %10s\n", + "Filter", "Total", "Errors", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(Z), + " %-16s %10s %10s %8s %8s %8s %10s\n", + "------", "-----", "------", "----", + "------", "-------", "---------"); + } /* end if */ + + /* Truncate the comment to fit in the field */ + HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); + comment[sizeof(comment) - 1] = '\0'; + + /* + * Format bandwidth to have four significant digits and + * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or + * the word `Inf' if the elapsed time is zero. + */ + H5_bandwidth(bandwidth, + (double)(H5Z_stat_table_g[i].stats[dir].total), H5Z_stat_table_g[i].stats[dir].times.elapsed); - /* Print the statistics */ + /* Print the statistics */ HDfprintf(H5DEBUG(Z), " %s%-15s %10Hd %10Hd %8T %8T %8T %10s\n", (dir ? "<" : ">"), comment, H5Z_stat_table_g[i].stats[dir].total, @@ -177,12 +178,12 @@ H5Z_term_package(void) H5Z_stat_table_g[i].stats[dir].times.system, H5Z_stat_table_g[i].stats[dir].times.elapsed, bandwidth); - } /* end for */ - } /* end for */ - } /* end if */ + } /* end for */ + } /* end for */ + } /* end if */ #endif /* H5Z_DEBUG */ - /* Free the table of filters */ + /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -1256,7 +1257,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, int fclass_idx; /* Index of filter class in global table */ H5Z_class2_t *fclass = NULL; /* Filter class pointer */ #ifdef H5Z_DEBUG - H5Z_stats_t *fstats = NULL; /* Filter stats pointer */ + H5Z_stats_t *fstats = NULL; /* Filter stats pointer */ H5_timer_t timer; /* Timer for filter operations */ H5_timevals_t times; /* Elapsed time for each operation */ #endif @@ -1278,12 +1279,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, H5_timer_init(&timer); #endif if(pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ - for(i = pline->nused; i > 0; --i) { - idx = i - 1; - if(*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + for(i = pline->nused; i > 0; --i) { + idx = i - 1; + if(*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* If the filter isn't registered and the application doesn't * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), @@ -1304,7 +1305,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; - } /* end if */ + } else issue_error = TRUE; @@ -1353,24 +1354,25 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, *nbytes = *buf_size; failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - } /* end if */ + } else *nbytes = new_nbytes; - } /* end for */ - } else if (pline) { /* Write */ - for(idx = 0; idx < pline->nused; idx++) { - if(*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + } + } + else if(pline) { /* Write */ + for(idx = 0; idx < pline->nused; idx++) { + if(*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { /* Check if filter is optional -- If it isn't, then error */ - if((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") - failed |= (unsigned)1 << idx; + if((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") + failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - continue; /* filter excluded */ - } /* end if */ + continue; /* filter excluded */ + } /* end if */ fclass = &H5Z_table_g[fclass_idx]; @@ -1390,25 +1392,25 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, fstats->stats[0].times.system += times.system; fstats->stats[0].times.user += times.user; - fstats->stats[0].total += MAX(*nbytes, new_nbytes); + fstats->stats[0].total += MAX(*nbytes, new_nbytes); if(0 == new_nbytes) fstats->stats[0].errors += *nbytes; #endif if(0 == new_nbytes) { if(0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if((cb_struct.func && (H5Z_CB_FAIL==cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) + if((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; - } /* end if */ + } failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - } /* end if */ + } else *nbytes = new_nbytes; - } /* end for */ + } /* end for */ } *filter_mask = failed; diff --git a/src/H5public.h b/src/H5public.h index 93cb2ea..d3edd23 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -38,7 +38,7 @@ #include #endif #ifdef H5_STDC_HEADERS -# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ +# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ # include /*for variadic functions in H5VLpublic.h */ #endif #ifndef __cplusplus @@ -183,7 +183,7 @@ typedef long long ssize_t; */ #if H5_SIZEOF_LONG_LONG >= 8 H5_GCC_DIAG_OFF(long-long) -typedef unsigned long long hsize_t; +typedef unsigned long long hsize_t; typedef signed long long hssize_t; H5_GCC_DIAG_ON(long-long) # define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG @@ -229,7 +229,7 @@ H5_GCC_DIAG_ON(long-long) #else # error "nothing appropriate for H5_PRINTF_HADDR_FMT" #endif -#define HADDR_MAX (HADDR_UNDEF-1) +#define HADDR_MAX (HADDR_UNDEF-1) /* uint32_t type is used for creation order field for messages. It may be * defined in Posix.1g, otherwise it is defined here. @@ -297,7 +297,7 @@ typedef enum { H5_ITER_INC, /* Increasing order */ H5_ITER_DEC, /* Decreasing order */ H5_ITER_NATIVE, /* No particular order, whatever is fastest */ - H5_ITER_N /* Number of iteration orders */ + H5_ITER_N /* Number of iteration orders */ } H5_iter_order_t; /* Iteration callback values */ @@ -314,10 +314,10 @@ typedef enum { * links in groups/attributes on objects. */ typedef enum H5_index_t { - H5_INDEX_UNKNOWN = -1, /* Unknown index type */ - H5_INDEX_NAME, /* Index on names */ - H5_INDEX_CRT_ORDER, /* Index on creation order */ - H5_INDEX_N /* Number of indices defined */ + H5_INDEX_UNKNOWN = -1, /* Unknown index type */ + H5_INDEX_NAME, /* Index on names */ + H5_INDEX_CRT_ORDER, /* Index on creation order */ + H5_INDEX_N /* Number of indices defined */ } H5_index_t; /* diff --git a/src/H5system.c b/src/H5system.c index b3db39c..24935fd 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5system.c - * Aug 21 2006 - * Quincey Koziol + * Created: H5system.c + * Aug 21 2006 + * Quincey Koziol * - * Purpose: System call wrapper implementations. + * Purpose: System call wrapper implementations. * *------------------------------------------------------------------------- */ diff --git a/test/H5srcdir.h b/test/H5srcdir.h index b02d432..019cfda 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, March 17, 2010 * * Purpose: srcdir querying support. @@ -20,8 +20,6 @@ #ifndef _H5SRCDIR_H #define _H5SRCDIR_H -/* Include the header file with the correct relative path for the srcdir string */ - #ifdef __cplusplus extern "C" { #endif diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 1ab18a4..ab2620f 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Apr 17, 2007 * * Purpose: This program is run to generate an HDF5 data file with several diff --git a/test/gen_specmetaread.c b/test/gen_specmetaread.c index fd484d1..f2625a7 100644 --- a/test/gen_specmetaread.c +++ b/test/gen_specmetaread.c @@ -23,9 +23,8 @@ * the library on the trunk as of when this file is checked in. */ -#include -#include "testhdf5.h" +#include "h5test.h" #define FILENAME "specmetaread.h5" #define DIM 10 diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index d63f36f..e60097b 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -64,7 +64,7 @@ static struct long_options l_opts[] = { { NULL, 0, '\0' } }; - + /*------------------------------------------------------------------------- * Function: usage * @@ -185,7 +185,7 @@ error: return(-1); ; } /* parse_command_line() */ - + /*------------------------------------------------------------------------- * Function: leave * @@ -387,7 +387,7 @@ error: return -1; } /* end convert_dsets_cb() */ - + /*------------------------------------------------------------------------- * Function: main * diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 4d2d2b8..ad3b7b8 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -49,7 +49,7 @@ typedef struct mkgrp_opt_t { mkgrp_opt_t params_g; /* Command line parameter settings */ - + /*------------------------------------------------------------------------- * Function: leave * @@ -81,7 +81,7 @@ leave(int ret) HDexit(ret); } /* end leave() */ - + /*------------------------------------------------------------------------- * Function: usage * @@ -113,7 +113,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, "\n"); } /* end usage() */ - + /*------------------------------------------------------------------------- * Function: parse_command_line * @@ -248,7 +248,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) return 0; } /* parse_command_line() */ - + /*------------------------------------------------------------------------- * Function: main * -- cgit v0.12 From bc1bed2c55981f1802f87f83054d375431a0088f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Aug 2020 09:11:27 -0700 Subject: Squash merge of file locking fixes --- c++/src/H5FaccProp.cpp | 47 ++++++ c++/src/H5FaccProp.h | 6 + config/cmake/ConfigureChecks.cmake | 25 +++ config/cmake/H5pubconf.h.in | 6 + config/cmake/libhdf5.settings.cmake.in | 1 + configure.ac | 50 ++++++ fortran/src/H5Pf.c | 77 +++++++++ fortran/src/H5Pff.F90 | 102 ++++++++++++ fortran/src/H5f90proto.h | 2 + fortran/src/hdf5_fortrandll.def.in | 2 + java/src/hdf/hdf5lib/H5.java | 45 +++++ java/src/jni/h5pFAPLImp.c | 72 ++++++++ java/src/jni/h5pFAPLImp.h | 27 +++ java/test/TestH5Pfapl.java | 32 ++++ java/test/testfiles/JUnit-TestH5Pfapl.txt | 3 +- release_docs/RELEASE.txt | 111 ++++++++++++- src/H5F.c | 149 ----------------- src/H5FD.c | 8 +- src/H5FDcore.c | 42 ++++- src/H5FDdirect.c | 59 ++++++- src/H5FDfamily.c | 6 +- src/H5FDlog.c | 48 +++++- src/H5FDmulti.c | 4 +- src/H5FDsec2.c | 60 +++++-- src/H5FDsplitter.c | 31 ++-- src/H5FDstdio.c | 53 +++++- src/H5Fint.c | 266 ++++++++++++++++++++++++++++-- src/H5Fpkg.h | 7 + src/H5Fprivate.h | 2 + src/H5Ftest.c | 33 ++++ src/H5Pfapl.c | 127 ++++++++++++++ src/H5Ppublic.h | 2 + src/H5err.txt | 2 + src/H5private.h | 4 +- src/H5system.c | 6 +- src/libhdf5.settings.in | 1 + test/h5test.c | 58 +++++++ test/h5test.h | 1 + test/swmr.c | 190 ++++++++++++++------- 39 files changed, 1458 insertions(+), 309 deletions(-) diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 5a478e7..a028e00 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -685,6 +685,53 @@ unsigned FileAccPropList::getGcReferences() const } //-------------------------------------------------------------------------- +// Function: FileAccPropList::setFileLocking +///\brief Sets file locking flags. +///\param use_file_locking - IN: Flag that determines if file locks should +// be used or not. +///\param ignore_when_disabled - IN: Flag that determines if file locks +// should be be used when disabled on the file system or not. +///\exception H5::PropListIException +///\par Description +/// For information, please refer to the H5Pset_file_locking API in +/// the HDF5 C Reference Manual. +// Programmer Dana Robinson - 2020 +//-------------------------------------------------------------------------- +void FileAccPropList::setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const +{ + herr_t ret_value = H5Pset_file_locking(id, use_file_locking, ignore_when_disabled); + + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setFileLocking", "H5Pset_file_locking failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: FileAccPropList::getFileLocking +///\brief Gets file locking flags. +///\param use_file_locking - OUT: Flag that determines if file locks +// should be used or not. +///\param ignore_when_disabled - OUT: Flag that determines if file locks +// should be be used when disabled on the file system or not. +///\exception H5::PropListIException +///\par Description +/// For information, please refer to the H5Pget_file_locking API in +/// the HDF5 C Reference Manual. +// Programmer Dana Robinson - 2020 +//-------------------------------------------------------------------------- +void FileAccPropList::getFileLocking(hbool_t& use_file_locking, hbool_t& ignore_when_disabled) const +{ + herr_t ret_value = H5Pget_file_locking(id, &use_file_locking, &ignore_when_disabled); + + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getFileLocking", "H5Pget_file_locking failed"); + } +} + + +//-------------------------------------------------------------------------- // Function: FileAccPropList::setLibverBounds ///\brief Sets bounds on versions of library format to be used when creating /// or writing objects. diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 58f049e..2475cf5 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -126,6 +126,12 @@ class H5_DLLCPP FileAccPropList : public PropList { // Returns garbage collecting references setting. unsigned getGcReferences() const; + // Sets file locking parameters + void setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const; + + // Gets file locking parameters + void getFileLocking(hbool_t& use_file_locking, hbool_t& ignore_when_disabled) const; + // Sets bounds on versions of library format to be used when creating // or writing objects. void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 2930969..ab121e9 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -61,6 +61,31 @@ if (HDF5_ENABLE_CODESTACK) endif () MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) +# ---------------------------------------------------------------------- +# Check if they would like to use file locking by default +#----------------------------------------------------------------------------- +option (HDF5_USE_FILE_LOCKING "Use file locking by default (mainly for SWMR)" ON) +if (HDF5_USE_FILE_LOCKING) + set (${HDF_PREFIX}_USE_FILE_LOCKING 1) +endif () + +# ---------------------------------------------------------------------- +# Check if they would like to ignore file locks when disabled on a file system +#----------------------------------------------------------------------------- +option (HDF5_IGNORE_DISABLED_FILE_LOCKS "Ignore file locks when disabled on file system" ON) +if (HDF5_IGNORE_DISABLED_FILE_LOCKS) + set (${HDF_PREFIX}_IGNORE_DISABLED_FILE_LOCKS 1) +endif () + +# Set the libhdf5.settings file variable +if (HDF5_IGNORE_DISABLED_FILE_LOCKS AND HDF5_USE_FILE_LOCKING) + set (HDF5_FILE_LOCKING_SETTING "best-effort") +elseif (HDF5_IGNORE_DISABLED_FILE_LOCKS) + set (HDF5_FILE_LOCKING_SETTING "yes") +else () + set (HDF5_FILE_LOCKING_SETTING "no") +endif () + #----------------------------------------------------------------------------- # Are we going to use HSIZE_T #----------------------------------------------------------------------------- diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 64b4852..fdf4c7d 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -489,6 +489,9 @@ /* Define if the compiler understands __inline__ */ #cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@ +/* Define if the library will ignore file locks when disabled */ +#cmakedefine H5_IGNORE_DISABLED_FILE_LOCKS @H5_IGNORE_DISABLED_FILE_LOCKS@ + /* Define if the high-level library headers should be included in hdf5.h */ #cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ @@ -729,6 +732,9 @@ /* Define using v1.14 public API symbols by default */ #cmakedefine H5_USE_114_API_DEFAULT @H5_USE_114_API_DEFAULT@ +/* Define if the library will use file locking */ +#cmakedefine H5_FILE_LOCKING @H5_USE_FILE_LOCKING@ + /* Define if a memory checking tool will be used on the library, to cause library to be very picky about memory operations and also disable the internal free list manager code. */ diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index b745765..ebcbd61 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -85,5 +85,6 @@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@ Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ + Use file locking: @HDF5_FILE_LOCKING_SETTING@ Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ Optimization Instrumentation: @HDF5_Enable_Instrument@ diff --git a/configure.ac b/configure.ac index f79e9e6..6e0b4c7 100644 --- a/configure.ac +++ b/configure.ac @@ -2316,6 +2316,56 @@ case "X-$OPTIMIZATION" in esac ## ---------------------------------------------------------------------- +## Check if file locking should be used +## +AC_MSG_CHECKING([enable file locking]) +AC_ARG_ENABLE([file-locking], + [AS_HELP_STRING([--enable-file-locking=(yes|no|best-effort)], + [Sets the default for whether or not to use file + locking when opening files. Can be overridden + with the HDF5_USE_FILE_LOCKING environment variable + and the H5Pset_file_locking() API call. + best-effort attempts to use file locking but does + not fail when file locks have been disabled on + the file system (useful with Lustre). + [default=best-effort] + ])], + [DESIRED_FILE_LOCKING=$enableval]) + +## Set defaults +if test "X-$DESIRED_FILE_LOCKING" = X- ; then + DESIRED_FILE_LOCKING=best-effort +fi + +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) +AC_SUBST([DESIRED_FILE_LOCKING]) +AC_SUBST([USE_FILE_LOCKING]) +AC_SUBST([IGNORE_DISABLED_FILE_LOCKS]) + +case "X-$DESIRED_FILE_LOCKING" in + X-best-effort) + AC_MSG_RESULT([best-effort]) + AC_DEFINE([USE_FILE_LOCKING], [1], + [Define if the library will use file locking]) + AC_DEFINE([IGNORE_DISABLED_FILE_LOCKS], [1], + [Define if the library will ignore file locks when disabled]) + ;; + X-yes) + AC_MSG_RESULT([yes]) + AC_DEFINE([USE_FILE_LOCKING], [1], + [Define if the library will use file locking]) + ;; + X-no) + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_ERROR([Unrecognized value: $USE_FILE_LOCKING]) + ;; +esac + + +## ---------------------------------------------------------------------- ## Enable/disable internal package-level debugging output ## AC_MSG_CHECKING([for internal debug output]) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 7cb3db8..9816d7b 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -5241,6 +5241,83 @@ h5pget_file_image_c(hid_t_f *fapl_id, void **buf_ptr, size_t_f *buf_len_ptr) return ret_value; } +/****if* H5Pf/h5pset_file_locking_c + * NAME + * h5pset_file_locking_c + * PURPOSE + * Call H5Pset_file_locking to set file locking properties. + * INPUTS + * prp_id - file access property list identifier + * use_file_locking - TRUE/FALSE flag + * ignore_disabled_file_locking - TRUE/FALSE flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Dana Robinson + * Summer 2020 + * SOURCE +*/ +int_f +h5pset_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking) +/******/ +{ + int ret_value = 0; + hid_t c_prp_id = H5I_INVALID_HID; + herr_t status; + hbool_t c_use_flag = 1; + hbool_t c_ignore_flag = 1; + + if (*use_file_locking == 0) c_use_flag = 0; + if (*ignore_disabled_file_locking == 0) c_ignore_flag = 1; + + c_prp_id = (hid_t)*prp_id; + + status = H5Pset_file_locking(c_prp_id, c_use_flag, c_ignore_flag); + + if ( status < 0 ) ret_value = -1; + + return ret_value; +} + + +/****if* H5Pf/h5pget_file_locking_c + * NAME + * h5pget_file_locking_c + * PURPOSE + * Call H5Pget_file_locking to get file locking properties. + * INPUTS + * prp_id - file access property list identifier + * use_file_locking - TRUE/FALSE flag + * ignore_disabled_file_locking - TRUE/FALSE flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Dana Robinson + * Summer 2020 + * SOURCE +*/ +int_f +h5pget_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking) +/******/ +{ + int ret_value = 0; + hid_t c_prp_id = H5I_INVALID_HID; + hbool_t c_use_flag = 1; + hbool_t c_ignore_flag = 1; + herr_t c_ret; + + c_prp_id = (hid_t)*prp_id; + + c_ret = H5Pget_file_locking(c_prp_id, &c_use_flag, &c_ignore_flag); + + if ( c_ret < 0 ) ret_value = -1; + + *use_file_locking = (int_f)c_use_flag; + *ignore_disabled_file_locking = (int_f)c_ignore_flag; + + return ret_value; +} + #ifdef H5_HAVE_PARALLEL /****if* H5Pf/h5pset_fapl_mpio_c * NAME diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 7e06cf3..40c4e95 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -8263,5 +8263,107 @@ END SUBROUTINE h5pget_virtual_dsetname_f END SUBROUTINE h5pget_vol_id_f +!****s* H5P (F03)/h5pget_file_locking_f_F03 +! +! NAME +! h5pget_file_locking_f +! +! PURPOSE +! Gets the file locking properties. File locking is mainly used to help +! enforce SWMR semantics. +! +! INPUTS +! fapl_id - Target file access property list identifier. +! +! OUTPUTS +! use_file_locking - Whether or not to use file locks. +! ignore_disabled_locks - Whether or not to ignore file locks when locking +! is disabled on a file system. +! hdferr - error code: +! 0 on success and -1 on failure +! +! AUTHOR +! Dana Robinson +! Summer 2020 +! +! Fortran2003 Interface: + SUBROUTINE h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: fapl_id + LOGICAL , INTENT(OUT) :: use_file_locking + LOGICAL , INTENT(OUT) :: ignore_disabled_locks + INTEGER , INTENT(OUT) :: hdferr +!***** + LOGICAL(C_BOOL) :: c_use_flag + LOGICAL(C_BOOL) :: c_ignore_flag + + INTERFACE + INTEGER FUNCTION h5pget_file_locking_c(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pget_file_locking') + IMPORT :: HID_T, C_BOOL + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id + LOGICAL(C_BOOL), INTENT(OUT) :: use_file_locking + LOGICAL(C_BOOL), INTENT(OUT) :: ignore_disabled_locks + END FUNCTION h5pget_file_locking_c + END INTERFACE + + hdferr = INT(h5pget_file_locking_c(fapl_id, c_use_flag, c_ignore_flag)) + + ! Transfer value of C C_BOOL type to Fortran LOGICAL + use_file_locking = c_use_flag + ignore_disabled_locks = c_ignore_flag + + END SUBROUTINE h5pget_file_locking_f + +!****s* H5P (F03)/h5pset_file_locking_f_F03 +! +! NAME +! h5pset_file_locking_f +! +! PURPOSE +! Sets the file locking properties. File locking is mainly used to help +! enforce SWMR semantics. +! +! INPUTS +! fapl_id - Target file access property list identifier. +! use_file_locking - Whether or not to use file locks. +! ignore_disabled_locks - Whether or not to ignore file locks when locking +! is disabled on a file system. +! hdferr - error code: +! 0 on success and -1 on failure +! +! AUTHOR +! Dana Robinson +! Summer 2020 +! +! Fortran2003 Interface: + SUBROUTINE h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: fapl_id + LOGICAL , INTENT(IN) :: use_file_locking + LOGICAL , INTENT(IN) :: ignore_disabled_locks + INTEGER , INTENT(OUT) :: hdferr +!***** + LOGICAL(C_BOOL) :: c_use_flag + LOGICAL(C_BOOL) :: c_ignore_flag + + INTERFACE + INTEGER FUNCTION h5pset_file_locking_c(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pset_file_locking') + IMPORT :: HID_T, C_BOOL + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id + LOGICAL(C_BOOL), INTENT(IN) :: use_file_locking + LOGICAL(C_BOOL), INTENT(IN) :: ignore_disabled_locks + END FUNCTION h5pset_file_locking_c + END INTERFACE + + ! Transfer value of Fortran LOGICAL to C C_BOOL type + c_use_flag = use_file_locking + c_ignore_flag = ignore_disabled_locks + + hdferr = INT(h5pset_file_locking_c(fapl_id, c_use_flag, c_ignore_flag)) + + END SUBROUTINE h5pset_file_locking_f + END MODULE H5P diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 695efcd..56a685e 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -481,6 +481,8 @@ H5_FCDLL int_f h5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f h5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); H5_FCDLL int_f h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); +H5_FCDLL int_f h5pset_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking); +H5_FCDLL int_f h5pget_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking); #ifdef H5_HAVE_PARALLEL H5_FCDLL int_f h5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode); H5_FCDLL int_f h5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 9c69e5a..4207239 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -339,6 +339,8 @@ H5P_mp_H5PGET_DSET_NO_ATTRS_HINT_F H5P_mp_H5PSET_DSET_NO_ATTRS_HINT_F H5P_mp_H5PSET_VOL_F H5P_mp_H5PGET_VOL_ID_F +H5P_mp_H5PSET_FILE_LOCKING_F +H5P_mp_H5PGET_FILE_LOCKING_F ; Parallel @H5_NOPAREXP@H5P_mp_H5PSET_FAPL_MPIO_F @H5_NOPAREXP@H5P_mp_H5PGET_FAPL_MPIO_F diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 1527dc2..ae1eb3d 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -6687,6 +6687,51 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) throws HDF5LibraryException; + /** + * H5Pget_use_file_locking retrieves whether we are using file locking. + * + * @param fapl_id + * IN: File access property list identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native boolean H5Pget_use_file_locking(long fapl_id) + throws HDF5LibraryException; + + /** + * H5Pget_use_file_locking retrieves whether we ignore file locks when they are disabled. + * + * @param fapl_id + * IN: File access property list identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native boolean H5Pget_ignore_disabled_file_locking(long fapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_file_locking sets parameters related to file locking. + * + * @param fapl_id + * IN: File access property list identifier + * + * @param use_file_locking + * IN: Whether the library will use file locking when opening files (mainly for SWMR semantics). + * + * @param ignore_when_disabled + * IN: Whether file locking will be ignored when disabled on a file system (useful for Lustre). + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_file_locking(long fapl_id, boolean use_file_locking, boolean ignore_when_disabled) + throws HDF5LibraryException; + // ///// unimplemented ///// // herr_t H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info); // herr_t H5Pget_vol_id(hid_t plist_id, hid_t *vol_id); diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c index 9ae8775..dbfbb5a 100644 --- a/java/src/jni/h5pFAPLImp.c +++ b/java/src/jni/h5pFAPLImp.c @@ -1377,6 +1377,78 @@ done: /* * Class: hdf_hdf5lib_H5 + * Method: H5Pset_file_locking + * Signature: (JZZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1file_1locking + (JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking, jboolean ignore_when_disabled) +{ + hbool_t use_file_locking_val = TRUE; + hbool_t ignore_when_disabled_val = TRUE; + + UNUSED(clss); + + use_file_locking_val = (use_file_locking == JNI_TRUE) ? TRUE : FALSE; + ignore_when_disabled_val = (ignore_when_disabled == JNI_TRUE) ? TRUE : FALSE; + + if (H5Pset_file_locking((hid_t)fapl_id, use_file_locking_val, ignore_when_disabled_val) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return; +} /* end Java_hdf_hdf5lib_H5_H5Pset_1file_1locking */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_use_file_locking + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking + (JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t use_file_locking_val = TRUE; + hbool_t unused = TRUE; + jboolean bval = JNI_FALSE; + + UNUSED(clss); + + if (H5Pget_file_locking((hid_t)fapl_id, &use_file_locking_val, &unused) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (use_file_locking_val == TRUE) ? JNI_TRUE : JNI_FALSE; + +done: + return bval; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_ignore_disabled_file_locking + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking + (JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t ignore_when_disabled_val = TRUE; + hbool_t unused = TRUE; + jboolean bval = JNI_FALSE; + + UNUSED(clss); + + if (H5Pget_file_locking((hid_t)fapl_id, &unused, &ignore_when_disabled_val) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (ignore_when_disabled_val == TRUE) ? JNI_TRUE : JNI_FALSE; + +done: + return bval; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking */ + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts * Signature: (JJ)V */ diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h index 9b353e6..b9b4556 100644 --- a/java/src/jni/h5pFAPLImp.h +++ b/java/src/jni/h5pFAPLImp.h @@ -392,6 +392,33 @@ Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close /* * Class: hdf_hdf5lib_H5 + * Method: H5Pset_file_locking + * Signature: (JZZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1file_1locking +(JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking, jboolean ignore_when_disabled); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_use_file_locking + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking +(JNIEnv *env, jclass clss, jlong fapl_id); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_ignore_disabled_file_locking + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking +(JNIEnv *env, jclass clss, jlong fapl_id); + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts * Signature: (JJ)V */ diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 10a79dd..4233580 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1398,4 +1398,36 @@ public class TestH5Pfapl { fail("H5P_evict_on_close: " + err); } } + + @Test + public void testH5P_file_locking() { + boolean use_file_locking = false; + boolean ignore_disabled_file_locking = false; + try { + // false values (usually not the default) + H5.H5Pset_file_locking(fapl_id, false, false); + use_file_locking = H5.H5Pget_use_file_locking(fapl_id); + ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id); + assertFalse("H5P_file_locking", use_file_locking); + assertFalse("H5P_file_locking", ignore_disabled_file_locking); + + // true values (typically the default) + H5.H5Pset_file_locking(fapl_id, true, true); + use_file_locking = H5.H5Pget_use_file_locking(fapl_id); + ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id); + assertTrue("H5P_file_locking", use_file_locking); + assertTrue("H5P_file_locking", ignore_disabled_file_locking); + } + catch (HDF5PropertyListInterfaceException err) { + // parallel is not supported + if (err.getMinorErrorNumber() != HDF5Constants.H5E_UNSUPPORTED) { + err.printStackTrace(); + fail("H5P_test_file_locking: " + err); + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_test_file_locking: " + err); + } + } } diff --git a/java/test/testfiles/JUnit-TestH5Pfapl.txt b/java/test/testfiles/JUnit-TestH5Pfapl.txt index c4f37d0..c34ac1c 100644 --- a/java/test/testfiles/JUnit-TestH5Pfapl.txt +++ b/java/test/testfiles/JUnit-TestH5Pfapl.txt @@ -28,6 +28,7 @@ JUnit version 4.11 .testH5Pset_elink_fapl .testH5P_hyper_vector_size .testH5P_gc_references +.testH5P_file_locking .testH5P_family_offset .testH5P_fapl_core .testH5P_fapl_muti @@ -37,5 +38,5 @@ JUnit version 4.11 Time: XXXX -OK (35 tests) +OK (36 tests) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b9641d1..6013603 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -330,6 +330,55 @@ New Features (ADB - 2018/07/16) + - Add file locking configure and CMake options + + HDF5 1.10.0 introduced a file locking scheme, primarily to help + enforce SWMR setup. Formerly, the only user-level control of the scheme + was via the HDF5_USE_FILE_LOCKING environment variable. + + This change introduces configure-time options that control whether + or not file locking will be used and whether or not the library + ignores errors when locking has been disabled on the file system + (useful on some HPC Lustre installations). + + In both the Autotools and CMake, the settings have the effect of changing + the default property list settings (see the H5Pset/get_file_locking() + entry, below). + + The yes/no/best-effort file locking configure setting has also been + added to the libhdf5.settings file. + + Autotools: + + An --enable-file-locking=(yes|no|best-effort) option has been added. + + yes: Use file locking. + no: Do not use file locking. + best-effort: Use file locking and ignore "disabled" errors. + + CMake: + + Two self-explanatory options have been added: + + HDF5_USE_FILE_LOCKING + HDF5_IGNORE_DISABLED_FILE_LOCKS + + Setting both of these to ON is the equivalent to the Autotools' + best-effort setting. + + NOTE: + The precedence order of the various file locking control mechanisms is: + + 1) HDF5_USE_FILE_LOCKING environment variable (highest) + + 2) H5Pset_file_locking() + + 3) configure/CMake options (which set the property list defaults) + + 4) library defaults (currently best-effort) + + (DER - 2020/07/30, HDFFV-11092) + Library: -------- @@ -507,6 +556,32 @@ New Features (DER - 2020/03/18, HDFFV-11057) + - Add BEST-EFFORT value to HDF5_USE_FILE_LOCKING environment variable + + This change adds a BEST-EFFORT to the TRUE/FALSE, 1/0 settings that + were previously accepted. This option turns on file locking but + ignores locking errors when the library detects that file locking + has been disabled on a file system (useful on some HPC Lustre + installations). + + The capitalization of BEST-EFFORT is mandatory. + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + + + - Add H5Pset/get_file_locking() API calls + + This change adds new API calls which can be used to set or get the + file locking parameters. The single API call sets both the "use file + locking" flag and the "ignore disabled file locking" flag. + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) Parallel Library: ----------------- @@ -537,11 +612,21 @@ New Features (MSB, 2019/01/08, HDFFV-10443) + - Add wrappers for H5Pset/get_file_locking() API calls + + h5pget_file_locking_f() + h5pset_file_locking_f() + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + C++ Library: ------------ - Added new wrappers for H5Pset/get_create_intermediate_group() - LinkCreatPropList::setCreateIntermediateGroup() LinkCreatPropList::getCreateIntermediateGroup() + LinkCreatPropList::setCreateIntermediateGroup() (BMR - 2019/04/22, HDFFV-10622) @@ -550,6 +635,16 @@ New Features (BMR - 2019/02/14, HDFFV-10532) + - Add wrappers for H5Pset/get_file_locking() API calls + + FileAccPropList::setFileLocking() + FileAccPropList::getFileLocking() + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + Java Library: ---------------- @@ -587,6 +682,20 @@ New Features (DER - 2018/12/08, HDFFV-10252) + - Add wrappers for H5Pset/get_file_locking() API calls + + H5Pset_file_locking() + H5Pget_use_file_locking() + H5Pget_ignore_disabled_file_locking() + + Unlike the C++ and Fortran wrappers, there are separate getters for the + two file locking settings, each of which returns a boolean value. + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + Tools: ------ diff --git a/src/H5F.c b/src/H5F.c index 9d426ac..c6db109 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -73,8 +73,6 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5F__close_cb(H5VL_object_t *file_vol_obj); - /* Callback for getting object counts in a file */ static int H5F__get_all_count_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key); @@ -86,9 +84,6 @@ static int H5F__get_all_ids_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t obj_id, void /* Package Variables */ /*********************/ -/* Package initialization variable */ -hbool_t H5_PKG_INIT_VAR = FALSE; - /*****************************/ /* Library Private Variables */ @@ -105,150 +100,6 @@ H5FL_EXTERN(H5VL_t); /* Declare a free list to manage the H5VL_object_t struct */ H5FL_EXTERN(H5VL_object_t); -/* File ID class */ -static const H5I_class_t H5I_FILE_CLS[1] = {{ - H5I_FILE, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5F__close_cb /* Callback routine for closing objects of this class */ -}}; - - - -/*------------------------------------------------------------------------- - * Function: H5F_init - * - * Purpose: Initialize the interface from some other layer. - * - * Return: Success: non-negative - * - * Failure: negative - *------------------------------------------------------------------------- - */ -herr_t -H5F_init(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - /* FUNC_ENTER() does all the work */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_init() */ - - -/*-------------------------------------------------------------------------- -NAME - H5F__init_package -- Initialize interface-specific information -USAGE - herr_t H5F__init_package() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. - ---------------------------------------------------------------------------*/ -herr_t -H5F__init_package(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* - * Initialize the atom group for the file IDs. - */ - if(H5I_register_type(H5I_FILE_CLS) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5F__init_package() */ - - -/*------------------------------------------------------------------------- - * Function: H5F_term_package - * - * Purpose: Terminate this interface: free all memory and reset global - * variables to their initial values. Release all ID groups - * associated with this interface. - * - * Return: Success: Positive if anything was done that might - * have affected other interfaces; - * zero otherwise. - * - * Failure: Never fails - * - *------------------------------------------------------------------------- - */ -int -H5F_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(H5_PKG_INIT_VAR) { - if(H5I_nmembers(H5I_FILE) > 0) { - (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); - n++; /*H5I*/ - } /* end if */ - else { - /* Make certain we've cleaned up all the shared file objects */ - H5F_sfile_assert_num(0); - - /* Destroy the file object id group */ - n += (H5I_dec_type_ref(H5I_FILE) > 0); - - /* Mark closed */ - if(0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end else */ - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5F_term_package() */ - - -/*------------------------------------------------------------------------- - * Function: H5F__close_cb - * - * Purpose: Closes a file or causes the close operation to be pended. - * This function is called from the API and gets called - * by H5Fclose->H5I_dec_ref->H5F__close_cb when H5I_dec_ref() - * decrements the file ID reference count to zero. The file ID - * is removed from the H5I_FILE group by H5I_dec_ref() just - * before H5F__close_cb() is called. If there are open object - * headers then the close is pended by moving the file to the - * H5I_FILE_CLOSING ID group (the f->closing contains the ID - * assigned to file). - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -static herr_t -H5F__close_cb(H5VL_object_t *file_vol_obj) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity check */ - HDassert(file_vol_obj); - - /* Close the file */ - if(H5VL_file_close(file_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close file") - - /* Free the VOL object */ - if(H5VL_free_object(file_vol_obj) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F__close_cb() */ /*------------------------------------------------------------------------- diff --git a/src/H5FD.c b/src/H5FD.c index 2e80c7f..edcc121 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1642,7 +1642,7 @@ H5FDlock(H5FD_t *file, hbool_t rw) /* Call private function */ if(H5FD_lock(file, rw) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file lock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "file lock request failed") done: FUNC_LEAVE_API(ret_value) @@ -1672,7 +1672,7 @@ H5FD_lock(H5FD_t *file, hbool_t rw) /* Dispatch to driver */ if(file->cls->lock && (file->cls->lock)(file, rw) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver lock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "driver lock request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1704,7 +1704,7 @@ H5FDunlock(H5FD_t *file) /* Call private function */ if(H5FD_unlock(file) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file unlock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "file unlock request failed") done: FUNC_LEAVE_API(ret_value) @@ -1733,7 +1733,7 @@ H5FD_unlock(H5FD_t *file) /* Dispatch to driver */ if(file->cls->unlock && (file->cls->unlock)(file) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver unlock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "driver unlock request failed") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 0551dd0..a20f0c1 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -36,6 +36,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_CORE_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = FAIL; + /* The skip list node type. Represents a region in the file. */ typedef struct H5FD_core_region_t { haddr_t start; /* Start address of the region */ @@ -56,6 +59,7 @@ typedef struct H5FD_core_t { hbool_t backing_store; /* write to file name on flush */ hbool_t write_tracking; /* Whether to track writes */ size_t bstore_page_size; /* backing store page size */ + hbool_t ignore_disabled_file_locks; int fd; /* backing store file descriptor */ /* Information for determining uniqueness of a file with a backing store */ #ifndef H5_HAVE_WIN32_API @@ -412,10 +416,20 @@ done: static herr_t H5FD__init_package(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT + /* Check the use disabled file locks environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE")) + ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ + if(H5FD_core_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize core VFD") @@ -798,6 +812,16 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* Save file image callbacks */ file->fi_callbacks = file_image_info.callbacks; + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != FAIL) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + /* Use the value in the property list */ + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property") + } + if(fd >= 0) { /* Retrieve information for determining uniqueness of file */ #ifdef H5_HAVE_WIN32_API @@ -1615,8 +1639,12 @@ H5FD_core_lock(H5FD_t *_file, hbool_t rw) /* Place a non-blocking lock on the file */ if(HDflock(file->fd, lock_flags | LOCK_NB) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") } /* end if */ @@ -1652,11 +1680,15 @@ H5FD_core_unlock(H5FD_t *_file) if(file->fd >= 0) { if(HDflock(file->fd, LOCK_UN) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") - } /* end if */ + } } /* end if */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 34c4346..dcd8b13 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -38,6 +38,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_DIRECT_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = FAIL; + /* File operations */ #define OP_UNKNOWN 0 #define OP_READ 1 @@ -71,6 +74,7 @@ typedef struct H5FD_direct_t { haddr_t pos; /*current file I/O position */ int op; /*last operation */ H5FD_direct_fapl_t fa; /*file access properties */ + hbool_t ignore_disabled_file_locks; #ifndef H5_HAVE_WIN32_API /* * On most systems the combination of device and i-node number uniquely @@ -193,10 +197,20 @@ DESCRIPTION static herr_t H5FD__init_package(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + /* Check the use disabled file locks environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ + if(H5FD_direct_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize direct VFD") @@ -518,6 +532,16 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd file->fa.fbsize = fa->fbsize; file->fa.cbsize = fa->cbsize; + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != FAIL) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + /* Use the value in the property list */ + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property") + } + /* Try to decide if data alignment is required. The reason to check it here * is to handle correctly the case that the file is in a different file system * than the one where the program is running. @@ -1334,17 +1358,28 @@ done: static herr_t H5FD_direct_lock(H5FD_t *_file, hbool_t rw) { - H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ - const int lock = rw ? LOCK_EX : LOCK_SH; - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ + int lock_flags; /* file locking flags */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(file); - /* Place the lock with non-blocking */ - if(HDflock(file->fd, lock | LOCK_NB) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock file") + /* Set exclusive or shared lock based on rw status */ + lock_flags = rw ? LOCK_EX : LOCK_SH; + + /* Place a non-blocking lock on the file */ + if(HDflock(file->fd, lock_flags | LOCK_NB) < 0) { + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } + else + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -1372,8 +1407,16 @@ H5FD_direct_unlock(H5FD_t *_file) HDassert(file); - if(HDflock(file->fd, LOCK_UN) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock (unlock) file") + if(HDflock(file->fd, LOCK_UN) < 0) { + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } + else + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index d110ef7..154878e 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -1372,9 +1372,9 @@ H5FD_family_lock(H5FD_t *_file, hbool_t rw) for(v = 0; v < u; v++) { if(H5FD_unlock(file->memb[v]) < 0) /* Push error, but keep going */ - HDONE_ERROR(H5E_IO, H5E_CANTUNLOCK, FAIL, "unable to unlock member files") + HDONE_ERROR(H5E_IO, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock member files") } /* end for */ - HGOTO_ERROR(H5E_IO, H5E_CANTLOCK, FAIL, "unable to lock member files") + HGOTO_ERROR(H5E_IO, H5E_CANTLOCKFILE, FAIL, "unable to lock member files") } /* end if */ done: @@ -1406,7 +1406,7 @@ H5FD_family_unlock(H5FD_t *_file) for(u = 0; u < file->nmembs; u++) if(file->memb[u]) if(H5FD_unlock(file->memb[u]) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTUNLOCK, FAIL, "unable to unlock member files") + HGOTO_ERROR(H5E_IO, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock member files") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 78b7742..af6d8e0 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -40,6 +40,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_LOG_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = FAIL; + /* Driver-specific file access properties */ typedef struct H5FD_log_fapl_t { char *logfile; /* Allocated log file name */ @@ -80,6 +83,7 @@ typedef struct H5FD_log_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ + hbool_t ignore_disabled_file_locks; char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -234,10 +238,20 @@ H5FL_DEFINE_STATIC(H5FD_log_t); static herr_t H5FD__init_package(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + /* Check the use disabled file locks environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ + if(H5FD_log_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize log VFD") @@ -625,6 +639,16 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) } /* end if */ } /* end if */ + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != FAIL) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + /* Use the value in the property list */ + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property") + } + /* Check for non-default FAPL */ if(H5P_FILE_ACCESS_DEFAULT != fapl_id) { /* This step is for h5repart tool only. If user wants to change file driver from @@ -1671,11 +1695,15 @@ H5FD_log_lock(H5FD_t *_file, hbool_t rw) /* Place a non-blocking lock on the file */ if(HDflock(file->fd, lock_flags | LOCK_NB) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") - } /* end if */ + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -1704,11 +1732,15 @@ H5FD_log_unlock(H5FD_t *_file) HDassert(file); if(HDflock(file->fd, LOCK_UN) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") - } /* end if */ + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 72f4da5..f80cac5 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1856,7 +1856,7 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) } /* end if */ if(nerrors) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error locking member files", -1) + H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTLOCKFILE, "error locking member files", -1) return 0; } /* H5FD_multi_lock() */ @@ -1893,7 +1893,7 @@ H5FD_multi_unlock(H5FD_t *_file) } END_MEMBERS; if(nerrors) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error unlocking member files", -1) + H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "error unlocking member files", -1) return 0; } /* H5FD_multi_unlock() */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 3551905..f0ce82d 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -39,6 +39,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_SEC2_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = FAIL; + /* The description of a file belonging to this driver. The 'eoa' and 'eof' * determine the amount of hdf5 address space in use and the high-water mark * of the file (the current size of the underlying filesystem file). The @@ -57,6 +60,7 @@ typedef struct H5FD_sec2_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ + hbool_t ignore_disabled_file_locks; char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -190,10 +194,20 @@ H5FL_DEFINE_STATIC(H5FD_sec2_t); static herr_t H5FD__init_package(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + /* Check the use disabled file locks environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ + if(H5FD_sec2_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize sec2 VFD") @@ -219,7 +233,7 @@ done: hid_t H5FD_sec2_init(void) { - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(H5I_INVALID_HID) @@ -316,6 +330,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif h5_stat_t sb; + H5P_genplist_t *plist; /* Property list pointer */ H5FD_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -373,17 +388,26 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->inode = sb.st_ino; #endif /* H5_HAVE_WIN32_API */ + /* Get the FAPL */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, NULL, "not a file access property list") + + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != FAIL) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + /* Use the value in the property list */ + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property") + } + /* Retain a copy of the name used to open the file, for possible error reporting */ HDstrncpy(file->filename, name, sizeof(file->filename)); file->filename[sizeof(file->filename) - 1] = '\0'; /* Check for non-default FAPL */ if(H5P_FILE_ACCESS_DEFAULT != fapl_id) { - H5P_genplist_t *plist; /* Property list pointer */ - - /* Get the FAPL */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, NULL, "not a file access property list") /* This step is for h5repart tool only. If user wants to change file driver from * family to one that uses single files (sec2, etc.) while using h5repart, this @@ -961,11 +985,15 @@ H5FD_sec2_lock(H5FD_t *_file, hbool_t rw) /* Place a non-blocking lock on the file */ if(HDflock(file->fd, lock_flags | LOCK_NB) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") - } /* end if */ + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -994,11 +1022,15 @@ H5FD_sec2_unlock(H5FD_t *_file) HDassert(file); if(HDflock(file->fd, LOCK_UN) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") - } /* end if */ + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 4ed3c4a..eb30b1f 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -1221,16 +1221,12 @@ H5FD_splitter_lock(H5FD_t *_file, hbool_t rw) HDassert(file->rw_file); /* Place the lock on each file */ - if (H5FD_lock(file->rw_file, rw) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock R/W file") - } - if (file->wo_file != NULL) { - if (H5FD_lock(file->wo_file, rw) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock", - H5E_VFL, H5E_CANTLOCK, FAIL, - "unable to lock W/O file") - } - } + if (H5FD_lock(file->rw_file, rw) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock R/W file") + + if (file->wo_file != NULL) + if (H5FD_lock(file->wo_file, rw) < 0) + H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock", H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1260,15 +1256,12 @@ H5FD_splitter_unlock(H5FD_t *_file) HDassert(file->rw_file); /* Remove the lock on each file */ - if (H5FD_unlock(file->rw_file) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock R/W file") - } - if (file->wo_file != NULL) { - if (H5FD_unlock(file->wo_file) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, - "unable to unlock W/O file") - } - } + if (H5FD_unlock(file->rw_file) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock R/W file") + + if (file->wo_file != NULL) + if (H5FD_unlock(file->wo_file) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index d29a1b4..4e9ef39 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -52,6 +52,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_STDIO_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = -1; + /* The maximum number of bytes which can be written in a single I/O operation */ static size_t H5_STDIO_MAX_IO_BYTES_g = (size_t)-1; @@ -82,6 +85,7 @@ typedef struct H5FD_stdio_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ unsigned write_access; /* Flag to indicate the file was opened with write access */ + hbool_t ignore_disabled_file_locks; H5FD_stdio_file_op op; /* last operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -231,11 +235,23 @@ static const H5FD_class_t H5FD_stdio_g = { hid_t H5FD_stdio_init(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ + /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - if (H5I_VFL!=H5Iget_type(H5FD_STDIO_g)) + /* Check the use disabled file locks environment variable */ + lock_env_var = getenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !strcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = 1; /* Override: Ignore disabled locks */ + else if(lock_env_var && !strcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + ignore_disabled_file_locks_s = 0; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = -1; /* Environment variable not set, or not set correctly */ + + if (H5I_VFL != H5Iget_type(H5FD_STDIO_g)) H5FD_STDIO_g = H5FDregister(&H5FD_stdio_g); + return H5FD_STDIO_g; } /* end H5FD_stdio_init() */ @@ -318,7 +334,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_stdio_open( const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, +H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { FILE *f = NULL; @@ -396,6 +412,21 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, file->eof = (haddr_t)x; } + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != -1) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + hbool_t unused; + + /* Use the value in the property list */ + if(H5Pget_file_locking(fapl_id, &unused, &file->ignore_disabled_file_locks) < 0) { + free(file); + fclose(f); + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTGET, "unable to get use disabled file locks property", NULL); + } + } + /* Get the file descriptor (needed for truncate and some Windows information) */ #ifdef H5_HAVE_WIN32_API file->fd = _fileno(file->fp); @@ -1104,10 +1135,13 @@ H5FD_stdio_lock(H5FD_t *_file, hbool_t rw) /* Place a non-blocking lock on the file */ if(flock(file->fd, lock_flags | LOCK_NB) < 0) { - if(ENOSYS == errno) - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FCNTL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)", -1) + if(file->ignore_disabled_file_locks && ENOSYS == errno) + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; else - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FCNTL, "file lock failed", -1) + H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTLOCKFILE, "file lock failed", -1) } /* end if */ /* Flush the stream */ @@ -1152,10 +1186,13 @@ H5FD_stdio_unlock(H5FD_t *_file) /* Place a non-blocking lock on the file */ if(flock(file->fd, LOCK_UN) < 0) { - if(ENOSYS == errno) - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FCNTL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)", -1) + if(file->ignore_disabled_file_locks && ENOSYS == errno) + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; else - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FCNTL, "file unlock failed", -1) + H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "file unlock failed", -1) } /* end if */ #endif /* H5_HAVE_FLOCK */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 0bda894..8b2d18f 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -76,12 +76,14 @@ typedef struct H5F_olist_t { /* Local Prototypes */ /********************/ +static herr_t H5F__close_cb(H5VL_object_t *file_vol_obj); static herr_t H5F__set_vol_conn(H5F_t *file); static herr_t H5F__get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); static int H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); static herr_t H5F__build_name(const char *prefix, const char *file_name, char **full_name/*out*/); static char *H5F__getenv_prefix_name(char **env_prefix/*in,out*/); static H5F_t *H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); +static herr_t H5F__check_if_using_file_locks(H5P_genplist_t *fapl, hbool_t *use_file_locking); static herr_t H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *name, char ** /*out*/ actual_name); static herr_t H5F__flush_phase1(H5F_t *f); static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing); @@ -91,6 +93,15 @@ static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + +/* Based on the value of the HDF5_USE_FILE_LOCKING environment variable. + * TRUE/FALSE have obvious meanings. FAIL means the environment variable was + * not set, so the code should ignore it and use the fapl value instead. + */ +htri_t use_locks_env_g = FAIL; + /*****************************/ /* Library Private Variables */ @@ -107,6 +118,186 @@ H5FL_DEFINE(H5F_t); /* Declare a free list to manage the H5F_shared_t struct */ H5FL_DEFINE(H5F_shared_t); +/* File ID class */ +static const H5I_class_t H5I_FILE_CLS[1] = {{ + H5I_FILE, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5F__close_cb /* Callback routine for closing objects of this class */ +}}; + + + +/*------------------------------------------------------------------------- + * Function: H5F_init + * + * Purpose: Initialize the interface from some other layer. + * + * Return: Success: non-negative + * + * Failure: negative + *------------------------------------------------------------------------- + */ +herr_t +H5F_init(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + /* FUNC_ENTER() does all the work */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_init() */ + + +/*-------------------------------------------------------------------------- +NAME + H5F__init_package -- Initialize interface-specific information +USAGE + herr_t H5F__init_package() +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. + +--------------------------------------------------------------------------*/ +herr_t +H5F__init_package(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* + * Initialize the atom group for the file IDs. + */ + if(H5I_register_type(H5I_FILE_CLS) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface") + + /* Check the file locking environment variable */ + if(H5F__parse_file_lock_env_var(&use_locks_env_g) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to parse file locking environment variable") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F__init_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_term_package + * + * Purpose: Terminate this interface: free all memory and reset global + * variables to their initial values. Release all ID groups + * associated with this interface. + * + * Return: Success: Positive if anything was done that might + * have affected other interfaces; + * zero otherwise. + * + * Failure: Never fails + * + *------------------------------------------------------------------------- + */ +int +H5F_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + if(H5I_nmembers(H5I_FILE) > 0) { + (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { + /* Make certain we've cleaned up all the shared file objects */ + H5F_sfile_assert_num(0); + + /* Destroy the file object id group */ + n += (H5I_dec_type_ref(H5I_FILE) > 0); + + /* Mark closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end else */ + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5F_term_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__close_cb + * + * Purpose: Closes a file or causes the close operation to be pended. + * This function is called from the API and gets called + * by H5Fclose->H5I_dec_ref->H5F__close_cb when H5I_dec_ref() + * decrements the file ID reference count to zero. The file ID + * is removed from the H5I_FILE group by H5I_dec_ref() just + * before H5F__close_cb() is called. If there are open object + * headers then the close is pended by moving the file to the + * H5I_FILE_CLOSING ID group (the f->closing contains the ID + * assigned to file). + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5F__close_cb(H5VL_object_t *file_vol_obj) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(file_vol_obj); + + /* Close the file */ + if(H5VL_file_close(file_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close file") + + /* Free the VOL object */ + if(H5VL_free_object(file_vol_obj) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__close_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__parse_file_lock_env_var + * + * Purpose: Parses the HDF5_USE_FILE_LOCKING environment variable. + * + * NOTE: This is done in a separate function so we can call it from + * the test code. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__parse_file_lock_env_var(htri_t *use_locks) +{ + char *lock_env_var = NULL; /* Environment variable pointer */ + + FUNC_ENTER_PACKAGE_NOERR + + /* Check the file locking environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && (!HDstrcmp(lock_env_var, "FALSE") || !HDstrcmp(lock_env_var, "0"))) + *use_locks = FALSE; /* Override: Never use locks */ + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "BEST-EFFORT") || !HDstrcmp(lock_env_var, "1"))) + *use_locks = TRUE; /* Override: Always use locks */ + else + *use_locks = FAIL; /* Environment variable not set, or not set correctly */ + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5F__parse_file_lock_env_var() */ /*------------------------------------------------------------------------- @@ -1426,6 +1617,52 @@ H5F__dest(H5F_t *f, hbool_t flush) /*------------------------------------------------------------------------- + * Function: H5F__check_if_using_file_locks + * + * Purpose: Determines if this file will use file locks. + * + * There are three ways that file locking can be controlled: + * + * 1) The configure/cmake option that sets the H5_USE_FILE_LOCKING + * symbol (which is used as the default fapl value). + * + * 2) The H5Pset_file_locking() API call, which will override + * the configuration default. + * + * 3) The HDF5_USE_FILE_LOCKING environment variable, which overrides + * everything above. + * + * The main reason to disable file locking is to prevent errors on file + * systems where locking is not supported or has been disabled (as is + * often the case in parallel file systems). + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5F__check_if_using_file_locks(H5P_genplist_t *fapl, hbool_t *use_file_locking) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Make sure the out parameter has a value */ + *use_file_locking = TRUE; + + /* Check the fapl property */ + if(H5P_get(fapl, H5F_ACS_USE_FILE_LOCKING_NAME, use_file_locking) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get use file locking flag") + + /* Check the environment variable */ + if(use_locks_env_g != FAIL) + *use_file_locking = (use_locks_env_g == TRUE) ? TRUE : FALSE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__check_if_using_file_locks() */ + + +/*------------------------------------------------------------------------- * Function: H5F_open * * Purpose: Opens (or creates) a file. This function understands the @@ -1514,8 +1751,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) hbool_t set_flag = FALSE; /*set the status_flags in the superblock */ hbool_t clear = FALSE; /*clear the status_flags */ hbool_t evict_on_close; /* evict on close value from plist */ - char *lock_env_var = NULL;/*env var pointer */ - hbool_t use_file_locking; /*read from env var */ + hbool_t use_file_locking = TRUE; /* Using file locks? */ hbool_t ci_load = FALSE; /* whether MDC ci load requested */ hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *ret_value = NULL; /*actual return value */ @@ -1533,15 +1769,13 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) if(NULL == (drvr = H5FD_get_class(fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to retrieve VFL class") - /* Check the environment variable that determines if we care - * about file locking. File locking should be used unless explicitly - * disabled. - */ - lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "FALSE")) - use_file_locking = FALSE; - else - use_file_locking = TRUE; + /* Get the file access property list, for future queries */ + if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") + + /* Check if we are using file locking */ + if (H5F__check_if_using_file_locks(a_plist, &use_file_locking) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to get file locking flag") /* * Opening a file is a two step process. First we try to open the @@ -1618,8 +1852,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) if(H5FD_lock(lf, (hbool_t)((flags & H5F_ACC_RDWR) ? TRUE : FALSE)) < 0) { /* Locking failed - Closing will remove the lock */ if(H5FD_close(lf) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to close low-level file info") - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to lock the file") + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "unable to close low-level file info") + HGOTO_ERROR(H5E_FILE, H5E_CANTLOCKFILE, NULL, "unable to lock the file") } /* end if */ /* Create the 'top' file structure */ @@ -1651,10 +1885,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) shared = file->shared; lf = shared->lf; - /* Get the file access property list, for future queries */ - if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") - /* Check if page buffering is enabled */ if(H5P_get(a_plist, H5F_ACS_PAGE_BUFFER_SIZE_NAME, &page_buf_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get page buffer size") @@ -1795,7 +2025,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) /* Remove the file lock for SWMR_WRITE */ if(use_file_locking && (H5F_INTENT(file) & H5F_ACC_SWMR_WRITE)) { if(H5FD_unlock(file->shared->lf) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to unlock the file") + HGOTO_ERROR(H5E_FILE, H5E_CANTUNLOCKFILE, NULL, "unable to unlock the file") } /* end if */ } /* end if */ else { /* H5F_ACC_RDONLY: check consistency of status_flags */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 46185ff..3a39e67 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -384,6 +384,7 @@ struct H5F_t { unsigned nmounts; /* Number of children mounted to this file */ }; + /*****************************/ /* Package Private Variables */ /*****************************/ @@ -394,6 +395,10 @@ H5FL_EXTERN(H5F_t); /* Declare a free list to manage the H5F_shared_t struct */ H5FL_EXTERN(H5F_shared_t); +/* Whether or not to use file locking (based on the environment variable) + * FAIL means ignore the environment variable. + */ +H5_DLLVAR htri_t use_locks_env_g; /******************************/ /* Package Private Prototypes */ @@ -412,6 +417,7 @@ H5_DLL herr_t H5F__start_swmr_write(H5F_t *f); H5_DLL herr_t H5F__close(H5F_t *f); H5_DLL herr_t H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high); H5_DLL herr_t H5F__get_cont_info(const H5F_t *f, H5VL_file_cont_info_t *info); +H5_DLL herr_t H5F__parse_file_lock_env_var(htri_t *use_locks); /* File mount related routines */ H5_DLL herr_t H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id); @@ -472,6 +478,7 @@ H5_DLL herr_t H5F__check_cached_stab_test(hid_t file_id); H5_DLL herr_t H5F__get_maxaddr_test(hid_t file_id, haddr_t *maxaddr); H5_DLL herr_t H5F__get_sbe_addr_test(hid_t file_id, haddr_t *sbe_addr); H5_DLL htri_t H5F__same_file_test(hid_t file_id1, hid_t file_id2); +H5_DLL herr_t H5F__reparse_file_lock_variable_test(void); #endif /* H5F_TESTING */ #endif /* _H5Fpkg_H */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index c5d4c89..5fa4f7f 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -518,6 +518,8 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_PAGE_BUFFER_SIZE_NAME "page_buffer_size" /* the maximum size for the page buffer cache */ #define H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME "page_buffer_min_meta_perc" /* the min metadata percentage for the page buffer cache */ #define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */ +#define H5F_ACS_USE_FILE_LOCKING_NAME "use_file_locking" /* whether or not we use file locks for SWMR control and to prevent multiple writers */ +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME "ignore_disabled_file_locks" /* whether or not we ignore "locks disabled" errors */ #ifdef H5_HAVE_PARALLEL #define H5F_ACS_MPI_PARAMS_COMM_NAME "mpi_params_comm" /* the MPI communicator */ #define H5F_ACS_MPI_PARAMS_INFO_NAME "mpi_params_info" /* the MPI info struct */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 49a2a22..f17af2f 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -267,3 +267,36 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__same_file_test() */ + +/*------------------------------------------------------------------------- + * Function: H5F__reparse_file_lock_variable_test + * + * Purpose: Re-parse the file locking environment variable. + * + * Since getenv(3) is fairly expensive, we only parse it once, + * when the library opens. This test function is used to + * re-parse the environment variable after we've changed it + * with setnev(3). + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Summer 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__reparse_file_lock_variable_test(void) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Check the file locking environment variable */ + if(H5F__parse_file_lock_env_var(&use_locks_env_g) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to parse file locking environment variable") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__reparse_file_lock_variable_test() */ + diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 30b590f..7b332d0 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -281,6 +281,29 @@ #define H5F_ACS_VOL_CONN_COPY H5P__facc_vol_copy #define H5F_ACS_VOL_CONN_CMP H5P__facc_vol_cmp #define H5F_ACS_VOL_CONN_CLOSE H5P__facc_vol_close +/* Definition for using file locking or not. The default is set + * via the configure step. + */ +#define H5F_ACS_USE_FILE_LOCKING_SIZE sizeof(hbool_t) +#if defined H5_USE_FILE_LOCKING && H5_USE_FILE_LOCKING +#define H5F_ACS_USE_FILE_LOCKING_DEF TRUE +#else +#define H5F_ACS_USE_FILE_LOCKING_DEF FALSE +#endif +#define H5F_ACS_USE_FILE_LOCKING_ENC H5P__encode_hbool_t +#define H5F_ACS_USE_FILE_LOCKING_DEC H5P__decode_hbool_t +/* Definition for whether we ignore file locking errors when we can + * tell that file locking has been disabled on the file system. + * The default is set via the configure step. + */ +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_SIZE sizeof(hbool_t) +#if defined H5_IGNORE_DISABLED_FILE_LOCKS && H5_IGNORE_DISABLED_FILE_LOCKS +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF TRUE +#else +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF FALSE +#endif +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_ENC H5P__encode_hbool_t +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEC H5P__decode_hbool_t /******************/ @@ -447,6 +470,8 @@ static const H5AC_cache_image_config_t H5F_def_mdc_initCacheImageCfg_g = H5F_ACS static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; /* Default page buffer size */ static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer mininum raw data size */ +static const hbool_t H5F_def_use_file_locking_g = H5F_ACS_USE_FILE_LOCKING_DEF; /* Default use file locking flag */ +static const hbool_t H5F_def_ignore_disabled_file_locks_g = H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF; /* Default ignore disabled file locks flag */ /*------------------------------------------------------------------------- @@ -705,6 +730,16 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) H5F_ACS_VOL_CONN_DEL, H5F_ACS_VOL_CONN_COPY, H5F_ACS_VOL_CONN_CMP, H5F_ACS_VOL_CONN_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the use file locking flag */ + if(H5P__register_real(pclass, H5F_ACS_USE_FILE_LOCKING_NAME, H5F_ACS_USE_FILE_LOCKING_SIZE, &H5F_def_use_file_locking_g, + NULL, NULL, NULL, H5F_ACS_USE_FILE_LOCKING_ENC, H5F_ACS_USE_FILE_LOCKING_DEC, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the ignore disabled file locks flag */ + if(H5P__register_real(pclass, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_SIZE, &H5F_def_ignore_disabled_file_locks_g, + NULL, NULL, NULL, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_ENC, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEC, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ @@ -4551,6 +4586,98 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_evict_on_close() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_file_locking + * + * Purpose: Sets the file locking property values. + * + * Overrides the default file locking flag setting that was + * set when the library was configured. + * + * Can be overridden by the HDF5_USE_FILE_LOCKING environment + * variable. + * + * File locking is used when creating/opening a file to prevent + * problematic file accesses. + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Spring 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_file_locking(hid_t fapl_id, hbool_t use_file_locking, hbool_t ignore_when_disabled) +{ + H5P_genplist_t *plist; /* property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "ibb", fapl_id, use_file_locking, ignore_when_disabled); + + /* Make sure this is a fapl */ + 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") + + /* Get the plist structure */ + 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 */ + if(H5P_set(plist, H5F_ACS_USE_FILE_LOCKING_NAME, &use_file_locking) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set use file locking property") + if(H5P_set(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &ignore_when_disabled) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set ignore disabled file locks property") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_file_locking() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_file_locking + * + * Purpose: Gets the file locking property values. + * + * File locking is used when creating/opening a file to prevent + * problematic file accesses. + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Spring 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking, hbool_t *ignore_when_disabled) +{ + H5P_genplist_t *plist; /* property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "i*b*b", fapl_id, use_file_locking, ignore_when_disabled); + + /* Make sure this is a fapl */ + if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not an access plist") + + /* Get the plist structure */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get values */ + if(H5P_get(plist, H5F_ACS_USE_FILE_LOCKING_NAME, use_file_locking) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get use file locking property") + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, ignore_when_disabled) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get ignore disabled file locks property") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_file_locking() */ + #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index bb33561..9dfa050 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -380,6 +380,8 @@ H5_DLL herr_t H5Pset_mdc_log_options(hid_t plist_id, hbool_t is_enabled, const c H5_DLL herr_t H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled, char *location, size_t *location_size, hbool_t *start_on_access); H5_DLL herr_t H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close); H5_DLL herr_t H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close); +H5_DLL herr_t H5Pset_file_locking(hid_t fapl_id, hbool_t use_file_locking, hbool_t ignore_when_disabled); +H5_DLL herr_t H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking, hbool_t *ignore_when_disabled); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5Pset_all_coll_metadata_ops(hid_t plist_id, hbool_t is_collective); H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective); diff --git a/src/H5err.txt b/src/H5err.txt index 9fec521..24ac2ac 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -136,6 +136,8 @@ MINOR, FILEACC, H5E_BADFILE, Bad file ID accessed MINOR, FILEACC, H5E_TRUNCATED, File has been truncated MINOR, FILEACC, H5E_MOUNT, File mount error MINOR, FILEACC, H5E_CANTDELETEFILE, Unable to delete file +MINOR, FILEACC, H5E_CANTLOCKFILE, Unable to lock file +MINOR, FILEACC, H5E_CANTUNLOCKFILE, Unable to unlock file # Generic low-level file I/O errors MINOR, FILE, H5E_SEEKERROR, Seek failed diff --git a/src/H5private.h b/src/H5private.h index 836d7d5..08aebdf 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -888,8 +888,8 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDflock /* NOTE: flock(2) is not present on all POSIX systems. * If it is not present, we try a flock() equivalent based on - * fcntl(2), then fall back to a function that always fails if - * it is not present at all (Windows uses a separate Wflock() + * fcntl(2), then fall back to a function that always succeeds + * if it is not present at all (Windows uses a separate Wflock() * function). */ #if defined(H5_HAVE_FLOCK) diff --git a/src/H5system.c b/src/H5system.c index b3db39c..a6a68b3 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -689,14 +689,14 @@ Pflock(int fd, int operation) { * Purpose: Wrapper function for systems where no file locking is * available. * - * Return: Failure: -1 (always fails) + * Return: 0 (success) * *------------------------------------------------------------------------- */ int H5_ATTR_CONST Nflock(int H5_ATTR_UNUSED fd, int H5_ATTR_UNUSED operation) { - /* just fail */ - return -1; + /* just succeed */ + return 0; } /* end Nflock() */ diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index fb9deec..98390b8 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -89,5 +89,6 @@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ Using memory checker: @USINGMEMCHECKER@ Memory allocation sanity checks: @MEMORYALLOCSANITYCHECK@ Function stack tracing: @CODESTACK@ + Use file locking: @DESIRED_FILE_LOCKING@ Strict file format checks: @STRICT_FORMAT_CHECKS@ Optimization instrumentation: @INSTRUMENT_LIBRARY@ diff --git a/test/h5test.c b/test/h5test.c index 1b445dd..858f30a 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2236,3 +2236,61 @@ done: return ret_value; } /* end h5_duplicate_file_by_bytes() */ +/*------------------------------------------------------------------------- + * Function: h5_check_if_file_locking_enabled + * + * Purpose: Checks if file locking is enabled on this file system. + * + * Return: SUCCEED/FAIL + * are_enabled will be FALSE if file locking is disabled on + * the file system of if there were errors. + * + *------------------------------------------------------------------------- + */ +herr_t +h5_check_if_file_locking_enabled(hbool_t *are_enabled) +{ + const char *filename = "locking_test_file"; + mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + int fd = -1; + + *are_enabled = TRUE; + + if((fd = HDcreat(filename, mode)) < 0) + goto error; + + /* Test HDflock() to see if it works */ + if(HDflock(fd, LOCK_EX | LOCK_NB) < 0) { + if(ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. This is most frequently used on + * Lustre. If we also want to check for disabled NFS locks + * we'll need to check for ENOLCK, too. That isn't done by + * default here since that could also represent an actual + * error condition. + */ + errno = 0; + *are_enabled = FALSE; + } + else + goto error; + } + if(HDflock(fd, LOCK_UN) < 0) + goto error; + + if(HDclose(fd) < 0) + goto error; + if(HDremove(filename) < 0) + goto error; + + return SUCCEED; + +error: + *are_enabled = FALSE; + if (fd > -1) { + HDclose(fd); + HDremove(filename); + } + return FAIL; +} /* end h5_check_if_file_locking_enabled() */ + diff --git a/test/h5test.h b/test/h5test.h index 3eeb1f8..697bde6 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -211,6 +211,7 @@ H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void); H5TEST_DLL const char *h5_get_version_string(H5F_libver_t libver); H5TEST_DLL int h5_compare_file_bytes(char *fname1, char *fname2); H5TEST_DLL int h5_duplicate_file_by_bytes(const char *orig, const char *dest); +H5TEST_DLL herr_t h5_check_if_file_locking_enabled(hbool_t *are_enabled); /* Functions that will replace components of a FAPL */ H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id); diff --git a/test/swmr.c b/test/swmr.c index bab91bd..a839a74 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -91,7 +91,7 @@ static int test_file_lock_concur(hid_t fapl); static int test_file_lock_swmr_concur(hid_t fapl); /* Test file lock environment variable */ -static int test_file_lock_env_var(hid_t fapl); +static int test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_override); /* Tests for SWMR VFD flag */ static int test_swmr_vfd_flag(void); @@ -4256,8 +4256,11 @@ test_file_lock_same(hid_t in_fapl) /* Output message about test being performed */ TESTING("File open with different combinations of flags--single process access"); + /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR + if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); @@ -4416,9 +4419,11 @@ test_file_lock_swmr_same(hid_t in_fapl) /* Output message about test being performed */ TESTING("File open with different combinations of flags + SWMR flags--single process access"); - /* Get a copy of the parameter in_fapl */ + /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR + if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); @@ -4726,8 +4731,11 @@ test_file_lock_concur(hid_t in_fapl) /* Output message about test being performed */ TESTING("File open with different combinations of flags--concurrent access"); + /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR + if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); @@ -5102,8 +5110,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Output message about test being performed */ TESTING("File open with different combintations of flags + SWMR flags--concurrent access"); + /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR + if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[2], fapl, filename, sizeof(filename)); @@ -5134,7 +5145,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5155,7 +5166,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5205,13 +5216,13 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Fork child process */ if((childpid = HDfork()) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; - /* Close unused write end for out_pdf */ + /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) HDexit(EXIT_FAILURE); @@ -5230,7 +5241,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5243,7 +5254,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Open the test file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Notify child process */ notify = 1; @@ -5256,7 +5267,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Wait for child process to complete */ if(HDwaitpid(childpid, &child_status, child_wait_option) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Check if child terminated normally */ if(WIFEXITED(child_status)) { @@ -5284,7 +5295,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5305,7 +5316,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5354,11 +5365,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Fork child process */ if((childpid = HDfork()) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5379,7 +5390,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5392,7 +5403,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Open the test file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR|H5F_ACC_SWMR_WRITE, fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Notify child process */ notify = 1; @@ -5405,7 +5416,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Wait for child process to complete */ if(HDwaitpid(childpid, &child_status, child_wait_option) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Check if child terminated normally */ if(WIFEXITED(child_status)) { @@ -5428,11 +5439,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Fork child process */ if((childpid = HDfork()) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5456,7 +5467,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) HDexit(EXIT_SUCCESS); } - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5469,7 +5480,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Open the test file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR|H5F_ACC_SWMR_WRITE, fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Notify child process */ notify = 1; @@ -5482,7 +5493,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Wait for child process to complete */ if(HDwaitpid(childpid, &child_status, child_wait_option) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Check if child terminated normally */ if(WIFEXITED(child_status)) { @@ -5509,7 +5520,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5530,7 +5541,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5584,7 +5595,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5598,14 +5609,14 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Open the test file */ H5E_BEGIN_TRY { - child_fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); + child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); } H5E_END_TRY; /* Should fail */ if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5659,7 +5670,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5734,7 +5745,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5812,7 +5823,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5835,7 +5846,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) HDexit(EXIT_SUCCESS); } - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5889,7 +5900,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5910,7 +5921,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5922,7 +5933,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR /* Open the test file */ - if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR /* Notify child process */ @@ -5964,7 +5975,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -6059,7 +6070,7 @@ error: ** *****************************************************************/ static int -test_file_lock_env_var(hid_t in_fapl) +test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_override) { #if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) SKIPPED(); @@ -6074,18 +6085,40 @@ test_file_lock_env_var(hid_t in_fapl) int child_wait_option=0; /* Options passed to waitpid */ int out_pdf[2]; int notify = 0; + int exit_status = 0; + herr_t ret; + + if (turn_locking_on && env_var_override) + TESTING("File locking: ON w/ env var override") + else if (turn_locking_on && !env_var_override) + TESTING("File locking: ON") + else if (!turn_locking_on && env_var_override) + TESTING("File locking: OFF w/ env var override") + else + TESTING("File locking: OFF") - - TESTING("File locking environment variable"); - - - /* Set the environment variable */ - if(HDsetenv("HDF5_USE_FILE_LOCKING", "FALSE", TRUE) < 0) + /* Copy the incoming fapl */ + if((fapl = H5Pcopy(in_fapl)) < 0) TEST_ERROR - if((fapl = H5Pcopy(in_fapl)) < 0) + /* Set locking in the fapl */ + if(H5Pset_file_locking(fapl, turn_locking_on ? TRUE : FALSE, TRUE) < 0) TEST_ERROR + /* If requested, set the environment variable */ + if (env_var_override) { + if(HDsetenv("HDF5_USE_FILE_LOCKING", turn_locking_on ? "FALSE" : "TRUE", TRUE) < 0) + TEST_ERROR + if(H5F__reparse_file_lock_variable_test() < 0) + TEST_ERROR + } + else { + if(HDsetenv("HDF5_USE_FILE_LOCKING", "", TRUE) < 0) + TEST_ERROR + if(H5F__reparse_file_lock_variable_test() < 0) + TEST_ERROR + } + /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); @@ -6097,10 +6130,8 @@ test_file_lock_env_var(hid_t in_fapl) if(H5Fclose(fid) < 0) TEST_ERROR - /* Open a file for read-only and then read-write. This would - * normally fail due to the file locking scheme but should - * pass when the environment variable is set to disable file - * locking. + /* Open a file for read-only and then read-write. This will fail + * when the locking scheme is turned on. */ /* Create 1 pipe */ @@ -6115,7 +6146,7 @@ test_file_lock_env_var(hid_t in_fapl) /* Child process */ - hid_t child_fid; /* File ID */ + hid_t child_fid = H5I_INVALID_HID; /* File ID */ int child_notify = 0; /* Close unused write end for out_pdf */ @@ -6126,18 +6157,23 @@ test_file_lock_env_var(hid_t in_fapl) while(child_notify != 1) { if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0) HDexit(EXIT_FAILURE); - } /* end while */ + } - /* Open the test file */ - if((child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) - TEST_ERROR + /* Open and close the test file */ + H5E_BEGIN_TRY { + child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); + ret = H5Fclose(child_fid); + } H5E_END_TRY; /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); - HDexit(EXIT_SUCCESS); - } /* end if */ + if(H5I_INVALID_HID == child_fid || FAIL == ret) + HDexit(EXIT_FAILURE); + else + HDexit(EXIT_SUCCESS); + } /* end child process work */ /* close unused read end for out_pdf */ if(HDclose(out_pdf[0]) < 0) @@ -6160,15 +6196,28 @@ test_file_lock_env_var(hid_t in_fapl) if(HDwaitpid(childpid, &child_status, child_wait_option) < 0) TEST_ERROR - /* Check if child terminated normally */ - if(WIFEXITED(child_status)) { - /* Check exit status of the child */ - if(WEXITSTATUS(child_status) != 0) - TEST_ERROR - } /* end if */ + /* Check exit status of the child */ + if(WIFEXITED(child_status)) + exit_status = WEXITSTATUS(child_status); else TEST_ERROR + /* The child process should have passed or failed as follows: + * + * locks on: FAIL + * locks off: PASS + * locks on, env var override: PASS + * locks off, env var override: FAIL + */ + if(turn_locking_on && !env_var_override && (0 == exit_status)) + TEST_ERROR + else if(!turn_locking_on && !env_var_override && (0 != exit_status)) + TEST_ERROR + else if(turn_locking_on && env_var_override && (0 != exit_status)) + TEST_ERROR + else if(!turn_locking_on && env_var_override && (0 == exit_status)) + TEST_ERROR + /* Close the file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -6192,7 +6241,7 @@ error: #endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */ -} /* end test_file_lock_env_var() */ +} /* end test_file_locking() */ static int @@ -7019,7 +7068,7 @@ error: H5Fclose(fid3); } H5E_END_TRY; - return -1; + return 1; } /* test_multiple_same() */ @@ -7036,6 +7085,7 @@ main(void) char *driver = NULL; /* VFD string (from env variable) */ char *lock_env_var = NULL; /* file locking env var pointer */ hbool_t use_file_locking; /* read from env var */ + hbool_t file_locking_enabled = FALSE; /* Checks if the file system supports locks */ /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. @@ -7056,6 +7106,13 @@ main(void) else use_file_locking = TRUE; + /* Check if file locking is enabled on this file system */ + if(use_file_locking) + if(h5_check_if_file_locking_enabled(&file_locking_enabled) < 0) { + HDprintf("Error when determining if file locks are enabled\n"); + return EXIT_FAILURE; + } + /* Set up */ h5_reset(); @@ -7097,7 +7154,7 @@ main(void) nerrors += test_append_flush_dataset_fixed(fapl); nerrors += test_append_flush_dataset_multiple(fapl); - if(use_file_locking) { + if(use_file_locking && file_locking_enabled) { /* * Tests for: * file open flags--single process access @@ -7127,7 +7184,12 @@ main(void) /* This test changes the HDF5_USE_FILE_LOCKING environment variable * so it should be run last. */ - nerrors += test_file_lock_env_var(fapl); + if (use_file_locking && file_locking_enabled) { + nerrors += test_file_locking(fapl, TRUE, TRUE); + nerrors += test_file_locking(fapl, TRUE, FALSE); + nerrors += test_file_locking(fapl, FALSE, TRUE); + nerrors += test_file_locking(fapl, FALSE, FALSE); + } if(nerrors) goto error; -- cgit v0.12 From 6e7199250237518a7ad8e414d7f7f236b4912175 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Aug 2020 09:35:17 -0700 Subject: Minor change to header comments in file locking C++ changes. --- c++/src/H5FaccProp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 2475cf5..ee90fa4 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -126,10 +126,10 @@ class H5_DLLCPP FileAccPropList : public PropList { // Returns garbage collecting references setting. unsigned getGcReferences() const; - // Sets file locking parameters + // Sets file locking parameters. void setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const; - // Gets file locking parameters + // Gets file locking parameters. void getFileLocking(hbool_t& use_file_locking, hbool_t& ignore_when_disabled) const; // Sets bounds on versions of library format to be used when creating -- cgit v0.12 From bd685b0e803e13a10243bd0e50fa01c5fceffc67 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Aug 2020 15:47:46 -0700 Subject: Fixed missing parens in VFDs --- src/H5FDcore.c | 2 +- src/H5FDdirect.c | 2 +- src/H5FDlog.c | 2 +- src/H5FDsec2.c | 2 +- src/H5FDstdio.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index a20f0c1..7a31fdf 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -425,7 +425,7 @@ H5FD__init_package(void) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ - else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE")) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index dcd8b13..6494fff 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -206,7 +206,7 @@ H5FD__init_package(void) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ - else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index af6d8e0..045662a 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -247,7 +247,7 @@ H5FD__init_package(void) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ - else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index f0ce82d..eee554a 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -203,7 +203,7 @@ H5FD__init_package(void) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ - else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 4e9ef39..574cd9d 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -244,7 +244,7 @@ H5FD_stdio_init(void) lock_env_var = getenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !strcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = 1; /* Override: Ignore disabled locks */ - else if(lock_env_var && !strcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + else if(lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = 0; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = -1; /* Environment variable not set, or not set correctly */ -- cgit v0.12 From b2c90cc84ec84f51233d69f5eb951d48ba20d37e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Aug 2020 18:43:19 -0700 Subject: Updated the file locking Fortran property list wrappers and added a test. --- fortran/src/H5Pf.c | 77 ---------------------------------------- fortran/src/H5Pff.F90 | 16 ++++----- fortran/src/H5f90proto.h | 2 -- fortran/test/fortranlib_test.F90 | 6 +++- fortran/test/tH5P.F90 | 73 +++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 88 deletions(-) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 9816d7b..7cb3db8 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -5241,83 +5241,6 @@ h5pget_file_image_c(hid_t_f *fapl_id, void **buf_ptr, size_t_f *buf_len_ptr) return ret_value; } -/****if* H5Pf/h5pset_file_locking_c - * NAME - * h5pset_file_locking_c - * PURPOSE - * Call H5Pset_file_locking to set file locking properties. - * INPUTS - * prp_id - file access property list identifier - * use_file_locking - TRUE/FALSE flag - * ignore_disabled_file_locking - TRUE/FALSE flag - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Dana Robinson - * Summer 2020 - * SOURCE -*/ -int_f -h5pset_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking) -/******/ -{ - int ret_value = 0; - hid_t c_prp_id = H5I_INVALID_HID; - herr_t status; - hbool_t c_use_flag = 1; - hbool_t c_ignore_flag = 1; - - if (*use_file_locking == 0) c_use_flag = 0; - if (*ignore_disabled_file_locking == 0) c_ignore_flag = 1; - - c_prp_id = (hid_t)*prp_id; - - status = H5Pset_file_locking(c_prp_id, c_use_flag, c_ignore_flag); - - if ( status < 0 ) ret_value = -1; - - return ret_value; -} - - -/****if* H5Pf/h5pget_file_locking_c - * NAME - * h5pget_file_locking_c - * PURPOSE - * Call H5Pget_file_locking to get file locking properties. - * INPUTS - * prp_id - file access property list identifier - * use_file_locking - TRUE/FALSE flag - * ignore_disabled_file_locking - TRUE/FALSE flag - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Dana Robinson - * Summer 2020 - * SOURCE -*/ -int_f -h5pget_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking) -/******/ -{ - int ret_value = 0; - hid_t c_prp_id = H5I_INVALID_HID; - hbool_t c_use_flag = 1; - hbool_t c_ignore_flag = 1; - herr_t c_ret; - - c_prp_id = (hid_t)*prp_id; - - c_ret = H5Pget_file_locking(c_prp_id, &c_use_flag, &c_ignore_flag); - - if ( c_ret < 0 ) ret_value = -1; - - *use_file_locking = (int_f)c_use_flag; - *ignore_disabled_file_locking = (int_f)c_ignore_flag; - - return ret_value; -} - #ifdef H5_HAVE_PARALLEL /****if* H5Pf/h5pset_fapl_mpio_c * NAME diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 40c4e95..38e3aac 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -8298,16 +8298,16 @@ END SUBROUTINE h5pget_virtual_dsetname_f LOGICAL(C_BOOL) :: c_ignore_flag INTERFACE - INTEGER FUNCTION h5pget_file_locking_c(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pget_file_locking') + INTEGER FUNCTION h5pget_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pget_file_locking') IMPORT :: HID_T, C_BOOL IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id LOGICAL(C_BOOL), INTENT(OUT) :: use_file_locking LOGICAL(C_BOOL), INTENT(OUT) :: ignore_disabled_locks - END FUNCTION h5pget_file_locking_c + END FUNCTION h5pget_file_locking END INTERFACE - hdferr = INT(h5pget_file_locking_c(fapl_id, c_use_flag, c_ignore_flag)) + hdferr = INT(h5pget_file_locking(fapl_id, c_use_flag, c_ignore_flag)) ! Transfer value of C C_BOOL type to Fortran LOGICAL use_file_locking = c_use_flag @@ -8348,20 +8348,20 @@ END SUBROUTINE h5pget_virtual_dsetname_f LOGICAL(C_BOOL) :: c_ignore_flag INTERFACE - INTEGER FUNCTION h5pset_file_locking_c(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pset_file_locking') + INTEGER FUNCTION h5pset_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pset_file_locking') IMPORT :: HID_T, C_BOOL IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id - LOGICAL(C_BOOL), INTENT(IN) :: use_file_locking - LOGICAL(C_BOOL), INTENT(IN) :: ignore_disabled_locks - END FUNCTION h5pset_file_locking_c + LOGICAL(C_BOOL), INTENT(IN), VALUE :: use_file_locking + LOGICAL(C_BOOL), INTENT(IN), VALUE :: ignore_disabled_locks + END FUNCTION h5pset_file_locking END INTERFACE ! Transfer value of Fortran LOGICAL to C C_BOOL type c_use_flag = use_file_locking c_ignore_flag = ignore_disabled_locks - hdferr = INT(h5pset_file_locking_c(fapl_id, c_use_flag, c_ignore_flag)) + hdferr = INT(h5pset_file_locking(fapl_id, c_use_flag, c_ignore_flag)) END SUBROUTINE h5pset_file_locking_f diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 56a685e..695efcd 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -481,8 +481,6 @@ H5_FCDLL int_f h5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f h5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); H5_FCDLL int_f h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); -H5_FCDLL int_f h5pset_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking); -H5_FCDLL int_f h5pget_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking); #ifdef H5_HAVE_PARALLEL H5_FCDLL int_f h5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode); H5_FCDLL int_f h5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index 92f9279..1fb3e68 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -183,9 +183,13 @@ PROGRAM fortranlibtest CALL write_test_status(ret_total_error, ' Multi file driver test', total_error) ret_total_error = 0 - CALL test_chunk_cache (cleanup, ret_total_error) + CALL test_chunk_cache(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error) + ret_total_error = 0 + CALL test_misc_properties(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Miscellaneous properties', total_error) + ! ! '=========================================' ! 'Testing ATTRIBUTE interface ' diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90 index 7fe3971..19bee75 100644 --- a/fortran/test/tH5P.F90 +++ b/fortran/test/tH5P.F90 @@ -724,4 +724,77 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) END SUBROUTINE test_chunk_cache +!------------------------------------------------------------------------- +! Function: test_misc_properties +! +! Purpose: Tests setting and getting of miscellaneous properties. Does +! not test the underlying functionality as that is done in +! the C library tests. +! +! Tests APIs: +! H5P_GET/SET_FILE_LOCKING_F +! +! Return: Success: 0 +! Failure: -1 +! +!------------------------------------------------------------------------- +! +SUBROUTINE test_misc_properties(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(hid_t) :: fapl_id = -1 ! Local fapl + LOGICAL :: use_file_locking ! (H5Pset/get_file_locking_f) + LOGICAL :: ignore_disabled_locks ! (H5Pset/get_file_locking_f) + INTEGER :: error + + ! Create a default fapl + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_id, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Test H5Pset/get_file_locking_f + ! true values + use_file_locking = .TRUE. + ignore_disabled_locks = .TRUE. + CALL h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pset_set_file_locking_f", error, total_error) + use_file_locking = .FALSE. + ignore_disabled_locks = .FALSE. + CALL h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pget_set_file_locking_f", error, total_error) + if(use_file_locking .neqv. .TRUE.) then + total_error = total_error + 1 + write(*,*) "Got wrong use_file_locking flag from h5pget_file_locking_f" + endif + if(ignore_disabled_locks .neqv. .TRUE.) then + total_error = total_error + 1 + write(*,*) "Got wrong ignore_disabled_locks flag from h5pget_file_locking_f" + endif + + ! false values + use_file_locking = .FALSE. + ignore_disabled_locks = .FALSE. + CALL h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pset_set_file_locking_f", error, total_error) + use_file_locking = .TRUE. + ignore_disabled_locks = .TRUE. + CALL h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pget_set_file_locking_f", error, total_error) + if(use_file_locking .neqv. .FALSE.) then + total_error = total_error + 1 + write(*,*) "Got wrong use_file_locking flag from h5pget_file_locking_f" + endif + if(ignore_disabled_locks .neqv. .FALSE.) then + total_error = total_error + 1 + write(*,*) "Got wrong ignore_disabled_locks flag from h5pget_file_locking_f" + endif + + ! Close the fapl + CALL H5Pclose_f(fapl_id, error) + CALL check("H5Pclose_f", error, total_error) + +END SUBROUTINE test_misc_properties + END MODULE TH5P -- cgit v0.12 From be02566f49f953bc80c5b5018871138e201ea633 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 4 Aug 2020 09:14:36 -0700 Subject: Fixes indenting in tools test scripts --- tools/test/h5copy/testh5copy.sh.in | 10 +- tools/test/h5diff/h5diff_plugin.sh.in | 117 +++++----- tools/test/h5diff/testh5diff.sh.in | 43 ++-- tools/test/h5dump/h5dump_plugin.sh.in | 28 +-- tools/test/h5dump/testh5dump.sh.in | 381 ++++++++++++++++---------------- tools/test/h5dump/testh5dumppbits.sh.in | 158 ++++++------- tools/test/h5dump/testh5dumpvds.sh.in | 172 +++++++------- tools/test/h5dump/testh5dumpxml.sh.in | 31 ++- tools/test/h5ls/h5ls_plugin.sh.in | 6 +- tools/test/misc/testh5mkgrp.sh.in | 91 ++++---- 10 files changed, 529 insertions(+), 508 deletions(-) diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index 2440ca4..84e3b65 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -200,6 +200,7 @@ TOOLTEST() fi runh5diff=no fi + if [ "$3" = -o ]; then outputfile=$4 else @@ -219,6 +220,7 @@ TOOLTEST() $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -268,6 +270,7 @@ TOOLTEST_PREFILL() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -282,6 +285,7 @@ TOOLTEST_PREFILL() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -313,6 +317,7 @@ TOOLTEST_SAME() else runh5diff=no fi + if [ "$3" = -o ]; then outputfile=$4 else @@ -330,6 +335,7 @@ TOOLTEST_SAME() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -344,6 +350,7 @@ TOOLTEST_SAME() $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -406,6 +413,7 @@ TOOLTEST_FAIL() if [ "$1" = -i ]; then inputfile=$2 fi + if [ "$3" = -o ]; then outputfile=$4 fi @@ -417,8 +425,8 @@ TOOLTEST_FAIL() #echo "#############################" $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr - RET=$? + # save actualout and actualerr in case they are needed later. cp $actualout $actualout_sav STDOUT_FILTER $actualout diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in index 341cba5..ffc43da 100644 --- a/tools/test/h5diff/h5diff_plugin.sh.in +++ b/tools/test/h5diff/h5diff_plugin.sh.in @@ -135,24 +135,24 @@ CLEAN_TESTFILES_AND_TESTDIR() # -h print help page while [ $# -gt 0 ]; do case "$1" in - -p) # reset the tool name and bin to run ph5diff tests - TESTNAME=ph5diff - H5DIFF=../../src/h5diff/ph5diff # The tool name - H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary - pmode=yes - shift - ;; + -p) # reset the tool name and bin to run ph5diff tests + TESTNAME=ph5diff + H5DIFF=../../src/h5diff/ph5diff # The tool name + H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary + pmode=yes + shift + ;; -h) # print help page - echo "$0 [-p] [-h]" - echo " -p run ph5diff tests" - echo " -h print help page" - shift - exit 0 - ;; + echo "$0 [-p] [-h]" + echo " -p run ph5diff tests" + echo " -h print help page" + shift + exit 0 + ;; *) # unknown option echo "$0: Unknown option ($1)" - exit 1 - ;; + exit 1 + ;; esac done @@ -218,19 +218,21 @@ TOOLTEST() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err cat $actual_err >> $actual + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -260,27 +262,29 @@ TOOLTEST() { actual_sorted=actual_sorted sort $expect -o $expect_sorted sort $actual -o $actual_sorted + # remove "EXIT CODE:" line from expect file. test for exit code # is done by serial mode. grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then @@ -306,18 +310,20 @@ TOOLTEST_ERR() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -348,23 +354,24 @@ TOOLTEST_ERR() { sort $expect_err -o $expect_sorted sort $actual_err -o $actual_sorted mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 4e622ee..9f88ee1 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -500,18 +500,20 @@ TOOLTEST() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -545,23 +547,24 @@ TOOLTEST() { # is done by serial mode. grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then diff --git a/tools/test/h5dump/h5dump_plugin.sh.in b/tools/test/h5dump/h5dump_plugin.sh.in index 6a00a16..d940ab3 100644 --- a/tools/test/h5dump/h5dump_plugin.sh.in +++ b/tools/test/h5dump/h5dump_plugin.sh.in @@ -181,8 +181,8 @@ TOOLTEST() { # Run test. TESTING $H5DUMP $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $H5DUMP_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $H5DUMP_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -192,24 +192,24 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual > /dev/null 2>&1 ; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 53c8927..b69346e 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -465,14 +465,14 @@ TESTING() { TOOLTEST() { # check if caseless compare and diff requested if [ "$1" = ignorecase ]; then - caseless="-i" - # replace cmp with diff which runs much longer. - xCMP="$DIFF -i" - shift + caseless="-i" + # replace cmp with diff which runs much longer. + xCMP="$DIFF -i" + shift else - caseless="" - # stick with faster cmp if ignorecase is not requested. - xCMP="$CMP" + caseless="" + # stick with faster cmp if ignorecase is not requested. + xCMP="$CMP" fi expect="$TESTDIR/$1" @@ -485,8 +485,8 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -495,24 +495,24 @@ TOOLTEST() { cp $actual_err $actual_err_sav STDERR_FILTER $actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $xCMP $expect $actual > /dev/null 2>&1 ; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } @@ -534,41 +534,41 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -592,56 +592,55 @@ TOOLTEST2A() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $DIFF $expectdata $actualdata; then - if [ ! -f $expectmeta ]; then - # Create the expect meta file if it doesn't yet exist. - echo " CREATED" - cp $actualmeta $expectmeta - echo " Expected metafile (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expectmeta $actualmeta; then - echo " PASSED" + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $DIFF $expectdata $actualdata; then + if [ ! -f $expectmeta ]; then + # Create the expect meta file if it doesn't yet exist. + echo " CREATED" + cp $actualmeta $expectmeta + echo " Expected metafile (*.ddl) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectmeta $actualmeta; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /' + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi - else + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err $actualmeta + rm -f $actual $actualdata $actual_err $actualmeta fi - } # same as TOOLTEST2 but only compares the generated data file to the expected data file @@ -658,28 +657,28 @@ TOOLTEST2B() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. - echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -699,8 +698,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -719,23 +718,23 @@ TOOLTEST3() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -757,8 +756,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -777,30 +776,30 @@ TOOLTEST4() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -822,8 +821,8 @@ TOOLTEST5() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -842,33 +841,33 @@ TOOLTEST5() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi - } + # ADD_HELP_TEST TOOLTEST_HELP() { @@ -880,27 +879,27 @@ TOOLTEST_HELP() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect-CREATED - echo " Expected output (*.txt) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect-CREATED + echo " Expected output (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected output (*.txt) differs from actual output (*.out)" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + echo " Expected output (*.txt) differs from actual output (*.out)" + nerrors="`expr $nerrors + 1`" fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } @@ -920,14 +919,16 @@ GREPTEST() # Run test. TESTING $DUMPER -p $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err + if [ "$txttype" = "ERRTXT" ]; then $GREP "$expectdata" $actual_err > /dev/null else $GREP "$expectdata" $actual > /dev/null fi + if [ $? -eq 0 ]; then echo " PASSED" else @@ -937,7 +938,7 @@ GREPTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } @@ -956,14 +957,16 @@ GREPTEST2() # Run test. TESTING $DUMPER -p $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err + if [ "$txttype" = "ERRTXT" ]; then $GREP "$expectdata" $actual_err > /dev/null else $GREP "$expectdata" $actual > /dev/null fi + if [ $? -eq 0 ]; then echo " PASSED" else @@ -973,21 +976,21 @@ GREPTEST2() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ + TESTING $DUMPER $@ echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -997,10 +1000,11 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -1014,8 +1018,8 @@ DIFFTEST() # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -1025,15 +1029,16 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -1138,9 +1143,9 @@ TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5 # tests for bitfields and opaque data types if test $WORDS_BIGENDIAN != "yes"; then -TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5 + TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5 else -TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5 + TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5 fi #test for the nested compound type @@ -1318,12 +1323,12 @@ TOOLTEST tallfilters.ddl --enable-error-stack -H -p -d all tfilters.h5 TOOLTEST tuserfilter.ddl --enable-error-stack -H -p -d myfilter tfilters.h5 if test $USE_FILTER_DEFLATE = "yes" ; then - # data read internal filters - TOOLTEST treadintfilter.ddl --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5 - if test $USE_FILTER_SZIP = "yes"; then - # data read - TOOLTEST treadfilter.ddl --enable-error-stack -d all -d szip tfilters.h5 - fi + # data read internal filters + TOOLTEST treadintfilter.ddl --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5 + if test $USE_FILTER_SZIP = "yes"; then + # data read + TOOLTEST treadfilter.ddl --enable-error-stack -d all -d szip tfilters.h5 + fi fi # test for displaying objects with very long names @@ -1380,9 +1385,9 @@ TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbin # Clean up binary output files if test -z "$HDF5_NOCLEANUP"; then - rm -f out[1-4].bin - rm -f out1.h5 - rm -f out3.h5 + rm -f out[1-4].bin + rm -f out1.h5 + rm -f out3.h5 fi # test for dataset region references @@ -1394,7 +1399,7 @@ TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR. # Clean up text output files if test -z "$HDF5_NOCLEANUP"; then - rm -f tbinregR.txt + rm -f tbinregR.txt fi # tests for group creation order diff --git a/tools/test/h5dump/testh5dumppbits.sh.in b/tools/test/h5dump/testh5dumppbits.sh.in index febce2c..ff0659a 100644 --- a/tools/test/h5dump/testh5dumppbits.sh.in +++ b/tools/test/h5dump/testh5dumppbits.sh.in @@ -236,26 +236,25 @@ TOOLTEST() { cp $actual_err $actual_err_sav STDERR_FILTER $actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi - } @@ -274,36 +273,36 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file @@ -328,8 +327,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -348,23 +347,23 @@ TOOLTEST3() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -385,8 +384,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -405,30 +404,30 @@ TOOLTEST4() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -442,8 +441,8 @@ SKIP() { # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -453,10 +452,11 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -470,8 +470,8 @@ DIFFTEST() # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -481,22 +481,22 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } diff --git a/tools/test/h5dump/testh5dumpvds.sh.in b/tools/test/h5dump/testh5dumpvds.sh.in index f89234e..29ff238 100644 --- a/tools/test/h5dump/testh5dumpvds.sh.in +++ b/tools/test/h5dump/testh5dumpvds.sh.in @@ -205,8 +205,8 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -216,26 +216,25 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi - } @@ -254,42 +253,42 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err cat $actual_err >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -309,8 +308,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -326,27 +325,27 @@ TOOLTEST3() { -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ - $actual_err > $actual_ext + $actual_err > $actual_ext cat $actual_ext >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -367,8 +366,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -384,47 +383,46 @@ TOOLTEST4() { -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ - $actual_err > $actual_ext + $actual_err > $actual_ext #cat $actual_ext >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi - } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ + TESTING $DUMPER $@ echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -434,25 +432,25 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -462,22 +460,22 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } @@ -491,7 +489,7 @@ COPY_TESTFILES_TO_TESTDIR ####### test for dataset vds ###### - # Data read +# Data read if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST tvds-1.ddl --enable-error-stack 1_vds.h5 TOOLTEST tvds-2.ddl --enable-error-stack 2_vds.h5 @@ -504,7 +502,7 @@ if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST vds-gap2.ddl --vds-gap-size=2 --enable-error-stack vds-eiger.h5 fi - # Layout read +# Layout read if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST tvds_layout-1.ddl -p --enable-error-stack 1_vds.h5 TOOLTEST tvds_layout-2.ddl -p --enable-error-stack 2_vds.h5 diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index f7af300..52a13c2 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -262,36 +262,35 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.xml) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.xml) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.xml) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.xml) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ - echo " -SKIP-" + TESTING $DUMPER $@ + echo " -SKIP-" } diff --git a/tools/test/h5ls/h5ls_plugin.sh.in b/tools/test/h5ls/h5ls_plugin.sh.in index c89269d..28370e6 100644 --- a/tools/test/h5ls/h5ls_plugin.sh.in +++ b/tools/test/h5ls/h5ls_plugin.sh.in @@ -139,8 +139,8 @@ CLEAN_TESTFILES_AND_TESTDIR() # Print a $* message left justified in a field of 70 characters # MESSAGE() { - SPACES=" " - echo "$* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo "$* $SPACES" | cut -c1-70 | tr -d '\012' } # Print a line-line message left justified in a field of 70 characters @@ -206,7 +206,7 @@ TOOLTEST() { echo "" fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect echo " Expected result (*.ls) missing" diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in index 3ad1f71..b08cce1 100644 --- a/tools/test/misc/testh5mkgrp.sh.in +++ b/tools/test/misc/testh5mkgrp.sh.in @@ -150,10 +150,11 @@ TOOLTEST() { TESTING $H5MKGRP $@ ( - cd $TESTDIR - $RUNSERIAL $H5MKGRP_BIN $@ + cd $TESTDIR + $RUNSERIAL $H5MKGRP_BIN $@ ) > output.out RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -164,7 +165,7 @@ TOOLTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f output.out + rm -f output.out fi fi } @@ -181,8 +182,8 @@ H5LSTEST() # any unexpected output from that stream too. VERIFY_H5LS $@ ( - cd $TESTDIR - $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ + cd $TESTDIR + $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' >$actual # save actual in case it is needed later. @@ -190,25 +191,25 @@ H5LSTEST() STDOUT_FILTER $actual STDERR_FILTER $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ls) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.ls) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_sav - fi + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ls) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_sav + fi } # Single run of tool @@ -258,30 +259,30 @@ CMPTEST() # any unexpected output from that stream too. TESTING $H5MKGRP $@ ( - cd $TESTDIR - $RUNSERIAL $H5MKGRP_BIN $@ + cd $TESTDIR + $RUNSERIAL $H5MKGRP_BIN $@ ) >$actual 2>$actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.txt) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.txt) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err - fi + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.txt) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.txt) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err + fi } ############################################################################## -- cgit v0.12 From 65e92e1d56dd2e04ebe7b7713fee9e9e38cd8849 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 17:15:57 -0700 Subject: Warning fixes in tools and h5test.c --- test/h5test.c | 23 ++++++++++++------- tools/lib/h5diff_attr.c | 49 ++++++++++++++++++++-------------------- tools/src/h5diff/h5diff_common.c | 5 +++- 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/test/h5test.c b/test/h5test.c index 1b445dd..28513b9 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2097,8 +2097,14 @@ h5_compare_file_bytes(char *f1name, char *f2name) HDrewind(f1ptr); HDrewind(f2ptr); for (ii = 0; ii < f1size; ii++) { - HDfread(&f1char, 1, 1, f1ptr); - HDfread(&f2char, 1, 1, f2ptr); + if(HDfread(&f1char, 1, 1, f1ptr) != 1) { + ret_value = -1; + goto done; + } + if(HDfread(&f2char, 1, 1, f2ptr) != 1) { + ret_value = -1; + goto done; + } if (f1char != f2char) { HDfprintf(stderr, "Mismatch @ 0x%llX: 0x%X != 0x%X\n", ii, f1char, f2char); ret_value = -1; @@ -2107,13 +2113,11 @@ h5_compare_file_bytes(char *f1name, char *f2name) } done: - if (f1ptr) { + if (f1ptr) HDfclose(f1ptr); - } - if (f2ptr) { + if (f2ptr) HDfclose(f2ptr); - } - return(ret_value); + return ret_value; } /* end h5_compare_file_bytes() */ /*------------------------------------------------------------------------- @@ -2220,7 +2224,10 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) } while (read_size > 0) { - HDfread(dup_buf, read_size, 1, orig_ptr); /* warning: no error-check */ + if(HDfread(dup_buf, read_size, 1, orig_ptr) != 1) { + ret_value = -1; + goto done; + } HDfwrite(dup_buf, read_size, 1, dest_ptr); fsize -= read_size; read_size = MIN(fsize, max_buf); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index b7ec2e8..48663e2 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -333,7 +333,7 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */ hsize_t dims2[H5S_MAX_RANK]; /* dimensions of dataset */ hsize_t nfound = 0; - int j; + size_t sz; diff_err_t ret_value = opts->err_stat; H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); @@ -384,19 +384,19 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, H5TOOLS_DEBUG("attr_names: %s - %s", name1, name2); if (name1) { - j = (int)HDstrlen(name1); - H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j); - if (j > 0) { - opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1); - HDstrncpy(opts->obj_name[0], name1, (size_t)j + 1); + sz = HDstrlen(name1); + H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); + if (sz > 0) { + opts->obj_name[0] = (char *)HDmalloc(sz + 1); + HDstrncpy(opts->obj_name[0], name1, sz + 1); } } if (name2) { - j = (int)HDstrlen(name2); - H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j); - if (j > 0) { - opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1); - HDstrncpy(opts->obj_name[1], name2, (size_t)j + 1); + sz = HDstrlen(name2); + H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); + if (sz > 0) { + opts->obj_name[1] = (char *)HDmalloc(sz + 1); + HDstrncpy(opts->obj_name[1], name2, sz + 1); } } H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); @@ -404,6 +404,9 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, /* pass dims1 and dims2 for maxdims as well since attribute's maxdims * are always same */ if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, dims1, dims2, opts, 0) == 1) { + + int j; + /*----------------------------------------------------------------- * "upgrade" the smaller memory size *------------------------------------------------------------------ @@ -461,22 +464,18 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2); if (name1) { - j = (int)HDstrlen(name1) + (int)HDstrlen(path1) + 7; - H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j); - if (j > 0) { - opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDsnprintf(opts->obj_name[0], j, "%s of <%s>", name1, path1); - opts->obj_name[0][j] = '\0'; - } + sz = HDstrlen(name1) + HDstrlen(path1) + 7; + H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); + opts->obj_name[0] = (char *)HDcalloc(sz + 1, sizeof(char)); + HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); + opts->obj_name[0][sz] = '\0'; } if (name2) { - j = (int)HDstrlen(name2) + (int)HDstrlen(path2) + 7; - H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j); - if (j > 0) { - opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDsnprintf(opts->obj_name[1], j, "%s of <%s>", name2, path2); - opts->obj_name[1][j] = '\0'; - } + sz = HDstrlen(name2) + HDstrlen(path2) + 7; + H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); + opts->obj_name[1] = (char *)HDcalloc(sz + 1, sizeof(char)); + HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); + opts->obj_name[1][sz] = '\0'; } /*--------------------------------------------------------------------- diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index a02ad5a..a4fe3bb 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -90,6 +90,7 @@ static void check_options(diff_opt_t* opts) * Return: *------------------------------------------------------------------------- */ +#if 0 static void parse_hsize_list(const char *h_list, subset_d *d) { @@ -139,6 +140,7 @@ parse_hsize_list(const char *h_list, subset_d *d) d->len = size_count; H5TOOLS_ENDDEBUG(""); } +#endif /*------------------------------------------------------------------------- * Function: parse_subset_params @@ -149,6 +151,7 @@ parse_hsize_list(const char *h_list, subset_d *d) * Failure: NULL *------------------------------------------------------------------------- */ +#if 0 static struct subset_t * parse_subset_params(const char *dset) { @@ -190,7 +193,7 @@ parse_subset_params(const char *dset) return s; } - +#endif /*------------------------------------------------------------------------- * Function: parse_command_line -- cgit v0.12 From 8e7f3e38a7a3ada0500d830df6b76b1caa31dc3d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 22:13:38 -0700 Subject: Fixes warnings in the splitter VFD and tests --- src/H5FDsplitter.c | 94 ++++++++------------ test/vfd.c | 257 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 186 insertions(+), 165 deletions(-) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 4ed3c4a..3c33f57 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -27,8 +27,6 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5FDsec2.h" /* Generic Functions */ -#include "H5FDstdio.h" /* Generic Functions */ #include "H5Pprivate.h" /* Property lists */ /* The driver identification number, initialized at runtime */ @@ -93,7 +91,7 @@ typedef struct H5FD_splitter_t { #if H5FD_SPLITTER_DEBUG_OP_CALLS #define H5FD_SPLITTER_LOG_CALL(name) do { \ HDprintf("called %s()\n", (name)); \ - fflush(stdout); \ + HDfflush(stdout); \ } while (0) #else #define H5FD_SPLITTER_LOG_CALL(name) /* no-op */ @@ -302,27 +300,22 @@ done: herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) { - H5FD_splitter_fapl_t info; + H5FD_splitter_fapl_t *info = NULL; H5P_genplist_t *plist_ptr = NULL; herr_t ret_value = SUCCEED; - H5Eclear2(H5E_DEFAULT); - FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Dr", fapl_id, vfd_config); H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter"); - if (H5FD_SPLITTER_MAGIC != vfd_config->magic) { + if (H5FD_SPLITTER_MAGIC != vfd_config->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)") - } - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) { + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invlaid config (version number mismatch)") - } - if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) { + if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid property list") - } /* Make sure that the W/O channel supports write-only capability. @@ -338,48 +331,46 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) unsigned long wo_driver_flags = 0; wo_plist_ptr = (H5P_genplist_t *)H5I_object(vfd_config->wo_fapl_id); - if (NULL == wo_plist_ptr) { + if (NULL == wo_plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) { + if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info") - } wo_driver = (H5FD_class_t *)H5I_object(wo_driver_prop.driver_id); - if (NULL == wo_driver) { + if (NULL == wo_driver) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list") - } - if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) { + if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't query VFD flags") - } - if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) { + if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unsuitable W/O driver") - } } /* end if W/O VFD is non-default */ + if (NULL == (info = H5MM_calloc(sizeof(H5FD_splitter_fapl_t)))) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "can't allocate memory for splitter struct") - info.ignore_wo_errs = vfd_config->ignore_wo_errs; - HDstrncpy(info.wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); - HDstrncpy(info.log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); - info.rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ - info.wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info->ignore_wo_errs = vfd_config->ignore_wo_errs; + HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); + info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ /* Set non-default channel FAPL IDs in splitter configuration info */ if (H5P_DEFAULT != vfd_config->rw_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) { + if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - info.rw_fapl_id = vfd_config->rw_fapl_id; + info->rw_fapl_id = vfd_config->rw_fapl_id; } if (H5P_DEFAULT != vfd_config->wo_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) { + if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - info.wo_fapl_id = vfd_config->wo_fapl_id; + info->wo_fapl_id = vfd_config->wo_fapl_id; } - ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, &info); + if(H5P_set_driver(plist_ptr, H5FD_SPLITTER, info) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set driver") done: + H5MM_xfree(info); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_fapl_splitter() */ @@ -409,45 +400,36 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out) H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter"); /* Check arguments */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) { + if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (config_out == NULL) { + if (config_out == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null") - } - if (H5FD_SPLITTER_MAGIC != config_out->magic) { + if (H5FD_SPLITTER_MAGIC != config_out->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)") - } - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) { + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)") - } /* Pre-set out FAPL IDs with intent to replace these values */ config_out->rw_fapl_id = H5I_INVALID_HID; config_out->wo_fapl_id = H5I_INVALID_HID; /* Check and get the splitter fapl */ - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) { + if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) { - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") - } - if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) { - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info") - } + if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "incorrect VFL driver") + if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to get specific-driver info") HDstrncpy(config_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL"); - } - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL"); - } + if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy R/W FAPL"); + if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy W/O FAPL"); done: FUNC_LEAVE_API(ret_value) diff --git a/test/vfd.c b/test/vfd.c index bb04e97..09ef106 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -2258,46 +2258,51 @@ static int compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info) { int ret_value = 0; - H5FD_splitter_vfd_config_t fetched_info; + H5FD_splitter_vfd_config_t *fetched_info = NULL; - fetched_info.magic = H5FD_SPLITTER_MAGIC; - fetched_info.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - fetched_info.rw_fapl_id = H5I_INVALID_HID; - fetched_info.wo_fapl_id = H5I_INVALID_HID; + if (NULL == (fetched_info = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + SPLITTER_TEST_FAULT("memory allocation for fetched_info struct failed"); - if (H5Pget_fapl_splitter(fapl_id, &fetched_info) < 0) { - SPLITTER_TEST_FAULT("can't get splitter info\n"); + fetched_info->magic = H5FD_SPLITTER_MAGIC; + fetched_info->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + fetched_info->rw_fapl_id = H5I_INVALID_HID; + fetched_info->wo_fapl_id = H5I_INVALID_HID; + + if (H5Pget_fapl_splitter(fapl_id, fetched_info) < 0) { + SPLITTER_TEST_FAULT("can't get splitter info"); } if (info->rw_fapl_id == H5P_DEFAULT) { - if (H5Pget_driver(fetched_info.rw_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) { + if (H5Pget_driver(fetched_info->rw_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) { SPLITTER_TEST_FAULT("Read-Write driver mismatch (default)\n"); } } else { - if (H5Pget_driver(fetched_info.rw_fapl_id) != H5Pget_driver(info->rw_fapl_id)) { + if (H5Pget_driver(fetched_info->rw_fapl_id) != H5Pget_driver(info->rw_fapl_id)) { SPLITTER_TEST_FAULT("Read-Write driver mismatch\n"); } } if (info->wo_fapl_id == H5P_DEFAULT) { - if (H5Pget_driver(fetched_info.wo_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) { + if (H5Pget_driver(fetched_info->wo_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) { SPLITTER_TEST_FAULT("Write-Only driver mismatch (default)\n"); } } else { - if (H5Pget_driver(fetched_info.wo_fapl_id) != H5Pget_driver(info->wo_fapl_id)) { + if (H5Pget_driver(fetched_info->wo_fapl_id) != H5Pget_driver(info->wo_fapl_id)) { SPLITTER_TEST_FAULT("Write-Only driver mismatch\n"); } } - if ( (HDstrlen(info->wo_path) != HDstrlen(fetched_info.wo_path)) || - HDstrncmp(info->wo_path, fetched_info.wo_path, H5FD_SPLITTER_PATH_MAX)) + if ( (HDstrlen(info->wo_path) != HDstrlen(fetched_info->wo_path)) || + HDstrncmp(info->wo_path, fetched_info->wo_path, H5FD_SPLITTER_PATH_MAX)) { - HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info.wo_path); + HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info->wo_path); HEXPRINT(H5FD_SPLITTER_PATH_MAX, info->wo_path); - HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info.wo_path); + HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info->wo_path); SPLITTER_TEST_FAULT("Write-Only file path mismatch\n"); } done: + HDfree(fetched_info); + return ret_value; } /* end compare_splitter_config_info() */ @@ -2331,37 +2336,42 @@ run_splitter_test(const struct splitter_dataset_def *data, hid_t space_id = H5I_INVALID_HID; hid_t fapl_id_out = H5I_INVALID_HID; hid_t fapl_id_cpy = H5I_INVALID_HID; - H5FD_splitter_vfd_config_t vfd_config; - char filename_rw[H5FD_SPLITTER_PATH_MAX + 1]; + H5FD_splitter_vfd_config_t *vfd_config = NULL; + char *filename_rw = NULL; FILE *logfile = NULL; int ret_value = 0; - vfd_config.magic = H5FD_SPLITTER_MAGIC; - vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - vfd_config.ignore_wo_errs = ignore_wo_errors; - vfd_config.rw_fapl_id = sub_fapl_ids[0]; - vfd_config.wo_fapl_id = sub_fapl_ids[1]; + if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); + if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); + + vfd_config->magic = H5FD_SPLITTER_MAGIC; + vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + vfd_config->ignore_wo_errs = ignore_wo_errors; + vfd_config->rw_fapl_id = sub_fapl_ids[0]; + vfd_config->wo_fapl_id = sub_fapl_ids[1]; - if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) { + if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) { SPLITTER_TEST_FAULT("can't prepare file paths\n"); } if (provide_logfile_path == FALSE) { - *vfd_config.log_file_path = '\0'; /* reset as empty string */ + vfd_config->log_file_path[0] = '\0'; /* reset as empty string */ } /* Create a new fapl to use the SPLITTER file driver */ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) { SPLITTER_TEST_FAULT("can't create FAPL ID\n"); } - if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) { + if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) { SPLITTER_TEST_FAULT("can't set splitter FAPL\n"); } if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) { SPLITTER_TEST_FAULT("set FAPL not SPLITTER\n"); } - if (compare_splitter_config_info(fapl_id, &vfd_config) < 0) { + if (compare_splitter_config_info(fapl_id, vfd_config) < 0) { SPLITTER_TEST_FAULT("information mismatch\n"); } @@ -2374,7 +2384,7 @@ run_splitter_test(const struct splitter_dataset_def *data, if (H5I_INVALID_HID == fapl_id_cpy) { SPLITTER_TEST_FAULT("can't copy FAPL\n"); } - if (compare_splitter_config_info(fapl_id_cpy, &vfd_config) < 0) { + if (compare_splitter_config_info(fapl_id_cpy, vfd_config) < 0) { SPLITTER_TEST_FAULT("information mismatch\n"); } if (H5Pclose(fapl_id_cpy) < 0) { @@ -2401,7 +2411,7 @@ run_splitter_test(const struct splitter_dataset_def *data, if (H5Pget_driver(fapl_id_out) != H5FD_SPLITTER) { SPLITTER_TEST_FAULT("wrong file FAPL driver\n"); } - if (compare_splitter_config_info(fapl_id_out, &vfd_config) < 0) { + if (compare_splitter_config_info(fapl_id_out, vfd_config) < 0) { SPLITTER_TEST_FAULT("information mismatch\n"); } if (H5Pclose(fapl_id_out) < 0) { @@ -2439,12 +2449,12 @@ run_splitter_test(const struct splitter_dataset_def *data, } /* Verify that the R/W and W/O files are identical */ - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { + if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } /* Verify existence of logfile iff appropriate */ - logfile = fopen(vfd_config.log_file_path, "r"); + logfile = fopen(vfd_config->log_file_path, "r"); if ( (TRUE == provide_logfile_path && NULL == logfile) || (FALSE == provide_logfile_path && NULL != logfile) ) { @@ -2454,19 +2464,22 @@ run_splitter_test(const struct splitter_dataset_def *data, done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Dclose(dset_id); - (void)H5Sclose(space_id); - (void)H5Pclose(fapl_id_out); - (void)H5Pclose(fapl_id_cpy); - (void)H5Pclose(fapl_id); - (void)H5Fclose(file_id); + H5Dclose(dset_id); + H5Sclose(space_id); + H5Pclose(fapl_id_out); + H5Pclose(fapl_id_cpy); + H5Pclose(fapl_id); + H5Fclose(file_id); } H5E_END_TRY; } - if (logfile != NULL) { + + if (logfile != NULL) fclose(logfile); - } - return ret_value; + HDfree(vfd_config); + HDfree(filename_rw); + + return ret_value; } /* end run_splitter_test() */ @@ -2488,25 +2501,28 @@ done: static int driver_is_splitter_compatible(hid_t fapl_id) { - H5FD_splitter_vfd_config_t vfd_config; + H5FD_splitter_vfd_config_t *vfd_config = NULL; hid_t split_fapl_id = H5I_INVALID_HID; herr_t ret = SUCCEED; int ret_value = 0; - split_fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if (H5I_INVALID_HID == split_fapl_id) { + if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) { + FAIL_PUTS_ERROR("memory allocation for vfd_config struct failed"); + } + + if(H5I_INVALID_HID == (split_fapl_id = H5Pcreate(H5P_FILE_ACCESS))) { FAIL_PUTS_ERROR("Can't create contained FAPL"); } - vfd_config.magic = H5FD_SPLITTER_MAGIC; - vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - vfd_config.ignore_wo_errs = FALSE; - vfd_config.rw_fapl_id = H5P_DEFAULT; - vfd_config.wo_fapl_id = fapl_id; - HDstrncpy(vfd_config.wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX); - *vfd_config.log_file_path = '\0'; + vfd_config->magic = H5FD_SPLITTER_MAGIC; + vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + vfd_config->ignore_wo_errs = FALSE; + vfd_config->rw_fapl_id = H5P_DEFAULT; + vfd_config->wo_fapl_id = fapl_id; + HDstrncpy(vfd_config->wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX); + vfd_config->log_file_path[0] = '\0'; H5E_BEGIN_TRY { - ret = H5Pset_fapl_splitter(split_fapl_id, &vfd_config); + ret = H5Pset_fapl_splitter(split_fapl_id, vfd_config); } H5E_END_TRY; if (SUCCEED == ret) { ret_value = -1; @@ -2517,12 +2533,17 @@ driver_is_splitter_compatible(hid_t fapl_id) } split_fapl_id = H5I_INVALID_HID; + HDfree(vfd_config); + return ret_value; error: H5E_BEGIN_TRY { - (void)H5Pclose(split_fapl_id); + H5Pclose(split_fapl_id); } H5E_END_TRY; + + HDfree(vfd_config); + return -1; } /* end driver_is_splitter_compatible() */ @@ -2545,19 +2566,24 @@ splitter_RO_test( const struct splitter_dataset_def *data, hid_t child_fapl_id) { - char filename_rw[H5FD_SPLITTER_PATH_MAX + 1]; - H5FD_splitter_vfd_config_t vfd_config; + char *filename_rw = NULL; + H5FD_splitter_vfd_config_t *vfd_config = NULL; hid_t fapl_id = H5I_INVALID_HID; - int ret_value = 0; hid_t file_id = H5I_INVALID_HID; + int ret_value = 0; - vfd_config.magic = H5FD_SPLITTER_MAGIC; - vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - vfd_config.ignore_wo_errs = FALSE; - vfd_config.rw_fapl_id = child_fapl_id; - vfd_config.wo_fapl_id = child_fapl_id; + if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); + if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); - if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) { + vfd_config->magic = H5FD_SPLITTER_MAGIC; + vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + vfd_config->ignore_wo_errs = FALSE; + vfd_config->rw_fapl_id = child_fapl_id; + vfd_config->wo_fapl_id = child_fapl_id; + + if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) { SPLITTER_TEST_FAULT("can't prepare splitter file paths\n"); } @@ -2566,7 +2592,7 @@ splitter_RO_test( if (H5I_INVALID_HID == fapl_id) { SPLITTER_TEST_FAULT("can't create FAPL ID\n"); } - if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) { + if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) { SPLITTER_TEST_FAULT("can't set splitter FAPL\n"); } if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) { @@ -2588,7 +2614,7 @@ splitter_RO_test( * Should fail. */ - if (splitter_create_single_file_at(vfd_config.wo_path, vfd_config.wo_fapl_id, data) < 0) { + if (splitter_create_single_file_at(vfd_config->wo_path, vfd_config->wo_fapl_id, data) < 0) { SPLITTER_TEST_FAULT("can't write W/O file\n"); } H5E_BEGIN_TRY { @@ -2597,13 +2623,13 @@ splitter_RO_test( if (file_id >= 0) { SPLITTER_TEST_FAULT("R/O open with extant W/O file unexpectedly successful\n"); } - HDremove(vfd_config.wo_path); + HDremove(vfd_config->wo_path); /* Attempt R/O open when only R/W file exists * Should fail. */ - if (splitter_create_single_file_at(filename_rw, vfd_config.rw_fapl_id, data) < 0) { + if (splitter_create_single_file_at(filename_rw, vfd_config->rw_fapl_id, data) < 0) { SPLITTER_TEST_FAULT("can't create R/W file\n"); } H5E_BEGIN_TRY { @@ -2616,7 +2642,7 @@ splitter_RO_test( /* Attempt R/O open when both R/W and W/O files exist */ - if (splitter_create_single_file_at(vfd_config.wo_path, vfd_config.wo_fapl_id, data) < 0) { + if (splitter_create_single_file_at(vfd_config->wo_path, vfd_config->wo_fapl_id, data) < 0) { SPLITTER_TEST_FAULT("can't create W/O file\n"); } file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); @@ -2642,10 +2668,14 @@ splitter_RO_test( done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Pclose(fapl_id); - (void)H5Fclose(file_id); + H5Pclose(fapl_id); + H5Fclose(file_id); } H5E_END_TRY; - } /* end if error */ + } + + HDfree(vfd_config); + HDfree(filename_rw); + return ret_value; } /* end splitter_RO_test() */ @@ -2784,9 +2814,9 @@ splitter_create_single_file_at( done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Dclose(dset_id); - (void)H5Sclose(space_id); - (void)H5Fclose(file_id); + H5Dclose(dset_id); + H5Sclose(space_id); + H5Fclose(file_id); } H5E_END_TRY; } /* end if error */ return ret_value; @@ -2847,7 +2877,7 @@ splitter_compare_expected_data(hid_t file_id, done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Dclose(dset_id); + H5Dclose(dset_id); } H5E_END_TRY; } return ret_value; @@ -2880,9 +2910,9 @@ done: static int splitter_tentative_open_test(hid_t child_fapl_id) { - const char filename_tmp[H5FD_SPLITTER_PATH_MAX + 1] = "splitter_tmp.h5"; - char filename_rw[H5FD_SPLITTER_PATH_MAX + 1]; - H5FD_splitter_vfd_config_t vfd_config; + const char *filename_tmp = "splitter_tmp.h5"; + char *filename_rw = NULL; + H5FD_splitter_vfd_config_t *vfd_config = NULL; hid_t fapl_id = H5I_INVALID_HID; hid_t file_id = H5I_INVALID_HID; int buf[SPLITTER_SIZE][SPLITTER_SIZE]; /* for comparison */ @@ -2892,6 +2922,11 @@ splitter_tentative_open_test(hid_t child_fapl_id) struct splitter_dataset_def data; /* for comparison */ int ret_value = 0; + if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); + if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); + /* pre-fill data buffer to write */ for (i=0; i < SPLITTER_SIZE; i++) { for (j=0; j < SPLITTER_SIZE; j++) { @@ -2906,13 +2941,13 @@ splitter_tentative_open_test(hid_t child_fapl_id) data.n_dims = 2; data.dset_name = SPLITTER_DATASET_NAME; - vfd_config.magic = H5FD_SPLITTER_MAGIC; - vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - vfd_config.ignore_wo_errs = FALSE; - vfd_config.rw_fapl_id = child_fapl_id; - vfd_config.wo_fapl_id = child_fapl_id; + vfd_config->magic = H5FD_SPLITTER_MAGIC; + vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + vfd_config->ignore_wo_errs = FALSE; + vfd_config->rw_fapl_id = child_fapl_id; + vfd_config->wo_fapl_id = child_fapl_id; - if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) { + if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) { SPLITTER_TEST_FAULT("can't prepare splitter file paths\n"); } @@ -2920,7 +2955,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) { SPLITTER_TEST_FAULT("can't create FAPL ID\n"); } - if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) { + if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) { SPLITTER_TEST_FAULT("can't set splitter FAPL\n"); } if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) { @@ -2950,7 +2985,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file unexpectedly created\n"); } - if (file_exists(vfd_config.wo_path, child_fapl_id)) { + if (file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file unexpectedly created\n"); } @@ -2960,7 +2995,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) * Should fail. */ - if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } H5E_BEGIN_TRY { @@ -2972,11 +3007,11 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file unexpectedly created\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - HDremove(vfd_config.wo_path); - if (file_exists(vfd_config.wo_path, child_fapl_id)) { + HDremove(vfd_config->wo_path); + if (file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("failed to remove W/O file\n"); } @@ -2998,7 +3033,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappeared\n"); } - if (file_exists(vfd_config.wo_path, child_fapl_id)) { + if (file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file unexpectedly created\n"); } @@ -3007,7 +3042,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) * Both files present. */ - if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); @@ -3021,7 +3056,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } @@ -3041,14 +3076,14 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { + if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } HDremove(filename_rw); - HDremove(vfd_config.wo_path); + HDremove(vfd_config->wo_path); /* * H5Fcreate() with TRUNC access. @@ -3058,7 +3093,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (h5_duplicate_file_by_bytes(filename_tmp, filename_rw) < 0) { SPLITTER_TEST_FAULT("Can't create R/W file copy.\n"); } - if (file_exists(vfd_config.wo_path, child_fapl_id)) { + if (file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("failed to remove W/O file\n"); } file_id = H5Fcreate(filename_rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); @@ -3072,21 +3107,21 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { + if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } HDremove(filename_rw); - HDremove(vfd_config.wo_path); + HDremove(vfd_config->wo_path); /* * H5Fcreate() with TRUNC access. * Only W/O present. */ - if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } if (file_exists(filename_rw, child_fapl_id)) { @@ -3103,14 +3138,14 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { + if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } HDremove(filename_rw); - HDremove(vfd_config.wo_path); + HDremove(vfd_config->wo_path); /* H5Fcreate with both files absent is tested elsewhere */ @@ -3125,10 +3160,14 @@ splitter_tentative_open_test(hid_t child_fapl_id) done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Pclose(fapl_id); - (void)H5Fclose(file_id); + H5Pclose(fapl_id); + H5Fclose(file_id); } H5E_END_TRY; - } /* end if error */ + } + + HDfree(vfd_config); + HDfree(filename_rw); + return ret_value; } /* end splitter_tentative_open_test() */ @@ -3165,7 +3204,7 @@ file_exists(const char *filename, hid_t fapl_id) error: H5E_BEGIN_TRY { - (void)H5Fclose(file_id); + H5Fclose(file_id); } H5E_END_TRY; return ret_value; } /* end file_exists() */ @@ -3272,9 +3311,9 @@ test_splitter(void) return 0; error: - if (child_fapl_id != H5I_INVALID_HID) { - (void)H5Pclose(child_fapl_id); - } + if (child_fapl_id != H5I_INVALID_HID) + H5Pclose(child_fapl_id); + return -1; } /* end test_splitter() */ @@ -3317,7 +3356,7 @@ main(void) HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); return EXIT_FAILURE; - } /* end if */ + } HDprintf("All Virtual File Driver tests passed.\n"); -- cgit v0.12 From e327843f7af9857bdd4b560cd47ca3afe52bb74c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 22:51:34 -0700 Subject: Adds -Wnull-dereference to the warnings we ignore in flex/bison generated code (that we have no control over). --- hl/src/H5LTanalyze.c | 1163 +++++++++++++++++++++++++----------------- hl/src/H5LTanalyze.l | 7 + hl/src/H5LTparse.c | 1368 ++++++++++++++++++++++---------------------------- hl/src/H5LTparse.h | 155 +++--- 4 files changed, 1392 insertions(+), 1301 deletions(-) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index c05db67..e5f0bea 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -1,25 +1,25 @@ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wnested-externs" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wstrict-overflow" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#pragma GCC diagnostic ignored "-Wswitch-default" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-macros" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined __SUNPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-overflow" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif #line 2 "hl/src/H5LTanalyze.c" #line 4 "hl/src/H5LTanalyze.c" @@ -30,11 +30,17 @@ #define yy_create_buffer H5LTyy_create_buffer #define yy_delete_buffer H5LTyy_delete_buffer -#define yy_flex_debug H5LTyy_flex_debug +#define yy_scan_buffer H5LTyy_scan_buffer +#define yy_scan_string H5LTyy_scan_string +#define yy_scan_bytes H5LTyy_scan_bytes #define yy_init_buffer H5LTyy_init_buffer #define yy_flush_buffer H5LTyy_flush_buffer #define yy_load_buffer_state H5LTyy_load_buffer_state #define yy_switch_to_buffer H5LTyy_switch_to_buffer +#define yypush_buffer_state H5LTyypush_buffer_state +#define yypop_buffer_state H5LTyypop_buffer_state +#define yyensure_buffer_stack H5LTyyensure_buffer_stack +#define yy_flex_debug H5LTyy_flex_debug #define yyin H5LTyyin #define yyleng H5LTyyleng #define yylex H5LTyylex @@ -49,12 +55,246 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define H5LTyy_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer H5LTyy_create_buffer +#endif + +#ifdef yy_delete_buffer +#define H5LTyy_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer H5LTyy_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define H5LTyy_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer H5LTyy_scan_buffer +#endif + +#ifdef yy_scan_string +#define H5LTyy_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string H5LTyy_scan_string +#endif + +#ifdef yy_scan_bytes +#define H5LTyy_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes H5LTyy_scan_bytes +#endif + +#ifdef yy_init_buffer +#define H5LTyy_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer H5LTyy_init_buffer +#endif + +#ifdef yy_flush_buffer +#define H5LTyy_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer H5LTyy_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define H5LTyy_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state H5LTyy_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define H5LTyy_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer H5LTyy_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define H5LTyypush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state H5LTyypush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define H5LTyypop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state H5LTyypop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define H5LTyyensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack H5LTyyensure_buffer_stack +#endif + +#ifdef yylex +#define H5LTyylex_ALREADY_DEFINED +#else +#define yylex H5LTyylex +#endif + +#ifdef yyrestart +#define H5LTyyrestart_ALREADY_DEFINED +#else +#define yyrestart H5LTyyrestart +#endif + +#ifdef yylex_init +#define H5LTyylex_init_ALREADY_DEFINED +#else +#define yylex_init H5LTyylex_init +#endif + +#ifdef yylex_init_extra +#define H5LTyylex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra H5LTyylex_init_extra +#endif + +#ifdef yylex_destroy +#define H5LTyylex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy H5LTyylex_destroy +#endif + +#ifdef yyget_debug +#define H5LTyyget_debug_ALREADY_DEFINED +#else +#define yyget_debug H5LTyyget_debug +#endif + +#ifdef yyset_debug +#define H5LTyyset_debug_ALREADY_DEFINED +#else +#define yyset_debug H5LTyyset_debug +#endif + +#ifdef yyget_extra +#define H5LTyyget_extra_ALREADY_DEFINED +#else +#define yyget_extra H5LTyyget_extra +#endif + +#ifdef yyset_extra +#define H5LTyyset_extra_ALREADY_DEFINED +#else +#define yyset_extra H5LTyyset_extra +#endif + +#ifdef yyget_in +#define H5LTyyget_in_ALREADY_DEFINED +#else +#define yyget_in H5LTyyget_in +#endif + +#ifdef yyset_in +#define H5LTyyset_in_ALREADY_DEFINED +#else +#define yyset_in H5LTyyset_in +#endif + +#ifdef yyget_out +#define H5LTyyget_out_ALREADY_DEFINED +#else +#define yyget_out H5LTyyget_out +#endif + +#ifdef yyset_out +#define H5LTyyset_out_ALREADY_DEFINED +#else +#define yyset_out H5LTyyset_out +#endif + +#ifdef yyget_leng +#define H5LTyyget_leng_ALREADY_DEFINED +#else +#define yyget_leng H5LTyyget_leng +#endif + +#ifdef yyget_text +#define H5LTyyget_text_ALREADY_DEFINED +#else +#define yyget_text H5LTyyget_text +#endif + +#ifdef yyget_lineno +#define H5LTyyget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno H5LTyyget_lineno +#endif + +#ifdef yyset_lineno +#define H5LTyyset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno H5LTyyset_lineno +#endif + +#ifdef yywrap +#define H5LTyywrap_ALREADY_DEFINED +#else +#define yywrap H5LTyywrap +#endif + +#ifdef yyalloc +#define H5LTyyalloc_ALREADY_DEFINED +#else +#define yyalloc H5LTyyalloc +#endif + +#ifdef yyrealloc +#define H5LTyyrealloc_ALREADY_DEFINED +#else +#define yyrealloc H5LTyyrealloc +#endif + +#ifdef yyfree +#define H5LTyyfree_ALREADY_DEFINED +#else +#define yyfree H5LTyyfree +#endif + +#ifdef yytext +#define H5LTyytext_ALREADY_DEFINED +#else +#define yytext H5LTyytext +#endif + +#ifdef yyleng +#define H5LTyyleng_ALREADY_DEFINED +#else +#define yyleng H5LTyyleng +#endif + +#ifdef yyin +#define H5LTyyin_ALREADY_DEFINED +#else +#define yyin H5LTyyin +#endif + +#ifdef yyout +#define H5LTyyout_ALREADY_DEFINED +#else +#define yyout H5LTyyout +#endif + +#ifdef yy_flex_debug +#define H5LTyy_flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug H5LTyy_flex_debug +#endif + +#ifdef yylineno +#define H5LTyylineno_ALREADY_DEFINED +#else +#define yylineno H5LTyylineno +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -75,7 +315,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -92,7 +332,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -125,65 +365,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +/* begin standard C++ headers. */ -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE H5LTyyrestart(H5LTyyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -200,30 +436,30 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t H5LTyyleng; +extern int yyleng; -extern FILE *H5LTyyin, *H5LTyyout; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up H5LTyytext. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up H5LTyytext again */ \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -238,12 +474,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -283,8 +519,8 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via H5LTyyrestart()), so that the user can continue scanning by - * just pointing H5LTyyin at a new input file. + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -294,7 +530,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -305,103 +541,98 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when H5LTyytext is formed. */ +/* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t H5LTyyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow H5LTyywrap()'s to do buffer switches - * instead of setting up a fresh H5LTyyin. A bit of a hack ... +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void H5LTyyrestart (FILE *input_file ); -void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE H5LTyy_create_buffer (FILE *file,int size ); -void H5LTyy_delete_buffer (YY_BUFFER_STATE b ); -void H5LTyy_flush_buffer (YY_BUFFER_STATE b ); -void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void H5LTyypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -static void H5LTyyensure_buffer_stack (void ); -static void H5LTyy_load_buffer_state (void ); -static void H5LTyy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER H5LTyy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE H5LTyy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE H5LTyy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *H5LTyyalloc (yy_size_t ); -void *H5LTyyrealloc (void *,yy_size_t ); -void H5LTyyfree (void * ); - -#define yy_new_buffer H5LTyy_create_buffer +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - H5LTyyensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - H5LTyyensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *H5LTyyin = (FILE *) 0, *H5LTyyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int H5LTyylineno; +extern int yylineno; +int yylineno = 1; -int H5LTyylineno = 1; - -extern char *H5LTyytext; -#define yytext_ptr H5LTyytext +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the - * corresponding action - sets up H5LTyytext. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - H5LTyyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 66 #define YY_END_OF_BUFFER 67 /* This struct is not used in this scanner, @@ -411,7 +642,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[437] = +static const flex_int16_t yy_acclist[437] = { 0, 64, 64, 64, 64, 67, 66, 64, 66, 64, 65, 66, 56, 66, 55, 66, 62, 66, 63, 66, 66, @@ -463,7 +694,7 @@ static yyconst flex_int16_t yy_acclist[437] = 57, 21, 57, 34, 34, 57 } ; -static yyconst flex_int16_t yy_accept[546] = +static const flex_int16_t yy_accept[546] = { 0, 1, 2, 3, 4, 5, 6, 7, 9, 12, 14, 16, 18, 20, 21, 22, 23, 24, 26, 28, 30, @@ -527,7 +758,7 @@ static yyconst flex_int16_t yy_accept[546] = 432, 434, 435, 437, 437 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -559,7 +790,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[42] = +static const YY_CHAR yy_meta[42] = { 0, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, @@ -568,7 +799,7 @@ static yyconst flex_int32_t yy_meta[42] = 1 } ; -static yyconst flex_int16_t yy_base[547] = +static const flex_int16_t yy_base[547] = { 0, 0, 0, 41, 0, 610, 611, 81, 83, 611, 0, 611, 611, 56, 599, 580, 575, 611, 611, 611, 611, @@ -632,7 +863,7 @@ static yyconst flex_int16_t yy_base[547] = 0, 611, 0, 611, 106, 275 } ; -static yyconst flex_int16_t yy_def[547] = +static const flex_int16_t yy_def[547] = { 0, 544, 1, 544, 3, 544, 544, 544, 544, 544, 545, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, @@ -696,7 +927,7 @@ static yyconst flex_int16_t yy_def[547] = 546, 544, 546, 0, 544, 544 } ; -static yyconst flex_int16_t yy_nxt[653] = +static const flex_int16_t yy_nxt[653] = { 0, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 12, 6, 6, 13, 6, 6, 6, @@ -772,7 +1003,7 @@ static yyconst flex_int16_t yy_nxt[653] = 544, 544 } ; -static yyconst flex_int16_t yy_chk[653] = +static const flex_int16_t yy_chk[653] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -848,15 +1079,15 @@ static yyconst flex_int16_t yy_chk[653] = 544, 544 } ; -extern int H5LTyy_flex_debug; -int H5LTyy_flex_debug = 0; +extern int yy_flex_debug; +int yy_flex_debug = 0; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; #define REJECT \ { \ -*yy_cp = (yy_hold_char); /* undo effects of setting up H5LTyytext */ \ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ ++(yy_lp); \ goto find_rule; \ @@ -865,7 +1096,7 @@ goto find_rule; \ #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *H5LTyytext; +char *yytext; #line 1 "hl/src/H5LTanalyze.l" /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * @@ -893,6 +1124,13 @@ char *H5LTyytext; /* Turn off suggest const & malloc attribute warnings in gcc */ #if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#endif + +/* Turn off null dereference warnings in gcc. + * We have no control over this generated code. + */ +#if defined __GNUC__ && 600 <= __GNUC__ * 100 +#pragma GCC diagnostic ignored "-Wnull-dereference" #endif int my_yyinput(char *, int); @@ -942,8 +1180,9 @@ extern hbool_t is_opq_tag; hbool_t first_quote = 1; +#line 1162 "hl/src/H5LTanalyze.c" -#line 925 "hl/src/H5LTanalyze.c" +#line 1164 "hl/src/H5LTanalyze.c" #define INITIAL 0 #define TAG_STRING 1 @@ -952,36 +1191,36 @@ hbool_t first_quote = 1; #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int H5LTyylex_destroy (void ); +int yylex_destroy ( void ); -int H5LTyyget_debug (void ); +int yyget_debug ( void ); -void H5LTyyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE H5LTyyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void H5LTyyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *H5LTyyget_in (void ); +FILE *yyget_in ( void ); -void H5LTyyset_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *H5LTyyget_out (void ); +FILE *yyget_out ( void ); -void H5LTyyset_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t H5LTyyget_leng (void ); + int yyget_leng ( void ); -char *H5LTyyget_text (void ); +char *yyget_text ( void ); -int H5LTyyget_lineno (void ); +int yyget_lineno ( void ); -void H5LTyyset_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -989,35 +1228,43 @@ void H5LTyyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int H5LTyywrap (void ); +extern "C" int yywrap ( void ); #else -extern int H5LTyywrap (void ); +extern int yywrap ( void ); #endif #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr ); + +#endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1025,7 +1272,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1036,20 +1283,20 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ - (c = getc( H5LTyyin )) != EOF && c != '\n'; ++n ) \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( H5LTyyin ) ) \ + if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, H5LTyyin))==0 && ferror(H5LTyyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1057,7 +1304,7 @@ static int input (void ); break; \ } \ errno=0; \ - clearerr(H5LTyyin); \ + clearerr(yyin); \ } \ }\ \ @@ -1090,12 +1337,12 @@ static int input (void ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int H5LTyylex (void); +extern int yylex (void); -#define YY_DECL int H5LTyylex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ -/* Code executed at the beginning of each rule, after H5LTyytext and H5LTyyleng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -1104,7 +1351,7 @@ extern int H5LTyylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1114,15 +1361,10 @@ extern int H5LTyylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 82 "hl/src/H5LTanalyze.l" - - -#line 1103 "hl/src/H5LTanalyze.c" - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -1133,33 +1375,39 @@ YY_DECL /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) - (yy_state_buf) = (yy_state_type *)H5LTyyalloc(YY_STATE_BUF_SIZE ); + (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_state_buf) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyylex()" ); + YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ - if ( ! H5LTyyin ) - H5LTyyin = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! H5LTyyout ) - H5LTyyout = stdout; + if ( ! yyout ) + yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 89 "hl/src/H5LTanalyze.l" + + +#line 1383 "hl/src/H5LTanalyze.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); - /* Support of H5LTyytext. */ + /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of @@ -1175,14 +1423,14 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } @@ -1191,7 +1439,9 @@ yy_match: yy_find_action: yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; + find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) @@ -1215,293 +1465,293 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 84 "hl/src/H5LTanalyze.l" +#line 91 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 85 "hl/src/H5LTanalyze.l" +#line 92 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 86 "hl/src/H5LTanalyze.l" +#line 93 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 87 "hl/src/H5LTanalyze.l" +#line 94 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 88 "hl/src/H5LTanalyze.l" +#line 95 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 89 "hl/src/H5LTanalyze.l" +#line 96 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 90 "hl/src/H5LTanalyze.l" +#line 97 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 91 "hl/src/H5LTanalyze.l" +#line 98 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 93 "hl/src/H5LTanalyze.l" +#line 100 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 94 "hl/src/H5LTanalyze.l" +#line 101 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 95 "hl/src/H5LTanalyze.l" +#line 102 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 96 "hl/src/H5LTanalyze.l" +#line 103 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 97 "hl/src/H5LTanalyze.l" +#line 104 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 98 "hl/src/H5LTanalyze.l" +#line 105 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 99 "hl/src/H5LTanalyze.l" +#line 106 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 100 "hl/src/H5LTanalyze.l" +#line 107 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 102 "hl/src/H5LTanalyze.l" +#line 109 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 103 "hl/src/H5LTanalyze.l" +#line 110 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 104 "hl/src/H5LTanalyze.l" +#line 111 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 105 "hl/src/H5LTanalyze.l" +#line 112 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 106 "hl/src/H5LTanalyze.l" +#line 113 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 107 "hl/src/H5LTanalyze.l" +#line 114 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 108 "hl/src/H5LTanalyze.l" +#line 115 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 109 "hl/src/H5LTanalyze.l" +#line 116 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 110 "hl/src/H5LTanalyze.l" +#line 117 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 111 "hl/src/H5LTanalyze.l" +#line 118 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 112 "hl/src/H5LTanalyze.l" +#line 119 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 114 "hl/src/H5LTanalyze.l" +#line 121 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 115 "hl/src/H5LTanalyze.l" +#line 122 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 116 "hl/src/H5LTanalyze.l" +#line 123 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 117 "hl/src/H5LTanalyze.l" +#line 124 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 118 "hl/src/H5LTanalyze.l" +#line 125 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 119 "hl/src/H5LTanalyze.l" +#line 126 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 120 "hl/src/H5LTanalyze.l" +#line 127 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 122 "hl/src/H5LTanalyze.l" +#line 129 "hl/src/H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 123 "hl/src/H5LTanalyze.l" +#line 130 "hl/src/H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 124 "hl/src/H5LTanalyze.l" +#line 131 "hl/src/H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 125 "hl/src/H5LTanalyze.l" +#line 132 "hl/src/H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 126 "hl/src/H5LTanalyze.l" +#line 133 "hl/src/H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 127 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_NULLTERM_TOKEN);} +#line 134 "hl/src/H5LTanalyze.l" +{return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 128 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_NULLPAD_TOKEN);} +#line 135 "hl/src/H5LTanalyze.l" +{return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 129 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_SPACEPAD_TOKEN);} +#line 136 "hl/src/H5LTanalyze.l" +{return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 130 "hl/src/H5LTanalyze.l" +#line 137 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 131 "hl/src/H5LTanalyze.l" +#line 138 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 132 "hl/src/H5LTanalyze.l" +#line 139 "hl/src/H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 133 "hl/src/H5LTanalyze.l" +#line 140 "hl/src/H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 134 "hl/src/H5LTanalyze.l" +#line 141 "hl/src/H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 136 "hl/src/H5LTanalyze.l" +#line 143 "hl/src/H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 137 "hl/src/H5LTanalyze.l" +#line 144 "hl/src/H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 138 "hl/src/H5LTanalyze.l" +#line 145 "hl/src/H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 139 "hl/src/H5LTanalyze.l" +#line 146 "hl/src/H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 141 "hl/src/H5LTanalyze.l" +#line 148 "hl/src/H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 142 "hl/src/H5LTanalyze.l" +#line 149 "hl/src/H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 143 "hl/src/H5LTanalyze.l" +#line 150 "hl/src/H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 145 "hl/src/H5LTanalyze.l" -{ - if( is_str_size || (is_enum && is_enum_memb) || +#line 152 "hl/src/H5LTanalyze.l" +{ + if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || (csindex>-1 && cmpd_stack[csindex].is_field) ) { - H5LTyylval.ival = atoi(H5LTyytext); - return NUMBER; + H5LTyylval.ival = atoi(yytext); + return NUMBER; } else REJECT; } YY_BREAK case 56: YY_RULE_SETUP -#line 155 "hl/src/H5LTanalyze.l" +#line 162 "hl/src/H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ - if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) + if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) && first_quote) { first_quote = 0; BEGIN TAG_STRING; @@ -1513,12 +1763,12 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 165 "hl/src/H5LTanalyze.l" +#line 172 "hl/src/H5LTanalyze.l" { #ifdef H5_HAVE_WIN32_API - H5LTyylval.sval = _strdup(H5LTyytext); + H5LTyylval.sval = _strdup(yytext); #else /* H5_HAVE_WIN32_API */ - H5LTyylval.sval = strdup(H5LTyytext); + H5LTyylval.sval = strdup(yytext); #endif /* H5_HAVE_WIN32_API */ BEGIN INITIAL; return STRING; @@ -1526,52 +1776,52 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 175 "hl/src/H5LTanalyze.l" +#line 182 "hl/src/H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 176 "hl/src/H5LTanalyze.l" +#line 183 "hl/src/H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 177 "hl/src/H5LTanalyze.l" +#line 184 "hl/src/H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 178 "hl/src/H5LTanalyze.l" +#line 185 "hl/src/H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 179 "hl/src/H5LTanalyze.l" +#line 186 "hl/src/H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 180 "hl/src/H5LTanalyze.l" +#line 187 "hl/src/H5LTanalyze.l" {return token(';');} YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 181 "hl/src/H5LTanalyze.l" +#line 188 "hl/src/H5LTanalyze.l" ; YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 182 "hl/src/H5LTanalyze.l" +#line 189 "hl/src/H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 184 "hl/src/H5LTanalyze.l" +#line 191 "hl/src/H5LTanalyze.l" ECHO; YY_BREAK -#line 1553 "hl/src/H5LTanalyze.c" +#line 1803 "hl/src/H5LTanalyze.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TAG_STRING): yyterminate(); @@ -1589,15 +1839,15 @@ ECHO; { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed H5LTyyin at a new source and called - * H5LTyylex(). If so, then we have to assure + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = H5LTyyin; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1650,11 +1900,11 @@ ECHO; { (yy_did_buffer_switch_on_eof) = 0; - if ( H5LTyywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * H5LTyytext, we can now set up + * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the @@ -1703,7 +1953,8 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of H5LTyylex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1714,9 +1965,9 @@ ECHO; */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1745,7 +1996,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1758,7 +2009,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1784,7 +2035,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - H5LTyyrestart(H5LTyyin ); + yyrestart( yyin ); } else @@ -1798,12 +2049,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) H5LTyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1819,9 +2073,9 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); (yy_state_ptr) = (yy_state_buf); @@ -1829,14 +2083,14 @@ static int yy_get_next_buffer (void) for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; } @@ -1850,16 +2104,16 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; + int yy_is_jam; + + YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 544); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; @@ -1867,22 +2121,24 @@ static int yy_get_next_buffer (void) return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; +#ifndef YY_NO_UNPUT + static void yyunput (int c, char * yy_bp ) +{ + char *yy_cp; + yy_cp = (yy_c_buf_p); - /* undo effects of setting up H5LTyytext */ + /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1891,7 +2147,7 @@ static int yy_get_next_buffer (void) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1904,6 +2160,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1913,7 +2171,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1928,7 +2186,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1945,14 +2203,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - H5LTyyrestart(H5LTyyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( H5LTyywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1971,7 +2229,7 @@ static int yy_get_next_buffer (void) } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve H5LTyytext */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; @@ -1980,35 +2238,35 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ - void H5LTyyrestart (FILE * input_file ) + void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - H5LTyy_init_buffer(YY_CURRENT_BUFFER,input_file ); - H5LTyy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ - void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with - * H5LTyypop_buffer_state(); - * H5LTyypush_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -2021,61 +2279,61 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (H5LTyywrap()) processing, but the only time this flag - * is looked at is after H5LTyywrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } -static void H5LTyy_load_buffer_state (void) +static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - H5LTyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ - YY_BUFFER_STATE H5LTyy_create_buffer (FILE * file, int size ) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) H5LTyyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - H5LTyy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. - * @param b a buffer created with H5LTyy_create_buffer() - * + * @param b a buffer created with yy_create_buffer() + * */ - void H5LTyy_delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2083,27 +2341,27 @@ static void H5LTyy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - H5LTyyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - H5LTyyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a H5LTyyrestart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void H5LTyy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - - H5LTyy_flush_buffer(b ); + + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then H5LTyy_init_buffer was _probably_ - * called from H5LTyyrestart() or through yy_get_next_buffer. + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ @@ -2112,15 +2370,15 @@ static void H5LTyy_load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ - void H5LTyy_flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -2140,23 +2398,23 @@ static void H5LTyy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; - H5LTyyensure_buffer_stack(); + yyensure_buffer_stack(); - /* This block is copied from H5LTyy_switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -2170,27 +2428,27 @@ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from H5LTyy_switch_to_buffer. */ - H5LTyy_load_buffer_state( ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -void H5LTyypop_buffer_state (void) +void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; - H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2198,22 +2456,22 @@ void H5LTyypop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void H5LTyyensure_buffer_stack (void) +static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyalloc + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -2225,15 +2483,15 @@ static void H5LTyyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyrealloc + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2244,80 +2502,80 @@ static void H5LTyyensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - H5LTyy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } -/** Setup the input buffer state to scan a string. The next call to H5LTyylex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * H5LTyy_scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - - return H5LTyy_scan_bytes(yystr,strlen(yystr) ); + + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to H5LTyylex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) H5LTyyalloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = H5LTyy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in H5LTyy_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -2331,9 +2589,9 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_ #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2343,107 +2601,107 @@ static void yy_fatal_error (yyconst char* msg ) #define yyless(n) \ do \ { \ - /* Undo effects of setting up H5LTyytext. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - H5LTyytext[H5LTyyleng] = (yy_hold_char); \ - (yy_c_buf_p) = H5LTyytext + yyless_macro_arg; \ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ - H5LTyyleng = yyless_macro_arg; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ -int H5LTyyget_lineno (void) +int yyget_lineno (void) { - - return H5LTyylineno; + + return yylineno; } /** Get the input stream. - * + * */ -FILE *H5LTyyget_in (void) +FILE *yyget_in (void) { - return H5LTyyin; + return yyin; } /** Get the output stream. - * + * */ -FILE *H5LTyyget_out (void) +FILE *yyget_out (void) { - return H5LTyyout; + return yyout; } /** Get the length of the current token. - * + * */ -yy_size_t H5LTyyget_leng (void) +int yyget_leng (void) { - return H5LTyyleng; + return yyleng; } /** Get the current token. - * + * */ -char *H5LTyyget_text (void) +char *yyget_text (void) { - return H5LTyytext; + return yytext; } /** Set the current line number. - * @param line_number - * + * @param _line_number line number + * */ -void H5LTyyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - - H5LTyylineno = line_number; + + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. - * - * @see H5LTyy_switch_to_buffer + * @param _in_str A readable stream. + * + * @see yy_switch_to_buffer */ -void H5LTyyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - H5LTyyin = in_str ; + yyin = _in_str ; } -void H5LTyyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - H5LTyyout = out_str ; + yyout = _out_str ; } -int H5LTyyget_debug (void) +int yyget_debug (void) { - return H5LTyy_flex_debug; + return yy_flex_debug; } -void H5LTyyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - H5LTyy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. - * This function is called from H5LTyylex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -2454,39 +2712,39 @@ static int yy_init_globals (void) /* Defined in main.c */ #ifdef YY_STDINIT - H5LTyyin = stdin; - H5LTyyout = stdout; + yyin = stdin; + yyout = stdout; #else - H5LTyyin = (FILE *) 0; - H5LTyyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * H5LTyylex_init() + * yylex_init() */ return 0; } -/* H5LTyylex_destroy is for both reentrant and non-reentrant scanners. */ -int H5LTyylex_destroy (void) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; - H5LTyypop_buffer_state(); + yypop_buffer_state(); } /* Destroy the stack itself. */ - H5LTyyfree((yy_buffer_stack) ); + yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; - H5LTyyfree ( (yy_state_buf) ); + yyfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time - * H5LTyylex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -2497,18 +2755,19 @@ int H5LTyylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2516,13 +2775,14 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *H5LTyyalloc (yy_size_t size ) +void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *H5LTyyrealloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2530,35 +2790,34 @@ void *H5LTyyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void H5LTyyfree (void * ptr ) +void yyfree (void * ptr ) { - free( (char *) ptr ); /* see H5LTyyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 184 "hl/src/H5LTanalyze.l" - +#line 191 "hl/src/H5LTanalyze.l" int my_yyinput(char *buf, int max_size) { int ret; - - memcpy(buf, myinput, input_len); + + memcpy(buf, myinput, input_len); ret = (int)input_len; return ret; } int H5LTyyerror(const char *msg) { - printf("ERROR: %s before \"%s\".\n", msg, H5LTyytext); + printf("ERROR: %s before \"%s\".\n", msg, yytext); return 0; } -int H5LTyywrap() +int yywrap() { return(1); } diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 5015053..cdd5b0d 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -28,6 +28,13 @@ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" #endif +/* Turn off null dereference warnings in gcc. + * We have no control over this generated code. + */ +#if defined __GNUC__ && 600 <= __GNUC__ * 100 +#pragma GCC diagnostic ignored "-Wnull-dereference" +#endif + int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index d8661a7..a9b3dc3 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1,30 +1,30 @@ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wnested-externs" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wstrict-overflow" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#pragma GCC diagnostic ignored "-Wswitch-default" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-macros" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined __SUNPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif -/* A Bison parser, made by GNU Bison 2.7. */ +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-overflow" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,7 +66,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -85,14 +85,14 @@ #define yyparse H5LTyyparse #define yylex H5LTyylex #define yyerror H5LTyyerror -#define yylval H5LTyylval -#define yychar H5LTyychar #define yydebug H5LTyydebug #define yynerrs H5LTyynerrs +#define yylval H5LTyylval +#define yychar H5LTyychar + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 20 "hl/src/H5LTparse.y" +#line 20 "hl/src/H5LTparse.y" /* yacc.c:339 */ #include #include @@ -127,7 +127,7 @@ struct arr_info { }; /*stack for nested array type*/ struct arr_info arr_stack[STACK_SIZE]; -int asindex = -1; /*pointer to the top of array stack*/ +int asindex = -1; /*pointer to the top of array stack*/ hbool_t is_str_size = 0; /*flag to lexer for string size*/ hbool_t is_str_pad = 0; /*flag to lexer for string padding*/ @@ -135,7 +135,7 @@ H5T_str_t str_pad; /*variable for string padding*/ H5T_cset_t str_cset; /*variable for string character set*/ hbool_t is_variable = 0; /*variable for variable-length string*/ size_t str_size; /*variable for string size*/ - + hid_t enum_id; /*type ID*/ hbool_t is_enum = 0; /*flag to lexer for enum type*/ hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ @@ -145,14 +145,13 @@ hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ -/* Line 371 of yacc.c */ -#line 128 "hl/src/H5LTparse.c" +#line 127 "hl/src/H5LTparse.c" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -168,7 +167,7 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ by #include "H5LTparse.h". */ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -176,113 +175,99 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ extern int H5LTyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - H5T_STD_I8BE_TOKEN = 258, - H5T_STD_I8LE_TOKEN = 259, - H5T_STD_I16BE_TOKEN = 260, - H5T_STD_I16LE_TOKEN = 261, - H5T_STD_I32BE_TOKEN = 262, - H5T_STD_I32LE_TOKEN = 263, - H5T_STD_I64BE_TOKEN = 264, - H5T_STD_I64LE_TOKEN = 265, - H5T_STD_U8BE_TOKEN = 266, - H5T_STD_U8LE_TOKEN = 267, - H5T_STD_U16BE_TOKEN = 268, - H5T_STD_U16LE_TOKEN = 269, - H5T_STD_U32BE_TOKEN = 270, - H5T_STD_U32LE_TOKEN = 271, - H5T_STD_U64BE_TOKEN = 272, - H5T_STD_U64LE_TOKEN = 273, - H5T_NATIVE_CHAR_TOKEN = 274, - H5T_NATIVE_SCHAR_TOKEN = 275, - H5T_NATIVE_UCHAR_TOKEN = 276, - H5T_NATIVE_SHORT_TOKEN = 277, - H5T_NATIVE_USHORT_TOKEN = 278, - H5T_NATIVE_INT_TOKEN = 279, - H5T_NATIVE_UINT_TOKEN = 280, - H5T_NATIVE_LONG_TOKEN = 281, - H5T_NATIVE_ULONG_TOKEN = 282, - H5T_NATIVE_LLONG_TOKEN = 283, - H5T_NATIVE_ULLONG_TOKEN = 284, - H5T_IEEE_F32BE_TOKEN = 285, - H5T_IEEE_F32LE_TOKEN = 286, - H5T_IEEE_F64BE_TOKEN = 287, - H5T_IEEE_F64LE_TOKEN = 288, - H5T_NATIVE_FLOAT_TOKEN = 289, - H5T_NATIVE_DOUBLE_TOKEN = 290, - H5T_NATIVE_LDOUBLE_TOKEN = 291, - H5T_STRING_TOKEN = 292, - STRSIZE_TOKEN = 293, - STRPAD_TOKEN = 294, - CSET_TOKEN = 295, - CTYPE_TOKEN = 296, - H5T_VARIABLE_TOKEN = 297, - H5T_STR_NULLTERM_TOKEN = 298, - H5T_STR_NULLPAD_TOKEN = 299, - H5T_STR_SPACEPAD_TOKEN = 300, - H5T_CSET_ASCII_TOKEN = 301, - H5T_CSET_UTF8_TOKEN = 302, - H5T_C_S1_TOKEN = 303, - H5T_FORTRAN_S1_TOKEN = 304, - H5T_OPAQUE_TOKEN = 305, - OPQ_SIZE_TOKEN = 306, - OPQ_TAG_TOKEN = 307, - H5T_COMPOUND_TOKEN = 308, - H5T_ENUM_TOKEN = 309, - H5T_ARRAY_TOKEN = 310, - H5T_VLEN_TOKEN = 311, - STRING = 312, - NUMBER = 313 - }; + enum yytokentype + { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 72 "hl/src/H5LTparse.y" +#line 72 "hl/src/H5LTparse.y" /* yacc.c:355 */ int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ +#line 232 "hl/src/H5LTparse.c" /* yacc.c:355 */ +}; -/* Line 387 of yacc.c */ -#line 236 "hl/src/H5LTparse.c" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE H5LTyylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -hid_t H5LTyyparse (void *YYPARSE_PARAM); -#else -hid_t H5LTyyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus hid_t H5LTyyparse (void); -#else -hid_t H5LTyyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 264 "hl/src/H5LTparse.c" +#line 249 "hl/src/H5LTparse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -296,11 +281,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -320,8 +302,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -343,6 +324,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -350,24 +358,26 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -385,8 +395,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -398,8 +407,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -415,7 +424,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -423,15 +432,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -441,7 +448,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -466,16 +473,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -494,7 +501,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -510,17 +517,19 @@ union yyalloc #define YYNNTS 46 /* YYNRULES -- Number of rules. */ #define YYNRULES 95 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 143 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 313 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -558,52 +567,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, - 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, - 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, - 78, 80, 82, 84, 86, 88, 90, 92, 93, 99, - 100, 103, 104, 112, 114, 115, 118, 120, 121, 128, - 129, 132, 133, 134, 140, 142, 147, 148, 149, 150, - 151, 167, 169, 171, 172, 173, 174, 175, 176, 197, - 199, 201, 203, 205, 207, 209, 211, 213, 215, 216, - 224, 225, 228, 229, 236, 238 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 67, 0, -1, -1, 68, -1, 69, -1, 72, -1, - 80, -1, 87, -1, 70, -1, 71, -1, 95, -1, - 105, -1, 88, -1, 3, -1, 4, -1, 5, -1, - 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, - 11, -1, 12, -1, 13, -1, 14, -1, 15, -1, - 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, - 21, -1, 22, -1, 23, -1, 24, -1, 25, -1, - 26, -1, 27, -1, 28, -1, 29, -1, 30, -1, - 31, -1, 32, -1, 33, -1, 34, -1, 35, -1, - 36, -1, -1, 53, 73, 59, 74, 60, -1, -1, - 74, 75, -1, -1, 68, 76, 63, 77, 63, 78, - 65, -1, 57, -1, -1, 64, 79, -1, 58, -1, - -1, 55, 81, 59, 82, 68, 60, -1, -1, 82, - 83, -1, -1, -1, 61, 84, 86, 85, 62, -1, - 58, -1, 56, 59, 68, 60, -1, -1, -1, -1, - -1, 50, 59, 51, 89, 93, 65, 90, 52, 91, - 63, 94, 63, 65, 92, 60, -1, 58, -1, 57, - -1, -1, -1, -1, -1, -1, 37, 59, 38, 96, - 101, 65, 97, 39, 102, 65, 98, 40, 103, 65, - 99, 41, 104, 65, 100, 60, -1, 42, -1, 58, - -1, 43, -1, 44, -1, 45, -1, 46, -1, 47, - -1, 48, -1, 49, -1, -1, 54, 59, 70, 65, - 106, 107, 60, -1, -1, 107, 108, -1, -1, 63, - 110, 63, 109, 111, 65, -1, 57, -1, 58, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 105, 105, 106, 108, 109, 110, 111, 113, 114, @@ -652,13 +616,13 @@ static const char *const yytname[] = "$@5", "dimsize", "vlen_type", "opaque_type", "$@6", "@7", "$@8", "$@9", "opaque_size", "opaque_tag", "string_type", "$@10", "$@11", "$@12", "$@13", "@14", "strsize", "strpad", "cset", "ctype", "enum_type", "$@15", - "enum_list", "enum_def", "$@16", "enum_symbol", "enum_val", YY_NULL + "enum_list", "enum_def", "$@16", "enum_symbol", "enum_val", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -671,71 +635,18 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 66, 67, 67, 68, 68, 68, 68, 69, 69, - 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 71, 71, 71, 71, 71, 71, 71, 73, 72, 74, - 74, 76, 75, 77, 78, 78, 79, 81, 80, 82, - 82, 84, 85, 83, 86, 87, 89, 90, 91, 92, - 88, 93, 94, 96, 97, 98, 99, 100, 95, 101, - 101, 102, 102, 102, 103, 103, 104, 104, 106, 105, - 107, 107, 109, 108, 110, 111 -}; +#define YYPACT_NINF -25 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, - 2, 0, 7, 1, 0, 2, 1, 0, 6, 0, - 2, 0, 0, 5, 1, 4, 0, 0, 0, 0, - 15, 1, 1, 0, 0, 0, 0, 0, 20, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, - 0, 2, 0, 6, 1, 1 -}; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-25))) -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, - 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, - 10, 11, 0, 0, 0, 0, 0, 0, 1, 73, - 66, 49, 0, 59, 0, 0, 0, 0, 88, 0, - 65, 79, 80, 0, 71, 0, 48, 51, 50, 90, - 61, 0, 60, 74, 67, 0, 0, 0, 58, 0, - 0, 0, 89, 0, 91, 64, 62, 0, 68, 53, - 0, 94, 0, 0, 81, 82, 83, 0, 0, 54, - 92, 63, 75, 0, 0, 0, 0, 0, 72, 0, - 56, 55, 52, 95, 0, 0, 0, 93, 84, 85, - 0, 69, 76, 0, 0, 70, 0, 86, 87, 0, - 77, 0, 78 -}; +#define YYTABLE_NINF -1 -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 41, 42, 43, 44, 45, 46, 54, 67, 78, - 85, 100, 115, 121, 47, 56, 69, 82, 87, 103, - 96, 48, 49, 66, 90, 108, 133, 75, 119, 50, - 65, 89, 117, 134, 141, 73, 107, 130, 139, 51, - 79, 86, 94, 116, 102, 124 -}; +#define yytable_value_is_error(Yytable_value) \ + 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -25 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 114, -25, -25, -25, -25, -25, -25, -25, -25, -25, @@ -755,7 +666,29 @@ static const yytype_int16 yypact[] = -25, 143, -25 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, + 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, + 10, 11, 0, 0, 0, 0, 0, 0, 1, 73, + 66, 49, 0, 59, 0, 0, 0, 0, 88, 0, + 65, 79, 80, 0, 71, 0, 48, 51, 50, 90, + 61, 0, 60, 74, 67, 0, 0, 0, 58, 0, + 0, 0, 89, 0, 91, 64, 62, 0, 68, 53, + 0, 94, 0, 0, 81, 82, 83, 0, 0, 54, + 92, 63, 75, 0, 0, 0, 0, 0, 72, 0, + 56, 55, 52, 95, 0, 0, 0, 93, 84, 85, + 0, 69, 76, 0, 0, 70, 0, 86, 87, 0, + 77, 0, 78 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -25, -25, -21, -25, 108, -25, -25, -25, -25, -25, @@ -765,10 +698,19 @@ static const yytype_int8 yypgoto[] = -25, -25, -25, -25, -25, -25 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 41, 42, 43, 44, 45, 46, 54, 67, 78, + 85, 100, 115, 121, 47, 56, 69, 82, 87, 103, + 96, 48, 49, 66, 90, 108, 133, 75, 119, 50, + 65, 89, 117, 134, 141, 73, 107, 130, 139, 51, + 79, 86, 94, 116, 102, 124 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, @@ -794,12 +736,6 @@ static const yytype_uint8 yytable[] = 132, 136, 140, 142 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-25))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_uint8 yycheck[] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -825,8 +761,8 @@ static const yytype_uint8 yycheck[] = 65, 41, 65, 60 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, @@ -846,30 +782,46 @@ static const yytype_uint8 yystos[] = 65, 100, 60 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 66, 67, 67, 68, 68, 68, 68, 69, 69, + 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 71, 71, 71, 71, 71, 71, 71, 73, 72, 74, + 74, 76, 75, 77, 78, 78, 79, 81, 80, 82, + 82, 84, 85, 83, 86, 87, 89, 90, 91, 92, + 88, 93, 94, 96, 97, 98, 99, 100, 95, 101, + 101, 102, 102, 102, 103, 103, 104, 104, 106, 105, + 107, 107, 109, 108, 110, 111 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, + 2, 0, 7, 1, 0, 2, 1, 0, 6, 0, + 2, 0, 0, 5, 1, 4, 0, 0, 0, 0, + 15, 1, 1, 0, 0, 0, 0, 0, 20, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, + 0, 2, 0, 6, 1, 1 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + #define YYRECOVERING() (!!yyerrstatus) @@ -886,27 +838,15 @@ do \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -916,40 +856,36 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); @@ -958,14 +894,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -973,22 +903,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -999,16 +918,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1019,49 +930,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1075,7 +979,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1098,15 +1002,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1122,16 +1019,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1161,27 +1050,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1204,11 +1093,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1216,10 +1105,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1269,7 +1154,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1336,31 +1221,17 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1369,18 +1240,8 @@ yydestruct (yymsg, yytype, yyvaluep) /* The lookahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; @@ -1389,35 +1250,16 @@ int yynerrs; | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -hid_t -yyparse (void *YYPARSE_PARAM) -#else -hid_t -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) hid_t yyparse (void) -#else -hid_t -yyparse () - -#endif -#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1485,23 +1327,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1509,22 +1351,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1533,10 +1375,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1565,7 +1407,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -1630,7 +1472,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1644,440 +1486,439 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ -#line 105 "hl/src/H5LTparse.y" +#line 105 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } +#line 1470 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 3: -/* Line 1792 of yacc.c */ -#line 106 "hl/src/H5LTparse.y" +#line 106 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { return (yyval.hid);} +#line 1476 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 13: -/* Line 1792 of yacc.c */ -#line 120 "hl/src/H5LTparse.y" +#line 120 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } +#line 1482 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 14: -/* Line 1792 of yacc.c */ -#line 121 "hl/src/H5LTparse.y" +#line 121 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } +#line 1488 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 15: -/* Line 1792 of yacc.c */ -#line 122 "hl/src/H5LTparse.y" +#line 122 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } +#line 1494 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 16: -/* Line 1792 of yacc.c */ -#line 123 "hl/src/H5LTparse.y" +#line 123 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } +#line 1500 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 17: -/* Line 1792 of yacc.c */ -#line 124 "hl/src/H5LTparse.y" +#line 124 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } +#line 1506 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 18: -/* Line 1792 of yacc.c */ -#line 125 "hl/src/H5LTparse.y" +#line 125 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } +#line 1512 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 19: -/* Line 1792 of yacc.c */ -#line 126 "hl/src/H5LTparse.y" +#line 126 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } +#line 1518 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 20: -/* Line 1792 of yacc.c */ -#line 127 "hl/src/H5LTparse.y" +#line 127 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } +#line 1524 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 21: -/* Line 1792 of yacc.c */ -#line 128 "hl/src/H5LTparse.y" +#line 128 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } +#line 1530 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 22: -/* Line 1792 of yacc.c */ -#line 129 "hl/src/H5LTparse.y" +#line 129 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } +#line 1536 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 23: -/* Line 1792 of yacc.c */ -#line 130 "hl/src/H5LTparse.y" +#line 130 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } +#line 1542 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 24: -/* Line 1792 of yacc.c */ -#line 131 "hl/src/H5LTparse.y" +#line 131 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } +#line 1548 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 25: -/* Line 1792 of yacc.c */ -#line 132 "hl/src/H5LTparse.y" +#line 132 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } +#line 1554 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 26: -/* Line 1792 of yacc.c */ -#line 133 "hl/src/H5LTparse.y" +#line 133 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } +#line 1560 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 27: -/* Line 1792 of yacc.c */ -#line 134 "hl/src/H5LTparse.y" +#line 134 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } +#line 1566 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 28: -/* Line 1792 of yacc.c */ -#line 135 "hl/src/H5LTparse.y" +#line 135 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } +#line 1572 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 29: -/* Line 1792 of yacc.c */ -#line 136 "hl/src/H5LTparse.y" +#line 136 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } +#line 1578 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 30: -/* Line 1792 of yacc.c */ -#line 137 "hl/src/H5LTparse.y" +#line 137 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } +#line 1584 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 31: -/* Line 1792 of yacc.c */ -#line 138 "hl/src/H5LTparse.y" +#line 138 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } +#line 1590 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 32: -/* Line 1792 of yacc.c */ -#line 139 "hl/src/H5LTparse.y" +#line 139 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } +#line 1596 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 33: -/* Line 1792 of yacc.c */ -#line 140 "hl/src/H5LTparse.y" +#line 140 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } +#line 1602 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 34: -/* Line 1792 of yacc.c */ -#line 141 "hl/src/H5LTparse.y" +#line 141 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } +#line 1608 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 35: -/* Line 1792 of yacc.c */ -#line 142 "hl/src/H5LTparse.y" +#line 142 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } +#line 1614 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 36: -/* Line 1792 of yacc.c */ -#line 143 "hl/src/H5LTparse.y" +#line 143 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } +#line 1620 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 37: -/* Line 1792 of yacc.c */ -#line 144 "hl/src/H5LTparse.y" +#line 144 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } +#line 1626 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 38: -/* Line 1792 of yacc.c */ -#line 145 "hl/src/H5LTparse.y" +#line 145 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } +#line 1632 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 39: -/* Line 1792 of yacc.c */ -#line 146 "hl/src/H5LTparse.y" +#line 146 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } +#line 1638 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 40: -/* Line 1792 of yacc.c */ -#line 149 "hl/src/H5LTparse.y" +#line 149 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } +#line 1644 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 41: -/* Line 1792 of yacc.c */ -#line 150 "hl/src/H5LTparse.y" +#line 150 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } +#line 1650 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 42: -/* Line 1792 of yacc.c */ -#line 151 "hl/src/H5LTparse.y" +#line 151 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } +#line 1656 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 43: -/* Line 1792 of yacc.c */ -#line 152 "hl/src/H5LTparse.y" +#line 152 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } +#line 1662 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 44: -/* Line 1792 of yacc.c */ -#line 153 "hl/src/H5LTparse.y" +#line 153 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } +#line 1668 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 45: -/* Line 1792 of yacc.c */ -#line 154 "hl/src/H5LTparse.y" +#line 154 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } +#line 1674 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 46: -/* Line 1792 of yacc.c */ -#line 155 "hl/src/H5LTparse.y" +#line 155 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } +#line 1680 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 47: -/* Line 1792 of yacc.c */ -#line 159 "hl/src/H5LTparse.y" +#line 159 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } +#line 1686 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 48: -/* Line 1792 of yacc.c */ -#line 161 "hl/src/H5LTparse.y" - { (yyval.hid) = cmpd_stack[csindex].id; +#line 161 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; - cmpd_stack[csindex].first_memb = 1; + cmpd_stack[csindex].first_memb = 1; csindex--; } +#line 1696 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 51: -/* Line 1792 of yacc.c */ -#line 170 "hl/src/H5LTparse.y" +#line 170 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } +#line 1702 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 52: -/* Line 1792 of yacc.c */ -#line 172 "hl/src/H5LTparse.y" - { +#line 172 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size((yyvsp[(1) - (7)].hid)) + (yyvsp[(6) - (7)].ival); + new_size = H5Tget_size((yyvsp[-6].hid)) + (yyvsp[-1].ival); H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-3].sval), (yyvsp[-1].ival), (yyvsp[-6].hid)); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - - if((yyvsp[(6) - (7)].ival) == 0) { - new_size = origin_size + H5Tget_size((yyvsp[(1) - (7)].hid)); + + if((yyvsp[-1].ival) == 0) { + new_size = origin_size + H5Tget_size((yyvsp[-6].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), origin_size, (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-3].sval), origin_size, (yyvsp[-6].hid)); } else { - new_size = (yyvsp[(6) - (7)].ival) + H5Tget_size((yyvsp[(1) - (7)].hid)); + new_size = (yyvsp[-1].ival) + H5Tget_size((yyvsp[-6].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-3].sval), (yyvsp[-1].ival), (yyvsp[-6].hid)); } } - if((yyvsp[(4) - (7)].sval)) { - free((yyvsp[(4) - (7)].sval)); - (yyvsp[(4) - (7)].sval) = NULL; + if((yyvsp[-3].sval)) { + free((yyvsp[-3].sval)); + (yyvsp[-3].sval) = NULL; } cmpd_stack[csindex].is_field = 0; - H5Tclose((yyvsp[(1) - (7)].hid)); - + H5Tclose((yyvsp[-6].hid)); + new_size = H5Tget_size(dtype_id); } +#line 1741 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 53: -/* Line 1792 of yacc.c */ -#line 208 "hl/src/H5LTparse.y" +#line 208 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.sval) = strdup(yylval.sval); free(yylval.sval); yylval.sval = NULL; } +#line 1751 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 54: -/* Line 1792 of yacc.c */ -#line 215 "hl/src/H5LTparse.y" +#line 215 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } +#line 1757 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 55: -/* Line 1792 of yacc.c */ -#line 217 "hl/src/H5LTparse.y" +#line 217 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.ival) = yylval.ival; } +#line 1763 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 57: -/* Line 1792 of yacc.c */ -#line 221 "hl/src/H5LTparse.y" +#line 221 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { asindex++; /*pushd onto the stack*/ } +#line 1769 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 58: -/* Line 1792 of yacc.c */ -#line 223 "hl/src/H5LTparse.y" - { - (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); +#line 223 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + (yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; - H5Tclose((yyvsp[(5) - (6)].hid)); + H5Tclose((yyvsp[-1].hid)); } +#line 1780 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 61: -/* Line 1792 of yacc.c */ -#line 233 "hl/src/H5LTparse.y" +#line 233 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } +#line 1786 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 62: -/* Line 1792 of yacc.c */ -#line 234 "hl/src/H5LTparse.y" +#line 234 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { unsigned ndims = arr_stack[asindex].ndims; - arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; + arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; - arr_stack[asindex].is_dim = 0; + arr_stack[asindex].is_dim = 0; } +#line 1796 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 65: -/* Line 1792 of yacc.c */ -#line 245 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } +#line 245 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } +#line 1802 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 66: -/* Line 1792 of yacc.c */ -#line 250 "hl/src/H5LTparse.y" +#line 250 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_opq_size = 1; } +#line 1808 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 67: -/* Line 1792 of yacc.c */ -#line 251 "hl/src/H5LTparse.y" - { +#line 251 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); - is_opq_size = 0; + is_opq_size = 0; } +#line 1818 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 68: -/* Line 1792 of yacc.c */ -#line 256 "hl/src/H5LTparse.y" +#line 256 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_opq_tag = 1; } +#line 1824 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 69: -/* Line 1792 of yacc.c */ -#line 257 "hl/src/H5LTparse.y" - { - H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); +#line 257 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + H5Tset_tag((yyvsp[-6].hid), yylval.sval); free(yylval.sval); yylval.sval = NULL; is_opq_tag = 0; } +#line 1835 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 70: -/* Line 1792 of yacc.c */ -#line 263 "hl/src/H5LTparse.y" - { (yyval.hid) = (yyvsp[(7) - (15)].hid); } +#line 263 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = (yyvsp[-8].hid); } +#line 1841 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 73: -/* Line 1792 of yacc.c */ -#line 271 "hl/src/H5LTparse.y" +#line 271 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_str_size = 1; } +#line 1847 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 74: -/* Line 1792 of yacc.c */ -#line 272 "hl/src/H5LTparse.y" - { - if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) +#line 272 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; - else + else str_size = yylval.ival; - is_str_size = 0; + is_str_size = 0; } +#line 1859 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 75: -/* Line 1792 of yacc.c */ -#line 280 "hl/src/H5LTparse.y" +#line 280 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) + if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; - else if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLPAD_TOKEN) + else if((yyvsp[-1].ival) == H5T_STR_NULLPAD_TOKEN) str_pad = H5T_STR_NULLPAD; - else if((yyvsp[(9) - (10)].ival) == H5T_STR_SPACEPAD_TOKEN) + else if((yyvsp[-1].ival) == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } +#line 1872 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 76: -/* Line 1792 of yacc.c */ -#line 289 "hl/src/H5LTparse.y" - { - if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) +#line 289 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; - else if((yyvsp[(13) - (14)].ival) == H5T_CSET_UTF8_TOKEN) + else if((yyvsp[-1].ival) == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } +#line 1883 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 77: -/* Line 1792 of yacc.c */ -#line 296 "hl/src/H5LTparse.y" +#line 296 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) + if((yyvsp[-1].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); - else if((yyvsp[(17) - (18)].hid) == H5T_FORTRAN_S1_TOKEN) + else if((yyvsp[-1].hid) == H5T_FORTRAN_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_FORTRAN_S1); } +#line 1894 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 78: -/* Line 1792 of yacc.c */ -#line 303 "hl/src/H5LTparse.y" - { - hid_t str_id = (yyvsp[(19) - (20)].hid); +#line 303 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + hid_t str_id = (yyvsp[-1].hid); /*set string size*/ if(is_variable) { @@ -2085,93 +1926,93 @@ yyreduce: is_variable = 0; } else H5Tset_size(str_id, str_size); - + /*set string padding and character set*/ H5Tset_strpad(str_id, str_pad); H5Tset_cset(str_id, str_cset); - (yyval.hid) = str_id; + (yyval.hid) = str_id; } +#line 1915 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 79: -/* Line 1792 of yacc.c */ -#line 320 "hl/src/H5LTparse.y" +#line 320 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_VARIABLE_TOKEN;} +#line 1921 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 81: -/* Line 1792 of yacc.c */ -#line 323 "hl/src/H5LTparse.y" +#line 323 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} +#line 1927 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 82: -/* Line 1792 of yacc.c */ -#line 324 "hl/src/H5LTparse.y" +#line 324 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} +#line 1933 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 83: -/* Line 1792 of yacc.c */ -#line 325 "hl/src/H5LTparse.y" +#line 325 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} +#line 1939 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 84: -/* Line 1792 of yacc.c */ -#line 327 "hl/src/H5LTparse.y" +#line 327 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} +#line 1945 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 85: -/* Line 1792 of yacc.c */ -#line 328 "hl/src/H5LTparse.y" +#line 328 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} +#line 1951 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 86: -/* Line 1792 of yacc.c */ -#line 330 "hl/src/H5LTparse.y" +#line 330 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.hid) = H5T_C_S1_TOKEN;} +#line 1957 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 87: -/* Line 1792 of yacc.c */ -#line 331 "hl/src/H5LTparse.y" +#line 331 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} +#line 1963 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 88: -/* Line 1792 of yacc.c */ -#line 335 "hl/src/H5LTparse.y" - { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } +#line 335 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } +#line 1969 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 89: -/* Line 1792 of yacc.c */ -#line 337 "hl/src/H5LTparse.y" +#line 337 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } +#line 1975 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 92: -/* Line 1792 of yacc.c */ -#line 342 "hl/src/H5LTparse.y" +#line 342 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_enum_memb = 1; /*indicate member of enum*/ #ifdef H5_HAVE_WIN32_API - enum_memb_symbol = _strdup(yylval.sval); + enum_memb_symbol = _strdup(yylval.sval); #else /* H5_HAVE_WIN32_API */ - enum_memb_symbol = strdup(yylval.sval); + enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ free(yylval.sval); yylval.sval = NULL; } +#line 1990 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 93: -/* Line 1792 of yacc.c */ -#line 353 "hl/src/H5LTparse.y" +#line 353 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2182,43 +2023,43 @@ yyreduce: hid_t native = H5Tget_native_type(super, H5T_DIR_ASCEND); H5T_order_t super_order = H5Tget_order(super); H5T_order_t native_order = H5Tget_order(native); - + if(is_enum && is_enum_memb) { /*if it's an enum member*/ /*To handle machines of different endianness*/ if(H5Tequal(native, H5T_NATIVE_SCHAR) || H5Tequal(native, H5T_NATIVE_UCHAR)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &char_val); } else if(H5Tequal(native, H5T_NATIVE_SHORT) || H5Tequal(native, H5T_NATIVE_USHORT)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &short_val); } else if(H5Tequal(native, H5T_NATIVE_INT) || H5Tequal(native, H5T_NATIVE_UINT)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &int_val); } else if(H5Tequal(native, H5T_NATIVE_LONG) || H5Tequal(native, H5T_NATIVE_ULONG)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &long_val); } else if(H5Tequal(native, H5T_NATIVE_LLONG) || H5Tequal(native, H5T_NATIVE_ULLONG)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &llong_val); } - is_enum_memb = 0; + is_enum_memb = 0; if(enum_memb_symbol) free(enum_memb_symbol); } H5Tclose(super); H5Tclose(native); } +#line 2037 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; -/* Line 1792 of yacc.c */ -#line 2200 "hl/src/H5LTparse.c" +#line 2041 "hl/src/H5LTparse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2240,7 +2081,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2255,9 +2096,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2308,20 +2149,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2340,7 +2181,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2353,29 +2194,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2426,14 +2267,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2444,8 +2285,5 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 0ecd15d..e38116a 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,105 +40,92 @@ extern int H5LTyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - H5T_STD_I8BE_TOKEN = 258, - H5T_STD_I8LE_TOKEN = 259, - H5T_STD_I16BE_TOKEN = 260, - H5T_STD_I16LE_TOKEN = 261, - H5T_STD_I32BE_TOKEN = 262, - H5T_STD_I32LE_TOKEN = 263, - H5T_STD_I64BE_TOKEN = 264, - H5T_STD_I64LE_TOKEN = 265, - H5T_STD_U8BE_TOKEN = 266, - H5T_STD_U8LE_TOKEN = 267, - H5T_STD_U16BE_TOKEN = 268, - H5T_STD_U16LE_TOKEN = 269, - H5T_STD_U32BE_TOKEN = 270, - H5T_STD_U32LE_TOKEN = 271, - H5T_STD_U64BE_TOKEN = 272, - H5T_STD_U64LE_TOKEN = 273, - H5T_NATIVE_CHAR_TOKEN = 274, - H5T_NATIVE_SCHAR_TOKEN = 275, - H5T_NATIVE_UCHAR_TOKEN = 276, - H5T_NATIVE_SHORT_TOKEN = 277, - H5T_NATIVE_USHORT_TOKEN = 278, - H5T_NATIVE_INT_TOKEN = 279, - H5T_NATIVE_UINT_TOKEN = 280, - H5T_NATIVE_LONG_TOKEN = 281, - H5T_NATIVE_ULONG_TOKEN = 282, - H5T_NATIVE_LLONG_TOKEN = 283, - H5T_NATIVE_ULLONG_TOKEN = 284, - H5T_IEEE_F32BE_TOKEN = 285, - H5T_IEEE_F32LE_TOKEN = 286, - H5T_IEEE_F64BE_TOKEN = 287, - H5T_IEEE_F64LE_TOKEN = 288, - H5T_NATIVE_FLOAT_TOKEN = 289, - H5T_NATIVE_DOUBLE_TOKEN = 290, - H5T_NATIVE_LDOUBLE_TOKEN = 291, - H5T_STRING_TOKEN = 292, - STRSIZE_TOKEN = 293, - STRPAD_TOKEN = 294, - CSET_TOKEN = 295, - CTYPE_TOKEN = 296, - H5T_VARIABLE_TOKEN = 297, - H5T_STR_NULLTERM_TOKEN = 298, - H5T_STR_NULLPAD_TOKEN = 299, - H5T_STR_SPACEPAD_TOKEN = 300, - H5T_CSET_ASCII_TOKEN = 301, - H5T_CSET_UTF8_TOKEN = 302, - H5T_C_S1_TOKEN = 303, - H5T_FORTRAN_S1_TOKEN = 304, - H5T_OPAQUE_TOKEN = 305, - OPQ_SIZE_TOKEN = 306, - OPQ_TAG_TOKEN = 307, - H5T_COMPOUND_TOKEN = 308, - H5T_ENUM_TOKEN = 309, - H5T_ARRAY_TOKEN = 310, - H5T_VLEN_TOKEN = 311, - STRING = 312, - NUMBER = 313 - }; + enum yytokentype + { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 2058 of yacc.c */ -#line 72 "hl/src/H5LTparse.y" +#line 72 "hl/src/H5LTparse.y" /* yacc.c:1909 */ int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ +#line 119 "hl/src/H5LTparse.h" /* yacc.c:1909 */ +}; -/* Line 2058 of yacc.c */ -#line 122 "hl/src/H5LTparse.h" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE H5LTyylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int H5LTyyparse (void *YYPARSE_PARAM); -#else -int H5LTyyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int H5LTyyparse (void); -#else -int H5LTyyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ -- cgit v0.12 From b1c78579da25704d2c688a6047f58ebaf62cae82 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 22:56:15 -0700 Subject: Fixes -Wnull-dereference warning in hl/src/H5DS.c --- hl/src/H5DS.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 63fb461..82dc129 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1460,10 +1460,6 @@ out: * * Date: January 11, 2005 * -* Comments: -* -* Modifications: -* *------------------------------------------------------------------------- */ @@ -1481,6 +1477,9 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) char ** buf; /* discarding the 'const' qualifier in the free */ char const ** const_buf; /* buf calls */ } u; + + HDmemset(&u, 0, sizeof(u)); + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- -- cgit v0.12 From bd6f3bcdabc88c83393ff36149a80bd71f9365f4 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 23:14:40 -0700 Subject: Fixes -Wnull-dereference warnings around the cache logging calls --- src/H5AC.c | 70 +++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 6972a31..402f562 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -918,9 +918,10 @@ H5AC_mark_entry_dirty(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_mark_entry_dirty_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_mark_entry_dirty_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_mark_entry_dirty() */ @@ -971,9 +972,10 @@ H5AC_mark_entry_clean(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_mark_entry_clean_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_mark_entry_clean_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_mark_entry_clean() */ @@ -1013,9 +1015,10 @@ H5AC_mark_entry_unserialized(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_mark_unserialized_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_mark_unserialized_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_mark_entry_unserialized() */ @@ -1054,9 +1057,10 @@ H5AC_mark_entry_serialized(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_mark_serialized_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_mark_serialized_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_mark_entry_serialized() */ @@ -1156,9 +1160,10 @@ H5AC_pin_protected_entry(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_pin_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_pin_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_pin_protected_entry() */ @@ -1238,9 +1243,10 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_create_fd_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_create_fd_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_create_flush_dependency() */ @@ -1373,9 +1379,10 @@ H5AC_resize_entry(void *thing, size_t new_size) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_resize_entry_msg(cache_ptr, entry_ptr, new_size, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_resize_entry_msg(cache_ptr, entry_ptr, new_size, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_resize_entry() */ @@ -1416,9 +1423,10 @@ H5AC_unpin_entry(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_unpin_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_unpin_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_unpin_entry() */ @@ -1459,9 +1467,10 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_destroy_fd_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_destroy_fd_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_destroy_flush_dependency() */ @@ -2637,9 +2646,10 @@ H5AC_remove_entry(void *_entry) done: /* If currently logging, generate a message */ - if(cache->log_info->logging) - if(H5C_log_write_remove_entry_msg(cache, entry, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache != NULL && cache->log_info != NULL) + if(cache->log_info->logging) + if(H5C_log_write_remove_entry_msg(cache, entry, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_remove_entry() */ -- cgit v0.12 From 91ca481ff152e7a6b0326fcdb59e506141d2d32a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 6 Aug 2020 08:41:27 -0700 Subject: Reverts H5FDsplitter.c changes so they don't conflict with Quincey's big cleanup patch --- src/H5FDsplitter.c | 94 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 3c33f57..4ed3c4a 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -27,6 +27,8 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ +#include "H5FDsec2.h" /* Generic Functions */ +#include "H5FDstdio.h" /* Generic Functions */ #include "H5Pprivate.h" /* Property lists */ /* The driver identification number, initialized at runtime */ @@ -91,7 +93,7 @@ typedef struct H5FD_splitter_t { #if H5FD_SPLITTER_DEBUG_OP_CALLS #define H5FD_SPLITTER_LOG_CALL(name) do { \ HDprintf("called %s()\n", (name)); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #else #define H5FD_SPLITTER_LOG_CALL(name) /* no-op */ @@ -300,22 +302,27 @@ done: herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) { - H5FD_splitter_fapl_t *info = NULL; + H5FD_splitter_fapl_t info; H5P_genplist_t *plist_ptr = NULL; herr_t ret_value = SUCCEED; + H5Eclear2(H5E_DEFAULT); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Dr", fapl_id, vfd_config); H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter"); - if (H5FD_SPLITTER_MAGIC != vfd_config->magic) + if (H5FD_SPLITTER_MAGIC != vfd_config->magic) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)") - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) + } + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invlaid config (version number mismatch)") + } - if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) + if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid property list") + } /* Make sure that the W/O channel supports write-only capability. @@ -331,46 +338,48 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) unsigned long wo_driver_flags = 0; wo_plist_ptr = (H5P_genplist_t *)H5I_object(vfd_config->wo_fapl_id); - if (NULL == wo_plist_ptr) + if (NULL == wo_plist_ptr) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) + } + if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) { HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info") + } wo_driver = (H5FD_class_t *)H5I_object(wo_driver_prop.driver_id); - if (NULL == wo_driver) + if (NULL == wo_driver) { HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list") - if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) + } + if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) { HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't query VFD flags") - if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) + } + if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) { HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unsuitable W/O driver") + } } /* end if W/O VFD is non-default */ - if (NULL == (info = H5MM_calloc(sizeof(H5FD_splitter_fapl_t)))) - HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "can't allocate memory for splitter struct") - info->ignore_wo_errs = vfd_config->ignore_wo_errs; - HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); - HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); - info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ - info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info.ignore_wo_errs = vfd_config->ignore_wo_errs; + HDstrncpy(info.wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(info.log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); + info.rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info.wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ /* Set non-default channel FAPL IDs in splitter configuration info */ if (H5P_DEFAULT != vfd_config->rw_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) + if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - info->rw_fapl_id = vfd_config->rw_fapl_id; + } + info.rw_fapl_id = vfd_config->rw_fapl_id; } if (H5P_DEFAULT != vfd_config->wo_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) + if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - info->wo_fapl_id = vfd_config->wo_fapl_id; + } + info.wo_fapl_id = vfd_config->wo_fapl_id; } - if(H5P_set_driver(plist_ptr, H5FD_SPLITTER, info) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set driver") + ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, &info); done: - H5MM_xfree(info); - FUNC_LEAVE_API(ret_value) } /* end H5Pset_fapl_splitter() */ @@ -400,36 +409,45 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out) H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter"); /* Check arguments */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (config_out == NULL) + } + if (config_out == NULL) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null") - if (H5FD_SPLITTER_MAGIC != config_out->magic) + } + if (H5FD_SPLITTER_MAGIC != config_out->magic) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)") - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) + } + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)") + } /* Pre-set out FAPL IDs with intent to replace these values */ config_out->rw_fapl_id = H5I_INVALID_HID; config_out->wo_fapl_id = H5I_INVALID_HID; /* Check and get the splitter fapl */ - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "incorrect VFL driver") - if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to get specific-driver info") + } + if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) { + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") + } + if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) { + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info") + } HDstrncpy(config_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy R/W FAPL"); - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy W/O FAPL"); + if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) { + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL"); + } + if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) { + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL"); + } done: FUNC_LEAVE_API(ret_value) -- cgit v0.12 From 07e4ef9da47eda1f23ca72c748fbb6d4b309540b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 6 Aug 2020 15:56:04 -0500 Subject: Clean up private / package / static namespace issues (function naming, which header file, FUNC_ENTER / LEAVE, etc). Removed remaining personal email addresses from library source code (still needs cleaned from other directories). Misc. warning, style, and whitespace cleanup. --- MANIFEST | 1 + src/CMakeLists.txt | 1 + src/H5.c | 24 +- src/H5AC.c | 16 +- src/H5ACdbg.c | 6 - src/H5ACmodule.h | 2 +- src/H5ACmpio.c | 3 +- src/H5ACprivate.h | 2 +- src/H5ACpublic.h | 4 +- src/H5Abtree2.c | 3 +- src/H5Adense.c | 14 +- src/H5Adeprec.c | 2 +- src/H5Aint.c | 5 +- src/H5Amodule.h | 2 +- src/H5Apkg.h | 3 - src/H5B.c | 14 +- src/H5B2.c | 3 - src/H5B2cache.c | 24 +- src/H5B2dbg.c | 5 +- src/H5B2hdr.c | 7 +- src/H5B2int.c | 16 +- src/H5B2internal.c | 12 +- src/H5B2leaf.c | 16 +- src/H5B2module.h | 2 +- src/H5B2stat.c | 2 +- src/H5B2test.c | 2 +- src/H5Bcache.c | 7 +- src/H5C.c | 532 +++++------- src/H5CS.c | 4 - src/H5CX.c | 2 +- src/H5Cdbg.c | 68 -- src/H5Cimage.c | 48 -- src/H5Cmodule.h | 2 +- src/H5Cpkg.h | 2 - src/H5Cprivate.h | 3 - src/H5Cpublic.h | 2 - src/H5Dbtree.c | 7 +- src/H5Dbtree2.c | 17 +- src/H5Dchunk.c | 147 ++-- src/H5Dcompact.c | 2 +- src/H5Dcontig.c | 2 +- src/H5Ddeprec.c | 2 +- src/H5Dearray.c | 4 +- src/H5Defl.c | 5 +- src/H5Dfarray.c | 4 +- src/H5Dfill.c | 4 +- src/H5Dint.c | 18 +- src/H5Dmpio.c | 38 +- src/H5Dnone.c | 2 +- src/H5Dpkg.h | 5 +- src/H5Dsingle.c | 2 +- src/H5Dtest.c | 2 +- src/H5Dvirtual.c | 4 +- src/H5E.c | 12 +- src/H5EA.c | 17 +- src/H5EAcache.c | 31 +- src/H5EAdblkpage.c | 7 +- src/H5EAdblock.c | 11 +- src/H5EAhdr.c | 22 +- src/H5EAiblock.c | 34 +- src/H5EAint.c | 4 +- src/H5EApkg.h | 2 +- src/H5EAsblock.c | 2 +- src/H5EAstat.c | 7 +- src/H5EAtest.c | 4 +- src/H5Edeprec.c | 2 +- src/H5Eint.c | 2 +- src/H5Emodule.h | 2 +- src/H5Epkg.h | 2 +- src/H5FA.c | 9 +- src/H5FAcache.c | 18 +- src/H5FAdbg.c | 2 +- src/H5FAhdr.c | 4 +- src/H5FAint.c | 2 +- src/H5FAmodule.h | 2 +- src/H5FAstat.c | 6 +- src/H5FAtest.c | 2 +- src/H5FDcore.c | 37 +- src/H5FDcore.h | 2 +- src/H5FDdirect.c | 265 +++--- src/H5FDdirect.h | 2 +- src/H5FDdrvr_module.h | 2 +- src/H5FDfamily.c | 312 +++---- src/H5FDfamily.h | 2 +- src/H5FDhdfs.c | 1313 ++++++++++------------------- src/H5FDhdfs.h | 11 +- src/H5FDlog.c | 256 +++--- src/H5FDlog.h | 2 +- src/H5FDmirror.c | 878 ++++++++++---------- src/H5FDmirror.h | 292 ------- src/H5FDmirror_priv.h | 323 ++++++++ src/H5FDmodule.h | 2 +- src/H5FDmpi.c | 33 +- src/H5FDmpi.h | 2 +- src/H5FDmpio.c | 2 +- src/H5FDmpio.h | 2 +- src/H5FDmulti.c | 21 +- src/H5FDmulti.h | 2 +- src/H5FDpkg.h | 2 +- src/H5FDprivate.h | 2 +- src/H5FDpublic.h | 2 +- src/H5FDros3.c | 728 +++++++--------- src/H5FDs3comms.c | 1705 ++++++++++++-------------------------- src/H5FDsec2.c | 187 ++--- src/H5FDsec2.h | 2 +- src/H5FDspace.c | 14 +- src/H5FDsplitter.c | 774 ++++++++--------- src/H5FDstdio.c | 2 +- src/H5FDstdio.h | 2 +- src/H5FDtest.c | 1 - src/H5FDwindows.h | 4 +- src/H5FL.c | 2 +- src/H5FLmodule.h | 2 +- src/H5FLprivate.h | 4 +- src/H5FS.c | 11 +- src/H5FScache.c | 12 +- src/H5FSdbg.c | 2 +- src/H5FSint.c | 2 +- src/H5FSmodule.h | 2 +- src/H5FSpkg.h | 2 +- src/H5FSprivate.h | 2 +- src/H5FSsection.c | 147 +--- src/H5Faccum.c | 18 +- src/H5Fcwfs.c | 2 +- src/H5Fdbg.c | 3 +- src/H5Fdeprec.c | 2 +- src/H5Fefc.c | 2 +- src/H5Ffake.c | 2 - src/H5Fint.c | 2 +- src/H5Fio.c | 6 +- src/H5Fmodule.h | 2 +- src/H5Fmount.c | 12 +- src/H5Fmpi.c | 2 +- src/H5Fpkg.h | 2 +- src/H5Fprivate.h | 14 +- src/H5Fquery.c | 3 +- src/H5Fspace.c | 2 +- src/H5Fsuper.c | 5 +- src/H5Fsuper_cache.c | 14 +- src/H5Ftest.c | 2 +- src/H5Gbtree2.c | 145 ++-- src/H5Gcache.c | 2 +- src/H5Gcompact.c | 20 +- src/H5Gdense.c | 167 ++-- src/H5Gdeprec.c | 10 +- src/H5Gent.c | 9 +- src/H5Gint.c | 36 +- src/H5Glink.c | 48 +- src/H5Gloc.c | 10 +- src/H5Gmodule.h | 2 +- src/H5Gname.c | 78 +- src/H5Gnode.c | 96 +-- src/H5Gobj.c | 33 +- src/H5Gpkg.h | 2 +- src/H5Gprivate.h | 2 +- src/H5Gpublic.h | 2 +- src/H5Groot.c | 4 +- src/H5Gstab.c | 39 +- src/H5Gtest.c | 3 +- src/H5Gtraverse.c | 7 +- src/H5HF.c | 65 +- src/H5HFbtree2.c | 2 +- src/H5HFcache.c | 42 +- src/H5HFdbg.c | 35 +- src/H5HFdblock.c | 45 +- src/H5HFdtable.c | 81 +- src/H5HFhdr.c | 260 +++--- src/H5HFhuge.c | 64 +- src/H5HFiblock.c | 123 ++- src/H5HFiter.c | 132 +-- src/H5HFman.c | 31 +- src/H5HFmodule.h | 2 +- src/H5HFpkg.h | 128 ++- src/H5HFprivate.h | 18 +- src/H5HFsection.c | 385 ++++----- src/H5HFspace.c | 42 +- src/H5HFstat.c | 2 +- src/H5HFtest.c | 11 +- src/H5HFtiny.c | 86 +- src/H5HG.c | 4 +- src/H5HGcache.c | 2 +- src/H5HGdbg.c | 3 +- src/H5HGmodule.h | 2 +- src/H5HGpkg.h | 2 +- src/H5HGprivate.h | 2 +- src/H5HGquery.c | 2 +- src/H5HL.c | 2 +- src/H5HLcache.c | 2 +- src/H5HLdbg.c | 2 +- src/H5HLdblk.c | 2 +- src/H5HLint.c | 2 +- src/H5HLprfx.c | 2 +- src/H5HP.c | 72 +- src/H5Imodule.h | 2 +- src/H5Ipkg.h | 2 +- src/H5Itest.c | 2 +- src/H5L.c | 97 ++- src/H5Lexternal.c | 2 +- src/H5Lmodule.h | 2 +- src/H5Lpkg.h | 24 +- src/H5Lprivate.h | 22 - src/H5Lpublic.h | 2 +- src/H5MF.c | 36 +- src/H5MFaggr.c | 10 +- src/H5MFdbg.c | 5 +- src/H5MFmodule.h | 2 +- src/H5MFpkg.h | 3 +- src/H5MFprivate.h | 3 +- src/H5MFsection.c | 17 +- src/H5MM.c | 2 +- src/H5MMprivate.h | 2 +- src/H5MMpublic.h | 6 +- src/H5MP.c | 30 +- src/H5MPmodule.h | 2 +- src/H5MPpkg.h | 2 +- src/H5MPprivate.h | 2 +- src/H5MPtest.c | 18 +- src/H5Oainfo.c | 55 +- src/H5Oalloc.c | 17 +- src/H5Oattr.c | 112 +-- src/H5Oattribute.c | 54 -- src/H5Obogus.c | 36 +- src/H5Obtreek.c | 54 +- src/H5Ocache.c | 10 +- src/H5Ocache_image.c | 36 +- src/H5Ocopy.c | 34 +- src/H5Ocopy_ref.c | 112 ++- src/H5Odbg.c | 6 +- src/H5Odrvinfo.c | 57 +- src/H5Odtype.c | 170 ++-- src/H5Oefl.c | 60 +- src/H5Ofill.c | 179 ++-- src/H5Oflush.c | 2 +- src/H5Ofsinfo.c | 248 +++--- src/H5Oginfo.c | 65 +- src/H5Oint.c | 132 ++- src/H5Olayout.c | 4 +- src/H5Olinfo.c | 46 +- src/H5Olink.c | 57 +- src/H5Omessage.c | 36 +- src/H5Omodule.h | 2 +- src/H5Omtime.c | 86 +- src/H5Oname.c | 54 +- src/H5Onull.c | 1 - src/H5Opkg.h | 5 + src/H5Opline.c | 241 +++--- src/H5Oprivate.h | 11 +- src/H5Opublic.h | 2 +- src/H5Orefcount.c | 57 +- src/H5Osdspace.c | 105 +-- src/H5Oshared.c | 6 +- src/H5Oshared.h | 2 +- src/H5Oshmesg.c | 38 +- src/H5Ostab.c | 14 +- src/H5Otest.c | 4 +- src/H5Ounknown.c | 2 +- src/H5P.c | 2 +- src/H5PBmodule.h | 2 +- src/H5Pdapl.c | 42 +- src/H5Pdcpl.c | 80 +- src/H5Pdeprec.c | 2 +- src/H5Pdxpl.c | 18 +- src/H5Pencdec.c | 6 +- src/H5Pfapl.c | 164 ++-- src/H5Pfcpl.c | 39 +- src/H5Pfmpl.c | 14 +- src/H5Pgcpl.c | 2 +- src/H5Pint.c | 6 +- src/H5Plapl.c | 8 +- src/H5Plcpl.c | 14 +- src/H5Pmodule.h | 2 +- src/H5Pocpl.c | 83 +- src/H5Pocpypl.c | 2 +- src/H5Ppkg.h | 2 +- src/H5Pstrcpl.c | 2 +- src/H5Ptest.c | 2 +- src/H5RS.c | 14 +- src/H5Rdeprec.c | 152 +++- src/H5Rint.c | 193 ----- src/H5Rpkg.h | 4 - src/H5SL.c | 101 ++- src/H5SLmodule.h | 2 +- src/H5SM.c | 127 +-- src/H5SMbtree2.c | 42 - src/H5SMcache.c | 8 +- src/H5SMmessage.c | 26 +- src/H5SMmodule.h | 2 +- src/H5SMpkg.h | 14 +- src/H5SMprivate.h | 2 +- src/H5SMtest.c | 2 +- src/H5ST.c | 72 +- src/H5Sall.c | 2 +- src/H5Sdbg.c | 1 - src/H5Sdeprec.c | 1 - src/H5Shyper.c | 10 +- src/H5Smodule.h | 2 +- src/H5Snone.c | 2 +- src/H5Spkg.h | 2 +- src/H5Sselect.c | 38 +- src/H5Stest.c | 2 +- src/H5T.c | 32 +- src/H5TSprivate.h | 2 - src/H5Tcompound.c | 12 - src/H5Tconv.c | 106 +-- src/H5Tcset.c | 8 - src/H5Tdeprec.c | 2 +- src/H5Tenum.c | 49 +- src/H5Tfields.c | 13 - src/H5Tfixed.c | 9 - src/H5Tfloat.c | 4 - src/H5Tmodule.h | 2 +- src/H5Toffset.c | 20 +- src/H5Topaque.c | 4 - src/H5Torder.c | 14 +- src/H5Tpad.c | 8 - src/H5Tpkg.h | 3 +- src/H5Tprecis.c | 24 +- src/H5Tprivate.h | 1 - src/H5Tref.c | 8 +- src/H5Tstrpad.c | 8 - src/H5Tvisit.c | 2 +- src/H5VLnative_link.c | 22 +- src/H5VLnative_object.c | 8 +- src/H5VM.c | 77 +- src/H5VMprivate.h | 112 ++- src/H5WB.c | 6 +- src/H5WBprivate.h | 2 +- src/H5Z.c | 48 +- src/H5Zdeflate.c | 20 +- src/H5Zfletcher32.c | 27 +- src/H5Zmodule.h | 2 +- src/H5Znbit.c | 268 +++--- src/H5Zprivate.h | 2 +- src/H5Zpublic.h | 2 +- src/H5Zscaleoffset.c | 192 ++--- src/H5Zshuffle.c | 34 +- src/H5Zszip.c | 50 +- src/H5Ztrans.c | 342 ++++---- src/H5checksum.c | 22 +- src/H5detect.c | 25 - src/H5private.h | 5 +- src/H5system.c | 2 - src/H5timer.c | 2 +- src/H5trace.c | 2 +- src/hdf5.lnt | 6 +- test/accum.c | 4 +- test/big.c | 4 +- test/btree2.c | 12 +- test/dsets.c | 4 +- test/earray.c | 54 +- test/fheap.c | 141 +--- test/hdfs.c | 29 +- test/mirror_vfd.c | 2 + test/pool.c | 4 +- test/swmr_addrem_writer.c | 20 - test/swmr_generator.c | 28 - test/swmr_remove_writer.c | 20 - test/swmr_sparse_writer.c | 20 - test/swmr_start_write.c | 10 - test/swmr_writer.c | 16 - test/tattr.c | 11 +- utils/mirror_vfd/mirror_remote.h | 2 + 362 files changed, 6711 insertions(+), 10270 deletions(-) create mode 100644 src/H5FDmirror_priv.h diff --git a/MANIFEST b/MANIFEST index 9720ebf..6aaf772 100644 --- a/MANIFEST +++ b/MANIFEST @@ -692,6 +692,7 @@ ./src/H5FDlog.h ./src/H5FDmirror.c ./src/H5FDmirror.h +./src/H5FDmirror_priv.h ./src/H5FDmodule.h ./src/H5FDmpi.c ./src/H5FDmpi.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 39a9e3e..022e5a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -839,6 +839,7 @@ set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5FApkg.h ${HDF5_SRC_DIR}/H5FAprivate.h + ${HDF5_SRC_DIR}/H5FDmirror_priv.h ${HDF5_SRC_DIR}/H5FDpkg.h ${HDF5_SRC_DIR}/H5FDprivate.h diff --git a/src/H5.c b/src/H5.c index 31b8546..4e5648a 100644 --- a/src/H5.c +++ b/src/H5.c @@ -50,9 +50,9 @@ /********************/ /* Local Prototypes */ /********************/ -static void H5_debug_mask(const char*); +static void H5__debug_mask(const char*); #ifdef H5_HAVE_PARALLEL -static int H5_mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag); +static int H5__mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag); #endif /*H5_HAVE_PARALLEL*/ /*********************/ @@ -139,7 +139,7 @@ H5_init_library(void) int key_val; if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, - (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb, + (MPI_Comm_delete_attr_function *)H5__mpi_delete_cb, &key_val, NULL))) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_create_keyval failed", mpi_code) @@ -219,10 +219,6 @@ H5_init_library(void) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize vol interface") if(H5P_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize property list interface") - if(H5T_init() < 0) - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize datatype interface") - if(H5D_init() < 0) - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize dataset interface") if(H5AC_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize metadata caching interface") if(H5L_init() < 0) @@ -235,8 +231,8 @@ H5_init_library(void) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize vol interface") /* Debugging? */ - H5_debug_mask("-all"); - H5_debug_mask(HDgetenv("HDF5_DEBUG")); + H5__debug_mask("-all"); + H5__debug_mask(HDgetenv("HDF5_DEBUG")); done: FUNC_LEAVE_NOAPI(ret_value) @@ -639,7 +635,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5_debug_mask + * Function: H5__debug_mask * * Purpose: Set runtime debugging flags according to the string S. The * string should contain file numbers and package names @@ -662,7 +658,7 @@ done: *------------------------------------------------------------------------- */ static void -H5_debug_mask(const char *s) +H5__debug_mask(const char *s) { FILE *stream = stderr; char pkg_name[32], *rest; @@ -738,12 +734,12 @@ H5_debug_mask(const char *s) return; -} /* end H5_debug_mask() */ +} /* end H5__debug_mask() */ #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5_mpi_delete_cb + * Function: H5__mpi_delete_cb * * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 * library when the communicator is destroyed, i.e. on MPI_Finalize. @@ -752,7 +748,7 @@ H5_debug_mask(const char *s) * *------------------------------------------------------------------------- */ -static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag) +static int H5__mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag) { H5_term_library(); return MPI_SUCCESS; diff --git a/src/H5AC.c b/src/H5AC.c index 402f562..51e5102 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -15,7 +15,7 @@ * * Created: H5AC.c * Jul 9 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Functions in this file implement a cache for * things which exist on disk. All "things" associated @@ -239,8 +239,6 @@ H5AC_term_package(void) * * Programmer: John Mainzer, 1/10/17 * - * Changes: None. - * *------------------------------------------------------------------------- */ hbool_t @@ -275,7 +273,6 @@ H5AC_cache_image_pending(const H5F_t *f) * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -469,7 +466,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -587,7 +583,6 @@ H5AC_evict(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't evict cache") done: - /* If currently logging, generate a message */ if(f->shared->cache->log_info->logging) if(H5C_log_write_evict_cache_msg(f->shared->cache, ret_value) < 0) @@ -655,7 +650,6 @@ done: * request to flush all items and something was protected. * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -775,7 +769,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -1075,7 +1068,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -1271,7 +1263,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Sep 2 1997 * *------------------------------------------------------------------------- @@ -1509,7 +1500,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Sep 2 1997 * *------------------------------------------------------------------------- @@ -1536,8 +1526,8 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, HDassert(type->image_len); HDassert(H5F_addr_defined(addr)); HDassert(thing); - HDassert( ((H5AC_info_t *)thing)->addr == addr ); - HDassert( ((H5AC_info_t *)thing)->type == type ); + HDassert(((H5AC_info_t *)thing)->addr == addr); + HDassert(((H5AC_info_t *)thing)->type == type); dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || (((H5AC_info_t *)thing)->dirtied)); diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index b40f8d0..94f3d83 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -270,10 +270,6 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, * * Programmer: John Mainzer, 5/30/14 * - * Changes: None. - * - * JRM -- 9/17/16 - * *------------------------------------------------------------------------- */ #ifndef NDEBUG @@ -351,8 +347,6 @@ H5AC_get_serialization_in_progress(H5F_t *f) * * Programmer: John Mainzer, 6/18/16 * - * Changes: None. - * *------------------------------------------------------------------------- */ #ifndef NDEBUG diff --git a/src/H5ACmodule.h b/src/H5ACmodule.h index e218b31..8c6eae2 100644 --- a/src/H5ACmodule.h +++ b/src/H5ACmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index f097e83..c6ffc80 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -15,7 +15,7 @@ * * Created: H5ACmpio.c * Jun 20 2015 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions in this file implement support for parallel * I/O cache functionality @@ -2284,7 +2284,6 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, * request to flush all items and something was protected. * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 22 2009 * *------------------------------------------------------------------------- diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index b932e16..f6c3d6b 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -15,7 +15,7 @@ * * Created: H5ACprivate.h * Jul 9 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Constants and typedefs available to the rest of the * library. diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index a48aa69..e6f4010 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -15,12 +15,10 @@ * * Created: H5ACpublic.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public include file for cache functions. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef _H5ACpublic_H diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 3377aa2..843799e 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -15,7 +15,7 @@ * * Created: H5Abtree2.c * Dec 4 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: v2 B-tree callbacks for indexing attributes on objects * @@ -152,7 +152,6 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 4 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Adense.c b/src/H5Adense.c index fd92e8f..ac6501a 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -15,7 +15,7 @@ * * Created: H5Adense.c * Dec 4 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for operating on "dense" attribute storage * for an object. @@ -209,9 +209,6 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo) /* Retrieve the heap's address in the file */ if(H5HF_get_heap_addr(fheap, &ainfo->fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap address") -#ifdef QAK -HDfprintf(stderr, "%s: ainfo->fheap_addr = %a\n", FUNC, ainfo->fheap_addr); -#endif /* QAK */ #ifndef NDEBUG { @@ -221,9 +218,6 @@ HDfprintf(stderr, "%s: ainfo->fheap_addr = %a\n", FUNC, ainfo->fheap_addr); if(H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") HDassert(fheap_id_len == H5O_FHEAP_ID_LEN); -#ifdef QAK -HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); -#endif /* QAK */ } #endif /* NDEBUG */ @@ -243,9 +237,6 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); /* Retrieve the v2 B-tree's address in the file */ if(H5B2_get_addr(bt2_name, &ainfo->name_bt2_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index") -#ifdef QAK -HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr); -#endif /* QAK */ /* Check if we should create a creation order index v2 B-tree */ if(ainfo->index_corder) { @@ -264,9 +255,6 @@ HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr) /* Retrieve the v2 B-tree's address in the file */ if(H5B2_get_addr(bt2_corder, &ainfo->corder_bt2_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index") -#ifdef QAK -HDfprintf(stderr, "%s: ainfo->corder_bt2_addr = %a\n", FUNC, ainfo->corder_bt2_addr); -#endif /* QAK */ } /* end if */ done: diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index dd5eae3..c4d8bb8 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -15,7 +15,7 @@ * * Created: H5Adeprec.c * November 27 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5A interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Aint.c b/src/H5Aint.c index d6ea1f4..5ecfd06 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -14,8 +14,8 @@ /*------------------------------------------------------------------------- * * Created: H5Aint.c - * Dec 18 2006 - * Quincey Koziol + * Dec 18 2006 + * Quincey Koziol * * Purpose: Internal routines for managing attributes. * @@ -2416,7 +2416,6 @@ done: * Failure: Negative * * Programmer: Peter Cao - * xcao@hdfgroup.org * July 20, 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Amodule.h b/src/H5Amodule.h index 8ed056b..6b835e1 100644 --- a/src/H5Amodule.h +++ b/src/H5Amodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Apkg.h b/src/H5Apkg.h index f3870c0..39fdea3 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -263,9 +263,6 @@ H5_DLL herr_t H5O__attr_remove(const H5O_loc_t *loc, const char *name); H5_DLL herr_t H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL htri_t H5O__attr_exists(const H5O_loc_t *loc, const char *name); -#ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL int H5O__attr_count(const H5O_loc_t *loc); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ H5_DLL H5A_t *H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info); H5_DLL herr_t H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src, diff --git a/src/H5B.c b/src/H5B.c index f909d90..2ab5198 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -15,7 +15,7 @@ * * Created: H5B.c * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Implements balanced, sibling-linked, N-ary trees * capable of storing any type of data with unique key @@ -206,7 +206,6 @@ H5FL_SEQ_DEFINE_STATIC(size_t); * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -291,7 +290,6 @@ done: * UDATA is undefined). * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -387,7 +385,6 @@ done: * returned through the NEW_ADDR argument). Negative on failure. * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 3 1997 * *------------------------------------------------------------------------- @@ -542,7 +539,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -700,7 +696,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 8 1997 * *------------------------------------------------------------------------- @@ -789,7 +784,6 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, * Failure: H5B_INS_ERROR * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -1118,7 +1112,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -1185,7 +1178,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -1679,7 +1671,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 27 2008 * *------------------------------------------------------------------------- @@ -1786,7 +1777,6 @@ H5B_shared_free(void *_shared) * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 18 2000 * *------------------------------------------------------------------------- @@ -1852,7 +1842,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 3 2008 * *------------------------------------------------------------------------- @@ -2066,7 +2055,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 26, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5B2.c b/src/H5B2.c index 5c83de2..06806aa 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -1497,9 +1497,6 @@ H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, H5B2_remove_t op, HDassert(H5F_addr_defined(addr)); /* Lock the v2 B-tree header into memory */ -#ifdef QAK -HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); -#endif /* QAK */ if(NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 80cb6c5..3b7dd5d 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -15,7 +15,7 @@ * * Created: H5B2cache.c * Jan 31 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement v2 B-tree metadata cache methods. * @@ -171,7 +171,6 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 18, 2010 * *------------------------------------------------------------------------- @@ -240,7 +239,6 @@ H5B2__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 1 2005 * *------------------------------------------------------------------------- @@ -339,7 +337,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 20, 2010 * *------------------------------------------------------------------------- @@ -370,7 +367,6 @@ H5B2__cache_hdr_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 1 2005 * *------------------------------------------------------------------------- @@ -442,7 +438,6 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Apr 24 2012 * *------------------------------------------------------------------------- @@ -530,7 +525,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy - * mcgreevy@hdfgroup.org * June 18, 2008 * *------------------------------------------------------------------------- @@ -562,7 +556,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 18, 2010 * *------------------------------------------------------------------------- @@ -637,7 +630,6 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -756,7 +748,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 20, 2010 * *------------------------------------------------------------------------- @@ -788,7 +779,6 @@ H5B2__cache_int_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 3 2005 * *------------------------------------------------------------------------- @@ -875,7 +865,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Apr 25 2012 * *------------------------------------------------------------------------- @@ -886,7 +875,7 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing) H5B2_internal_t *internal = (H5B2_internal_t *)_thing; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -952,7 +941,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy - * mcgreevy@hdfgroup.org * June 18, 2008 * *------------------------------------------------------------------------- @@ -985,7 +973,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 18, 2010 * *------------------------------------------------------------------------- @@ -1060,7 +1047,6 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -1159,7 +1145,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 20, 2010 * *------------------------------------------------------------------------- @@ -1191,7 +1176,6 @@ H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -1264,7 +1248,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Apr 25 2012 * *------------------------------------------------------------------------- @@ -1275,7 +1258,7 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing) H5B2_leaf_t *leaf = (H5B2_leaf_t *)_thing; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1341,7 +1324,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy - * mcgreevy@hdfgroup.org * June 18, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index b5b1c03..0d93ed6 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -15,7 +15,7 @@ * * Created: H5B2dbg.c * Feb 2 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Dump debugging information about a v2 B-tree. * @@ -80,7 +80,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -175,7 +174,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 4 2005 * *------------------------------------------------------------------------- @@ -287,7 +285,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 7 2005 * *------------------------------------------------------------------------- diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 9ba8235..fc5e7f8 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -174,7 +174,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ - u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); + u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned) HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); @@ -190,7 +190,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) * hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec; - u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); + u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[u].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec))) @@ -573,7 +573,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2015 * *------------------------------------------------------------------------- @@ -605,7 +604,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -682,7 +680,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 15 2009 * *------------------------------------------------------------------------- diff --git a/src/H5B2int.c b/src/H5B2int.c index 53ac835..3f9ae74 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -15,7 +15,7 @@ * * Created: H5B2int.c * Feb 27 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal routines for managing v2 B-trees. * @@ -97,7 +97,6 @@ H5FL_SEQ_EXTERN(H5B2_node_info_t); * record to locate is greater than all records to search). * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 3 2005 * *------------------------------------------------------------------------- @@ -141,7 +140,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 28 2006 * *------------------------------------------------------------------------- @@ -336,7 +334,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 3 2005 * *------------------------------------------------------------------------- @@ -370,7 +367,7 @@ H5B2__split_root(H5B2_hdr_t *hdr) hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100; hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) * hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec; - u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); + u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[hdr->depth].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") @@ -414,7 +411,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 9 2005 * *------------------------------------------------------------------------- @@ -658,7 +654,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 9 2005 * *------------------------------------------------------------------------- @@ -1032,7 +1027,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 4 2005 * *------------------------------------------------------------------------- @@ -1195,7 +1189,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 4 2005 * *------------------------------------------------------------------------- @@ -1437,7 +1430,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 23 2015 * *------------------------------------------------------------------------- @@ -1497,7 +1489,6 @@ done: * Return: Value from callback, non-negative on success, negative on error * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 11 2005 * *------------------------------------------------------------------------- @@ -1612,7 +1603,6 @@ done: * Return: Value from callback, non-negative on success, negative on error * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 9 2005 * *------------------------------------------------------------------------- @@ -1779,7 +1769,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@lbl.gov * Dec 1 2016 * *------------------------------------------------------------------------- @@ -1877,7 +1866,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@lbl.gov * Dec 1 2016 * *------------------------------------------------------------------------- diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 1fee0af..82f676f 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -15,7 +15,7 @@ * * Created: H5B2internal.c * Dec 01 2016 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for managing v2 B-tree internal ndoes. * @@ -87,7 +87,6 @@ H5FL_DEFINE(H5B2_internal_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 3 2005 * *------------------------------------------------------------------------- @@ -183,7 +182,6 @@ done: * Return: Pointer to internal node on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 25 2006 * *------------------------------------------------------------------------- @@ -277,7 +275,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 9 2005 * *------------------------------------------------------------------------- @@ -350,7 +347,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 2 2005 * *------------------------------------------------------------------------- @@ -513,7 +509,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 24 2015 * *------------------------------------------------------------------------- @@ -782,7 +777,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 3 2005 * *------------------------------------------------------------------------- @@ -1015,7 +1009,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -1300,7 +1293,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -1349,7 +1341,6 @@ done: * Return: Non-negative on success, negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 19 2005 * *------------------------------------------------------------------------- @@ -1390,7 +1381,6 @@ H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_U * Return: Non-negative on success, negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 19 2005 * *------------------------------------------------------------------------- diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 1fde36d..d2cfbe0 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -15,7 +15,7 @@ * * Created: H5B2leaf.c * Dec 01 2016 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for managing v2 B-tree leaf ndoes. * @@ -88,7 +88,6 @@ H5FL_DEFINE(H5B2_leaf_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -174,7 +173,6 @@ done: * Return: Pointer to leaf node on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 5 2010 * *------------------------------------------------------------------------- @@ -266,7 +264,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 9 2005 * *------------------------------------------------------------------------- @@ -340,7 +337,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 3 2005 * *------------------------------------------------------------------------- @@ -453,7 +449,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 23 2015 * *------------------------------------------------------------------------- @@ -608,7 +603,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 4 2005 * *------------------------------------------------------------------------- @@ -765,14 +759,14 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 3 2005 * *------------------------------------------------------------------------- */ herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, - H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data) + H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, + void *op_data) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ haddr_t leaf_addr = HADDR_UNDEF; /* Leaf address on disk */ @@ -874,7 +868,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -976,7 +969,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -1021,7 +1013,6 @@ done: * Return: Non-negative on success, negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 19 2005 * *------------------------------------------------------------------------- @@ -1045,7 +1036,6 @@ H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, * Return: Non-negative on success, negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 19 2005 * *------------------------------------------------------------------------- diff --git a/src/H5B2module.h b/src/H5B2module.h index 35c982c..6e8c92a 100644 --- a/src/H5B2module.h +++ b/src/H5B2module.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5B2stat.c b/src/H5B2stat.c index 5dd9cc2..5c09b3d 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, March 6, 2006 * * Purpose: v2 B-tree metadata statistics functions. diff --git a/src/H5B2test.c b/src/H5B2test.c index 7affd49..ee37c54 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, February 3, 2005 * * Purpose: v2 B-tree testing functions. diff --git a/src/H5Bcache.c b/src/H5Bcache.c index c2c7a80..80fb200 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -15,7 +15,7 @@ * * Created: H5Bcache.c * Oct 31 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement B-tree metadata cache methods. * @@ -98,7 +98,6 @@ const H5AC_class_t H5AC_BT[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 18, 2010 * *------------------------------------------------------------------------- @@ -135,7 +134,6 @@ H5B__cache_get_initial_load_size(void *_udata, size_t *image_len) * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 24, 2008 * *------------------------------------------------------------------------- @@ -241,7 +239,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 20, 2010 * *------------------------------------------------------------------------- @@ -277,7 +274,6 @@ H5B__cache_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 24, 2008 * *------------------------------------------------------------------------- @@ -363,7 +359,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 26, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5C.c b/src/H5C.c index 91e4158..fd4386c 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -147,11 +147,11 @@ static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr, static herr_t H5C__flush_invalidate_cache(H5F_t *f, unsigned flags); -static herr_t H5C_flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); +static herr_t H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); static herr_t H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); -static void * H5C_load_entry(H5F_t * f, +static void * H5C__load_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -166,19 +166,20 @@ static herr_t H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry); static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring); static herr_t H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); - +static herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr); static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t * type, haddr_t addr, size_t *len, hbool_t actual); #if H5C_DO_SLIST_SANITY_CHECKS -static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, +static hbool_t H5C__entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr); #endif /* H5C_DO_SLIST_SANITY_CHECKS */ #if H5C_DO_EXTREME_SANITY_CHECKS -static herr_t H5C_validate_lru_list(H5C_t * cache_ptr); -static herr_t H5C_validate_pinned_entry_list(H5C_t * cache_ptr); -static herr_t H5C_validate_protected_entry_list(H5C_t * cache_ptr); +static herr_t H5C__validate_lru_list(H5C_t * cache_ptr); +static herr_t H5C__validate_pinned_entry_list(H5C_t * cache_ptr); +static herr_t H5C__validate_protected_entry_list(H5C_t * cache_ptr); #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ #ifndef NDEBUG @@ -406,17 +407,17 @@ H5C_create(size_t max_cache_size, (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT; (cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off; - (cache_ptr->resize_ctl).flash_multiple = 1.0f; - (cache_ptr->resize_ctl).flash_threshold = 0.25f; + (cache_ptr->resize_ctl).flash_multiple = (double)1.0f; + (cache_ptr->resize_ctl).flash_threshold = (double)0.25f; (cache_ptr->resize_ctl).decr_mode = H5C_decr__off; - (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; - (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT; + (cache_ptr->resize_ctl).upper_hr_threshold = (double)H5C__DEF_AR_UPPER_THRESHHOLD; + (cache_ptr->resize_ctl).decrement = (double)H5C__DEF_AR_DECREMENT; (cache_ptr->resize_ctl).apply_max_decrement = TRUE; (cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT; (cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT; (cache_ptr->resize_ctl).apply_empty_reserve = TRUE; - (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE; + (cache_ptr->resize_ctl).empty_reserve = (double)H5C__DEF_AR_EMPTY_RESERVE; cache_ptr->epoch_markers_active = 0; @@ -691,7 +692,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, /*------------------------------------------------------------------------- - * Function: H5C_free_tag_list_cb + * Function: H5C__free_tag_list_cb * * Purpose: Callback function to free tag nodes from the skip list. * @@ -703,11 +704,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, *------------------------------------------------------------------------- */ static herr_t -H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) +H5C__free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) { H5C_tag_info_t *tag_info = (H5C_tag_info_t *)_item; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(tag_info); @@ -715,7 +716,7 @@ H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED tag_info = H5FL_FREE(H5C_tag_info_t, tag_info); FUNC_LEAVE_NOAPI(0) -} /* H5C_free_tag_list_cb() */ +} /* H5C__free_tag_list_cb() */ /*------------------------------------------------------------------------- @@ -863,7 +864,7 @@ H5C_dest(H5F_t * f) } /* end if */ if(cache_ptr->tag_list != NULL) { - H5SL_destroy(cache_ptr->tag_list, H5C_free_tag_list_cb, NULL); + H5SL_destroy(cache_ptr->tag_list, H5C__free_tag_list_cb, NULL); cache_ptr->tag_list = NULL; } /* end if */ @@ -951,7 +952,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag HDassert(H5F_addr_defined(addr)); #if H5C_DO_EXTREME_SANITY_CHECKS - if(H5C_validate_lru_list(cache_ptr) < 0) + if(H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -986,7 +987,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag done: #if H5C_DO_EXTREME_SANITY_CHECKS - if(H5C_validate_lru_list(cache_ptr) < 0) + if(H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1094,9 +1095,9 @@ H5C_flush_cache(H5F_t *f, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1277,9 +1278,9 @@ H5C_insert_entry(H5F_t * f, #if H5C_DO_EXTREME_SANITY_CHECKS /* no need to verify that entry is not already in the index as */ /* we already make that check below. */ - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1468,9 +1469,9 @@ H5C_insert_entry(H5F_t * f, H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL) #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1500,9 +1501,9 @@ H5C_insert_entry(H5F_t * f, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1828,9 +1829,9 @@ H5C_move_entry(H5C_t * cache_ptr, HDassert(H5F_addr_ne(old_addr, new_addr)); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1932,9 +1933,9 @@ H5C_move_entry(H5C_t * cache_ptr, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1981,8 +1982,8 @@ H5C_resize_entry(void *thing, size_t new_size) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??") #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2081,8 +2082,8 @@ H5C_resize_entry(void *thing, size_t new_size) done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2123,9 +2124,9 @@ H5C_pin_protected_entry(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2140,9 +2141,9 @@ H5C_pin_protected_entry(void *thing) done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2210,9 +2211,9 @@ H5C_protect(H5F_t * f, HDassert( H5F_addr_defined(addr) ); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2338,7 +2339,7 @@ H5C_protect(H5F_t * f, hit = FALSE; - if(NULL == (thing = H5C_load_entry(f, + if(NULL == (thing = H5C__load_entry(f, #ifdef H5_HAVE_PARALLEL coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -2592,9 +2593,9 @@ H5C_protect(H5F_t * f, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2910,9 +2911,9 @@ H5C_unpin_entry(void *_entry_ptr) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2923,9 +2924,9 @@ H5C_unpin_entry(void *_entry_ptr) done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3012,9 +3013,9 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) was_clean = ! ( entry_ptr->is_dirty ); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3211,9 +3212,9 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) { + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) { HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3958,7 +3959,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) enum H5C_resize_status status = in_spec; /* will change if needed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( f ); HDassert( cache_ptr ); @@ -4274,7 +4275,7 @@ H5C__autoadjust__ageout(H5F_t * f, double hit_rate, enum H5C_resize_status * sta size_t test_size; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( f ); HDassert( cache_ptr ); @@ -4375,10 +4376,10 @@ done: static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4492,7 +4493,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte H5C_cache_entry_t * prev_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( f ); HDassert( cache_ptr ); @@ -4675,10 +4676,10 @@ done: static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4745,11 +4746,11 @@ done: static herr_t H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - int i; int ring_buf_index; + int i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4822,11 +4823,11 @@ done: static herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - int i; int ring_buf_index; + int i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4912,7 +4913,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, double hit_rate; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -5128,7 +5129,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) */ ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { - if(H5C_flush_invalidate_ring(f, ring, flags) < 0) + if(H5C__flush_invalidate_ring(f, ring, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") ring++; } /* end while */ @@ -5176,7 +5177,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_flush_invalidate_ring + * Function: H5C__flush_invalidate_ring * * Purpose: Flush and destroy the entries contained in the target * cache and ring. @@ -5212,7 +5213,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) +H5C__flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) { H5C_t *cache_ptr; hbool_t restart_slist_scan; @@ -5231,7 +5232,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(f); HDassert(f->shared); @@ -5326,7 +5327,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * This flag is set to TRUE by H5C__flush_single_entry if the slist * is modified by a pre_serialize, serialize, or notify callback. * - * H5C_flush_invalidate_ring() uses this flag to detect any + * H5C__flush_invalidate_ring() uses this flag to detect any * modifications to the slist that might corrupt the scan of * the slist -- and restart the scan in this event. */ @@ -5622,7 +5623,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_flush_invalidate_ring() */ +} /* H5C__flush_invalidate_ring() */ /*------------------------------------------------------------------------- @@ -5679,9 +5680,9 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(ring < H5C_RING_NTYPES); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -6477,7 +6478,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5C_load_entry + * Function: H5C__load_entry * * Purpose: Attempt to load the entry at the specified disk address * and with the specified type into memory. If successful. @@ -6494,7 +6495,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5C_load_entry(H5F_t * f, +H5C__load_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -6514,7 +6515,7 @@ H5C_load_entry(H5F_t * f, #endif /* H5_HAVE_PARALLEL */ void * ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -6812,7 +6813,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_load_entry() */ +} /* H5C__load_entry() */ /*------------------------------------------------------------------------- @@ -7160,7 +7161,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5C_validate_lru_list + * Function: H5C__validate_lru_list * * Purpose: Debugging function that scans the LRU list for errors. * @@ -7172,123 +7173,73 @@ done: * * Programmer: John Mainzer, 7/14/05 * - * Changes: - * - * Added code to verify that the LRU contains no pinned - * entries. JRM -- 4/25/14 - * *------------------------------------------------------------------------- */ #if H5C_DO_EXTREME_SANITY_CHECKS - static herr_t -H5C_validate_lru_list(H5C_t * cache_ptr) +H5C__validate_lru_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC - if ( ( ( cache_ptr->LRU_head_ptr == NULL ) - || - ( cache_ptr->LRU_tail_ptr == NULL ) - ) - && - ( cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr ) - ) { + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + if(((cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_tail_ptr == NULL)) + && (cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed") - } if(cache_ptr->LRU_list_len < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed") - if ( ( cache_ptr->LRU_list_len == 1 ) - && - ( ( cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr ) - || - ( cache_ptr->LRU_head_ptr == NULL ) - || - ( cache_ptr->LRU_head_ptr->size != cache_ptr->LRU_list_size ) - ) - ) { - + if((cache_ptr->LRU_list_len == 1) && + ((cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr) || + (cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_head_ptr->size != cache_ptr->LRU_list_size))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed") - } - - if ( ( cache_ptr->LRU_list_len >= 1 ) - && - ( ( cache_ptr->LRU_head_ptr == NULL ) - || - ( cache_ptr->LRU_head_ptr->prev != NULL ) - || - ( cache_ptr->LRU_tail_ptr == NULL ) - || - ( cache_ptr->LRU_tail_ptr->next != NULL ) - ) - ) { + if((cache_ptr->LRU_list_len >= 1) && + ((cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_head_ptr->prev != NULL) + || (cache_ptr->LRU_tail_ptr == NULL) || (cache_ptr->LRU_tail_ptr->next != NULL))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed") - } entry_ptr = cache_ptr->LRU_head_ptr; - while ( entry_ptr != NULL ) - { - - if ( ( entry_ptr != cache_ptr->LRU_head_ptr ) && - ( ( entry_ptr->prev == NULL ) || - ( entry_ptr->prev->next != entry_ptr ) ) ) { - + while(entry_ptr != NULL) { + if((entry_ptr != cache_ptr->LRU_head_ptr) && + ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed") - } - - if ( ( entry_ptr != cache_ptr->LRU_tail_ptr ) && - ( ( entry_ptr->next == NULL ) || - ( entry_ptr->next->prev != entry_ptr ) ) ) { + if((entry_ptr != cache_ptr->LRU_tail_ptr) && + ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") - } - - if ( ( entry_ptr->is_pinned ) || - ( entry_ptr->pinned_from_client ) || - ( entry_ptr->pinned_from_cache ) ) { + if((entry_ptr->is_pinned) || + (entry_ptr->pinned_from_client) || (entry_ptr->pinned_from_cache)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed") - } len++; size += entry_ptr->size; entry_ptr = entry_ptr->next; } - if ( ( cache_ptr->LRU_list_len != len ) || - ( cache_ptr->LRU_list_size != size ) ) { - + if((cache_ptr->LRU_list_len != len) || (cache_ptr->LRU_list_size != size)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed") - } done: - - if ( ret_value != SUCCEED ) { - + if(ret_value != SUCCEED) HDassert(0); - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_validate_lru_list() */ - +} /* H5C__validate_lru_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_validate_pinned_entry_list + * Function: H5C__validate_pinned_entry_list * * Purpose: Debugging function that scans the pinned entry list for * errors. @@ -7301,126 +7252,78 @@ done: * * Programmer: John Mainzer, 4/25/14 * - * Changes: - * - * None. - * *------------------------------------------------------------------------- */ #if H5C_DO_EXTREME_SANITY_CHECKS - static herr_t -H5C_validate_pinned_entry_list(H5C_t * cache_ptr) +H5C__validate_pinned_entry_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC - if ( ( ( cache_ptr->pel_head_ptr == NULL ) - || - ( cache_ptr->pel_tail_ptr == NULL ) - ) - && - ( cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr ) - ) { + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + if(((cache_ptr->pel_head_ptr == NULL) || (cache_ptr->pel_tail_ptr == NULL)) + && (cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed") - } if(cache_ptr->pel_len < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed") - if ( ( cache_ptr->pel_len == 1 ) - && - ( ( cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr ) - || - ( cache_ptr->pel_head_ptr == NULL ) - || - ( cache_ptr->pel_head_ptr->size != cache_ptr->pel_size ) - ) - ) { - + if((cache_ptr->pel_len == 1) && + ((cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr) || + (cache_ptr->pel_head_ptr == NULL) || + (cache_ptr->pel_head_ptr->size != cache_ptr->pel_size))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed") - } - - if ( ( cache_ptr->pel_len >= 1 ) - && - ( ( cache_ptr->pel_head_ptr == NULL ) - || - ( cache_ptr->pel_head_ptr->prev != NULL ) - || - ( cache_ptr->pel_tail_ptr == NULL ) - || - ( cache_ptr->pel_tail_ptr->next != NULL ) - ) - ) { + if((cache_ptr->pel_len >= 1) && + ((cache_ptr->pel_head_ptr == NULL) || + (cache_ptr->pel_head_ptr->prev != NULL) || + (cache_ptr->pel_tail_ptr == NULL) || + (cache_ptr->pel_tail_ptr->next != NULL))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed") - } entry_ptr = cache_ptr->pel_head_ptr; - while ( entry_ptr != NULL ) - { - - if ( ( entry_ptr != cache_ptr->pel_head_ptr ) && - ( ( entry_ptr->prev == NULL ) || - ( entry_ptr->prev->next != entry_ptr ) ) ) { - + while(entry_ptr != NULL) { + if((entry_ptr != cache_ptr->pel_head_ptr) && + ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed") - } - - if ( ( entry_ptr != cache_ptr->pel_tail_ptr ) && - ( ( entry_ptr->next == NULL ) || - ( entry_ptr->next->prev != entry_ptr ) ) ) { + if((entry_ptr != cache_ptr->pel_tail_ptr) && + ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") - } - - if ( ! entry_ptr->is_pinned ) { + if(!entry_ptr->is_pinned) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed") - } - - if ( ! ( ( entry_ptr->pinned_from_client ) || - ( entry_ptr->pinned_from_cache ) ) ) { + if(!(entry_ptr->pinned_from_client || entry_ptr->pinned_from_cache)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed") - } len++; size += entry_ptr->size; entry_ptr = entry_ptr->next; } - if ( ( cache_ptr->pel_len != len ) || - ( cache_ptr->pel_size != size ) ) { - + if((cache_ptr->pel_len != len) || (cache_ptr->pel_size != size)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 9 failed") - } done: - - if ( ret_value != SUCCEED ) { - + if(ret_value != SUCCEED) HDassert(0); - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_validate_pinned_entry_list() */ - +} /* H5C__validate_pinned_entry_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_validate_protected_entry_list + * Function: H5C__validate_protected_entry_list * * Purpose: Debugging function that scans the protected entry list for * errors. @@ -7433,26 +7336,21 @@ done: * * Programmer: John Mainzer, 4/25/14 * - * Changes: - * - * None. - * *------------------------------------------------------------------------- */ #if H5C_DO_EXTREME_SANITY_CHECKS - static herr_t -H5C_validate_protected_entry_list(H5C_t * cache_ptr) +H5C__validate_protected_entry_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); if(((cache_ptr->pl_head_ptr == NULL) || (cache_ptr->pl_tail_ptr == NULL)) && (cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr)) @@ -7461,91 +7359,55 @@ H5C_validate_protected_entry_list(H5C_t * cache_ptr) if(cache_ptr->pl_len < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed") - if ( ( cache_ptr->pl_len == 1 ) - && - ( ( cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr ) - || - ( cache_ptr->pl_head_ptr == NULL ) - || - ( cache_ptr->pl_head_ptr->size != cache_ptr->pl_size ) - ) - ) { - + if((cache_ptr->pl_len == 1) && + ((cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr) || + (cache_ptr->pl_head_ptr == NULL) || + (cache_ptr->pl_head_ptr->size != cache_ptr->pl_size))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed") - } - - if ( ( cache_ptr->pl_len >= 1 ) - && - ( ( cache_ptr->pl_head_ptr == NULL ) - || - ( cache_ptr->pl_head_ptr->prev != NULL ) - || - ( cache_ptr->pl_tail_ptr == NULL ) - || - ( cache_ptr->pl_tail_ptr->next != NULL ) - ) - ) { + if((cache_ptr->pl_len >= 1) && + ((cache_ptr->pl_head_ptr == NULL) || + (cache_ptr->pl_head_ptr->prev != NULL) || + (cache_ptr->pl_tail_ptr == NULL) || + (cache_ptr->pl_tail_ptr->next != NULL))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed") - } entry_ptr = cache_ptr->pl_head_ptr; - while ( entry_ptr != NULL ) - { - - if ( ( entry_ptr != cache_ptr->pl_head_ptr ) && - ( ( entry_ptr->prev == NULL ) || - ( entry_ptr->prev->next != entry_ptr ) ) ) { - + while(entry_ptr != NULL) { + if((entry_ptr != cache_ptr->pl_head_ptr) && + ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed") - } - - if ( ( entry_ptr != cache_ptr->pl_tail_ptr ) && - ( ( entry_ptr->next == NULL ) || - ( entry_ptr->next->prev != entry_ptr ) ) ) { + if((entry_ptr != cache_ptr->pl_tail_ptr) && + ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") - } - - if ( ! entry_ptr->is_protected ) { + if(!entry_ptr->is_protected) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed") - } - - if ( ( entry_ptr->is_read_only ) && - ( entry_ptr->ro_ref_count <= 0 ) ) { + if(entry_ptr->is_read_only && (entry_ptr->ro_ref_count <= 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed") - } len++; size += entry_ptr->size; entry_ptr = entry_ptr->next; } - if ( ( cache_ptr->pl_len != len ) || - ( cache_ptr->pl_size != size ) ) { - + if((cache_ptr->pl_len != len) || (cache_ptr->pl_size != size)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 9 failed") - } done: - - if ( ret_value != SUCCEED ) { - + if(ret_value != SUCCEED) HDassert(0); - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_validate_protected_entry_list() */ - +} /* H5C__validate_protected_entry_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_entry_in_skip_list + * Function: H5C__entry_in_skip_list * * Purpose: Debugging function that scans skip list to see if it * is in present. We need this, as it is possible for @@ -7556,49 +7418,39 @@ done: * * Programmer: John Mainzer, 11/1/14 * - * Changes: - * - * None. - * *------------------------------------------------------------------------- */ #if H5C_DO_SLIST_SANITY_CHECKS - static hbool_t -H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) +H5C__entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) { - hbool_t in_slist = FALSE; - H5SL_node_t * node_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; + H5SL_node_t *node_ptr; + hbool_t in_slist; - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->slist_ptr ); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_ptr); node_ptr = H5SL_first(cache_ptr->slist_ptr); + in_slist = FALSE; + while((node_ptr != NULL) && (!in_slist)) { + H5C_cache_entry_t *entry_ptr; - while ( ( node_ptr != NULL ) && ( ! in_slist ) ) - { entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - HDassert( entry_ptr ); - HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( entry_ptr->is_dirty ); - HDassert( entry_ptr->in_slist ); - - if ( entry_ptr == target_ptr ) { + HDassert(entry_ptr); + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->is_dirty); + HDassert(entry_ptr->in_slist); + if(entry_ptr == target_ptr) in_slist = TRUE; - - } else { - + else node_ptr = H5SL_next(node_ptr); - } } return(in_slist); - -} /* H5C_entry_in_skip_list() */ +} /* H5C__entry_in_skip_list() */ #endif /* H5C_DO_SLIST_SANITY_CHECKS */ @@ -8062,9 +7914,9 @@ H5C__serialize_cache(H5F_t *f) #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -8502,7 +8354,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) { haddr_t new_addr = HADDR_UNDEF; @@ -8511,7 +8363,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET; herr_t ret_value = SUCCEED; - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); diff --git a/src/H5CS.c b/src/H5CS.c index 3fccce4..324d383 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -123,8 +123,6 @@ H5CS__get_stack(void) * Programmer: Quincey Koziol * Thursday, February 6, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -214,8 +212,6 @@ H5CS_push(const char *func_name) * Programmer: Quincey Koziol * Thursday, February 6, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5CX.c b/src/H5CX.c index b78d9ec..6beaf56 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, February 19, 2018 * * Purpose: diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index d5599f2..425bda3 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -1086,74 +1086,6 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) return; } /* H5C_stats__reset() */ -extern void -H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, - hbool_t dump_parents, const char *prefix, int indent); - -static void -H5C__dump_parents(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, const char *prefix, int indent) -{ - unsigned u; - - for(u = 0; u < entry_ptr->flush_dep_nparents; u++) - H5C__dump_entry(cache_ptr, entry_ptr->flush_dep_parent[u], TRUE, prefix, indent + 2); -} - -typedef struct H5C__dump_child_ctx_t { - H5C_t *cache_ptr; - const H5C_cache_entry_t *parent; - hbool_t dump_parents; - const char *prefix; - int indent; -} H5C__dump_child_ctx_t; - -static int -H5C__dump_children_cb(H5C_cache_entry_t *entry_ptr, void *_ctx) -{ - H5C__dump_child_ctx_t *ctx = (H5C__dump_child_ctx_t *)_ctx; - - if(entry_ptr->tag_info->tag != entry_ptr->addr) { - unsigned u; - - HDassert(entry_ptr->flush_dep_nparents); - for(u = 0; u < entry_ptr->flush_dep_nparents; u++) - if(ctx->parent == entry_ptr->flush_dep_parent[u]) - H5C__dump_entry(ctx->cache_ptr, entry_ptr, ctx->dump_parents, ctx->prefix, ctx->indent + 2); - } /* end if */ - - return(H5_ITER_CONT); -} /* end H5C__dump_children_cb() */ - -static void -H5C__dump_children(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, - hbool_t dump_parents, const char *prefix, int indent) -{ - H5C__dump_child_ctx_t ctx; - - HDassert(entry_ptr->tag_info); - - ctx.cache_ptr = cache_ptr; - ctx.parent = entry_ptr; - ctx.dump_parents = dump_parents; - ctx.prefix = prefix; - ctx.indent = indent; - H5C__iter_tagged_entries(cache_ptr, entry_ptr->tag_info->tag, FALSE, H5C__dump_children_cb, &ctx); -} /* end H5C__dump_children() */ - -void -H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, - hbool_t dump_parents, const char *prefix, int indent) -{ - HDassert(cache_ptr); - HDassert(entry_ptr); - - HDfprintf(stderr, "%*s%s: entry_ptr = (%a, '%s', %a, %t, %u, %u/%u)\n", indent, "", prefix, entry_ptr->addr, entry_ptr->type->name, entry_ptr->tag_info ? entry_ptr->tag_info->tag : HADDR_UNDEF, entry_ptr->is_dirty, entry_ptr->flush_dep_nparents, entry_ptr->flush_dep_nchildren, entry_ptr->flush_dep_ndirty_children); - if(dump_parents && entry_ptr->flush_dep_nparents) - H5C__dump_parents(cache_ptr, entry_ptr, "Parent", indent); - if(entry_ptr->flush_dep_nchildren) - H5C__dump_children(cache_ptr, entry_ptr, FALSE, "Child", indent); -} /* end H5C__dump_entry() */ - /*------------------------------------------------------------------------- * Function: H5C_flush_dependency_exists() diff --git a/src/H5Cimage.c b/src/H5Cimage.c index ee286d9..26cbe7d 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -864,54 +864,6 @@ H5C__free_image_entries_array(H5C_t * cache_ptr) /*------------------------------------------------------------------------- - * Function: H5C_force_cache_image_load() - * - * Purpose: On rare occasions, it is necessary to run - * H5MF_tidy_self_referential_fsm_hack() prior to the first - * metadata cache access. This is a problem as if there is a - * cache image at the end of the file, that routine will - * discard it. - * - * We solve this issue by calling this function, which will - * load the cache image and then call - * H5MF_tidy_self_referential_fsm_hack() to discard it. - * - * Return: SUCCEED on success, and FAIL on failure. - * - * Programmer: John Mainzer - * 1/11/17 - * - *------------------------------------------------------------------------- - */ -herr_t -H5C_force_cache_image_load(H5F_t *f) -{ - H5C_t *cache_ptr; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(cache_ptr->load_image); - - /* Load the cache image, if requested */ - if(cache_ptr->load_image) { - cache_ptr->load_image = FALSE; - if(H5C__load_cache_image(f) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "can't load cache image") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_force_cache_image_load() */ - - -/*------------------------------------------------------------------------- * Function: H5C_get_cache_image_config * * Purpose: Copy the current configuration for cache image generation diff --git a/src/H5Cmodule.h b/src/H5Cmodule.h index 534404d..5b23490 100644 --- a/src/H5Cmodule.h +++ b/src/H5Cmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 8712af5..22c67ce 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4911,8 +4911,6 @@ H5_DLL herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, size_t space_needed, hbool_t write_permitted); H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f); -H5_DLL herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, - H5C_cache_entry_t *entry_ptr); H5_DLL herr_t H5C__serialize_cache(H5F_t *f); H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, H5C_tag_iter_cb_t cb, void *cb_ctx); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 0ba0234..f82f8df 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -20,8 +20,6 @@ * Purpose: Constants and typedefs available to the rest of the * library. * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -2243,7 +2241,6 @@ H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags); H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags); H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); -H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f); H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global); H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags); H5_DLL herr_t H5C_get_tag(const void *thing, /*OUT*/ haddr_t *tag); diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h index 62107d9..565f41b 100644 --- a/src/H5Cpublic.h +++ b/src/H5Cpublic.h @@ -19,8 +19,6 @@ * * Purpose: Public include file for cache functions. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef _H5Cpublic_H diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 098e01b..c80f90a 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 8, 1997 * * Purpose: v1 B-tree indexed (chunked) I/O functions. The chunks are @@ -338,7 +338,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Compare the offsets but ignore the other fields */ - ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); + ret_value = H5VM__vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_cmp2() */ @@ -620,8 +620,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * March 28, 2002 * *------------------------------------------------------------------------- diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index ccb786b..b9cf6cd 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -112,7 +112,7 @@ static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data); */ static herr_t H5D__bt2_remove_cb(const void *nrecord, void *_udata); -/* Callback for H5B2_modify() which is called in H5D__bt2_idx_insert() */ +/* Callback for H5B2_update() which is called in H5D__bt2_idx_insert() */ static herr_t H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed); /* Chunked layout indexing callbacks for v2 B-tree indexing */ @@ -256,7 +256,7 @@ H5D__bt2_crt_context(void *_udata) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -355,7 +355,7 @@ H5D__bt2_compare(const void *_udata, const void *_rec2, int *result) HDassert(rec2); /* Compare the offsets but ignore the other fields */ - *result = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); + *result = H5VM__vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* H5D__bt2_compare() */ @@ -773,7 +773,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; @@ -837,7 +837,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) * Function: H5D__bt2_mod_cb * * Purpose: Modify record for dataset chunk when it is found in a v2 B-tree. - * This is the callback for H5B2_modify() which is called in + * This is the callback for H5B2_update() which is called in * H5D__bt2_idx_insert(). * * Return: Success: non-negative @@ -1266,13 +1266,6 @@ done: * * Programmer: Vailin Choi; June 2010 * - * Modifications: - * Vailin Choi; March 2011 - * Initialize size of an unfiltered chunk. - * This is a fix for for the assertion failure in: - * [src/H5FSsection.c:968: H5FS_sect_link_size: Assertion `bin < sinfo->nbins' failed.] - * which is uncovered by test_unlink_chunked_dataset() in test/unlink.c - * *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index ee83564..4d351dd 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, April 24, 2008 * * Purpose: Abstract indexed (chunked) I/O functions. The logical @@ -278,7 +278,7 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -/* format convert cb */ +/* Format convert cb */ static int H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata); /* Helper routines */ @@ -300,9 +300,7 @@ static herr_t H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info); static herr_t H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info); - static herr_t H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm); - static herr_t H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm); static herr_t H5D__chunk_file_cb(void *elem, const H5T_t *type, unsigned ndims, const hsize_t *coords, void *fm); @@ -327,8 +325,8 @@ static herr_t H5D__chunk_collective_fill(const H5D_t *dset, static int H5D__chunk_cmp_addr(const void *addr1, const void *addr2); #endif /* H5_HAVE_PARALLEL */ -static int -H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata); +/* Debugging helper routine callback */ +static int H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata); /*********************/ /* Package Variables */ @@ -835,7 +833,7 @@ H5D__chunk_set_sizes(H5D_t *dset) unsigned enc_bytes_per_dim; /* Number of bytes required to encode this dimension */ /* Get encoded size of dim, in bytes */ - enc_bytes_per_dim = (H5VM_log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; + enc_bytes_per_dim = (H5VM__log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; /* Check if this is the largest value so far */ if(enc_bytes_per_dim > max_enc_bytes_per_dim) @@ -999,14 +997,14 @@ H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id) rdcc->scaled_dims[u] = (dset->shared->curr_dims[u] + dset->shared->layout.u.chunk.dim[u] - 1) / dset->shared->layout.u.chunk.dim[u]; - if( !(scaled_power2up = H5VM_power2up(rdcc->scaled_dims[u])) ) + if(!(scaled_power2up = H5VM__power2up(rdcc->scaled_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Inital 'power2up' values for scaled dimensions */ rdcc->scaled_power2up[u] = scaled_power2up; /* Number of bits required to encode scaled dimension size */ - rdcc->scaled_encode_bits[u] = H5VM_log2_gen(rdcc->scaled_power2up[u]); + rdcc->scaled_encode_bits[u] = H5VM__log2_gen(rdcc->scaled_power2up[u]); } /* end for */ } /* end if */ @@ -2821,12 +2819,12 @@ H5D__chunk_flush(H5D_t *dset) /* Loop over all entries in the chunk cache */ for(ent = rdcc->head; ent; ent = next) { - next = ent->next; + next = ent->next; if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0) nerrors++; } /* end for */ if(nerrors) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2970,7 +2968,7 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /* Reset index structures */ if((storage->ops->reset)(storage, reset_addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2992,7 +2990,7 @@ done: static herr_t H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) { - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(last); @@ -3615,14 +3613,14 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size) { - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - size_t total = rdcc->nbytes_max; - const int nmeth = 2; /*number of methods */ - int w[1]; /*weighting as an interval */ - H5D_rdcc_ent_t *p[2], *cur; /*list pointers */ - H5D_rdcc_ent_t *n[2]; /*list next pointers */ - int nerrors = 0; /* Accumulated error count during preemptions */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); + size_t total = rdcc->nbytes_max; + const int nmeth = 2; /* Number of methods */ + int w[1]; /* Weighting as an interval */ + H5D_rdcc_ent_t *p[2], *cur; /* List pointers */ + H5D_rdcc_ent_t *n[2]; /* List next pointers */ + int nerrors = 0; /* Accumulated error count during preemptions */ + herr_t ret_value = SUCCEED;/* Return value */ FUNC_ENTER_STATIC @@ -3643,62 +3641,62 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size) while((p[0] || p[1]) && (rdcc->nbytes_used + size) > total) { int i; /* Local index variable */ - /* Introduce new pointers */ - for(i = 0; i < nmeth - 1; i++) + /* Introduce new pointers */ + for(i = 0; i < nmeth - 1; i++) if(0 == w[i]) p[i + 1] = rdcc->head; - /* Compute next value for each pointer */ - for(i = 0; i < nmeth; i++) + /* Compute next value for each pointer */ + for(i = 0; i < nmeth; i++) n[i] = p[i] ? p[i]->next : NULL; - /* Give each method a chance */ - for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { - if(0 == i && p[0] && !p[0]->locked && + /* Give each method a chance */ + for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { + if(0 == i && p[0] && !p[0]->locked && ((0 == p[0]->rd_count && 0 == p[0]->wr_count) || - (0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) || - (dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) { - /* - * Method 0: Preempt entries that have been completely written - * and/or completely read but not entries that are partially - * written or partially read. - */ - cur = p[0]; - } else if(1 == i && p[1] && !p[1]->locked) { - /* - * Method 1: Preempt the entry without regard to - * considerations other than being locked. This is the last - * resort preemption. - */ - cur = p[1]; - } else { - /* Nothing to preempt at this point */ - cur = NULL; - } + (0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) || + (dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) { + /* + * Method 0: Preempt entries that have been completely written + * and/or completely read but not entries that are partially + * written or partially read. + */ + cur = p[0]; + } else if(1 == i && p[1] && !p[1]->locked) { + /* + * Method 1: Preempt the entry without regard to + * considerations other than being locked. This is the last + * resort preemption. + */ + cur = p[1]; + } else { + /* Nothing to preempt at this point */ + cur = NULL; + } - if(cur) { + if(cur) { int j; /* Local index variable */ - for(j = 0; j < nmeth; j++) { - if(p[j] == cur) + for(j = 0; j < nmeth; j++) { + if(p[j] == cur) p[j] = NULL; - if(n[j] == cur) + if(n[j] == cur) n[j] = cur->next; - } /* end for */ - if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0) + } /* end for */ + if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0) nerrors++; - } /* end if */ - } /* end for */ + } /* end if */ + } /* end for */ - /* Advance pointers */ - for(i = 0; i < nmeth; i++) + /* Advance pointers */ + for(i = 0; i < nmeth; i++) p[i] = n[i]; - for(i = 0; i < nmeth - 1; i++) + for(i = 0; i < nmeth - 1; i++) w[i] -= 1; } /* end while */ if(nerrors) - HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry") + HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry") done: FUNC_LEAVE_NOAPI(ret_value) @@ -4347,7 +4345,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ hbool_t unfilt_edge_chunk_dim[H5O_LAYOUT_NDIMS]; /* Whether there are unfiltered edge chunks at the edge of each dimension */ hsize_t edge_chunk_scaled[H5O_LAYOUT_NDIMS]; /* Offset of the unfiltered edge chunks at the edge of each dimension */ unsigned nunfilt_edge_chunk_dims = 0; /* Number of dimensions on an edge */ - const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); + H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); /* Convenience variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4556,9 +4554,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") #ifndef NDEBUG /* None of the chunks should be allocated */ - if(H5D_CHUNK_IDX_NONE != sc->idx_type) { + if(H5D_CHUNK_IDX_NONE != sc->idx_type) HDassert(!H5F_addr_defined(udata.chunk_block.offset)); - } /* Make sure the chunk is really in the dataset and outside the * original dimensions */ @@ -5126,8 +5123,8 @@ H5D__chunk_cmp_addr(const void *addr1, const void *addr2) * * Return: Non-negative on success/Negative on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * March 26, 2002 + * Programmer: Pedro Vicente + * March 26, 2002 * *------------------------------------------------------------------------- */ @@ -5252,7 +5249,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * Algorithm: Robb Matzke * March 27, 2002 * @@ -5405,13 +5402,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) elmts_per_chunk = 1; for(u = 0; u < space_ndims; u++) { elmts_per_chunk *= layout->u.chunk.dim[u]; - chunk_dim[u] = layout->u.chunk.dim[u]; - shrunk_dim[u] = (space_dim[u] < old_dim[u]); + chunk_dim[u] = layout->u.chunk.dim[u]; + shrunk_dim[u] = (space_dim[u] < old_dim[u]); } /* end for */ /* Create a dataspace for a chunk & set the extent */ if(NULL == (chunk_space = H5S_create_simple(space_ndims, chunk_dim, NULL))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Reset hyperslab start array */ /* (hyperslabs will always start from origin) */ @@ -5599,7 +5596,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Remove the chunk from disk, if present */ if(H5F_addr_defined(chk_udata.chunk_block.offset)) { /* Update the offset in idx_udata */ - idx_udata.scaled = udata.common.scaled; + idx_udata.scaled = udata.common.scaled; /* Remove the chunk from disk */ if((sc->ops->remove)(&idx_info, &idx_udata) < 0) @@ -5989,7 +5986,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) if(pline && pline->nused) { must_filter = TRUE; if((udata->common.layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && - H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims)) + H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims)) must_filter = FALSE; } @@ -6890,12 +6887,12 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - allow_chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); + allow_chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); if(allow_chunk_size_len > 8) allow_chunk_size_len = 8; /* Compute encoded size of chunk */ - new_chunk_size_len = (H5VM_log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; + new_chunk_size_len = (H5VM__log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; if(new_chunk_size_len > 8) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?") @@ -6932,9 +6929,9 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old } /* end else */ } /* end if */ else { - HDassert(!H5F_addr_defined(new_chunk->offset)); - HDassert(new_chunk->length == idx_info->layout->size); - alloc_chunk = TRUE; + HDassert(!H5F_addr_defined(new_chunk->offset)); + HDassert(new_chunk->length == idx_info->layout->size); + alloc_chunk = TRUE; } /* end else */ /* Actually allocate space for the chunk in the file */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 809cdfc..1792fa2 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * August 5, 2002 * * Purpose: Compact dataset I/O functions. These routines are similar diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 655f660..662be69 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 28, 2000 * * Purpose: diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index f4f4223..7668389 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -15,7 +15,7 @@ * * Created: H5Ddeprec.c * April 5 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5D interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Dearray.c b/src/H5Dearray.c index a53489e..56be6a7 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -252,7 +252,7 @@ H5D__earray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -937,7 +937,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Defl.c b/src/H5Defl.c index 91caa61..79cec8c 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 30, 2004 */ @@ -336,9 +336,6 @@ done: * Programmer: Robb Matzke * Wednesday, March 4, 1998 * - * Modifications: - * Robb Matzke, 1999-07-28 - * The ADDR argument is passed by value. *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index a9202c2..a79471a 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -248,7 +248,7 @@ H5D__farray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -892,7 +892,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 94c7b1c..0efe98a 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -15,7 +15,7 @@ * * Created: H5Dfill.c * Jun 19 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Fill value operations for datasets * @@ -647,7 +647,7 @@ done: static herr_t H5D__fill_release(H5D_fill_buf_info_t *fb_info) { - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(fb_info); diff --git a/src/H5Dint.c b/src/H5Dint.c index c063bb9..d662cec 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -97,6 +97,7 @@ static herr_t H5D__vlen_get_buf_size_cb(void *elem, hid_t type_id, unsigned ndim const hsize_t *point, void *op_data); static herr_t H5D__vlen_get_buf_size_gen_cb(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *op_data); +static herr_t H5D__check_filters(H5D_t *dataset); /*********************/ @@ -671,7 +672,7 @@ H5D__cache_dataspace_info(const H5D_t *dset) for(u = 0; u < dset->shared->ndims; u++) { hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ - if( !(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u])) ) + if(!(scaled_power2up = H5VM__power2up(dset->shared->curr_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") dset->shared->curr_power2up[u] = scaled_power2up; } @@ -908,7 +909,7 @@ H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc) HDassert(dset); HDassert(oloc); - oh = H5O__create_ohdr(file, dset->shared->dcpl_id); + oh = H5O_create_ohdr(file, dset->shared->dcpl_id); if(NULL == oh) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "can't instantiate object header") @@ -917,7 +918,7 @@ H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "computed header size is invalid") /* Special allocation of space for compact datsets is handled by the call here. */ - if(H5O__apply_ohdr(file, oh, dset->shared->dcpl_id, ohdr_size, (size_t)1, oloc) == FAIL) + if(H5O_apply_ohdr(file, oh, dset->shared->dcpl_id, ohdr_size, (size_t)1, oloc) == FAIL) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "can't apply object header to file") done: @@ -1022,7 +1023,8 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) if(TRUE == use_minimized_header) { if(H5D__prepare_minimized_oh(file, dset, oloc) == FAIL) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create minimized dataset object header") - } else { + } /* end if */ + else { /* Add the dataset's raw data size to the size of the header, if the * raw data will be stored as compact */ @@ -2960,13 +2962,13 @@ done: * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ -herr_t +static herr_t H5D__check_filters(H5D_t *dataset) { H5O_fill_t *fill; /* Dataset's fill value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Check args */ HDassert(dataset); @@ -3086,14 +3088,14 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) dset->shared->cache.chunk.scaled_dims[dim_idx] > dset->shared->cache.chunk.nslots)) update_chunks = TRUE; - if(!(scaled_power2up = H5VM_power2up(scaled))) + if(!(scaled_power2up = H5VM__power2up(scaled))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Check if the number of bits required to encode the scaled size value changed */ if(dset->shared->cache.chunk.scaled_power2up[dim_idx] != scaled_power2up) { /* Update the 'power2up' & 'encode_bits' values for the current dimension */ dset->shared->cache.chunk.scaled_power2up[dim_idx] = scaled_power2up; - dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM_log2_gen(scaled_power2up); + dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM__log2_gen(scaled_power2up); /* Indicate that the cached chunk indices need to be updated */ update_chunks = TRUE; diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index cfed02e..e56f341 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1342,9 +1342,9 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDassert(fm); /* Obtain the current rank of the process and the number of processes */ - if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") - if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Set the actual-chunk-opt-mode property. */ @@ -1356,10 +1356,10 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* Build a list of selected chunks in the collective io operation */ - if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) + if(H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list") - if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ + if(io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ H5D_chk_idx_info_t index_info; H5D_chunk_ud_t udata; hsize_t mpi_buf_count; @@ -1379,15 +1379,15 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in * updating each chunk with the data modifications from other processes, * then re-filtering the chunk. */ - for (i = 0; i < chunk_list_num_entries; i++) - if (mpi_rank == chunk_list[i].owners.new_owner) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) + for(i = 0; i < chunk_list_num_entries; i++) + if(mpi_rank == chunk_list[i].owners.new_owner) + if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. */ - if (H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(H5D_filtered_collective_io_info_t), + if(H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(H5D_filtered_collective_io_info_t), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") @@ -1480,9 +1480,9 @@ done: H5MM_free(collective_chunk_list); /* Free the MPI buf and file types, if they were derived */ - if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) + if(mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) + if(file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) FUNC_LEAVE_NOAPI(ret_value) @@ -1770,9 +1770,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HDassert(fm); /* Obtain the current rank of the process and the number of processes */ - if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") - if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Set the actual chunk opt mode property */ @@ -1784,7 +1784,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* Build a list of selected chunks in the collective IO operation */ - if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) + if(H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list") /* Set up contiguous I/O info object */ @@ -1799,9 +1799,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Set dataset storage for I/O info */ io_info->store = &store; - if (io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ - for (i = 0; i < chunk_list_num_entries; i++) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) + if(io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ + for(i = 0; i < chunk_list_num_entries; i++) + if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't process chunk entry") } /* end if */ else { /* Filtered collective write */ @@ -1852,14 +1852,14 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Check if this process has a chunk to work on for this iteration */ hbool_t have_chunk_to_process = (i < chunk_list_num_entries) && (mpi_rank == chunk_list[i].owners.new_owner); - if (have_chunk_to_process) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) + if(have_chunk_to_process) + if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective re-allocation * of the chunks in the file */ - if (H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(H5D_filtered_collective_io_info_t), + if(H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(H5D_filtered_collective_io_info_t), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 40ddcb8..751d067 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Vailin Choi +/* Programmer: Vailin Choi * September 2010 * * Purpose: Implicit (Non Index) chunked I/O functions. diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 37a27d3..5efcc9b 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -234,8 +234,8 @@ typedef struct H5D_io_info_t { typedef struct H5D_chk_idx_info_t { H5F_t *f; /* File pointer for operation */ const H5O_pline_t *pline; /* I/O pipeline info */ - H5O_layout_chunk_t *layout; /* Chunk layout description */ - H5O_storage_chunk_t *storage; /* Chunk storage description */ + H5O_layout_chunk_t *layout; /* Chunk layout description */ + H5O_storage_chunk_t *storage; /* Chunk storage description */ } H5D_chk_idx_info_t; /* @@ -566,7 +566,6 @@ H5_DLL herr_t H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *coo H5_DLL haddr_t H5D__get_offset(const H5D_t *dset); H5_DLL herr_t H5D__vlen_get_buf_size(H5D_t *dset, hid_t type_id, hid_t space_id, hsize_t *size); H5_DLL herr_t H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id, hsize_t *size); -H5_DLL herr_t H5D__check_filters(H5D_t *dataset); H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size); H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset); H5_DLL herr_t H5D__flush_real(H5D_t *dataset); diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 33274bb..cd71e93 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Vailin Choi +/* Programmer: Vailin Choi * May 2011; updated 10/2015 * * Purpose: Single Chunk I/O functions. diff --git a/src/H5Dtest.c b/src/H5Dtest.c index 916ec72..7c791d4 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, May 27, 2004 * * Purpose: Dataset testing functions. diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index e07f538..799ee2b 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Wednesday, January 28, 2015 * * Purpose: @@ -2238,7 +2238,7 @@ H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset) size_t i, j; /* Local index variables */ hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(shared_dset); diff --git a/src/H5E.c b/src/H5E.c index f204864..0f7a031 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -391,7 +391,7 @@ H5E__get_stack(void) /*------------------------------------------------------------------------- - * Function: H5E_free_class + * Function: H5E__free_class * * Purpose: Private function to free an error class. * @@ -403,9 +403,9 @@ H5E__get_stack(void) *------------------------------------------------------------------------- */ static herr_t -H5E_free_class(H5E_cls_t *cls) +H5E__free_class(H5E_cls_t *cls) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments */ HDassert(cls); @@ -417,7 +417,7 @@ H5E_free_class(H5E_cls_t *cls) cls = H5FL_FREE(H5E_cls_t, cls); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5E_free_class() */ +} /* end H5E__free_class() */ /*------------------------------------------------------------------------- @@ -502,7 +502,7 @@ H5E__register_class(const char *cls_name, const char *lib_name, const char *vers done: if(!ret_value) - if(cls && H5E_free_class(cls) < 0) + if(cls && H5E__free_class(cls) < 0) HDONE_ERROR(H5E_ERROR, H5E_CANTRELEASE, NULL, "unable to free error class") FUNC_LEAVE_NOAPI(ret_value) @@ -572,7 +572,7 @@ H5E__unregister_class(H5E_cls_t *cls) HGOTO_ERROR(H5E_ERROR, H5E_BADITER, FAIL, "unable to free all messages in this error class") /* Free error class structure */ - if(H5E_free_class(cls) < 0) + if(H5E__free_class(cls) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTRELEASE, FAIL, "unable to free error class") done: diff --git a/src/H5EA.c b/src/H5EA.c index 56663dc..a027792 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -15,7 +15,7 @@ * * Created: H5EA.c * Jun 17 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements an "extensible array" for storing elements * in an array whose high bounds can extend and shrink. @@ -124,7 +124,6 @@ H5FL_BLK_DEFINE(ea_native_elmt); * NULL on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 10 2016 * *------------------------------------------------------------------------- @@ -190,7 +189,6 @@ END_FUNC(STATIC) /* end H5EA__new() */ * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 17 2008 * *------------------------------------------------------------------------- @@ -241,7 +239,6 @@ END_FUNC(PRIV) /* end H5EA_create() */ * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 28 2008 * *------------------------------------------------------------------------- @@ -283,7 +280,6 @@ END_FUNC(PRIV) /* end H5EA_open() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 21 2008 * *------------------------------------------------------------------------- @@ -314,7 +310,6 @@ END_FUNC(PRIV) /* end H5EA_get_nelmts() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 21 2008 * *------------------------------------------------------------------------- @@ -347,7 +342,6 @@ END_FUNC(PRIV) /* end H5EA_get_addr() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -559,7 +553,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, (page_idx * sblock->dblk_page_size); /* Check if page has been initialized yet */ - if(!H5VM_bit_get(sblock->page_init, page_init_idx)) { + if(!H5VM__bit_get(sblock->page_init, page_init_idx)) { /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the data block page */ @@ -567,7 +561,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in super block */ - H5VM_bit_set(sblock->page_init, page_init_idx, TRUE); + H5VM__bit_set(sblock->page_init, page_init_idx, TRUE); sblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ else @@ -656,7 +650,6 @@ END_FUNC(STATIC) /* end H5EA__lookup_elmt() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -721,7 +714,6 @@ END_FUNC(PRIV) /* end H5EA_set() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -786,7 +778,6 @@ END_FUNC(PRIV) /* end H5EA_get() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 27 2009 * *------------------------------------------------------------------------- @@ -836,7 +827,6 @@ END_FUNC(PRIV) /* end H5EA_depend() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 21 2008 * *------------------------------------------------------------------------- @@ -937,7 +927,6 @@ END_FUNC(PRIV) /* end H5EA_close() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 28 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAcache.c b/src/H5EAcache.c index affa127..f7534fb 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -15,7 +15,7 @@ * * Created: H5EAcache.c * Aug 26 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement extensible array metadata cache methods. * @@ -239,7 +239,6 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -305,7 +304,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -429,7 +427,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -459,7 +456,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -606,7 +602,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -635,7 +630,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -708,7 +702,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -815,7 +808,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -845,7 +837,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -932,7 +923,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1001,7 +991,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1030,7 +1019,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1122,7 +1110,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1226,7 +1213,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1256,7 +1242,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1330,7 +1315,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 31 2009 * *------------------------------------------------------------------------- @@ -1414,7 +1398,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1443,7 +1426,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1536,7 +1518,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1639,7 +1620,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1672,7 +1652,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1744,7 +1723,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 31 2009 * *------------------------------------------------------------------------- @@ -1828,7 +1806,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1904,7 +1881,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1970,7 +1946,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -2043,7 +2018,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -2073,7 +2047,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -2125,7 +2098,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 31 2009 * *------------------------------------------------------------------------- @@ -2209,7 +2181,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 6dd2e98..ee5c904 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -15,7 +15,7 @@ * * Created: H5EAdblkpage.c * Nov 20 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Data block page routines for extensible arrays. * @@ -91,7 +91,6 @@ H5FL_DEFINE_STATIC(H5EA_dblk_page_t); * Return: Non-NULL pointer to data block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- @@ -141,7 +140,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_alloc() */ * Return: Valid file address on success/HADDR_UNDEF on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- @@ -206,7 +204,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_create() */ * Return: Non-NULL pointer to data block page on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- @@ -267,7 +264,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- @@ -298,7 +294,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_unprotect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index d926fd5..c72dc7c 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -15,7 +15,7 @@ * * Created: H5EAdblock.c * Sep 11 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Data block routines for extensible arrays. * @@ -92,7 +92,6 @@ H5FL_DEFINE_STATIC(H5EA_dblock_t); * Return: Non-NULL pointer to data block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -153,7 +152,6 @@ END_FUNC(PKG) /* end H5EA__dblock_alloc() */ * Return: Valid file address on success/HADDR_UNDEF on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -248,7 +246,6 @@ END_FUNC(PKG) /* end H5EA__dblock_create() */ * Return: Super block index on success/Can't fail * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -269,7 +266,7 @@ H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx)) /* Determine the superblock information for the index */ H5_CHECK_OVERFLOW(idx, /*From:*/hsize_t, /*To:*/uint64_t); - sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); + sblk_idx = H5VM__log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); /* Set return value */ ret_value = sblk_idx; @@ -285,7 +282,6 @@ END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */ * Return: Non-NULL pointer to data block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 18 2008 * *------------------------------------------------------------------------- @@ -348,7 +344,6 @@ END_FUNC(PKG) /* end H5EA__dblock_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -379,7 +374,6 @@ END_FUNC(PKG) /* end H5EA__dblock_unprotect() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 22 2008 * *------------------------------------------------------------------------- @@ -442,7 +436,6 @@ END_FUNC(PKG) /* end H5EA__dblock_delete() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index ec40298..07330c1 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -15,7 +15,7 @@ * * Created: H5EAhdr.c * Aug 26 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Array header routines for extensible arrays. * @@ -110,7 +110,6 @@ H5FL_SEQ_DEFINE_STATIC(H5EA_sblk_info_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -180,7 +179,6 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 18 2008 * *------------------------------------------------------------------------- @@ -201,7 +199,7 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata)) HDassert(hdr->cparam.sup_blk_min_data_ptrs); /* Compute general information */ - hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts)); + hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM__log2_of2(hdr->cparam.data_blk_min_elmts)); hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits; hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits); @@ -245,7 +243,6 @@ END_FUNC(PKG) /* end H5EA__hdr_init() */ * Return: Non-NULL pointer to buffer for elements on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 16 2008 * *------------------------------------------------------------------------- @@ -264,7 +261,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Check for needing to increase size of array of factories */ if(idx >= hdr->elmt_fac.nalloc) { @@ -312,7 +309,6 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc_elmts() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 18 2008 * *------------------------------------------------------------------------- @@ -331,7 +327,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Free buffer for elements in index block */ HDassert(idx < hdr->elmt_fac.nalloc); @@ -349,7 +345,6 @@ END_FUNC(PKG) /* end H5EA__hdr_free_elmts() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 17 2008 * *------------------------------------------------------------------------- @@ -464,7 +459,6 @@ END_FUNC(PKG) /* end H5EA__hdr_create() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -497,7 +491,6 @@ END_FUNC(PKG) /* end H5EA__hdr_incr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -533,7 +526,6 @@ END_FUNC(PKG) /* end H5EA__hdr_decr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -559,7 +551,6 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_incr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -589,7 +580,6 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_decr() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -619,7 +609,6 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */ * Return: Non-NULL pointer to header on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 31 2013 * *------------------------------------------------------------------------- @@ -677,7 +666,6 @@ END_FUNC(PKG) /* end H5EA__hdr_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 1 2013 * *------------------------------------------------------------------------- @@ -708,7 +696,6 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -765,7 +752,6 @@ END_FUNC(PKG) /* end H5EA__hdr_delete() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index 1b5957a..c45d15a 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -15,7 +15,7 @@ * * Created: H5EAiblock.c * Sep 9 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Index block routines for extensible arrays. * @@ -42,7 +42,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -98,7 +98,6 @@ H5FL_SEQ_DEFINE_STATIC(haddr_t); * Return: Non-NULL pointer to index block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -129,11 +128,6 @@ H5EA__iblock_alloc(H5EA_hdr_t *hdr)) iblock->nsblks = H5EA_SBLK_FIRST_IDX(hdr->cparam.sup_blk_min_data_ptrs); iblock->ndblk_addrs = 2 * ((size_t)hdr->cparam.sup_blk_min_data_ptrs - 1); iblock->nsblk_addrs = hdr->nsblks - iblock->nsblks; -#ifdef QAK -HDfprintf(stderr, "%s: iblock->nsblks = %u\n", FUNC, iblock->nsblks); -HDfprintf(stderr, "%s: iblock->ndblk_addrs = %Zu\n", FUNC, iblock->ndblk_addrs); -HDfprintf(stderr, "%s: iblock->nsblk_addrs = %Zu\n", FUNC, iblock->nsblk_addrs); -#endif /* QAK */ /* Allocate buffer for elements in index block */ if(hdr->cparam.idx_blk_elmts > 0) @@ -169,7 +163,6 @@ END_FUNC(PKG) /* end H5EA__iblock_alloc() */ * Return: Valid file address on success/HADDR_UNDEF on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -183,10 +176,6 @@ H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed)) haddr_t iblock_addr; /* Extensible array index block address */ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* Sanity check */ HDassert(hdr); HDassert(stats_changed); @@ -197,9 +186,6 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Set size of index block on disk */ iblock->size = H5EA_IBLOCK_SIZE(iblock); -#ifdef QAK -HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size); -#endif /* QAK */ /* Allocate space for the index block on disk */ if(HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, (hsize_t)iblock->size))) @@ -284,7 +270,6 @@ END_FUNC(PKG) /* end H5EA__iblock_create() */ * Return: Non-NULL pointer to index block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -296,10 +281,6 @@ H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* Sanity check */ HDassert(hdr); @@ -340,7 +321,6 @@ END_FUNC(PKG) /* end H5EA__iblock_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -351,10 +331,6 @@ H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags)) /* Local variables */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* Sanity check */ HDassert(iblock); @@ -375,7 +351,6 @@ END_FUNC(PKG) /* end H5EA__iblock_unprotect() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -387,10 +362,6 @@ H5EA__iblock_delete(H5EA_hdr_t *hdr)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* Sanity check */ HDassert(hdr); HDassert(H5F_addr_defined(hdr->idx_blk_addr)); @@ -459,7 +430,6 @@ END_FUNC(PKG) /* end H5EA__iblock_delete() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAint.c b/src/H5EAint.c index 2baf1f4..ef8cd7a 100644 --- a/src/H5EAint.c +++ b/src/H5EAint.c @@ -15,7 +15,7 @@ * * Created: H5EAint.c * Jun 17 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal routines for extnsible arrays. * @@ -86,7 +86,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 26 2009 * *------------------------------------------------------------------------- @@ -116,7 +115,6 @@ END_FUNC(PKG) /* end H5EA__create_flush_depend() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 26 2009 * *------------------------------------------------------------------------- diff --git a/src/H5EApkg.h b/src/H5EApkg.h index b70231d..ad1fdfc 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -146,7 +146,7 @@ #define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) /* Compute the first super block index that will hold a certain # of data block pointers */ -#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM_log2_of2((uint32_t)m)) +#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM__log2_of2((uint32_t)m)) /****************************/ /* Package Private Typedefs */ diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index fb7c458..b5b9d94 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -42,7 +42,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ diff --git a/src/H5EAstat.c b/src/H5EAstat.c index 509d3f8..68e0b1e 100644 --- a/src/H5EAstat.c +++ b/src/H5EAstat.c @@ -15,7 +15,7 @@ * * Created: H5EAstat.c * Sep 11 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Extensible array metadata statistics functions. * @@ -87,7 +87,6 @@ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 21 2008 * *------------------------------------------------------------------------- @@ -98,10 +97,6 @@ H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats)) /* Local variables */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* * Check arguments. */ diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 8926d6a..a0802bc 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, August 28, 2008 * * Purpose: Extensible array testing functions. @@ -38,7 +38,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5VMprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index 4462303..437c431 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -15,7 +15,7 @@ * * Created: H5Edeprec.c * April 11 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5E interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Eint.c b/src/H5Eint.c index 2371a5f..cf1d649 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -15,7 +15,7 @@ * * Created: H5Eint.c * April 11 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: General use, "internal" routines for error handling. * diff --git a/src/H5Emodule.h b/src/H5Emodule.h index 2d1bcd0..fbfc262 100644 --- a/src/H5Emodule.h +++ b/src/H5Emodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Epkg.h b/src/H5Epkg.h index 83f3816..eac5829 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, April 11, 2007 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5FA.c b/src/H5FA.c index f8bb094..871793e 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -15,7 +15,7 @@ * * Created: H5FA.c * April 2009 - * Vailin Choi + * Vailin Choi * * Purpose: Implements a Fixed Array for storing elements * of datasets with fixed dimensions. @@ -112,7 +112,6 @@ H5FL_BLK_DEFINE(fa_native_elmt); * NULL on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 17 2016 * *------------------------------------------------------------------------- @@ -396,13 +395,13 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt)) dblk_page_nelmts = dblock->dblk_page_nelmts; /* Check if the page has been created yet */ - if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { /* Create the data block page */ if(H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in data block */ - H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE); + H5VM__bit_set(dblock->dblk_page_init, page_idx, TRUE); dblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -483,7 +482,7 @@ H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt)) page_idx = (size_t)(idx / dblock->dblk_page_nelmts); /* Check if the page is defined yet */ - if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { /* Call the class's 'fill' callback */ if((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0) H5E_THROW(H5E_CANTSET, "can't set element to class's fill value") diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 8f5e696..90770fb 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -15,7 +15,7 @@ * * Created: H5FAcache.c * Jul 2 2009 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement fixed array metadata cache methods. * @@ -180,7 +180,6 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 31, 2013 * *------------------------------------------------------------------------- @@ -246,7 +245,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -359,7 +357,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -389,7 +386,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -527,7 +523,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_notify() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -556,7 +551,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -644,7 +638,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -744,7 +737,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -777,7 +769,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -924,7 +915,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_notify() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1001,7 +991,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1068,7 +1057,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1141,7 +1129,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1171,7 +1158,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1223,7 +1209,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 17 2016 * *------------------------------------------------------------------------- @@ -1286,7 +1271,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index b578cf2..431e6fa 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -229,7 +229,7 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Read and print each page's elements in the data block */ for(page_idx = 0; page_idx < dblock->npages; page_idx++) { - if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth, "Page %Zu:", page_idx, "empty"); diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 506c767..b25d50b 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -414,7 +414,6 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */ * Return: Non-NULL pointer to header on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2013 * *------------------------------------------------------------------------- @@ -471,7 +470,6 @@ END_FUNC(PKG) /* end H5FA__hdr_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2013 * *------------------------------------------------------------------------- @@ -491,7 +489,7 @@ H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags)) CATCH -END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ +END_FUNC(PKG) /* end H5FA__hdr_unprotect() */ /*------------------------------------------------------------------------- diff --git a/src/H5FAint.c b/src/H5FAint.c index 9d3bce8..3a1375a 100644 --- a/src/H5FAint.c +++ b/src/H5FAint.c @@ -15,7 +15,7 @@ * * Created: H5FAint.c * Fall 2012 - * Dana Robinson + * Dana Robinson * * Purpose: Internal routines for fixed arrays. * diff --git a/src/H5FAmodule.h b/src/H5FAmodule.h index f675faf..57a85b1 100644 --- a/src/H5FAmodule.h +++ b/src/H5FAmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FAstat.c b/src/H5FAstat.c index 49a56a9..882da99 100644 --- a/src/H5FAstat.c +++ b/src/H5FAstat.c @@ -35,9 +35,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FApkg.h" /* Fixed Arrays */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FApkg.h" /* Fixed Arrays */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5FAtest.c b/src/H5FAtest.c index e55d408..2bcdc01 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -36,7 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5VMprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 0551dd0..2afe7ea 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 10, 1999 * * Purpose: A driver which stores the HDF5 data in main memory using @@ -144,8 +144,8 @@ static herr_t H5FD__core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha size_t size, const void *buf); static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_core_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_core_unlock(H5FD_t *_file); +static herr_t H5FD__core_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__core_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_core_g = { "core", /* name */ @@ -177,8 +177,8 @@ static const H5FD_class_t H5FD_core_g = { H5FD__core_write, /* write */ H5FD__core_flush, /* flush */ H5FD__core_truncate, /* truncate */ - H5FD_core_lock, /* lock */ - H5FD_core_unlock, /* unlock */ + H5FD__core_lock, /* lock */ + H5FD__core_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -345,7 +345,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) HDoff_t offset = (HDoff_t)addr; /* Offset to write at */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -414,7 +414,7 @@ H5FD__init_package(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5FD_core_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize core VFD") @@ -1581,7 +1581,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_core_lock + * Function: H5FD__core_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -1595,13 +1595,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_lock(H5FD_t *_file, hbool_t rw) +H5FD__core_lock(H5FD_t *_file, hbool_t rw) { H5FD_core_t *file = (H5FD_core_t*)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1609,7 +1609,6 @@ H5FD_core_lock(H5FD_t *_file, hbool_t rw) * descriptor, this is a no-op. */ if(file->fd >= 0) { - /* Set exclusive or shared lock based on rw status */ lock_flags = rw ? LOCK_EX : LOCK_SH; @@ -1620,16 +1619,15 @@ H5FD_core_lock(H5FD_t *_file, hbool_t rw) else HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") } /* end if */ - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_lock() */ +} /* end H5FD__core_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_unlock + * Function: H5FD__core_unlock * * Purpose: To remove the existing lock on the file * @@ -1640,17 +1638,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_unlock(H5FD_t *_file) +H5FD__core_unlock(H5FD_t *_file) { H5FD_core_t *file = (H5FD_core_t*)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); - if(file->fd >= 0) { - + if(file->fd >= 0) if(HDflock(file->fd, LOCK_UN) < 0) { if(ENOSYS == errno) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") @@ -1658,9 +1655,7 @@ H5FD_core_unlock(H5FD_t *_file) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") } /* end if */ - } /* end if */ - done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_unlock() */ +} /* end H5FD__core_unlock() */ diff --git a/src/H5FDcore.h b/src/H5FDcore.h index 5fe2912..63b6f27 100644 --- a/src/H5FDcore.h +++ b/src/H5FDcore.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the core driver. diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 34c4346..1dbf857 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Purpose: The Direct I/O file driver forces the data to be written to @@ -23,15 +23,15 @@ #include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5FDdirect.h" /* Direct file driver */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5FDdirect.h" /* Direct file driver */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ #ifdef H5_HAVE_DIRECT @@ -109,69 +109,68 @@ typedef struct H5FD_direct_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ - ((A) & ~(haddr_t)MAXADDR)) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) -#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - HADDR_UNDEF==(A)+(Z) || \ - (HDoff_t)((A)+(Z))<(HDoff_t)(A)) +#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ + HADDR_UNDEF == (A) + (Z) || \ + (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) /* Prototypes */ -static herr_t H5FD_direct_term(void); -static void *H5FD_direct_fapl_get(H5FD_t *file); -static void *H5FD_direct_fapl_copy(const void *_old_fa); -static H5FD_t *H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__direct_term(void); +static void *H5FD__direct_fapl_get(H5FD_t *file); +static void *H5FD__direct_fapl_copy(const void *_old_fa); +static H5FD_t *H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_direct_close(H5FD_t *_file); -static int H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_direct_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__direct_close(H5FD_t *_file); +static int H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__direct_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__direct_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_direct_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_direct_unlock(H5FD_t *_file); +static herr_t H5FD__direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__direct_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__direct_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_direct_g = { - "direct", /*name */ - MAXADDR, /*maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_direct_term, /*terminate */ - NULL, /*sb_size */ - NULL, /*sb_encode */ - NULL, /*sb_decode */ - sizeof(H5FD_direct_fapl_t), /*fapl_size */ - H5FD_direct_fapl_get, /*fapl_get */ - H5FD_direct_fapl_copy, /*fapl_copy */ - NULL, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_direct_open, /*open */ - H5FD_direct_close, /*close */ - H5FD_direct_cmp, /*cmp */ - H5FD_direct_query, /*query */ - NULL, /*get_type_map */ - NULL, /*alloc */ - NULL, /*free */ - H5FD_direct_get_eoa, /*get_eoa */ - H5FD_direct_set_eoa, /*set_eoa */ - H5FD_direct_get_eof, /*get_eof */ - H5FD_direct_get_handle, /*get_handle */ - H5FD_direct_read, /*read */ - H5FD_direct_write, /*write */ - NULL, /*flush */ - H5FD_direct_truncate, /*truncate */ - H5FD_direct_lock, /*lock */ - H5FD_direct_unlock, /*unlock */ - H5FD_FLMAP_DICHOTOMY /*fl_map */ + "direct", /* name */ + MAXADDR, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD__direct_term, /* terminate */ + NULL, /* sb_size */ + NULL, /* sb_encode */ + NULL, /* sb_decode */ + sizeof(H5FD_direct_fapl_t), /* fapl_size */ + H5FD__direct_fapl_get, /* fapl_get */ + H5FD__direct_fapl_copy, /* fapl_copy */ + NULL, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + H5FD__direct_open, /* open */ + H5FD__direct_close, /* close */ + H5FD__direct_cmp, /* cmp */ + H5FD__direct_query, /* query */ + NULL, /* get_type_map */ + NULL, /* alloc */ + NULL, /* free */ + H5FD__direct_get_eoa, /* get_eoa */ + H5FD__direct_set_eoa, /* set_eoa */ + H5FD__direct_get_eof, /* get_eof */ + H5FD__direct_get_handle, /* get_handle */ + H5FD__direct_read, /* read */ + H5FD__direct_write, /* write */ + NULL, /* flush */ + H5FD__direct_truncate, /* truncate */ + H5FD__direct_lock, /* lock */ + H5FD__direct_unlock, /* unlock */ + H5FD_FLMAP_DICHOTOMY /* fl_map */ }; /* Declare a free list to manage the H5FD_direct_t struct */ @@ -238,7 +237,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_direct_term + * Function: H5FD__direct_term * * Purpose: Shut down the VFD * @@ -250,15 +249,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_direct_term(void) +H5FD__direct_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_DIRECT_g=0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_direct_term() */ +} /* end H5FD__direct_term() */ /*------------------------------------------------------------------------- @@ -361,7 +360,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_fapl_get + * Function: H5FD__direct_fapl_get * * Purpose: Returns a file access property list which indicates how the * specified file is being accessed. The return list could be @@ -375,28 +374,26 @@ done: * Programmer: Raymond Lu * Wednesday, 18 October 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_direct_fapl_get(H5FD_t *_file) +H5FD__direct_fapl_get(H5FD_t *_file) { H5FD_direct_t *file = (H5FD_direct_t*)_file; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set return value */ - ret_value= H5FD_direct_fapl_copy(&(file->fa)); + ret_value= H5FD__direct_fapl_copy(&(file->fa)); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_direct_fapl_get() */ +} /* end H5FD__direct_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_fapl_copy + * Function: H5FD__direct_fapl_copy * * Purpose: Copies the direct-specific file access properties. * @@ -407,17 +404,15 @@ done: * Programmer: Raymond Lu * Wednesday, 18 October 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_direct_fapl_copy(const void *_old_fa) +H5FD__direct_fapl_copy(const void *_old_fa) { const H5FD_direct_fapl_t *old_fa = (const H5FD_direct_fapl_t*)_old_fa; H5FD_direct_fapl_t *new_fa = H5MM_calloc(sizeof(H5FD_direct_fapl_t)); - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(new_fa); @@ -425,11 +420,11 @@ H5FD_direct_fapl_copy(const void *_old_fa) H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t)); FUNC_LEAVE_NOAPI(new_fa) -} /* end H5FD_direct_fapl_copy() */ +} /* end H5FD__direct_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_open + * Function: H5FD__direct_open * * Purpose: Create and/or opens a Unix file for direct I/O as an HDF5 file. * @@ -442,12 +437,10 @@ H5FD_direct_fapl_copy(const void *_old_fa) * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) +H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { int o_flags; int fd=(-1); @@ -462,7 +455,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd void *buf1, *buf2; H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check on file offsets */ HDassert(sizeof(HDoff_t)>=sizeof(size_t)); @@ -577,7 +570,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_close + * Function: H5FD__direct_close * * Purpose: Closes the file. * @@ -588,17 +581,15 @@ done: * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_close(H5FD_t *_file) +H5FD__direct_close(H5FD_t *_file) { H5FD_direct_t *file = (H5FD_direct_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if (HDclose(file->fd)<0) HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") @@ -611,7 +602,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_cmp + * Function: H5FD__direct_cmp * * Purpose: Compares two files belonging to this driver using an * arbitrary (but consistent) ordering. @@ -624,18 +615,16 @@ done: * Programmer: Raymond Lu * Thursday, 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static int -H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_direct_t *f1 = (const H5FD_direct_t*)_f1; const H5FD_direct_t *f2 = (const H5FD_direct_t*)_f2; int ret_value=0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #ifdef H5_HAVE_WIN32_API if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) @@ -668,7 +657,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_query + * Function: H5FD__direct_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -680,14 +669,12 @@ done: * Programmer: Raymond Lu * Thursday, 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out */) +H5FD__direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out */) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -704,7 +691,7 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out /*------------------------------------------------------------------------- - * Function: H5FD_direct_get_eoa + * Function: H5FD__direct_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -717,26 +704,21 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) } /*------------------------------------------------------------------------- - * Function: H5FD_direct_set_eoa + * Function: H5FD__direct_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -749,19 +731,14 @@ H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) +H5FD__direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_direct_t *file = (H5FD_direct_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR file->eoa = addr; @@ -770,7 +747,7 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) /*------------------------------------------------------------------------- - * Function: H5FD_direct_get_eof + * Function: H5FD__direct_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the Unix end-of-file or the HDF5 end-of-address @@ -785,16 +762,14 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t*)_file; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC FUNC_LEAVE_NOAPI(file->eof) } @@ -810,17 +785,15 @@ H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * Programmer: Raymond Lu * 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle) +H5FD__direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle) { H5FD_direct_t *file = (H5FD_direct_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -832,7 +805,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_read + * Function: H5FD__direct_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -846,12 +819,10 @@ done: * Programmer: Raymond Lu * Thursday, 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_direct_t *file = (H5FD_direct_t*)_file; @@ -867,7 +838,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN size_t copy_size = size; /* Size remaining to read when using copy buffer */ size_t copy_offset; /* Offset into copy buffer of the requested data */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -1018,7 +989,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_write + * Function: H5FD__direct_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1031,12 +1002,10 @@ done: * Programmer: Raymond Lu * Thursday, 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_direct_t *file = (H5FD_direct_t*)_file; @@ -1055,7 +1024,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U size_t copy_size = size; /* Size remaining to write when using copy buffer */ size_t copy_offset; /* Offset into copy buffer of the data to write */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -1253,7 +1222,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_truncate + * Function: H5FD__direct_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -1268,12 +1237,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_direct_t *file = (H5FD_direct_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1314,11 +1283,11 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATT done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_direct_truncate() */ +} /* end H5FD__direct_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_lock + * Function: H5FD__direct_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -1332,13 +1301,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_lock(H5FD_t *_file, hbool_t rw) +H5FD__direct_lock(H5FD_t *_file, hbool_t rw) { H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ const int lock = rw ? LOCK_EX : LOCK_SH; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1348,11 +1317,11 @@ H5FD_direct_lock(H5FD_t *_file, hbool_t rw) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_direct_lock() */ +} /* end H5FD__direct_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_unlock + * Function: H5FD__direct_unlock * * Purpose: To remove the existing lock on the file * @@ -1363,12 +1332,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_unlock(H5FD_t *_file) +H5FD__direct_unlock(H5FD_t *_file) { H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1377,7 +1346,7 @@ H5FD_direct_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_direct_unlock() */ +} /* end H5FD__direct_unlock() */ #endif /* H5_HAVE_DIRECT */ diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h index 805f3be..630a1e6 100644 --- a/src/H5FDdirect.h +++ b/src/H5FDdirect.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Purpose: The public header file for the direct driver. diff --git a/src/H5FDdrvr_module.h b/src/H5FDdrvr_module.h index 59a419e..34beb32 100644 --- a/src/H5FDdrvr_module.h +++ b/src/H5FDdrvr_module.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index d110ef7..aa604c2 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 10, 1997 * * Purpose: Implements a family of files that acts as a single hdf5 @@ -79,67 +79,67 @@ typedef struct H5FD_family_fapl_t { } H5FD_family_fapl_t; /* Callback prototypes */ -static herr_t H5FD_family_term(void); -static void *H5FD_family_fapl_get(H5FD_t *_file); -static void *H5FD_family_fapl_copy(const void *_old_fa); -static herr_t H5FD_family_fapl_free(void *_fa); -static hsize_t H5FD_family_sb_size(H5FD_t *_file); -static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, +static herr_t H5FD__family_term(void); +static void *H5FD__family_fapl_get(H5FD_t *_file); +static void *H5FD__family_fapl_copy(const void *_old_fa); +static herr_t H5FD__family_fapl_free(void *_fa); +static hsize_t H5FD__family_sb_size(H5FD_t *_file); +static herr_t H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); -static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, +static herr_t H5FD__family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); -static H5FD_t *H5FD_family_open(const char *name, unsigned flags, +static H5FD_t *H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_family_close(H5FD_t *_file); -static int H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_family_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); -static haddr_t H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, +static herr_t H5FD__family_close(H5FD_t *_file); +static int H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__family_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); +static haddr_t H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/); -static herr_t H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, +static herr_t H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf); -static herr_t H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_family_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_family_unlock(H5FD_t *_file); +static herr_t H5FD__family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__family_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__family_unlock(H5FD_t *_file); /* The class struct */ static const H5FD_class_t H5FD_family_g = { - "family", /*name */ - HADDR_MAX, /*maxaddr */ - H5F_CLOSE_WEAK, /*fc_degree */ - H5FD_family_term, /*terminate */ - H5FD_family_sb_size, /*sb_size */ - H5FD_family_sb_encode, /*sb_encode */ - H5FD_family_sb_decode, /*sb_decode */ - sizeof(H5FD_family_fapl_t), /*fapl_size */ - H5FD_family_fapl_get, /*fapl_get */ - H5FD_family_fapl_copy, /*fapl_copy */ - H5FD_family_fapl_free, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_family_open, /*open */ - H5FD_family_close, /*close */ - H5FD_family_cmp, /*cmp */ - H5FD_family_query, /*query */ - NULL, /*get_type_map */ - NULL, /*alloc */ - NULL, /*free */ - H5FD_family_get_eoa, /*get_eoa */ - H5FD_family_set_eoa, /*set_eoa */ - H5FD_family_get_eof, /*get_eof */ - H5FD_family_get_handle, /*get_handle */ - H5FD_family_read, /*read */ - H5FD_family_write, /*write */ - H5FD_family_flush, /*flush */ - H5FD_family_truncate, /*truncate */ - H5FD_family_lock, /*lock */ - H5FD_family_unlock, /*unlock */ - H5FD_FLMAP_DICHOTOMY /*fl_map */ + "family", /* name */ + HADDR_MAX, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD__family_term, /* terminate */ + H5FD__family_sb_size, /* sb_size */ + H5FD__family_sb_encode, /* sb_encode */ + H5FD__family_sb_decode, /* sb_decode */ + sizeof(H5FD_family_fapl_t), /* fapl_size */ + H5FD__family_fapl_get, /* fapl_get */ + H5FD__family_fapl_copy, /* fapl_copy */ + H5FD__family_fapl_free, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + H5FD__family_open, /* open */ + H5FD__family_close, /* close */ + H5FD__family_cmp, /* cmp */ + H5FD__family_query, /* query */ + NULL, /* get_type_map */ + NULL, /* alloc */ + NULL, /* free */ + H5FD__family_get_eoa, /* get_eoa */ + H5FD__family_set_eoa, /* set_eoa */ + H5FD__family_get_eof, /* get_eof */ + H5FD__family_get_handle, /* get_handle */ + H5FD__family_read, /* read */ + H5FD__family_write, /* write */ + H5FD__family_flush, /* flush */ + H5FD__family_truncate, /* truncate */ + H5FD__family_lock, /* lock */ + H5FD__family_unlock, /* unlock */ + H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -203,7 +203,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_family_term + * Function: H5FD__family_term * * Purpose: Shut down the VFD * @@ -215,15 +215,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_family_term(void) +H5FD__family_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_FAMILY_g=0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_family_term() */ +} /* end H5FD__family_term() */ /*------------------------------------------------------------------------- @@ -242,13 +242,6 @@ H5FD_family_term(void) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -296,13 +289,6 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -335,7 +321,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_fapl_get + * Function: H5FD__family_fapl_get * * Purpose: Gets a file access property list which could be used to * create an identical file. @@ -347,19 +333,17 @@ done: * Programmer: Robb Matzke * Friday, August 13, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_family_fapl_get(H5FD_t *_file) +H5FD__family_fapl_get(H5FD_t *_file) { H5FD_family_t *file = (H5FD_family_t*)_file; H5FD_family_fapl_t *fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (fa = (H5FD_family_fapl_t *)H5MM_calloc(sizeof(H5FD_family_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -373,16 +357,16 @@ H5FD_family_fapl_get(H5FD_t *_file) ret_value=fa; done: - if(ret_value==NULL) { + if(ret_value==NULL) if(fa!=NULL) H5MM_xfree(fa); - } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- - * Function: H5FD_family_fapl_copy + * Function: H5FD__family_fapl_copy * * Purpose: Copies the family-specific file access properties. * @@ -393,19 +377,17 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_family_fapl_copy(const void *_old_fa) +H5FD__family_fapl_copy(const void *_old_fa) { const H5FD_family_fapl_t *old_fa = (const H5FD_family_fapl_t*)_old_fa; H5FD_family_fapl_t *new_fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (new_fa = (H5FD_family_fapl_t *)H5MM_malloc(sizeof(H5FD_family_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -428,16 +410,16 @@ H5FD_family_fapl_copy(const void *_old_fa) ret_value=new_fa; done: - if(ret_value==NULL) { + if(ret_value==NULL) if(new_fa!=NULL) H5MM_xfree(new_fa); - } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- - * Function: H5FD_family_fapl_free + * Function: H5FD__family_fapl_free * * Purpose: Frees the family-specific file access properties. * @@ -448,17 +430,15 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_fapl_free(void *_fa) +H5FD__family_fapl_free(void *_fa) { H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5I_dec_ref(fa->memb_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") @@ -470,7 +450,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_sb_size + * Function: H5FD__family_sb_size * * Purpose: Returns the size of the private information to be stored in * the superblock. @@ -482,14 +462,12 @@ done: * Programmer: Raymond Lu * Tuesday, May 10, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static hsize_t -H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) +H5FD__family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* 8 bytes field for the size of member file size field should be * enough for now. */ @@ -498,7 +476,7 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) /*------------------------------------------------------------------------- - * Function: H5FD_family_sb_encode + * Function: H5FD__family_sb_encode * * Purpose: Encode driver information for the superblock. The NAME * argument is a nine-byte buffer which will be initialized with @@ -513,16 +491,14 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) * Programmer: Raymond Lu * Tuesday, May 10, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) +H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) { H5FD_family_t *file = (H5FD_family_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Name and version number */ HDstrncpy(name, "NCSAfami", (size_t)9); @@ -532,18 +508,18 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out* * This is to guarantee backward compatibility. If a file is created with * v1.6 library and the driver info isn't saved in the superblock. We open * it with v1.8, the FILE->MEMB_SIZE will be the actual size of the first - * member file (see H5FD_family_open). So it isn't safe to use FILE->MEMB_SIZE. + * member file (see H5FD__family_open). So it isn't safe to use FILE->MEMB_SIZE. * If the file is created with v1.8, the correctness of FILE->PMEM_SIZE is - * checked in H5FD_family_sb_decode. SLU - 2009/3/21 + * checked in H5FD__family_sb_decode. SLU - 2009/3/21 */ UINT64ENCODE(buf, (uint64_t)file->pmem_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_family_sb_encode() */ +} /* end H5FD__family_sb_encode() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_sb_decode + * Function: H5FD__family_sb_decode * * Purpose: This function has 2 separate purpose. One is to decodes the * superblock information for this driver. The NAME argument is @@ -561,13 +537,13 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out* *------------------------------------------------------------------------- */ static herr_t -H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf) +H5FD__family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf) { H5FD_family_t *file = (H5FD_family_t*)_file; uint64_t msize; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Read member file size. Skip name template for now although it's saved. */ UINT64DECODE(buf, msize); @@ -594,11 +570,11 @@ H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsi done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_sb_decode() */ +} /* end H5FD__family_sb_decode() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_open + * Function: H5FD__family_open * * Purpose: Creates and/or opens a family of files as an HDF5 file. * @@ -621,7 +597,7 @@ done: */ H5_GCC_DIAG_OFF(format-nonliteral) static H5FD_t * -H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, +H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_family_t *file = NULL; @@ -630,7 +606,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, unsigned t_flags = flags & ~H5F_ACC_CREAT; H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ if(!name || !*name) @@ -769,12 +745,12 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_open() */ +} /* end H5FD__family_open() */ H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- - * Function: H5FD_family_close + * Function: H5FD__family_close * * Purpose: Closes a family of files. * @@ -790,14 +766,14 @@ H5_GCC_DIAG_ON(format-nonliteral) *------------------------------------------------------------------------- */ static herr_t -H5FD_family_close(H5FD_t *_file) +H5FD__family_close(H5FD_t *_file) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned nerrors = 0; /* Number of errors while closing member files */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Close as many members as possible. Use private function here to avoid clearing * the error stack. We need the error message to indicate wrong member file size. */ @@ -822,11 +798,11 @@ H5FD_family_close(H5FD_t *_file) H5MM_xfree(file); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_close() */ +} /* end H5FD__family_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_cmp + * Function: H5FD__family_cmp * * Purpose: Compares two file families to see if they are the same. It * does this by comparing the first member of the two families. @@ -839,18 +815,16 @@ H5FD_family_close(H5FD_t *_file) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int -H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_family_t *f1 = (const H5FD_family_t*)_f1; const H5FD_family_t *f2 = (const H5FD_family_t*)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f1->nmembs >= 1 && f1->memb[0]); HDassert(f2->nmembs >= 1 && f2->memb[0]); @@ -858,11 +832,11 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) ret_value = H5FDcmp(f1->memb[0], f2->memb[0]); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_cmp() */ +} /* end H5FD__family_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_query + * Function: H5FD__family_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -876,11 +850,11 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) *------------------------------------------------------------------------- */ static herr_t -H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) +H5FD__family_query(const H5FD_t * _file, unsigned long *flags /* out */) { const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -896,11 +870,11 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_family_query() */ +} /* end H5FD__family_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_get_eoa + * Function: H5FD__family_get_eoa * * Purpose: Returns the end-of-address marker for the file. The EOA * marker is the first address past the last byte allocated in @@ -913,26 +887,21 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_family_t *file = (const H5FD_family_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) } /*------------------------------------------------------------------------- - * Function: H5FD_family_set_eoa + * Function: H5FD__family_set_eoa * * Purpose: Set the end-of-address marker for the file. * @@ -943,11 +912,6 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ /* Disable warning for "format not a string literal" here -QAK */ @@ -958,7 +922,7 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) */ H5_GCC_DIAG_OFF(format-nonliteral) static herr_t -H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) +H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) { H5FD_family_t *file = (H5FD_family_t*)_file; haddr_t addr = abs_eoa; @@ -966,7 +930,7 @@ H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate space for the member name buffer */ if(NULL == (memb_name = (char *)H5MM_malloc(H5FD_FAM_MEMB_NAME_BUF_SIZE))) @@ -1027,7 +991,7 @@ H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- - * Function: H5FD_family_get_eof + * Function: H5FD__family_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the total family size or the current EOA marker. @@ -1041,19 +1005,17 @@ H5_GCC_DIAG_ON(format-nonliteral) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) +H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type) { const H5FD_family_t *file = (const H5FD_family_t*)_file; haddr_t eof=0; int i; /* Local index variable */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Find the last member that has a non-zero EOF and break out of the loop @@ -1085,7 +1047,7 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) /*------------------------------------------------------------------------- - * Function: H5FD_family_get_handle + * Function: H5FD__family_get_handle * * Purpose: Returns the file handle of FAMILY file driver. * @@ -1094,12 +1056,10 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) * Programmer: Raymond Lu * Sept. 16, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) +H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) { H5FD_family_t *file = (H5FD_family_t *)_file; H5P_genplist_t *plist; @@ -1107,7 +1067,7 @@ H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) int memb; herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the plist structure and family offset */ if(NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS))) @@ -1127,7 +1087,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_read + * Function: H5FD__family_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -1141,12 +1101,10 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, +H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/) { H5FD_family_t *file = (H5FD_family_t*)_file; @@ -1158,7 +1116,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Get the member data transfer property list. If the transfer property @@ -1197,7 +1155,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_write + * Function: H5FD__family_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1210,12 +1168,10 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, +H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf) { H5FD_family_t *file = (H5FD_family_t*)_file; @@ -1227,7 +1183,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Get the member data transfer property list. If the transfer property @@ -1266,7 +1222,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_flush + * Function: H5FD__family_flush * * Purpose: Flushes all family members. * @@ -1279,13 +1235,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned u, nerrors = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC for(u = 0; u < file->nmembs; u++) if(file->memb[u] && H5FD_flush(file->memb[u], closing) < 0) @@ -1296,11 +1252,11 @@ H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_flush() */ +} /* end H5FD__family_flush() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_truncate + * Function: H5FD__family_truncate * * Purpose: Truncates all family members. * @@ -1314,13 +1270,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned u, nerrors = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC for(u = 0; u < file->nmembs; u++) if(file->memb[u] && H5FD_truncate(file->memb[u], closing) < 0) @@ -1331,11 +1287,11 @@ H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closin done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_truncate() */ +} /* end H5FD__family_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_lock + * Function: H5FD__family_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -1349,13 +1305,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_lock(H5FD_t *_file, hbool_t rw) +H5FD__family_lock(H5FD_t *_file, hbool_t rw) { H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Place the lock on all the member files */ for(u = 0; u < file->nmembs; u++) @@ -1379,11 +1335,11 @@ H5FD_family_lock(H5FD_t *_file, hbool_t rw) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_lock() */ +} /* end H5FD__family_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_unlock + * Function: H5FD__family_unlock * * Purpose: To remove the existing lock on the file * @@ -1394,13 +1350,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_unlock(H5FD_t *_file) +H5FD__family_unlock(H5FD_t *_file) { H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Remove the lock on the member files */ for(u = 0; u < file->nmembs; u++) @@ -1410,5 +1366,5 @@ H5FD_family_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_unlock() */ +} /* end H5FD__family_unlock() */ diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h index 1584cf6..45bdccc 100644 --- a/src/H5FDfamily.h +++ b/src/H5FDfamily.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 4, 1999 * * Purpose: The public header file for the family driver. diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 3d086ea..29d032e 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -20,9 +20,6 @@ * File System (HDFS). */ -/* This source code file is part of the H5FD driver module */ -#include "H5FDdrvr_module.h" - #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FDprivate.h" /* File drivers */ @@ -32,8 +29,12 @@ #include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_LIBHDFS + +/* This source code file is part of the H5FD driver module */ +#include "H5FDdrvr_module.h" + +/* HDFS routines */ #include "hdfs.h" -#endif /* toggle function call prints: 1 turns on */ #define HDFS_DEBUG 0 @@ -74,7 +75,7 @@ static hid_t H5FD_HDFS_g = 0; #define HDFS_STATS_POW(bin_i, out_ptr) { \ unsigned long long donotshadowresult = 1; \ unsigned donotshadowindex = 0; \ - for (donotshadowindex = 0; \ + for(donotshadowindex = 0; \ donotshadowindex < (((bin_i) * HDFS_STATS_INTERVAL) + \ HDFS_STATS_START_POWER); \ donotshadowindex++) \ @@ -118,8 +119,6 @@ static unsigned long long hdfs_stats_boundaries[HDFS_STATS_BIN_COUNT]; * * Programmer: Jacob Smith * - * Changes: None - * ***************************************************************************/ typedef struct { unsigned long long count; @@ -130,7 +129,6 @@ typedef struct { #endif /* HDFS_STATS */ -#ifdef H5_HAVE_LIBHDFS /* "unique" identifier for `hdfs_t` structures. * Randomly generated by unweighted dice rolls. @@ -146,9 +144,7 @@ typedef struct { * * Contain/retain information associated with a file hosted on Hadoop * Distributed File System (HDFS). Instantiated and populated via - * `H5FD_hdfs_handle_open()` and cleaned up via `H5FD_hdfs_handle_close()`. - * - * + * `H5FD__hdfs_handle_open()` and cleaned up via `H5FD__hdfs_handle_close()`. * * `magic` (unisgned long) * @@ -175,8 +171,6 @@ typedef struct { * Programmer: Jacob Smith * May 2018 * - * Changes: None - * *************************************************************************** */ typedef struct { @@ -187,194 +181,6 @@ typedef struct { } hdfs_t; -/*-------------------------------------------------------------------------- - * Function: H5FD_hdfs_handle_open - * - * Purpose: Create a HDFS file handle, 'opening' the target file. - * - * Return: Success: Pointer to HDFS container/handle of opened file. - * Failure: NULL - * - * Programmer: Gerd Herber - * May 2018 - * - * Changes: None. - *-------------------------------------------------------------------------- - */ -static hdfs_t * -H5FD_hdfs_handle_open( - const char *path, - const char *namenode_name, - const int32_t namenode_port, - const char *user_name, - const char *kerberos_ticket_cache, - const int32_t stream_buffer_size) -{ - struct hdfsBuilder *builder = NULL; - hdfs_t *handle = NULL; - hdfs_t *ret_value = NULL; - - FUNC_ENTER_NOAPI_NOINIT - -#if HDFS_DEBUG - HDfprintf(stdout, "called H5FD_hdfs_handle_open.\n"); -#endif - - if (path == NULL || path[0] == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "path cannot be null.\n") - } - if (namenode_name == NULL /* || namenode_name[0] == '\0' */ ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "namenode name cannot be null.\n") - } - if (namenode_port < 0 || namenode_port > 65535) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "namenode port must be non-negative and <= 65535.\n") - } - if (stream_buffer_size < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "buffer size must non-negative.\n") - } - - handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t)); - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "could not malloc space for handle.\n") - } - - handle->magic = (unsigned long)HDFS_HDFST_MAGIC; - handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */ - handle->fileinfo = NULL; - handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */ - - builder = hdfsNewBuilder(); - if (!builder) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "(hdfs) failed to create builder") - } - hdfsBuilderSetNameNode(builder, namenode_name); - hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port); - if (user_name != NULL && user_name[0] != '\0') { - hdfsBuilderSetUserName(builder, user_name); - } - if (kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0') { - hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache); - } - /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */ - handle->filesystem = hdfsBuilderConnect(builder); - if (!handle->filesystem) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "(hdfs) could not connect to default namenode") - } - handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path); - if (!handle->fileinfo) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "hdfsGetPathInfo failed") - } - handle->file = hdfsOpenFile( - handle->filesystem, - path, - O_RDONLY, - stream_buffer_size, - 0, - 0); - if (!handle->file) { - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, - "(hdfs) could not open") - } - - ret_value = handle; - -done: - if (ret_value == NULL && handle != NULL) { - /* error; clean up */ - HDassert(handle->magic == HDFS_HDFST_MAGIC); - handle->magic++; - if (handle->file != NULL) { - if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "unable to close hdfs file handle") - } - } - if (handle->fileinfo != NULL) { - hdfsFreeFileInfo(handle->fileinfo, 1); - } - if (handle->filesystem != NULL) { - if (FAIL == (hdfsDisconnect(handle->filesystem))) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "unable to disconnect from hdfs") - } - } - H5MM_xfree(handle); - } - - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_handle_open() */ - - -/*-------------------------------------------------------------------------- - * Function: H5FD_hdfs_handle_close - * - * Purpose: 'Close' an HDFS file container/handle, releasing underlying - * resources. - * - * Return: Success: `SUCCEED` (0) - * Failure: `FAIL` (-1) - * - * Programmer: Gerd Herber - * May 2018 - * - * Changes: None. - *-------------------------------------------------------------------------- - */ -static herr_t -H5FD_hdfs_handle_close(hdfs_t *handle) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if HDFS_DEBUG - HDfprintf(stdout, "called H5FD_hdfs_close.\n"); -#endif - - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle cannot be null.\n") - } - if (handle->magic != HDFS_HDFST_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has invalid magic.\n") - } - - handle->magic++; - if (handle->file != NULL) { - if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to close hdfs file handle") - } - } - if (handle->fileinfo != NULL) { - hdfsFreeFileInfo(handle->fileinfo, 1); - } - if (handle->filesystem != NULL) { - if (FAIL == (hdfsDisconnect(handle->filesystem))) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to disconnect hdfs file system") - } - } - - H5MM_xfree(handle); - -done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_close() */ - -#endif /* H5_HAVE_LIBHDFS */ - /*************************************************************************** * @@ -432,17 +238,13 @@ done: * * Programmer: Jacob Smith * - * Changes: None. - * *************************************************************************** */ typedef struct H5FD_hdfs_t { H5FD_t pub; H5FD_hdfs_fapl_t fa; haddr_t eoa; -#ifdef H5_HAVE_LIBHDFS hdfs_t *hdfs_handle; -#endif #if HDFS_STATS hdfs_statsbin meta[HDFS_STATS_BIN_COUNT + 1]; hdfs_statsbin raw[HDFS_STATS_BIN_COUNT + 1]; @@ -459,75 +261,72 @@ typedef struct H5FD_hdfs_t { * Only included if HDFS code should compile. * */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#ifdef H5_HAVE_LIBHDFS +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) -#endif /* H5_HAVE_LIBHDFS */ /* Prototypes */ -static herr_t H5FD_hdfs_term(void); -static void *H5FD_hdfs_fapl_get(H5FD_t *_file); -static void *H5FD_hdfs_fapl_copy(const void *_old_fa); -static herr_t H5FD_hdfs_fapl_free(void *_fa); -static H5FD_t *H5FD_hdfs_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__hdfs_term(void); +static void *H5FD__hdfs_fapl_get(H5FD_t *_file); +static void *H5FD__hdfs_fapl_copy(const void *_old_fa); +static herr_t H5FD__hdfs_fapl_free(void *_fa); +static H5FD_t *H5FD__hdfs_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_hdfs_close(H5FD_t *_file); -static int H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_hdfs_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_hdfs_get_handle(H5FD_t *_file, hid_t fapl, +static herr_t H5FD__hdfs_close(H5FD_t *_file); +static int H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__hdfs_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__hdfs_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_hdfs_truncate(H5FD_t *_file, hid_t dxpl_id, +static herr_t H5FD__hdfs_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_hdfs_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_hdfs_unlock(H5FD_t *_file); -static herr_t H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa); +static herr_t H5FD__hdfs_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__hdfs_unlock(H5FD_t *_file); + +static herr_t H5FD__hdfs_validate_config(const H5FD_hdfs_fapl_t * fa); static const H5FD_class_t H5FD_hdfs_g = { "hdfs", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_hdfs_term, /* terminate */ + H5FD__hdfs_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ sizeof(H5FD_hdfs_fapl_t), /* fapl_size */ - H5FD_hdfs_fapl_get, /* fapl_get */ - H5FD_hdfs_fapl_copy, /* fapl_copy */ - H5FD_hdfs_fapl_free, /* fapl_free */ + H5FD__hdfs_fapl_get, /* fapl_get */ + H5FD__hdfs_fapl_copy, /* fapl_copy */ + H5FD__hdfs_fapl_free, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_hdfs_open, /* open */ - H5FD_hdfs_close, /* close */ - H5FD_hdfs_cmp, /* cmp */ - H5FD_hdfs_query, /* query */ + H5FD__hdfs_open, /* open */ + H5FD__hdfs_close, /* close */ + H5FD__hdfs_cmp, /* cmp */ + H5FD__hdfs_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_hdfs_get_eoa, /* get_eoa */ - H5FD_hdfs_set_eoa, /* set_eoa */ - H5FD_hdfs_get_eof, /* get_eof */ - H5FD_hdfs_get_handle, /* get_handle */ - H5FD_hdfs_read, /* read */ - H5FD_hdfs_write, /* write */ + H5FD__hdfs_get_eoa, /* get_eoa */ + H5FD__hdfs_set_eoa, /* set_eoa */ + H5FD__hdfs_get_eof, /* get_eof */ + H5FD__hdfs_get_handle, /* get_handle */ + H5FD__hdfs_read, /* read */ + H5FD__hdfs_write, /* write */ NULL, /* flush */ - H5FD_hdfs_truncate, /* truncate */ - H5FD_hdfs_lock, /* lock */ - H5FD_hdfs_unlock, /* unlock */ + H5FD__hdfs_truncate, /* truncate */ + H5FD__hdfs_lock, /* lock */ + H5FD__hdfs_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; -#ifdef H5_HAVE_LIBHDFS /* Declare a free list to manage the H5FD_hdfs_t struct */ H5FL_DEFINE_STATIC(H5FD_hdfs_t); -#endif /* H5_HAVE_LIBHDFS */ /*------------------------------------------------------------------------- @@ -537,9 +336,6 @@ H5FL_DEFINE_STATIC(H5FD_hdfs_t); * * Return: Non-negative on success/Negative on failure * - * Changes: Rename as appropriate for hdfs vfd. - * Jacob Smith 2018 - * *------------------------------------------------------------------------- */ static herr_t @@ -549,14 +345,11 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - if (H5FD_hdfs_init() < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, - "unable to initialize hdfs VFD") - } + if(H5FD_hdfs_init() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize hdfs VFD") done: FUNC_LEAVE_NOAPI(ret_value) - } /* H5FD__init_package() */ @@ -584,11 +377,11 @@ H5FD_hdfs_init(void) FUNC_ENTER_NOAPI(FAIL) #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_init() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif if(H5I_VFL != H5I_get_type(H5FD_HDFS_g)) - H5FD_HDFS_g = H5FD_register( &H5FD_hdfs_g, sizeof(H5FD_class_t), FALSE); + H5FD_HDFS_g = H5FD_register(&H5FD_hdfs_g, sizeof(H5FD_class_t), FALSE); #if HDFS_STATS /* pre-compute statsbin boundaries @@ -609,7 +402,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_hdfs_term + * Function: H5FD__hdfs_term * * Purpose: Shut down the VFD * @@ -618,82 +411,162 @@ done: * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Changes: Rename as appropriate for hdfs vfd. - * Jacob Smith 2018 - * *--------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_term(void) +H5FD__hdfs_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_term() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* Reset VFL ID */ H5FD_HDFS_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_hdfs_term() */ +} /* end H5FD__hdfs_term() */ -/*------------------------------------------------------------------------- - * Function: H5Pset_fapl_hdfs - * - * Purpose: Modify the file access property list to use the H5FD_HDFS - * driver defined in this source file. All driver specfic - * properties are passed in as a pointer to a suitably - * initialized instance of H5FD_hdfs_fapl_t +/*-------------------------------------------------------------------------- + * Function: H5FD__hdfs_handle_open * - * Return: SUCCEED/FAIL + * Purpose: Create a HDFS file handle, 'opening' the target file. * - * Programmer: John Mainzer - * 9/10/17 + * Return: Success: Pointer to HDFS container/handle of opened file. + * Failure: NULL * - * Changes: Rename as appropriate for hdfs vfd. - * Jacob Smith 2018 + * Programmer: Gerd Herber + * May 2018 * - *------------------------------------------------------------------------- + *-------------------------------------------------------------------------- */ -herr_t -H5Pset_fapl_hdfs(hid_t fapl_id, - H5FD_hdfs_fapl_t *fa) +static hdfs_t * +H5FD__hdfs_handle_open(const char *path, const char *namenode_name, + const int32_t namenode_port, const char *user_name, + const char *kerberos_ticket_cache, const int32_t stream_buffer_size) { - H5P_genplist_t *plist = NULL; /* Property list pointer */ - herr_t ret_value = FAIL; - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa); + struct hdfsBuilder *builder = NULL; + hdfs_t *handle = NULL; + hdfs_t *ret_value = NULL; - HDassert(fa != NULL); + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5Pset_fapl_hdfs() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (plist == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ - "not a file access property list") - } + if(path == NULL || path[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "path cannot be null") + if(namenode_name == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode name cannot be null") + if(namenode_port < 0 || namenode_port > 65535) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode port must be non-negative and <= 65535") + if(stream_buffer_size < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "buffer size must non-negative") - if (FAIL == H5FD_hdfs_validate_config(fa)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "invalid hdfs config") - } + handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t)); + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle") - ret_value = H5P_set_driver(plist, H5FD_HDFS, (void *)fa); + handle->magic = (unsigned long)HDFS_HDFST_MAGIC; + handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */ + handle->fileinfo = NULL; + handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */ + + builder = hdfsNewBuilder(); + if(!builder) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) failed to create builder") + hdfsBuilderSetNameNode(builder, namenode_name); + hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port); + if(user_name != NULL && user_name[0] != '\0') + hdfsBuilderSetUserName(builder, user_name); + if(kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0') + hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache); + + /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */ + handle->filesystem = hdfsBuilderConnect(builder); + if(!handle->filesystem) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) could not connect to default namenode") + handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path); + if(!handle->fileinfo) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "hdfsGetPathInfo failed") + handle->file = hdfsOpenFile(handle->filesystem, path, O_RDONLY, stream_buffer_size, 0, 0); + if(!handle->file) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "(hdfs) could not open") + + ret_value = handle; done: - FUNC_LEAVE_API(ret_value) + if(ret_value == NULL && handle != NULL) { + /* error; clean up */ + HDassert(handle->magic == HDFS_HDFST_MAGIC); + handle->magic++; + if(handle->file != NULL) + if(FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close hdfs file handle") + if(handle->fileinfo != NULL) + hdfsFreeFileInfo(handle->fileinfo, 1); + if(handle->filesystem != NULL) + if(FAIL == (hdfsDisconnect(handle->filesystem))) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to disconnect from hdfs") + H5MM_xfree(handle); + } -} /* H5Pset_fapl_hdfs() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD__hdfs_handle_open() */ + + +/*-------------------------------------------------------------------------- + * Function: H5FD__hdfs_handle_close + * + * Purpose: 'Close' an HDFS file container/handle, releasing underlying + * resources. + * + * Return: Success: `SUCCEED` (0) + * Failure: `FAIL` (-1) + * + * Programmer: Gerd Herber + * May 2018 + * + *-------------------------------------------------------------------------- + */ +static herr_t +H5FD__hdfs_handle_close(hdfs_t *handle) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + +#if HDFS_DEBUG + HDfprintf(stdout, "called %s.\n", FUNC); +#endif + + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null") + if(handle->magic != HDFS_HDFST_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic") + + handle->magic++; + if(handle->file != NULL) + if(FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close hdfs file handle") + if(handle->fileinfo != NULL) + hdfsFreeFileInfo(handle->fileinfo, 1); + if(handle->filesystem != NULL) + if(FAIL == (hdfsDisconnect(handle->filesystem))) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to disconnect hdfs file system") + + H5MM_xfree(handle); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD__hdfs_handle_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_validate_config() + * Function: H5FD__hdfs_validate_config() * * Purpose: Test to see if the supplied instance of H5FD_hdfs_fapl_t * contains internally consistant data. Return SUCCEED if so, @@ -710,37 +583,70 @@ done: * Programmer: Jacob Smith * 9/10/17 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa) +H5FD__hdfs_validate_config(const H5FD_hdfs_fapl_t * fa) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(fa != NULL); - if ( fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Unknown H5FD_hdfs_fapl_t version"); - } - - if ( fa->namenode_port > 65535 ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Invalid namenode port number"); - } - if ( fa->namenode_port < 0 ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Invalid namenode port number"); - } + if(fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_hdfs_fapl_t version"); + if(fa->namenode_port > 65535) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number"); + if(fa->namenode_port < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number"); done: FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD__hdfs_validate_config() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pset_fapl_hdfs + * + * Purpose: Modify the file access property list to use the H5FD_HDFS + * driver defined in this source file. All driver specfic + * properties are passed in as a pointer to a suitably + * initialized instance of H5FD_hdfs_fapl_t + * + * Return: SUCCEED/FAIL + * + * Programmer: John Mainzer + * 9/10/17 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa) +{ + H5P_genplist_t *plist = NULL; /* Property list pointer */ + herr_t ret_value = FAIL; -} /* H5FD_hdfs_validate_config() */ + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*x", fapl_id, fa); + + HDassert(fa != NULL); + +#if HDFS_DEBUG + HDfprintf(stdout, "called %s.\n", FUNC); +#endif + + plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); + if(plist == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") + if(FAIL == H5FD__hdfs_validate_config(fa)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid hdfs config") + + ret_value = H5P_set_driver(plist, H5FD_HDFS, (void *)fa); + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Pset_fapl_hdfs() */ /*------------------------------------------------------------------------- @@ -756,13 +662,10 @@ done: * Programmer: John Mainzer * 9/10/17 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_hdfs(hid_t fapl_id, - H5FD_hdfs_fapl_t *fa_out) +H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out) { const H5FD_hdfs_fapl_t *fa = NULL; H5P_genplist_t *plist = NULL; @@ -772,40 +675,31 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5TRACE2("e", "i*x", fapl_id, fa_out); #if HDFS_DEBUG - HDfprintf(stdout, "H5Pget_fapl_hdfs() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - if (fa_out == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "fa_out is NULL") - } + if(fa_out == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL") plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (plist == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, - "not a file access list") - } - if (H5FD_HDFS != H5P_peek_driver(plist)) { - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, - "incorrect VFL driver") - } + if(plist == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") + if(H5FD_HDFS != H5P_peek_driver(plist)) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") fa = (const H5FD_hdfs_fapl_t *)H5P_peek_driver_info(plist); - if (fa == NULL) { - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, - "bad VFL driver info") - } + if(fa == NULL) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") /* Copy the hdfs fapl data out */ HDmemcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t)); done: FUNC_LEAVE_API(ret_value) - } /* H5Pget_fapl_hdfs() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_fapl_get + * Function: H5FD__hdfs_fapl_get * * Purpose: Gets a file access property list which could be used to * create an identical file. @@ -817,24 +711,20 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_hdfs_fapl_get(H5FD_t *_file) +H5FD__hdfs_fapl_get(H5FD_t *_file) { H5FD_hdfs_t *file = (H5FD_hdfs_t*)_file; H5FD_hdfs_fapl_t *fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC fa = (H5FD_hdfs_fapl_t *)H5MM_calloc(sizeof(H5FD_hdfs_fapl_t)); - if (fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed") - } + if(fa == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed") /* Copy the fields of the structure */ HDmemcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t)); @@ -842,17 +732,15 @@ H5FD_hdfs_fapl_get(H5FD_t *_file) ret_value = fa; done: - if (ret_value == NULL && fa != NULL) { + if(ret_value == NULL && fa != NULL) H5MM_xfree(fa); /* clean up on error */ - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_fapl_get() */ +} /* H5FD__hdfs_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_fapl_copy + * Function: H5FD__hdfs_fapl_copy * * Purpose: Copies the hdfs-specific file access properties. * @@ -863,40 +751,34 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_hdfs_fapl_copy(const void *_old_fa) +H5FD__hdfs_fapl_copy(const void *_old_fa) { const H5FD_hdfs_fapl_t *old_fa = (const H5FD_hdfs_fapl_t*)_old_fa; H5FD_hdfs_fapl_t *new_fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC new_fa = (H5FD_hdfs_fapl_t *)H5MM_malloc(sizeof(H5FD_hdfs_fapl_t)); - if (new_fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed") - } + if(new_fa == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed") HDmemcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t)); ret_value = new_fa; done: - if (ret_value == NULL && new_fa != NULL) { + if(ret_value == NULL && new_fa != NULL) H5MM_xfree(new_fa); /* clean up on error */ - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_fapl_copy() */ +} /* H5FD__hdfs_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_fapl_free + * Function: H5FD__hdfs_fapl_free * * Purpose: Frees the hdfs-specific file access properties. * @@ -905,30 +787,27 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_fapl_free(void *_fa) +H5FD__hdfs_fapl_free(void *_fa) { H5FD_hdfs_fapl_t *fa = (H5FD_hdfs_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fa != NULL); /* sanity check */ H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5FD__hdfs_fapl_free() */ -} /* H5FD_hdfs_fapl_free() */ #if HDFS_STATS - /*---------------------------------------------------------------------------- * - * Function: hdfs_reset_stats() + * Function: hdfs__reset_stats() * * Purpose: * @@ -945,28 +824,24 @@ H5FD_hdfs_fapl_free(void *_fa) * Programmer: Jacob Smith * 2017-12-08 * - * Changes: None. - * *---------------------------------------------------------------------------- */ static herr_t -hdfs_reset_stats(H5FD_hdfs_t *file) +hdfs__reset_stats(H5FD_hdfs_t *file) { unsigned i = 0; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDprintf("hdfs_reset_stats() called\n"); + HDprintf("hdfs__reset_stats() called\n"); #endif - if (file == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file was null") - } + if(file == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null") - for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { + for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { file->raw[i].bytes = 0; file->raw[i].count = 0; file->raw[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN; @@ -981,13 +856,13 @@ hdfs_reset_stats(H5FD_hdfs_t *file) done: FUNC_LEAVE_NOAPI(ret_value); -} /* hdfs_reset_stats */ +} /* hdfs__reset_stats */ #endif /* HDFS_STATS */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_open() + * Function: H5FD__hdfs_open() * * Purpose: * @@ -1006,137 +881,78 @@ done: * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS static H5FD_t * -H5FD_hdfs_open( - const char *path, - unsigned flags, - hid_t fapl_id, - haddr_t maxaddr) +H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_t *ret_value = NULL; H5FD_hdfs_t *file = NULL; hdfs_t *handle = NULL; H5FD_hdfs_fapl_t fa; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_open() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* HDFS_DEBUG */ /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); /* Check arguments */ - if (!path || !*path) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "invalid file name") - } - if (0 == maxaddr || HADDR_UNDEF == maxaddr) { - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, - "bogus maxaddr") - } - if (ADDR_OVERFLOW(maxaddr)) { - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, - "bogus maxaddr") - } - if (flags != H5F_ACC_RDONLY) { - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, - "only Read-Only access allowed") - } - if (fapl_id == H5P_DEFAULT || fapl_id == H5P_FILE_ACCESS_DEFAULT) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "fapl cannot be H5P_DEFAULT") - } - if (FAIL == H5Pget_fapl_hdfs(fapl_id, &fa)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "can't get property list") - } - - handle = H5FD_hdfs_handle_open( - path, - fa.namenode_name, - fa.namenode_port, - fa.user_name, - fa.kerberos_ticket_cache, - fa.stream_buffer_size); - - if (handle == NULL) { - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, - "could not open") - } + if(!path || !*path) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") + if(0 == maxaddr || HADDR_UNDEF == maxaddr) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") + if(ADDR_OVERFLOW(maxaddr)) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr") + if(flags != H5F_ACC_RDONLY) + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed") + if(fapl_id == H5P_DEFAULT || fapl_id == H5P_FILE_ACCESS_DEFAULT) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "fapl cannot be H5P_DEFAULT") + if(FAIL == H5Pget_fapl_hdfs(fapl_id, &fa)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list") + + handle = H5FD__hdfs_handle_open(path, fa.namenode_name, fa.namenode_port, + fa.user_name, fa.kerberos_ticket_cache, fa.stream_buffer_size); + if(handle == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open") HDassert(handle->magic == HDFS_HDFST_MAGIC); - /* create new file struct - */ + /* Create new file struct */ file = H5FL_CALLOC(H5FD_hdfs_t); - if (file == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "unable to allocate file struct") - } + if(file == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct") file->hdfs_handle = handle; HDmemcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t)); #if HDFS_STATS - if (FAIL == hdfs_reset_stats(file)) { - HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, - "unable to reset file statistics") - } + if(FAIL == hdfs__reset_stats(file)) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, "unable to reset file statistics") #endif /* HDFS_STATS */ ret_value = (H5FD_t*)file; done: - if (ret_value == NULL) { - if (handle != NULL) { - if (FAIL == H5FD_hdfs_handle_close(handle)) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "unable to close HDFS file handle") - } - } - if (file != NULL) { + if(ret_value == NULL) { + if(handle != NULL) + if(FAIL == H5FD__hdfs_handle_close(handle)) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close HDFS file handle") + if(file != NULL) file = H5FL_FREE(H5FD_hdfs_t, file); - } } /* end if null return value (error) */ FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD__hdfs_open() */ -} /* H5FD_hdfs_open() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static H5FD_t * -H5FD_hdfs_open( - const char H5_ATTR_UNUSED *path, - unsigned H5_ATTR_UNUSED flags, - hid_t H5_ATTR_UNUSED fapl_id, - haddr_t H5_ATTR_UNUSED maxaddr) -{ - H5FD_t *ret_value = NULL; - - FUNC_ENTER_NOAPI_NOINIT - - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, - "Illegal open of unsupported virtual file (hdfs)"); - -done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_open() */ - -#endif /* H5_HAVE_LIBHDFS */ #if HDFS_STATS /*---------------------------------------------------------------------------- * - * Function: hdfs_fprint_stats() + * Function: hdfs__fprint_stats() * * Purpose: * @@ -1186,14 +1002,10 @@ done: * * Programmer: Jacob Smith * - * Changes: None. - * *---------------------------------------------------------------------------- */ static herr_t -hdfs_fprint_stats( - FILE *stream, - const H5FD_hdfs_t *file) +hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file) { herr_t ret_value = SUCCEED; parsed_url_t *purl = NULL; @@ -1212,49 +1024,43 @@ hdfs_fprint_stats( unsigned suffix_i = 0; const char suffixes[] = { ' ', 'K', 'M', 'G', 'T', 'P' }; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - if (stream == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file stream cannot be null" ) - } - if (file == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file cannot be null") - } - if (file->hdfs_handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hdfs handle cannot be null") - } - if (file->hdfs_handle->magic != HDFS_HDFST_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hdfs handle has invalid magic") - } + if(stream == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null") + if(file == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null") + if(file->hdfs_handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle cannot be null") + if(file->hdfs_handle->magic != HDFS_HDFST_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle has invalid magic") /******************* * AGGREGATE STATS * *******************/ - for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { + for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { const hdfs_statsbin *r = &file->raw[i]; const hdfs_statsbin *m = &file->meta[i]; - if (m->min < min_meta) { min_meta = m->min; } - if (r->min < min_raw) { min_raw = r->min; } - if (m->max > max_meta) { max_meta = m->max; } - if (r->max > max_raw) { max_raw = r->max; } + if(m->min < min_meta) + min_meta = m->min; + if(r->min < min_raw) + min_raw = r->min; + if(m->max > max_meta) + max_meta = m->max; + if(r->max > max_raw) + max_raw = r->max; count_raw += r->count; count_meta += m->count; bytes_raw += r->bytes; bytes_meta += m->bytes; } - if (count_raw > 0) { + if(count_raw > 0) average_raw = (double)bytes_raw / (double)count_raw; - } - if (count_meta > 0) { + if(count_meta > 0) average_meta = (double)bytes_meta / (double)count_meta; - } /****************** * PRINT OVERVIEW * @@ -1265,9 +1071,8 @@ hdfs_fprint_stats( HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta, bytes_raw); - if (count_raw + count_meta == 0) { + if(count_raw + count_meta == 0) goto done; - } /************************* * PRINT AGGREGATE STATS * @@ -1275,55 +1080,49 @@ hdfs_fprint_stats( HDfprintf(stream, "SIZES meta raw\n"); HDfprintf(stream, " min "); - if (count_meta == 0) { + if(count_meta == 0) HDfprintf(stream, " 0.000 "); - } else { + else { re_dub = (double)min_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); } - if (count_raw == 0) { + if(count_raw == 0) HDfprintf(stream, " 0.000 \n"); - } else { + else { re_dub = (double)min_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); } HDfprintf(stream, " avg "); re_dub = (double)average_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)average_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); HDfprintf(stream, " max "); re_dub = (double)max_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)max_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); @@ -1336,7 +1135,7 @@ hdfs_fprint_stats( HDfprintf(stream, " up-to meta raw meta raw meta raw\n"); - for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { + for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { const hdfs_statsbin *m; const hdfs_statsbin *r; unsigned long long range_end = 0; @@ -1351,55 +1150,47 @@ hdfs_fprint_stats( m = &file->meta[i]; r = &file->raw[i]; - if (r->count == 0 && m->count == 0) { + if(r->count == 0 && m->count == 0) continue; - } range_end = hdfs_stats_boundaries[i]; - if (i == HDFS_STATS_BIN_COUNT) { + if(i == HDFS_STATS_BIN_COUNT) { range_end = hdfs_stats_boundaries[i-1]; HDfprintf(stream, ">"); - } else { - HDfprintf(stream, " "); } + else + HDfprintf(stream, " "); bm_val = (double)m->bytes; - for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) { + for(suffix_i = 0; bm_val >= 1024.0; suffix_i++) bm_val /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); bm_suffix = suffixes[suffix_i]; br_val = (double)r->bytes; - for (suffix_i = 0; br_val >= 1024.0; suffix_i++) { + for(suffix_i = 0; br_val >= 1024.0; suffix_i++) br_val /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); br_suffix = suffixes[suffix_i]; - if (m->count > 0) { + if(m->count > 0) am_val = (double)(m->bytes) / (double)(m->count); - } - for (suffix_i = 0; am_val >= 1024.0; suffix_i++) { + for(suffix_i = 0; am_val >= 1024.0; suffix_i++) am_val /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); am_suffix = suffixes[suffix_i]; - if (r->count > 0) { + if(r->count > 0) ar_val = (double)(r->bytes) / (double)(r->count); - } - for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) { + for(suffix_i = 0; ar_val >= 1024.0; suffix_i++) ar_val /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); ar_suffix = suffixes[suffix_i]; re_dub = (double)range_end; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf( @@ -1412,18 +1203,18 @@ hdfs_fprint_stats( br_val, br_suffix, /* rawdata bytes */ am_val, am_suffix, /* metadata average */ ar_val, ar_suffix); /* rawdata average */ - fflush(stream); + HDfflush(stream); } done: FUNC_LEAVE_NOAPI(ret_value); -} /* hdfs_fprint_stats */ +} /* hdfs__fprint_stats */ #endif /* HDFS_STATS */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_close() + * Function: H5FD__hdfs_close() * * Purpose: * @@ -1436,77 +1227,47 @@ done: * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static herr_t -H5FD_hdfs_close(H5FD_t *_file) +H5FD__hdfs_close(H5FD_t *_file) { herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_close() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - /* Sanity checks - */ + /* Sanity checks */ HDassert(file != NULL); HDassert(file->hdfs_handle != NULL); HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); - /* Close the underlying request handle - */ - if (file->hdfs_handle != NULL) { - if (FAIL == H5FD_hdfs_handle_close(file->hdfs_handle)) { - HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to close HDFS file handle") - } - } + /* Close the underlying request handle */ + if(file->hdfs_handle != NULL) + if(FAIL == H5FD__hdfs_handle_close(file->hdfs_handle)) + HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close HDFS file handle") #if HDFS_STATS /* TODO: mechanism to re-target stats printout */ - if (FAIL == hdfs_fprint_stats(stdout, file)) { - HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, - "problem while writing file statistics") - } + if(FAIL == hdfs__fprint_stats(stdout, file)) + HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics") #endif /* HDFS_STATS */ - /* Release the file info - */ + /* Release the file info */ file = H5FL_FREE(H5FD_hdfs_t, file); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_close() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static herr_t -H5FD_hdfs_close(H5FD_t H5_ATTR_UNUSED *_file) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "Illegal close of unsupported Virtual File (hdfs)") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_close() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_close() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_cmp() + * Function: H5FD__hdfs_cmp() * * Purpose: * @@ -1520,19 +1281,10 @@ done: * Programmer: Gerd Herber * May 2018 * - * Changes: - * - * + Replace `if (ret_value == 0)` chain with `HGOTO_DONE` jumps. - * Jacob Smith 17 May 2018 - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static int -H5FD_hdfs_cmp( - const H5FD_t *_f1, - const H5FD_t *_f2) +H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { int ret_value = 0; const H5FD_hdfs_t *f1 = (const H5FD_hdfs_t *)_f1; @@ -1540,10 +1292,10 @@ H5FD_hdfs_cmp( hdfsFileInfo *finfo1 = NULL; hdfsFileInfo *finfo2 = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_cmp() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* HDFS_DEBUG */ HDassert(f1->hdfs_handle != NULL); @@ -1556,40 +1308,24 @@ H5FD_hdfs_cmp( HDassert(finfo1 != NULL); HDassert(finfo2 != NULL); - if (finfo1->mKind != finfo2->mKind) { HGOTO_DONE(-1); } - if (finfo1->mName != finfo2->mName) { HGOTO_DONE(-1); } - if (finfo1->mLastMod != finfo2->mLastMod) { HGOTO_DONE(-1); } - if (finfo1->mSize != finfo2->mSize) { HGOTO_DONE(-1); } - if (finfo1->mReplication != finfo2->mReplication) { HGOTO_DONE(-1); } - if (finfo1->mBlockSize != finfo2->mBlockSize) { HGOTO_DONE(-1); } - if (strcmp(finfo1->mOwner, finfo2->mOwner)) { HGOTO_DONE(-1); } - if (strcmp(finfo1->mGroup, finfo2->mGroup)) { HGOTO_DONE(-1); } - if (finfo1->mPermissions != finfo2->mPermissions) { HGOTO_DONE(-1); } - if (finfo1->mLastAccess != finfo2->mLastAccess) { HGOTO_DONE(-1); } + if(finfo1->mKind != finfo2->mKind) { HGOTO_DONE(-1); } + if(finfo1->mName != finfo2->mName) { HGOTO_DONE(-1); } + if(finfo1->mLastMod != finfo2->mLastMod) { HGOTO_DONE(-1); } + if(finfo1->mSize != finfo2->mSize) { HGOTO_DONE(-1); } + if(finfo1->mReplication != finfo2->mReplication) { HGOTO_DONE(-1); } + if(finfo1->mBlockSize != finfo2->mBlockSize) { HGOTO_DONE(-1); } + if(HDstrcmp(finfo1->mOwner, finfo2->mOwner)) { HGOTO_DONE(-1); } + if(HDstrcmp(finfo1->mGroup, finfo2->mGroup)) { HGOTO_DONE(-1); } + if(finfo1->mPermissions != finfo2->mPermissions) { HGOTO_DONE(-1); } + if(finfo1->mLastAccess != finfo2->mLastAccess) { HGOTO_DONE(-1); } done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_hdfs_cmp() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static int -H5FD_hdfs_cmp( - const H5FD_t H5_ATTR_UNUSED *_f1, - const H5FD_t H5_ATTR_UNUSED *_f2) -{ - int ret_value = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_hdfs_cmp() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* H5FD__hdfs_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_query + * Function: H5FD__hdfs_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -1608,28 +1344,26 @@ H5FD_hdfs_cmp( *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_query( - const H5FD_t H5_ATTR_UNUSED *_file, - unsigned long *flags) /* out variable */ +H5FD__hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_query() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - if (flags) { + if(flags) { *flags = 0; *flags |= H5FD_FEAT_DATA_SIEVE; } FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FD_hdfs_query() */ +} /* H5FD__hdfs_query() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_get_eoa() + * Function: H5FD__hdfs_get_eoa() * * Purpose: * @@ -1644,50 +1378,26 @@ H5FD_hdfs_query( * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static haddr_t -H5FD_hdfs_get_eoa( - const H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif FUNC_LEAVE_NOAPI(file->eoa) -} /* end H5FD_hdfs_get_eoa() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static haddr_t -H5FD_hdfs_get_eoa( - const H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n"); -#endif - - FUNC_LEAVE_NOAPI(0) -} /* end H5FD_hdfs_get_eoa() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_get_eoa() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_set_eoa() + * Function: H5FD__hdfs_set_eoa() * * Purpose: * @@ -1700,54 +1410,28 @@ H5FD_hdfs_get_eoa( * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static herr_t -H5FD_hdfs_set_eoa( - H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - haddr_t addr) +H5FD__hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FD_hdfs_set_eoa() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static herr_t -H5FD_hdfs_set_eoa( - H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - haddr_t H5_ATTR_UNUSED addr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n"); -#endif - - FUNC_LEAVE_NOAPI(FAIL) -} /* H5FD_hdfs_set_eoa() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* H5FD__hdfs_set_eoa() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_get_eof() + * Function: H5FD__hdfs_get_eof() * * Purpose: * @@ -1763,49 +1447,27 @@ H5FD_hdfs_set_eoa( * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static haddr_t -H5FD_hdfs_get_eof( - const H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif HDassert(file->hdfs_handle != NULL); HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); FUNC_LEAVE_NOAPI((size_t) file->hdfs_handle->fileinfo->mSize) -} /* end H5FD_hdfs_get_eof() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static haddr_t -H5FD_hdfs_get_eof( - const H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n"); -#endif - - FUNC_LEAVE_NOAPI((size_t)0) -} /* end H5FD_hdfs_get_eof() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_get_eof() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_get_handle() + * Function: H5FD__hdfs_get_handle() * * Purpose: * @@ -1818,67 +1480,33 @@ H5FD_hdfs_get_eof( * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static herr_t -H5FD_hdfs_get_handle( - H5FD_t *_file, - hid_t H5_ATTR_UNUSED fapl, - void **file_handle) +H5FD__hdfs_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* HDFS_DEBUG */ - if (!file_handle) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file handle not valid") - } + if(!file_handle) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") *file_handle = file->hdfs_handle; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_get_handle() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static herr_t -H5FD_hdfs_get_handle( - H5FD_t H5_ATTR_UNUSED *_file, - hid_t H5_ATTR_UNUSED fapl, - void H5_ATTR_UNUSED **file_handle) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n"); -#endif /* HDFS_DEBUG */ - - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "Illegal get-handle of unsupported virtual file (hdfs)"); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_get_handle() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_get_handle() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_read() + * Function: H5FD__hdfs_read() * * Purpose: * @@ -1896,20 +1524,11 @@ done: * Programmer: Jacob Smith * 2017-11-?? * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static herr_t -H5FD_hdfs_read( - H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, /* start offset */ - size_t size, /* length of read */ - void *buf) /* out */ +H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf) { herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; @@ -1920,10 +1539,10 @@ H5FD_hdfs_read( unsigned bin_i = 0; #endif /* HDFS_STATS */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_read() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* HDFS_DEBUG */ HDassert(file != NULL); @@ -1933,44 +1552,33 @@ H5FD_hdfs_read( filesize = (size_t) file->hdfs_handle->fileinfo->mSize; - if ((addr > filesize) || ((addr + size) > filesize)) { - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, - "range exceeds file address") - } + if((addr > filesize) || ((addr + size) > filesize)) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address") - if (FAIL == hdfsPread( - file->hdfs_handle->filesystem, - file->hdfs_handle->file, - (tOffset)addr, - buf, - (tSize)size)) - { - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, - "unable to execute read") - } + if(FAIL == hdfsPread(file->hdfs_handle->filesystem, file->hdfs_handle->file, + (tOffset)addr, buf, (tSize)size)) + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read") #if HDFS_STATS - /* Find which "bin" this read fits in. Can be "overflow" bin. - */ - for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) { - if ((unsigned long long)size < hdfs_stats_boundaries[bin_i]) { + /* Find which "bin" this read fits in. Can be "overflow" bin. */ + for(bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) + if((unsigned long long)size < hdfs_stats_boundaries[bin_i]) break; - } - } bin = (type == H5FD_MEM_DRAW) ? &file->raw[bin_i] : &file->meta[bin_i]; - /* Store collected stats in appropriate bin - */ - if (bin->count == 0) { + /* Store collected stats in appropriate bin */ + if(bin->count == 0) { bin->min = size; bin->max = size; } else { - if (size < bin->min) { bin->min = size; } - if (size > bin->max) { bin->max = size; } + if(size < bin->min) + bin->min = size; + if(size > bin->max) + bin->max = size; } bin->count++; bin->bytes += (unsigned long long)size; @@ -1979,40 +1587,12 @@ H5FD_hdfs_read( done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_read() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static herr_t -H5FD_hdfs_read( - H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t H5_ATTR_UNUSED addr, - size_t H5_ATTR_UNUSED size, - void H5_ATTR_UNUSED *buf) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_read() called.\n"); -#endif /* HDFS_DEBUG */ - - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "Illegal get-handle of unsupported virtual file (hdfs)"); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_read() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_read() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_write() + * Function: H5FD__hdfs_write() * * Purpose: * @@ -2026,38 +1606,31 @@ done: * Programmer: Jacob Smith * 2017-10-23 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_write( - H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t H5_ATTR_UNUSED addr, - size_t H5_ATTR_UNUSED size, - const void H5_ATTR_UNUSED *buf) +H5FD__hdfs_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, + const void H5_ATTR_UNUSED *buf) { herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_write() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "cannot write to read-only file.") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_hdfs_write() */ +} /* H5FD__hdfs_write() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_truncate() + * Function: H5FD__hdfs_truncate() * * Purpose: * @@ -2073,35 +1646,30 @@ done: * Programmer: Jacob Smith * 2017-10-23 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_truncate( - H5FD_t H5_ATTR_UNUSED *_file, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED closing) +H5FD__hdfs_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, + hbool_t H5_ATTR_UNUSED closing) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_truncate() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "cannot truncate read-only file.") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_truncate() */ +} /* end H5FD__hdfs_truncate() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_lock() + * Function: H5FD__hdfs_lock() * * Purpose: * @@ -2118,23 +1686,22 @@ done: * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_lock( +H5FD__hdfs_lock( H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR + FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_hdfs_lock() */ +} /* end H5FD__hdfs_lock() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_unlock() + * Function: H5FD__hdfs_unlock() * * Purpose: * @@ -2148,14 +1715,14 @@ H5FD_hdfs_lock( * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file) +H5FD__hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR + FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_hdfs_unlock() */ +} /* end H5FD__hdfs_unlock() */ +#endif /* H5_HAVE_LIBHDFS */ diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index 37252f0..d67ab9e 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -22,8 +22,13 @@ #ifndef H5FDhdfs_H #define H5FDhdfs_H -#define H5FD_HDFS (H5FD_hdfs_init()) +#ifdef H5_HAVE_LIBHDFS +#define H5FD_HDFS (H5FD_hdfs_init()) +#else /* H5_HAVE_LIBHDFS */ +#define H5FD_HDFS (-1) +#endif /* H5_HAVE_LIBHDFS */ +#ifdef H5_HAVE_LIBHDFS #ifdef __cplusplus extern "C" { #endif @@ -90,8 +95,6 @@ extern "C" { * Programmer: Jacob Smith * 2018-04-23 * - * Changes: None - * ****************************************************************************/ #define H5FD__CURR_HDFS_FAPL_T_VERSION 1 @@ -116,7 +119,7 @@ H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa); #ifdef __cplusplus } #endif +#endif /* H5_HAVE_LIBHDFS */ #endif /* ifndef H5FDhdfs_H */ - diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 78b7742..8793a76 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2000 * * Purpose: The POSIX unbuffered file driver using only the HDF5 public @@ -151,71 +151,71 @@ typedef struct H5FD_log_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - HADDR_UNDEF==(A)+(Z) || \ - (HDoff_t)((A)+(Z))<(HDoff_t)(A)) + HADDR_UNDEF == (A) + (Z) || \ + (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) /* Prototypes */ -static herr_t H5FD_log_term(void); -static void *H5FD_log_fapl_get(H5FD_t *file); -static void *H5FD_log_fapl_copy(const void *_old_fa); -static herr_t H5FD_log_fapl_free(void *_fa); -static H5FD_t *H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__log_term(void); +static void *H5FD__log_fapl_get(H5FD_t *file); +static void *H5FD__log_fapl_copy(const void *_old_fa); +static herr_t H5FD__log_fapl_free(void *_fa); +static H5FD_t *H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_log_close(H5FD_t *_file); -static int H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_log_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); +static herr_t H5FD__log_close(H5FD_t *_file); +static int H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__log_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); static herr_t H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); -static haddr_t H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static haddr_t H5FD__log_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__log_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__log_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_log_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_log_unlock(H5FD_t *_file); +static herr_t H5FD__log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__log_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__log_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_log_g = { - "log", /*name */ - MAXADDR, /*maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_log_term, /*terminate */ - NULL, /*sb_size */ - NULL, /*sb_encode */ - NULL, /*sb_decode */ - sizeof(H5FD_log_fapl_t), /*fapl_size */ - H5FD_log_fapl_get, /*fapl_get */ - H5FD_log_fapl_copy, /*fapl_copy */ - H5FD_log_fapl_free, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_log_open, /*open */ - H5FD_log_close, /*close */ - H5FD_log_cmp, /*cmp */ - H5FD_log_query, /*query */ - NULL, /*get_type_map */ - H5FD_log_alloc, /*alloc */ - H5FD__log_free, /*free */ - H5FD_log_get_eoa, /*get_eoa */ - H5FD_log_set_eoa, /*set_eoa */ - H5FD_log_get_eof, /*get_eof */ - H5FD_log_get_handle, /*get_handle */ - H5FD_log_read, /*read */ - H5FD_log_write, /*write */ - NULL, /*flush */ - H5FD_log_truncate, /*truncate */ - H5FD_log_lock, /*lock */ - H5FD_log_unlock, /*unlock */ - H5FD_FLMAP_DICHOTOMY /*fl_map */ + "log", /* name */ + MAXADDR, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD__log_term, /* terminate */ + NULL, /* sb_size */ + NULL, /* sb_encode */ + NULL, /* sb_decode */ + sizeof(H5FD_log_fapl_t), /* fapl_size */ + H5FD__log_fapl_get, /* fapl_get */ + H5FD__log_fapl_copy, /* fapl_copy */ + H5FD__log_fapl_free, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + H5FD__log_open, /* open */ + H5FD__log_close, /* close */ + H5FD__log_cmp, /* cmp */ + H5FD__log_query, /* query */ + NULL, /* get_type_map */ + H5FD__log_alloc, /* alloc */ + H5FD__log_free, /* free */ + H5FD__log_get_eoa, /* get_eoa */ + H5FD__log_set_eoa, /* set_eoa */ + H5FD__log_get_eof, /* get_eof */ + H5FD__log_get_handle, /* get_handle */ + H5FD__log_read, /* read */ + H5FD__log_write, /* write */ + NULL, /* flush */ + H5FD__log_truncate, /* truncate */ + H5FD__log_lock, /* lock */ + H5FD__log_unlock, /* unlock */ + H5FD_FLMAP_DICHOTOMY /* fl_map */ }; /* Declare a free list to manage the H5FD_log_t struct */ @@ -279,7 +279,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_log_term + * Function: H5FD__log_term * * Purpose: Shut down the VFD * @@ -291,15 +291,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_log_term(void) +H5FD__log_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_LOG_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_log_term() */ +} /* end H5FD__log_term() */ /*------------------------------------------------------------------------- @@ -352,7 +352,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_log_fapl_get + * Function: H5FD__log_fapl_get * * Purpose: Returns a file access property list which indicates how the * specified file is being accessed. The return list could be @@ -368,22 +368,22 @@ done: *------------------------------------------------------------------------- */ static void * -H5FD_log_fapl_get(H5FD_t *_file) +H5FD__log_fapl_get(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ - ret_value = H5FD_log_fapl_copy(&(file->fa)); + ret_value = H5FD__log_fapl_copy(&(file->fa)); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_fapl_get() */ +} /* end H5FD__log_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_fapl_copy + * Function: H5FD__log_fapl_copy * * Purpose: Copies the log-specific file access properties. * @@ -396,13 +396,13 @@ H5FD_log_fapl_get(H5FD_t *_file) *------------------------------------------------------------------------- */ static void * -H5FD_log_fapl_copy(const void *_old_fa) +H5FD__log_fapl_copy(const void *_old_fa) { const H5FD_log_fapl_t *old_fa = (const H5FD_log_fapl_t*)_old_fa; H5FD_log_fapl_t *new_fa = NULL; /* New FAPL info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(old_fa); @@ -430,11 +430,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_fapl_copy() */ +} /* end H5FD__log_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_fapl_free + * Function: H5FD__log_fapl_free * * Purpose: Frees the log-specific file access properties. * @@ -446,11 +446,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_fapl_free(void *_fa) +H5FD__log_fapl_free(void *_fa) { H5FD_log_fapl_t *fa = (H5FD_log_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Free the fapl information */ if(fa->logfile) @@ -458,11 +458,11 @@ H5FD_log_fapl_free(void *_fa) H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_log_fapl_free() */ +} /* end H5FD__log_fapl_free() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_open + * Function: H5FD__log_open * * Purpose: Create and/or opens a file as an HDF5 file. * @@ -477,7 +477,7 @@ H5FD_log_fapl_free(void *_fa) *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) +H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_log_t *file = NULL; H5P_genplist_t *plist; /* Property list */ @@ -492,7 +492,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) h5_stat_t sb; H5FD_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); @@ -649,11 +649,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_open() */ +} /* end H5FD__log_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_close + * Function: H5FD__log_close * * Purpose: Closes an HDF5 file. * @@ -666,13 +666,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_close(H5FD_t *_file) +H5FD__log_close(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; H5_timer_t close_timer; /* Timer for close() call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(file); @@ -794,11 +794,11 @@ H5FD_log_close(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_close() */ +} /* end H5FD__log_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_cmp + * Function: H5FD__log_cmp * * Purpose: Compares two files belonging to this driver using an * arbitrary (but consistent) ordering. @@ -813,13 +813,13 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_log_t *f1 = (const H5FD_log_t *)_f1; const H5FD_log_t *f2 = (const H5FD_log_t *)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #ifdef H5_HAVE_WIN32_API if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1) @@ -850,11 +850,11 @@ H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_cmp() */ +} /* end H5FD__log_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_query + * Function: H5FD__log_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -867,11 +867,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) +H5FD__log_query(const H5FD_t *_file, unsigned long *flags /* out */) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -890,11 +890,11 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_log_query() */ +} /* end H5FD__log_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_alloc + * Function: H5FD__log_alloc * * Purpose: Allocate file memory. * @@ -907,13 +907,13 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsize_t size) +H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsize_t size) { H5FD_log_t *file = (H5FD_log_t *)_file; haddr_t addr; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Compute the address for the block to allocate */ addr = file->eoa; @@ -937,7 +937,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsi ret_value = addr; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_alloc() */ +} /* end H5FD__log_alloc() */ /*------------------------------------------------------------------------- @@ -978,7 +978,7 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, /*------------------------------------------------------------------------- - * Function: H5FD_log_get_eoa + * Function: H5FD__log_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -993,18 +993,18 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) -} /* end H5FD_log_get_eoa() */ +} /* end H5FD__log_get_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_set_eoa + * Function: H5FD__log_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -1018,11 +1018,11 @@ H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) +H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) { H5FD_log_t *file = (H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(file->fa.flags != 0) { /* Check for increasing file size */ @@ -1061,11 +1061,11 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_log_set_eoa() */ +} /* end H5FD__log_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_get_eof + * Function: H5FD__log_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the filesystem end-of-file or the HDF5 end-of-address @@ -1082,18 +1082,18 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eof) -} /* end H5FD_log_get_eof() */ +} /* end H5FD__log_get_eof() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_get_handle + * Function: H5FD__log_get_handle * * Purpose: Returns the file handle of LOG file driver. * @@ -1105,12 +1105,12 @@ H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) +H5FD__log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1119,11 +1119,11 @@ H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_get_handle() */ +} /* end H5FD__log_get_handle() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_read + * Function: H5FD__log_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -1139,7 +1139,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_log_t *file = (H5FD_log_t *)_file; @@ -1154,7 +1154,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -1325,11 +1325,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_read() */ +} /* end H5FD__log_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_write + * Function: H5FD__log_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1343,7 +1343,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_log_t *file = (H5FD_log_t *)_file; @@ -1358,7 +1358,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(size > 0); @@ -1531,11 +1531,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_write() */ +} /* end H5FD__log_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_truncate + * Function: H5FD__log_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -1548,12 +1548,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1639,11 +1639,11 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_truncate() */ +} /* end H5FD__log_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_lock + * Function: H5FD__log_lock * * Purpose: Place a lock on the file * @@ -1655,13 +1655,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_lock(H5FD_t *_file, hbool_t rw) +H5FD__log_lock(H5FD_t *_file, hbool_t rw) { H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(file); @@ -1679,11 +1679,11 @@ H5FD_log_lock(H5FD_t *_file, hbool_t rw) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_lock() */ +} /* end H5FD__log_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_unlock + * Function: H5FD__log_unlock * * Purpose: Remove the existing lock on the file * @@ -1694,12 +1694,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_unlock(H5FD_t *_file) +H5FD__log_unlock(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1712,5 +1712,5 @@ H5FD_log_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_unlock() */ +} /* end H5FD__log_unlock() */ diff --git a/src/H5FDlog.h b/src/H5FDlog.h index a69bb18..db51f3d 100644 --- a/src/H5FDlog.h +++ b/src/H5FDlog.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2000 * * Purpose: The public header file for the log driver. diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index ef035c1..6bee4a7 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -25,6 +25,7 @@ #include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ #include "H5FDmirror.h" /* "Mirror" definitions */ +#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -136,32 +137,32 @@ typedef struct H5FD_mirror_t { #if MIRROR_DEBUG_OP_CALLS #define LOG_OP_CALL(name) do { \ HDprintf("called %s()\n", (name)); \ - fflush(stdout); \ + HDfflush(stdout); \ } while (0) #else #define LOG_OP_CALL(name) /* no-op */ #endif /* MIRROR_DEBUG_OP_CALLS */ /* Prototypes */ -static herr_t H5FD_mirror_term(void); -static void *H5FD_mirror_fapl_get(H5FD_t *_file); -static void *H5FD_mirror_fapl_copy(const void *_old_fa); -static herr_t H5FD_mirror_fapl_free(void *_fa); -static haddr_t H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_mirror_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static H5FD_t *H5FD_mirror_open(const char *name, unsigned flags, \ +static herr_t H5FD__mirror_term(void); +static void *H5FD__mirror_fapl_get(H5FD_t *_file); +static void *H5FD__mirror_fapl_copy(const void *_old_fa); +static herr_t H5FD__mirror_fapl_free(void *_fa); +static haddr_t H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static H5FD_t *H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_mirror_close(H5FD_t *_file); -static herr_t H5FD_mirror_query(const H5FD_t *_file, unsigned long *flags); -static herr_t H5FD_mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, \ +static herr_t H5FD__mirror_close(H5FD_t *_file); +static herr_t H5FD__mirror_query(const H5FD_t *_file, unsigned long *flags); +static herr_t H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_mirror_truncate(H5FD_t *_file, hid_t dxpl_id, \ +static herr_t H5FD__mirror_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_mirror_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_mirror_unlock(H5FD_t *_file); +static herr_t H5FD__mirror_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__mirror_unlock(H5FD_t *_file); static herr_t H5FD__mirror_verify_reply(H5FD_mirror_t *file); @@ -169,40 +170,46 @@ static const H5FD_class_t H5FD_mirror_g = { "mirror", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_mirror_term, /* terminate */ + H5FD__mirror_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ 0, /* fapl_size */ - H5FD_mirror_fapl_get, /* fapl_get */ - H5FD_mirror_fapl_copy, /* fapl_copy */ - H5FD_mirror_fapl_free, /* fapl_free */ + H5FD__mirror_fapl_get, /* fapl_get */ + H5FD__mirror_fapl_copy, /* fapl_copy */ + H5FD__mirror_fapl_free, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_mirror_open, /* open */ - H5FD_mirror_close, /* close */ + H5FD__mirror_open, /* open */ + H5FD__mirror_close, /* close */ NULL, /* cmp */ - H5FD_mirror_query, /* query */ + H5FD__mirror_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_mirror_get_eoa, /* get_eoa */ - H5FD_mirror_set_eoa, /* set_eoa */ - H5FD_mirror_get_eof, /* get_eof */ + H5FD__mirror_get_eoa, /* get_eoa */ + H5FD__mirror_set_eoa, /* set_eoa */ + H5FD__mirror_get_eof, /* get_eof */ NULL, /* get_handle */ - H5FD_mirror_read, /* read */ - H5FD_mirror_write, /* write */ + H5FD__mirror_read, /* read */ + H5FD__mirror_write, /* write */ NULL, /* flush */ - H5FD_mirror_truncate, /* truncate */ - H5FD_mirror_lock, /* lock */ - H5FD_mirror_unlock, /* unlock */ + H5FD__mirror_truncate, /* truncate */ + H5FD__mirror_lock, /* lock */ + H5FD__mirror_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; +/* Declare a free list to manage the transmission buffers */ +H5FL_BLK_DEFINE_STATIC(xmit); + /* Declare a free list to manage the H5FD_mirror_t struct */ H5FL_DEFINE_STATIC(H5FD_mirror_t); +/* Declare a free list to manage the H5FD_mirror_xmit_open_t struct */ +H5FL_DEFINE_STATIC(H5FD_mirror_xmit_open_t); + /*------------------------------------------------------------------------- * Function: H5FD__init_package @@ -219,12 +226,10 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD__init_package"); + LOG_OP_CALL(FUNC); - if (H5FD_mirror_init() < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, - "unable to initialize mirror VFD"); - } + if(H5FD_mirror_init() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize mirror VFD"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -248,12 +253,10 @@ H5FD_mirror_init(void) FUNC_ENTER_NOAPI(FAIL) - LOG_OP_CALL("H5FD_mirror_init"); + LOG_OP_CALL(FUNC); - if (H5I_VFL != H5I_get_type(H5FD_MIRROR_g)) { - H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), - FALSE); - } + if(H5I_VFL != H5I_get_type(H5FD_MIRROR_g)) + H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), FALSE); ret_value = H5FD_MIRROR_g; @@ -263,7 +266,7 @@ done: /* --------------------------------------------------------------------------- - * Function: H5FD_mirror_term + * Function: H5FD__mirror_term * * Purpose: Shut down the VFD * @@ -271,17 +274,17 @@ done: * --------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_term(void) +H5FD__mirror_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_MIRROR_g = 0; - LOG_OP_CALL("H5FD_mirror_term"); + LOG_OP_CALL(FUNC); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_mirror_term() */ +} /* end H5FD__mirror_term() */ /* --------------------------------------------------------------------------- @@ -301,10 +304,14 @@ size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *_buf) { uint16_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint16"); + + LOG_OP_CALL(__func__); + HDassert(_buf && out); + HDmemcpy(&n, _buf, sizeof(n)); *out = (uint16_t)HDntohs(n); + return 2; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint16() */ @@ -326,14 +333,17 @@ size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf) { uint32_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint32"); + + LOG_OP_CALL(__func__); + HDassert(_buf && out); + HDmemcpy(&n, _buf, sizeof(n)); *out = (uint32_t)HDntohl(n); + return 4; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint32() */ - /* --------------------------------------------------------------------------- * Function: is_host_little_endian @@ -357,12 +367,11 @@ is_host_little_endian(void) uint8_t u8[4]; } echeck; echeck.u32 = 0xA1B2C3D4; - if (echeck.u8[0] == 0xD4) { + + if(echeck.u8[0] == 0xD4) return TRUE; - } - else { + else return FALSE; - } } /* end is_host_little_endian() */ @@ -385,15 +394,17 @@ size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf) { uint64_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint64"); + + LOG_OP_CALL(__func__); + HDassert(_buf && out); + HDmemcpy(&n, _buf, sizeof(n)); - if (TRUE == is_host_little_endian()) { + if(TRUE == is_host_little_endian()) *out = BSWAP_64(n); - } - else { + else *out = n; - } + return 8; } /* end H5FD__mirror_xmit_decode_uint64() */ @@ -412,9 +423,12 @@ H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf) size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *_buf) { - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint8"); + LOG_OP_CALL(__func__); + HDassert(_buf && out); + HDmemcpy(out, _buf, sizeof(uint8_t)); + return 1; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint8() */ @@ -435,10 +449,14 @@ size_t H5FD__mirror_xmit_encode_uint16(unsigned char *_dest, uint16_t v) { uint16_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_encode_uint16"); + + LOG_OP_CALL(__func__); + HDassert(_dest); + n = (uint16_t)HDhtons(v); HDmemcpy(_dest, &n, sizeof(n)); + return 2; } /* end H5FD__mirror_xmit_encode_uint16() */ @@ -459,10 +477,14 @@ size_t H5FD__mirror_xmit_encode_uint32(unsigned char *_dest, uint32_t v) { uint32_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_encode_uint32"); + + LOG_OP_CALL(__func__); + HDassert(_dest); + n = (uint32_t)HDhtonl(v); HDmemcpy(_dest, &n, sizeof(n)); + return 4; } /* end H5FD__mirror_xmit_encode_uint32() */ @@ -483,12 +505,15 @@ size_t H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v) { uint64_t n = v; - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint64"); + + LOG_OP_CALL(__func__); + HDassert(_dest); - if (TRUE == is_host_little_endian()) { + + if(TRUE == is_host_little_endian()) n = BSWAP_64(v); - } HDmemcpy(_dest, &n, sizeof(n)); + return 8; } /* H5FD__mirror_xmit_encode_uint64() */ @@ -509,9 +534,12 @@ H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v) size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v) { - LOG_OP_CALL("H5FD__mirror_xmit_encode_uint8"); + LOG_OP_CALL(__func__); + HDassert(dest); + HDmemcpy(dest, &v, sizeof(v)); + return 1; } /* end H5FD__mirror_xmit_encode_uint8() */ @@ -540,8 +568,11 @@ H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_header"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->magic), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->version), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->session_token), @@ -550,6 +581,7 @@ H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->op), &buf[n_eaten]); HDassert(n_eaten == H5FD_MIRROR_XMIT_HEADER_SIZE); + return n_eaten; } /* end H5FD_mirror_xmit_decode_header() */ @@ -578,11 +610,15 @@ H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_lock"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->rw), &buf[n_eaten]); HDassert(n_eaten == H5FD_MIRROR_XMIT_LOCK_SIZE); + return n_eaten; } /* end H5FD_mirror_xmit_decode_lock() */ @@ -612,8 +648,11 @@ H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_open"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->flags), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->maxaddr), &buf[n_eaten]); @@ -622,8 +661,9 @@ H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_eaten); HDstrncpy(out->filename, (const char *)&buf[n_eaten], - H5FD_MIRROR_XMIT_FILEPATH_MAX-1); - out->filename[H5FD_MIRROR_XMIT_FILEPATH_MAX-1] = 0; /* force final NULL */ + H5FD_MIRROR_XMIT_FILEPATH_MAX - 1); + out->filename[H5FD_MIRROR_XMIT_FILEPATH_MAX - 1] = 0; /* force final NULL */ + return H5FD_MIRROR_XMIT_OPEN_SIZE; } /* end H5FD_mirror_xmit_decode_open() */ @@ -653,15 +693,19 @@ H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_reply"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->status), &buf[n_eaten]); HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_eaten); HDstrncpy(out->message, (const char *)&buf[n_eaten], - H5FD_MIRROR_STATUS_MESSAGE_MAX-1); - out->message[H5FD_MIRROR_STATUS_MESSAGE_MAX-1] = 0; /* force NULL term */ + H5FD_MIRROR_STATUS_MESSAGE_MAX - 1); + out->message[H5FD_MIRROR_STATUS_MESSAGE_MAX - 1] = 0; /* force NULL term */ + return H5FD_MIRROR_XMIT_REPLY_SIZE; } /* end H5FD_mirror_xmit_decode_reply() */ @@ -690,12 +734,16 @@ H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_set_eoa"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->eoa_addr), &buf[n_eaten]); HDassert(n_eaten == H5FD_MIRROR_XMIT_EOA_SIZE); + return n_eaten; } /* end H5FD_mirror_xmit_decode_set_eoa() */ @@ -724,13 +772,17 @@ H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_write"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->offset), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->size), &buf[n_eaten]); HDassert(n_eaten == H5FD_MIRROR_XMIT_WRITE_SIZE); + return n_eaten; } /* end H5FD_mirror_xmit_decode_write() */ @@ -754,14 +806,18 @@ H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_header"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->magic); n_writ += H5FD__mirror_xmit_encode_uint8((dest+n_writ), x->version); n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->session_token); n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->xmit_count); n_writ += H5FD__mirror_xmit_encode_uint8((dest+n_writ), x->op); HDassert(n_writ == H5FD_MIRROR_XMIT_HEADER_SIZE); + return n_writ; } /* end H5FD_mirror_xmit_encode_header() */ @@ -784,12 +840,16 @@ H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_lock"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->rw); HDassert(n_writ == H5FD_MIRROR_XMIT_LOCK_SIZE); + return n_writ; } /* end H5FD_mirror_xmit_encode_lock() */ @@ -813,13 +873,14 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_open"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + /* clear entire structure, but especially its filepath string area */ - for (n_writ = 0; n_writ < H5FD_MIRROR_XMIT_OPEN_SIZE; n_writ++) { - *(dest+n_writ) = 0; - } - n_writ = 0; + HDmemset(dest, 0, H5FD_MIRROR_XMIT_OPEN_SIZE); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->flags); @@ -827,8 +888,8 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest, n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size_t_blob); HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_writ); - HDstrncpy((char *)&dest[n_writ], x->filename, - H5FD_MIRROR_XMIT_FILEPATH_MAX); + HDstrncpy((char *)&dest[n_writ], x->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX); + return H5FD_MIRROR_XMIT_OPEN_SIZE; } /* end H5FD_mirror_xmit_encode_open() */ @@ -853,20 +914,21 @@ H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_reply"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + /* clear entire structure, but especially its message string area */ - for (n_writ = 0; n_writ < H5FD_MIRROR_XMIT_REPLY_SIZE; n_writ++) { - *(dest+n_writ) = 0; - } - n_writ = 0; + HDmemset(dest, 0, H5FD_MIRROR_XMIT_REPLY_SIZE); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->status); HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_writ); - HDstrncpy((char *)&dest[n_writ], x->message, - H5FD_MIRROR_STATUS_MESSAGE_MAX); + HDstrncpy((char *)&dest[n_writ], x->message, H5FD_MIRROR_STATUS_MESSAGE_MAX); + return H5FD_MIRROR_XMIT_REPLY_SIZE; } /* end H5FD_mirror_xmit_encode_reply() */ @@ -890,13 +952,17 @@ H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_set_eoa"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->eoa_addr); HDassert(n_writ == H5FD_MIRROR_XMIT_EOA_SIZE); + return n_writ; } /* end H5FD_mirror_xmit_encode_set_eoa() */ @@ -920,14 +986,18 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_write"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->offset); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size); HDassert(n_writ == H5FD_MIRROR_XMIT_WRITE_SIZE); + return n_writ; } /* end H5FD_mirror_xmit_encode_write() */ @@ -942,16 +1012,16 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest, * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_close"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && - (H5FD_MIRROR_OP_CLOSE == xmit->op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && (H5FD_MIRROR_OP_CLOSE == xmit->op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_close() */ @@ -966,16 +1036,16 @@ H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_lock"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_LOCK == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_LOCK == xmit->pub.op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_lock() */ @@ -990,16 +1060,17 @@ H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_open"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_OPEN == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_OPEN == xmit->pub.op)) + return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_open() */ @@ -1014,16 +1085,16 @@ H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_set_eoa"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_eoa() */ @@ -1038,16 +1109,16 @@ H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_reply"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_REPLY == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_REPLY == xmit->pub.op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_reply() */ @@ -1062,16 +1133,16 @@ H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_write"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_WRITE == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_WRITE == xmit->pub.op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_write() */ @@ -1086,16 +1157,16 @@ H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_xmit"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || - (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version) ) - { + + if((H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version)) return FALSE; - } + return TRUE; } /* end H5FD_mirror_xmit_is_xmit() */ @@ -1111,60 +1182,55 @@ H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit) * Return: SUCCEED if ok, else FAIL. * ---------------------------------------------------------------------------- */ -herr_t +static herr_t H5FD__mirror_verify_reply(H5FD_mirror_t *file) { - char xmit_buf[H5FD_MIRROR_XMIT_REPLY_SIZE]; + unsigned char *xmit_buf = NULL; struct H5FD_mirror_xmit_reply_t reply; ssize_t read_ret = 0; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD__mirror_verify_reply"); + LOG_OP_CALL(FUNC); HDassert(file && file->sock_fd); + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + read_ret = HDread(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_REPLY_SIZE); - if (read_ret < 0) { + if(read_ret < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to read reply"); - } - if (read_ret != H5FD_MIRROR_XMIT_REPLY_SIZE) { + if(read_ret != H5FD_MIRROR_XMIT_REPLY_SIZE) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unexpected read size"); - } LOG_XMIT_BYTES("reply", xmit_buf, read_ret); - if (H5FD_mirror_xmit_decode_reply(&reply, (const unsigned char *)xmit_buf) - != H5FD_MIRROR_XMIT_REPLY_SIZE) - { + if(H5FD_mirror_xmit_decode_reply(&reply, xmit_buf) != H5FD_MIRROR_XMIT_REPLY_SIZE) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unable to decode reply xmit"); - } - if (H5FD_mirror_xmit_is_reply(&reply) != TRUE) { + if(H5FD_mirror_xmit_is_reply(&reply) != TRUE) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "xmit op code was not REPLY"); - } - if (reply.pub.session_token != file->xmit.session_token) { + if(reply.pub.session_token != file->xmit.session_token) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "wrong session"); - } - - if (reply.pub.xmit_count != (file->xmit_i)++) { + if(reply.pub.xmit_count != (file->xmit_i)++) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "xmit out of sync"); - } - - if (reply.status != H5FD_MIRROR_STATUS_OK) { - HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, - "%s", (const char *)(reply.message)); - } + if(reply.status != H5FD_MIRROR_STATUS_OK) + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "%s", (const char *)(reply.message)); done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value); } /* end H5FD__mirror_verify_reply() */ /* ------------------------------------------------------------------------- - * Function: H5FD_mirror_fapl_get + * Function: H5FD__mirror_fapl_get * * Purpose: Get the file access propety list which could be used to create * an identical file. @@ -1174,37 +1240,35 @@ done: * ------------------------------------------------------------------------- */ static void * -H5FD_mirror_fapl_get(H5FD_t *_file) +H5FD__mirror_fapl_get(H5FD_t *_file) { H5FD_mirror_t *file = (H5FD_mirror_t *)_file; H5FD_mirror_fapl_t *fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_fapl_get"); + LOG_OP_CALL(FUNC); fa = (H5FD_mirror_fapl_t *)H5MM_calloc(sizeof(H5FD_mirror_fapl_t)); - if (NULL == fa) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "calloc failed"); - } + if(NULL == fa) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "calloc failed"); HDmemcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t)); ret_value = fa; done: - if (ret_value == NULL) { - if (fa != NULL) { + if(ret_value == NULL) + if(fa != NULL) H5MM_xfree(fa); - } - } + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_fapl_get() */ +} /* end H5FD__mirror_fapl_get() */ /* ------------------------------------------------------------------------- - * Function: H5FD_mirror_fapl_copy + * Function: H5FD__mirror_fapl_copy * * Purpose: Copies the mirror vfd-specific file access properties. * @@ -1213,37 +1277,34 @@ done: * ------------------------------------------------------------------------- */ static void * -H5FD_mirror_fapl_copy(const void *_old_fa) +H5FD__mirror_fapl_copy(const void *_old_fa) { const H5FD_mirror_fapl_t *old_fa = (const H5FD_mirror_fapl_t *)_old_fa; H5FD_mirror_fapl_t *new_fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_fapl_copy"); + LOG_OP_CALL(FUNC); new_fa = (H5FD_mirror_fapl_t *)H5MM_malloc(sizeof(H5FD_mirror_fapl_t)); - if (new_fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed"); - } + if(new_fa == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed"); HDmemcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t)); ret_value = new_fa; done: - if (ret_value == NULL) { - if (new_fa != NULL) { + if(ret_value == NULL) + if(new_fa != NULL) H5MM_xfree(new_fa); - } - } + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_fapl_copy() */ +} /* end H5FD__mirror_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_fapl_free + * Function: H5FD__mirror_fapl_free * * Purpose: Frees the mirror VFD-specific file access properties. * @@ -1251,13 +1312,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_fapl_free(void *_fa) +H5FD__mirror_fapl_free(void *_fa) { H5FD_mirror_fapl_t *fa = (H5FD_mirror_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - LOG_OP_CALL("H5FD_mirror_fapl_free"); + LOG_OP_CALL(FUNC); /* sanity check */ HDassert(fa != NULL); @@ -1267,7 +1328,7 @@ H5FD_mirror_fapl_free(void *_fa) H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_mirror_fapl_free() */ +} /* end H5FD__mirror_fapl_free() */ /* ------------------------------------------------------------------------- @@ -1289,26 +1350,20 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", fapl_id, fa_out); - LOG_OP_CALL("H5Pget_fapl_mirror"); + LOG_OP_CALL(FUNC); - if (NULL == fa_out) { + if(NULL == fa_out) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL"); - } plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (NULL == plist) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, - "not a file access property list"); - } - - if (H5P_peek_driver(plist) != H5FD_MIRROR) { + if(NULL == plist) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + if(H5P_peek_driver(plist) != H5FD_MIRROR) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); - } fa = (const H5FD_mirror_fapl_t *)H5P_peek_driver_info(plist); - if (NULL == fa) { + if(NULL == fa) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info"); - } HDassert(fa->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */ @@ -1337,22 +1392,17 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", fapl_id, fa); - LOG_OP_CALL("H5Pset_fapl_mirror"); + LOG_OP_CALL(FUNC); plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (NULL == plist) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, - "not a file access property list"); - } - if (NULL == fa) { + if(NULL == plist) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + if(NULL == fa) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null fapl_t pointer"); - } - if (H5FD_MIRROR_FAPL_MAGIC != fa->magic) { + if(H5FD_MIRROR_FAPL_MAGIC != fa->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fapl_t magic"); - } - if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa->version) { + if(H5FD_MIRROR_CURR_FAPL_T_VERSION != fa->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown fapl_t version"); - } ret_value = H5P_set_driver(plist, H5FD_MIRROR, (const void *)fa); @@ -1362,7 +1412,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mirror_open + * Function: H5FD__mirror_open * * Purpose: Create and/or opens a file as an HDF5 file. * @@ -1376,64 +1426,51 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_mirror_open(const char *name, +H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { -#define MIRR_OPEN_MAXBUF 16 /* local symbol to give meaning to magic number */ - /* #defined because it is needed at compile time */ - /* Large enough to hold a port number string */ int live_socket = -1; struct sockaddr_in target_addr; socklen_t addr_size; - char xmit_buf[H5FD_MIRROR_XMIT_OPEN_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_fapl_t fa; H5FD_mirror_t *file = NULL; - H5FD_mirror_xmit_open_t open_xmit; + H5FD_mirror_xmit_open_t *open_xmit = NULL; H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_open"); + LOG_OP_CALL(FUNC); /* --------------- */ /* Check arguments */ /* --------------- */ - if (!name || !*name) { + if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name"); - } - if (HDstrlen(name) >= H5FD_MIRROR_XMIT_FILEPATH_MAX) { + if(HDstrlen(name) >= H5FD_MIRROR_XMIT_FILEPATH_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "filename is too long"); - } - if (0 == maxaddr || HADDR_UNDEF == maxaddr) { + if(0 == maxaddr || HADDR_UNDEF == maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr"); - } - if (ADDR_OVERFLOW(maxaddr)) { + if(ADDR_OVERFLOW(maxaddr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr"); - } - if (H5Pget_fapl_mirror(fapl_id, &fa) == FAIL) { + if(H5Pget_fapl_mirror(fapl_id, &fa) == FAIL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get config info"); - } - - if (H5FD_MIRROR_FAPL_MAGIC != fa.magic) { + if(H5FD_MIRROR_FAPL_MAGIC != fa.magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid fapl magic"); - } - - if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa.version) { + if(H5FD_MIRROR_CURR_FAPL_T_VERSION != fa.version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid fapl version"); - } /* --------------------- */ /* Handshake with remote */ /* --------------------- */ live_socket = HDsocket(AF_INET, SOCK_STREAM, 0); - if (live_socket < 0) { + if(live_socket < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't create socket"); - } target_addr.sin_family = AF_INET; target_addr.sin_port = HDhtons((uint16_t)fa.handshake_port); @@ -1441,21 +1478,16 @@ H5FD_mirror_open(const char *name, HDmemset(target_addr.sin_zero, '\0', sizeof target_addr.sin_zero); addr_size = sizeof(target_addr); - if (HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "can't connect to remote server"); - } + if(HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't connect to remote server"); /* ------------- */ /* Open the file */ /* ------------- */ file = (H5FD_mirror_t *)H5FL_CALLOC(H5FD_mirror_t); - if (NULL == file) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "unable to allocate file struct"); - } + if(NULL == file) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct"); file->sock_fd = live_socket; file->xmit_i = 0; @@ -1466,49 +1498,53 @@ H5FD_mirror_open(const char *name, file->xmit.session_token = (uint32_t)(0x01020304 ^ file->sock_fd); /* TODO: hashing? */ /* int --> uint32_t may truncate on some systems... shouldn't matter? */ + open_xmit = (H5FD_mirror_xmit_open_t *)H5FL_CALLOC(H5FD_mirror_xmit_open_t); + if(NULL == open_xmit) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate open_xmit struct"); + file->xmit.op = H5FD_MIRROR_OP_OPEN; - open_xmit.pub = file->xmit; - open_xmit.flags = (uint32_t)flags; - open_xmit.maxaddr = (uint64_t)maxaddr; - open_xmit.size_t_blob = (uint64_t)((size_t)(-1)); - HDsnprintf(open_xmit.filename, H5FD_MIRROR_XMIT_FILEPATH_MAX-1, "%s", name); - - if (H5FD_mirror_xmit_encode_open((unsigned char *)xmit_buf, - (const H5FD_mirror_xmit_open_t *)&open_xmit) - != H5FD_MIRROR_XMIT_OPEN_SIZE) - { + open_xmit->pub = file->xmit; + open_xmit->flags = (uint32_t)flags; + open_xmit->maxaddr = (uint64_t)maxaddr; + open_xmit->size_t_blob = (uint64_t)((size_t)(-1)); + HDsnprintf(open_xmit->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX-1, "%s", name); + + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_open(xmit_buf, open_xmit) != H5FD_MIRROR_XMIT_OPEN_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, NULL, "unable to encode open"); - } LOG_XMIT_BYTES("open", xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, NULL, "unable to transmit open"); - } - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid reply"); - } ret_value = (H5FD_t *)file; done: - if (NULL == ret_value) { - if (file) { + if(NULL == ret_value) { + if(file) file = H5FL_FREE(H5FD_mirror_t, file); - } - if (live_socket >= 0 && HDclose(live_socket) < 0) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "can't close socket"); - } + if(live_socket >= 0 && HDclose(live_socket) < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "can't close socket"); } + + if(open_xmit) + open_xmit = H5FL_FREE(H5FD_mirror_xmit_open_t, open_xmit); + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -#undef MIRR_OPEN_MAXBUF -} /* end H5FD_mirror_open() */ +} /* end H5FD__mirror_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_close + * Function: H5FD__mirror_close * * Purpose: Closes the HDF5 file. * @@ -1523,16 +1559,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_close(H5FD_t *_file) +H5FD__mirror_close(H5FD_t *_file) { H5FD_mirror_t *file = (H5FD_mirror_t *)_file; - unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE]; + unsigned char *xmit_buf = NULL; int xmit_encoded = 0; /* monitor point of failure */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_close"); + LOG_OP_CALL(FUNC); /* Sanity check */ HDassert(file); @@ -1541,68 +1577,59 @@ H5FD_mirror_close(H5FD_t *_file) file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_CLOSE; - if (H5FD_mirror_xmit_encode_header(xmit_buf, - (const H5FD_mirror_xmit_t *)&(file->xmit)) - != H5FD_MIRROR_XMIT_HEADER_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to encode close"); - } xmit_encoded = 1; LOG_XMIT_BYTES("close", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to transmit close"); - } - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } - if (HDclose(file->sock_fd) < 0) { + if(HDclose(file->sock_fd) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket"); - } done: - if (ret_value == FAIL) { - if (xmit_encoded == 0) { + if(ret_value == FAIL) { + if(xmit_encoded == 0) { /* Encode failed; send GOODBYE to force writer halt. * We can ignore any response from the writer, if we receive * any reply at all. */ - if (HDwrite(file->sock_fd, "GOODBYE", HDstrlen("GOODBYE")) < 0) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to transmit close"); - if (HDclose(file->sock_fd) < 0) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "can't close socket"); - } + if(HDwrite(file->sock_fd, "GOODBYE", HDstrlen("GOODBYE")) < 0) { + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to transmit close"); + if(HDclose(file->sock_fd) < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket"); file->sock_fd = -1; /* invalidate for later */ } /* end if problem writing goodbye; go down hard */ else - if (HDshutdown(file->sock_fd, SHUT_WR) < 0) { - HDONE_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, - "can't shutdown socket write: %s", - HDstrerror(errno)); - } /* end else-if problem shutting down socket */ + if(HDshutdown(file->sock_fd, SHUT_WR) < 0) + HDONE_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't shutdown socket write: %s", HDstrerror(errno)); } /* end if xmit encode failed */ - if (file->sock_fd >= 0) { - if (HDclose(file->sock_fd) < 0) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "can't close socket"); - } - } /* end if socket not closed by going down hard */ + if(file->sock_fd >= 0) + if(HDclose(file->sock_fd) < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket"); } /* end if error */ file = H5FL_FREE(H5FD_mirror_t, file); /* always release resources */ + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_close() */ +} /* end H5FD__mirror_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_query + * Function: H5FD__mirror_query * * Purpose: Get the driver feature flags implemented by the driver. * @@ -1610,11 +1637,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) +H5FD__mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) { - FUNC_ENTER_NOAPI_NOINIT_NOERR; + FUNC_ENTER_STATIC_NOERR; - LOG_OP_CALL("H5FD_mirror_query"); + LOG_OP_CALL(FUNC); /* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as * the underying driver -- as such, the Mirror VFD implementation copies @@ -1624,23 +1651,21 @@ H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) * is never included. * -- JOS 2020-01-13 */ - if (flags) { - *flags = 0 \ - | H5FD_FEAT_AGGREGATE_METADATA \ + if(flags) + *flags = H5FD_FEAT_AGGREGATE_METADATA \ | H5FD_FEAT_ACCUMULATE_METADATA \ | H5FD_FEAT_DATA_SIEVE \ | H5FD_FEAT_AGGREGATE_SMALLDATA \ | H5FD_FEAT_POSIX_COMPAT_HANDLE \ | H5FD_FEAT_SUPPORTS_SWMR_IO \ | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; - } FUNC_LEAVE_NOAPI(SUCCEED); -} /* end H5FD_mirror_query() */ +} /* end H5FD__mirror_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_get_eoa + * Function: H5FD__mirror_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -1652,22 +1677,22 @@ H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) *------------------------------------------------------------------------- */ static haddr_t -H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_mirror_t *file = (const H5FD_mirror_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - LOG_OP_CALL("H5FD_mirror_get_eoa"); + LOG_OP_CALL(FUNC); HDassert(file); FUNC_LEAVE_NOAPI(file->eoa) -} /* end H5FD_mirror_get_eoa() */ +} /* end H5FD__mirror_get_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_set_eoa + * Function: H5FD__mirror_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -1677,16 +1702,16 @@ H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) +H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) { H5FD_mirror_xmit_eoa_t xmit_eoa; - unsigned char xmit_buf[H5FD_MIRROR_XMIT_EOA_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_set_eoa"); + LOG_OP_CALL(FUNC); HDassert(file); @@ -1699,31 +1724,31 @@ H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) xmit_eoa.type = (uint8_t)type; xmit_eoa.eoa_addr = (uint64_t)addr; - if (H5FD_mirror_xmit_encode_set_eoa(xmit_buf, - (const H5FD_mirror_xmit_eoa_t *)&xmit_eoa) - != H5FD_MIRROR_XMIT_EOA_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_set_eoa(xmit_buf, &xmit_eoa) != H5FD_MIRROR_XMIT_EOA_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode set-eoa"); - } LOG_XMIT_BYTES("set-eoa", xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, - "unable to transmit set-eoa"); - } + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE) < 0) + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit set-eoa"); - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_set_eoa() */ +} /* end H5FD__mirror_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_get_eof + * Function: H5FD__mirror_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the filesystem end-of-file or the HDF5 end-of-address @@ -1736,49 +1761,43 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_mirror_t *file = (const H5FD_mirror_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - LOG_OP_CALL("H5FD_mirror_get_eof"); + LOG_OP_CALL(FUNC); HDassert(file); FUNC_LEAVE_NOAPI(file->eof) -} /* end H5FD_mirror_get_eof() */ +} /* end H5FD__mirror_get_eof() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_read + * Function: H5FD__mirror_read * - * Purpose: Required to register the driver. - * If called, MUST fail. + * Purpose: Required to register the driver, but if called, MUST fail. * * Return: FAIL *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_read(H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED fapl_id, - haddr_t H5_ATTR_UNUSED addr, - size_t H5_ATTR_UNUSED size, - void H5_ATTR_UNUSED *buf) +H5FD__mirror_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, + size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { - herr_t ret_value = FAIL; + FUNC_ENTER_STATIC_NOERR - FUNC_ENTER_NOAPI_NOINIT_NOERR + LOG_OP_CALL(FUNC); - LOG_OP_CALL("H5FD_mirror_read"); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_read() */ + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5FD__mirror_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_write + * Function: H5FD__mirror_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1795,21 +1814,17 @@ H5FD_mirror_read(H5FD_t H5_ATTR_UNUSED *_file, *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_write(H5FD_t *_file, - H5FD_mem_t type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, - size_t size, - const void *buf) +H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, + haddr_t addr, size_t size, const void *buf) { H5FD_mirror_xmit_write_t xmit_write; - unsigned char xmit_buf[H5FD_MIRROR_XMIT_WRITE_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_write"); + LOG_OP_CALL(FUNC); HDassert(file); HDassert(buf); @@ -1822,43 +1837,41 @@ H5FD_mirror_write(H5FD_t *_file, xmit_write.offset = (uint64_t)addr; xmit_write.type = (uint8_t)type; + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); /* Notify Writer of incoming data to write. */ - if (H5FD_mirror_xmit_encode_write(xmit_buf, - (const H5FD_mirror_xmit_write_t *)&xmit_write) - != H5FD_MIRROR_XMIT_WRITE_SIZE) - { + if(H5FD_mirror_xmit_encode_write(xmit_buf, &xmit_write) != H5FD_MIRROR_XMIT_WRITE_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode write"); - } LOG_XMIT_BYTES("write", xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit write"); - } /* Check that our write xmission was received */ - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } /* Send the data to be written */ - if (HDwrite(file->sock_fd, buf, size) < 0) { + if(HDwrite(file->sock_fd, buf, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit data"); - } /* Writer should reply that it got the data and is still okay/ready */ - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_write() */ +} /* end H5FD__mirror_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_truncate + * Function: H5FD__mirror_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -1867,45 +1880,45 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_truncate(H5FD_t *_file, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED closing) +H5FD__mirror_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, + hbool_t H5_ATTR_UNUSED closing) { - unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_truncate"); + LOG_OP_CALL(FUNC); file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_TRUNCATE; - if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) - != H5FD_MIRROR_XMIT_HEADER_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode truncate"); - } LOG_XMIT_BYTES("truncate", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, - "unable to transmit truncate"); - } + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit truncate"); - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_truncate() */ +} /* end H5FD__mirror_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_lock + * Function: H5FD__mirror_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -1916,16 +1929,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_lock(H5FD_t *_file, hbool_t rw) +H5FD__mirror_lock(H5FD_t *_file, hbool_t rw) { H5FD_mirror_xmit_lock_t xmit_lock; - unsigned char xmit_buf[H5FD_MIRROR_XMIT_LOCK_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_lock"); + LOG_OP_CALL(FUNC); file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_LOCK; @@ -1933,30 +1946,31 @@ H5FD_mirror_lock(H5FD_t *_file, hbool_t rw) xmit_lock.pub = file->xmit; xmit_lock.rw = (uint64_t)rw; - if (H5FD_mirror_xmit_encode_lock(xmit_buf, - (const H5FD_mirror_xmit_lock_t *)&xmit_lock) - != H5FD_MIRROR_XMIT_LOCK_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_lock(xmit_buf, &xmit_lock) != H5FD_MIRROR_XMIT_LOCK_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode lock"); - } LOG_XMIT_BYTES("lock", xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit lock"); - } - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FD_mirror_lock */ +} /* end H5FD__mirror_lock */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_unlock + * Function: H5FD__mirror_unlock * * Purpose: Remove the existing lock on the file. * @@ -1964,38 +1978,40 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_unlock(H5FD_t *_file) +H5FD__mirror_unlock(H5FD_t *_file) { - unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_unlock"); + LOG_OP_CALL(FUNC); file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_UNLOCK; - if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) - != H5FD_MIRROR_XMIT_HEADER_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode unlock"); - } LOG_XMIT_BYTES("unlock", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit unlock"); - } - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FD_mirror_unlock */ +} /* end H5FD__mirror_unlock */ #endif /* H5_HAVE_MIRROR_VFD */ diff --git a/src/H5FDmirror.h b/src/H5FDmirror.h index fb66b7b..7d15c1b 100644 --- a/src/H5FDmirror.h +++ b/src/H5FDmirror.h @@ -65,297 +65,6 @@ H5_DLL hid_t H5FD_mirror_init(void); H5_DLL herr_t H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out); H5_DLL herr_t H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa); -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - * IPC - Mirror VFD and Remote Worker application. - * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - */ - - -/* The maximum allowed size for a receiving buffer when accepting bytes to - * write. Writes larger than this size are performed by multiple accept-write - * steps by the Writer. */ -#define H5FD_MIRROR_DATA_BUFFER_MAX H5_GB /* 1 Gigabyte */ - -#define H5FD_MIRROR_XMIT_CURR_VERSION 1 -#define H5FD_MIRROR_XMIT_MAGIC 0x87F8005B - -#define H5FD_MIRROR_OP_OPEN 1 -#define H5FD_MIRROR_OP_CLOSE 2 -#define H5FD_MIRROR_OP_WRITE 3 -#define H5FD_MIRROR_OP_TRUNCATE 4 -#define H5FD_MIRROR_OP_REPLY 5 -#define H5FD_MIRROR_OP_SET_EOA 6 -#define H5FD_MIRROR_OP_LOCK 7 -#define H5FD_MIRROR_OP_UNLOCK 8 - -#define H5FD_MIRROR_STATUS_OK 0 -#define H5FD_MIRROR_STATUS_ERROR 1 -#define H5FD_MIRROR_STATUS_MESSAGE_MAX 256 /* Dedicated error message size */ - -/* Maximum length of a path/filename string, including the NULL-terminator. - * Must not be smaller than H5FD_SPLITTER_PATH_MAX. */ -#define H5FD_MIRROR_XMIT_FILEPATH_MAX 4097 - -/* Define the exact sizes of the various xmit blobs as sent over the wire. - * This is used to minimize the number of bytes transmitted as well as to - * sanity-check received bytes. - * Any modifications to the xmit structures and/or the encode/decode functions - * must be reflected here. - * */ -#define H5FD_MIRROR_XMIT_HEADER_SIZE 14 -#define H5FD_MIRROR_XMIT_EOA_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 9) -#define H5FD_MIRROR_XMIT_LOCK_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 8) -#define H5FD_MIRROR_XMIT_OPEN_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 20 + H5FD_MIRROR_XMIT_FILEPATH_MAX) -#define H5FD_MIRROR_XMIT_REPLY_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 4 + H5FD_MIRROR_STATUS_MESSAGE_MAX) -#define H5FD_MIRROR_XMIT_WRITE_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 17) - -/* Maximum length of any xmit. */ -#define H5FD_MIRROR_XMIT_BUFFER_MAX MAX2( MAX3(H5FD_MIRROR_XMIT_HEADER_SIZE, \ - H5FD_MIRROR_XMIT_EOA_SIZE, \ - H5FD_MIRROR_XMIT_LOCK_SIZE), \ - MAX3(H5FD_MIRROR_XMIT_OPEN_SIZE, \ - H5FD_MIRROR_XMIT_REPLY_SIZE, \ - H5FD_MIRROR_XMIT_WRITE_SIZE) ) \ - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_t - * - * Common structure 'header' for all mirror VFD/worker IPC. - * Must be the first component of a derived operation xmit structure, - * such as file-open or write command. - * - * `magic` (uint32_t) - * A "unique" number identifying the structure and endianness of - * transmitting maching. - * Must be set to H5FD_MIRROR_XMIT_MAGIC native to the VFD "sender". - * - * `version` (uint8_t) - * Number used to identify the structure membership. - * Allows sane modifications to this structure in the future. - * Must be set to H5FD_MIRROR_XMIT_CURR_VERSION. - * - * `session_token` (uint32_t) - * A "unique" number identifying the session between VFD sender and - * remote receiver/worker/writer. Exists to help sanity-check. - * - * `xmit_count` (uint32_t) - * Which transmission this is since the session began. - * Used to sanity-check transmission errors. - * First xmit (file-open) must be 0. - * - * `op` (uint8_t) - * Number identifying which operation to perform. - * Corresponds with the extended structure outside of this xmit header. - * Possible values are all defined H5FD_MIRROR_OP_* constants. - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_t { - uint32_t magic; - uint8_t version; - uint32_t session_token; - uint32_t xmit_count; - uint8_t op; -} H5FD_mirror_xmit_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_eoa_t - * - * Structure containing eoa-set information from VFD sender. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `type` (uint8_t) - * System-independent alias for H5F[D]_mem_t. - * Specifies datatype to be written. - * - * `eoa_addr` (uint64_t) - * New address for eoa. - * (Natively 'haddr_t', always a 64-bit field) - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_eoa_t { - H5FD_mirror_xmit_t pub; - uint8_t type; - uint64_t eoa_addr; -} H5FD_mirror_xmit_eoa_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_lock_t - * - * Structure containing eoa-set information from VFD sender. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `rw` (uint64_t) - * The Read/Write mode flag passed into H5FDlock(). - * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit? - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_lock_t { - H5FD_mirror_xmit_t pub; - uint64_t rw; -} H5FD_mirror_xmit_lock_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_open_t - * - * Structure containing file-open information from the VFD sender. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `flags` (uint32_t) - * VFL-layer file-open flags passed directly to H5FDopen(). - * (Natively 'unsigned [int]') TODO: native int may be 64-bit? - * - * `maxaddr` (uint64_t) - * VFL-layer maximum allowed address space for the file to open passed - * directly to H5FDopen(). - * (Natively 'haddr_t', always a 64-bit field) - * - * `size_t_blob` (uint64_t) - * A number indicating how large a size_t is on the sending system. - * Must be set to (uint64_t)((size_t)(-1)) - * (maximum possible value of size_t, cast to uint64_t). - * The receiving system inspects this value -- if the local (remote) - * size_t is smaller than that of the Sender, issues a warning. - * Not an error, as: - * 1. It is assumed that underlying file systems/drivers have become - * smart enough to handle file sizes that otherwise might be - * constrained. - * 2. The Mirror Writer ingests bytes to write multiple 'slices' if the - * size is greater than H5FD_MIRROR_DATA_BUFFER_MAX, regardless of - * any size_t storage size disparity. - * - * `filename` (char[]) - * String giving the filename and path of file to open. - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_open_t { - H5FD_mirror_xmit_t pub; - uint32_t flags; - uint64_t maxaddr; - uint64_t size_t_blob; - char filename[H5FD_MIRROR_XMIT_FILEPATH_MAX]; -} H5FD_mirror_xmit_open_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_reply_t - * - * Structure used by the remote receiver/worker/writer to respond to - * a command from the VFD sender. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `status` (uint32_t) - * Number indicating whether the command was successful or if an - * occured. - * Allowed values are H5FD_MIRROR_STATUS_OK and - * H5FD_MIRROR_STATUS_ERROR. - * - * `message` (char[]) - * Error message. Populated if and only if there was a problem. - * It is possible that a message may reach the end of the alloted - * space without a NULL terminator -- the onus is on the programmer to - * handle this situation. - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_reply_t { - H5FD_mirror_xmit_t pub; - uint32_t status; - char message[H5FD_MIRROR_STATUS_MESSAGE_MAX]; -} H5FD_mirror_xmit_reply_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_write_t - * - * Structure containing data-write information from VFD sender. - * - * The data to be written is transmitted in subsequent, packets - * and may be broken up into more than one transmission buffer. - * The VFD sender and remote receiver/worker/writer must coordinate - * the receipt of data. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `type` (uint8_t) - * Specifies datatype to be written. - * (Natively 'H5FD_mem_t', an enumerated type in H5Fpublic.h) - * - * `offset` (uint64_t) - * Start location of write in file. - * (Natively 'haddr_t', always a 64-bit field) - * - * `size` (uint64_t) - * Size of the data to be written, in bytes. - * (Natively 'size_t', accommodate the largest possible as 64-bits) - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_write_t { - H5FD_mirror_xmit_t pub; - uint8_t type; - uint64_t offset; - uint64_t size; -} H5FD_mirror_xmit_write_t; - - - -/* Encode/decode routines are required to "pack" the xmit data into a known - * byte format for transmission over the wire. - * - * All component numbers must be stored in "network" word order (Big-Endian). - * - * All components must be packed in the order given in the structure definition. - * - * All components must be packed with zero padding between. - */ - -H5_DLL size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *buf); -H5_DLL size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *buf); -H5_DLL size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *buf); -H5_DLL size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *buf); -H5_DLL size_t H5FD__mirror_xmit_encode_uint16(unsigned char *dest, uint16_t v); -H5_DLL size_t H5FD__mirror_xmit_encode_uint32(unsigned char *dest, uint32_t v); -H5_DLL size_t H5FD__mirror_xmit_encode_uint64(unsigned char *dest, uint64_t v); -H5_DLL size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v); - -H5_DLL size_t H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf); - -H5_DLL size_t H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x); - -H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit); - #ifdef __cplusplus } #endif @@ -368,4 +77,3 @@ H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit); #endif /* H5FDmirror_H */ - diff --git a/src/H5FDmirror_priv.h b/src/H5FDmirror_priv.h new file mode 100644 index 0000000..dc15441 --- /dev/null +++ b/src/H5FDmirror_priv.h @@ -0,0 +1,323 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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 COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Public, shared definitions for Mirror VFD & remote Writer. + */ + +#ifndef H5FDmirror_priv_H +#define H5FDmirror_priv_H + +#ifdef H5_HAVE_MIRROR_VFD + +#ifdef __cplusplus +extern "C" { +#endif + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + * IPC - Mirror VFD and Remote Worker application. + * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + */ + +/* The maximum allowed size for a receiving buffer when accepting bytes to + * write. Writes larger than this size are performed by multiple accept-write + * steps by the Writer. */ +#define H5FD_MIRROR_DATA_BUFFER_MAX H5_GB /* 1 Gigabyte */ + +#define H5FD_MIRROR_XMIT_CURR_VERSION 1 +#define H5FD_MIRROR_XMIT_MAGIC 0x87F8005B + +#define H5FD_MIRROR_OP_OPEN 1 +#define H5FD_MIRROR_OP_CLOSE 2 +#define H5FD_MIRROR_OP_WRITE 3 +#define H5FD_MIRROR_OP_TRUNCATE 4 +#define H5FD_MIRROR_OP_REPLY 5 +#define H5FD_MIRROR_OP_SET_EOA 6 +#define H5FD_MIRROR_OP_LOCK 7 +#define H5FD_MIRROR_OP_UNLOCK 8 + +#define H5FD_MIRROR_STATUS_OK 0 +#define H5FD_MIRROR_STATUS_ERROR 1 +#define H5FD_MIRROR_STATUS_MESSAGE_MAX 256 /* Dedicated error message size */ + +/* Maximum length of a path/filename string, including the NULL-terminator. + * Must not be smaller than H5FD_SPLITTER_PATH_MAX. */ +#define H5FD_MIRROR_XMIT_FILEPATH_MAX 4097 + +/* Define the exact sizes of the various xmit blobs as sent over the wire. + * This is used to minimize the number of bytes transmitted as well as to + * sanity-check received bytes. + * Any modifications to the xmit structures and/or the encode/decode functions + * must be reflected here. + * */ +#define H5FD_MIRROR_XMIT_HEADER_SIZE 14 +#define H5FD_MIRROR_XMIT_EOA_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 9) +#define H5FD_MIRROR_XMIT_LOCK_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 8) +#define H5FD_MIRROR_XMIT_OPEN_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 20 + H5FD_MIRROR_XMIT_FILEPATH_MAX) +#define H5FD_MIRROR_XMIT_REPLY_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 4 + H5FD_MIRROR_STATUS_MESSAGE_MAX) +#define H5FD_MIRROR_XMIT_WRITE_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 17) + +/* Maximum length of any xmit. */ +#define H5FD_MIRROR_XMIT_BUFFER_MAX MAX2( MAX3(H5FD_MIRROR_XMIT_HEADER_SIZE, \ + H5FD_MIRROR_XMIT_EOA_SIZE, \ + H5FD_MIRROR_XMIT_LOCK_SIZE), \ + MAX3(H5FD_MIRROR_XMIT_OPEN_SIZE, \ + H5FD_MIRROR_XMIT_REPLY_SIZE, \ + H5FD_MIRROR_XMIT_WRITE_SIZE) ) \ + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_t + * + * Common structure 'header' for all mirror VFD/worker IPC. + * Must be the first component of a derived operation xmit structure, + * such as file-open or write command. + * + * `magic` (uint32_t) + * A "unique" number identifying the structure and endianness of + * transmitting maching. + * Must be set to H5FD_MIRROR_XMIT_MAGIC native to the VFD "sender". + * + * `version` (uint8_t) + * Number used to identify the structure membership. + * Allows sane modifications to this structure in the future. + * Must be set to H5FD_MIRROR_XMIT_CURR_VERSION. + * + * `session_token` (uint32_t) + * A "unique" number identifying the session between VFD sender and + * remote receiver/worker/writer. Exists to help sanity-check. + * + * `xmit_count` (uint32_t) + * Which transmission this is since the session began. + * Used to sanity-check transmission errors. + * First xmit (file-open) must be 0. + * + * `op` (uint8_t) + * Number identifying which operation to perform. + * Corresponds with the extended structure outside of this xmit header. + * Possible values are all defined H5FD_MIRROR_OP_* constants. + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_t { + uint32_t magic; + uint8_t version; + uint32_t session_token; + uint32_t xmit_count; + uint8_t op; +} H5FD_mirror_xmit_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_eoa_t + * + * Structure containing eoa-set information from VFD sender. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `type` (uint8_t) + * System-independent alias for H5F[D]_mem_t. + * Specifies datatype to be written. + * + * `eoa_addr` (uint64_t) + * New address for eoa. + * (Natively 'haddr_t', always a 64-bit field) + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_eoa_t { + H5FD_mirror_xmit_t pub; + uint8_t type; + uint64_t eoa_addr; +} H5FD_mirror_xmit_eoa_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_lock_t + * + * Structure containing eoa-set information from VFD sender. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `rw` (uint64_t) + * The Read/Write mode flag passed into H5FDlock(). + * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit? + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_lock_t { + H5FD_mirror_xmit_t pub; + uint64_t rw; +} H5FD_mirror_xmit_lock_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_open_t + * + * Structure containing file-open information from the VFD sender. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `flags` (uint32_t) + * VFL-layer file-open flags passed directly to H5FDopen(). + * (Natively 'unsigned [int]') TODO: native int may be 64-bit? + * + * `maxaddr` (uint64_t) + * VFL-layer maximum allowed address space for the file to open passed + * directly to H5FDopen(). + * (Natively 'haddr_t', always a 64-bit field) + * + * `size_t_blob` (uint64_t) + * A number indicating how large a size_t is on the sending system. + * Must be set to (uint64_t)((size_t)(-1)) + * (maximum possible value of size_t, cast to uint64_t). + * The receiving system inspects this value -- if the local (remote) + * size_t is smaller than that of the Sender, issues a warning. + * Not an error, as: + * 1. It is assumed that underlying file systems/drivers have become + * smart enough to handle file sizes that otherwise might be + * constrained. + * 2. The Mirror Writer ingests bytes to write multiple 'slices' if the + * size is greater than H5FD_MIRROR_DATA_BUFFER_MAX, regardless of + * any size_t storage size disparity. + * + * `filename` (char[]) + * String giving the filename and path of file to open. + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_open_t { + H5FD_mirror_xmit_t pub; + uint32_t flags; + uint64_t maxaddr; + uint64_t size_t_blob; + char filename[H5FD_MIRROR_XMIT_FILEPATH_MAX]; +} H5FD_mirror_xmit_open_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_reply_t + * + * Structure used by the remote receiver/worker/writer to respond to + * a command from the VFD sender. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `status` (uint32_t) + * Number indicating whether the command was successful or if an + * occured. + * Allowed values are H5FD_MIRROR_STATUS_OK and + * H5FD_MIRROR_STATUS_ERROR. + * + * `message` (char[]) + * Error message. Populated if and only if there was a problem. + * It is possible that a message may reach the end of the alloted + * space without a NULL terminator -- the onus is on the programmer to + * handle this situation. + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_reply_t { + H5FD_mirror_xmit_t pub; + uint32_t status; + char message[H5FD_MIRROR_STATUS_MESSAGE_MAX]; +} H5FD_mirror_xmit_reply_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_write_t + * + * Structure containing data-write information from VFD sender. + * + * The data to be written is transmitted in subsequent, packets + * and may be broken up into more than one transmission buffer. + * The VFD sender and remote receiver/worker/writer must coordinate + * the receipt of data. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `type` (uint8_t) + * Specifies datatype to be written. + * (Natively 'H5FD_mem_t', an enumerated type in H5Fpublic.h) + * + * `offset` (uint64_t) + * Start location of write in file. + * (Natively 'haddr_t', always a 64-bit field) + * + * `size` (uint64_t) + * Size of the data to be written, in bytes. + * (Natively 'size_t', accommodate the largest possible as 64-bits) + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_write_t { + H5FD_mirror_xmit_t pub; + uint8_t type; + uint64_t offset; + uint64_t size; +} H5FD_mirror_xmit_write_t; + + + +/* Encode/decode routines are required to "pack" the xmit data into a known + * byte format for transmission over the wire. + * + * All component numbers must be stored in "network" word order (Big-Endian). + * + * All components must be packed in the order given in the structure definition. + * + * All components must be packed with zero padding between. + */ + +H5_DLL size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *buf); +H5_DLL size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *buf); +H5_DLL size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *buf); +H5_DLL size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *buf); +H5_DLL size_t H5FD__mirror_xmit_encode_uint16(unsigned char *dest, uint16_t v); +H5_DLL size_t H5FD__mirror_xmit_encode_uint32(unsigned char *dest, uint32_t v); +H5_DLL size_t H5FD__mirror_xmit_encode_uint64(unsigned char *dest, uint64_t v); +H5_DLL size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v); + +H5_DLL size_t H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf); + +H5_DLL size_t H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x); + +H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit); + +#ifdef __cplusplus +} +#endif + +#endif /* H5_HAVE_MIRROR_VFD */ + +#endif /* H5FDmirror_priv_H */ + diff --git a/src/H5FDmodule.h b/src/H5FDmodule.h index ea1a9fd..11686be 100644 --- a/src/H5FDmodule.h +++ b/src/H5FDmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index b2959a5..43fa340 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 30, 2004 * * Purpose: Common routines for all MPI-based VFL drivers. @@ -43,8 +43,6 @@ * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -82,8 +80,6 @@ done: * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -120,8 +116,6 @@ done: * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ MPI_Comm @@ -158,8 +152,6 @@ done: * Programmer: John Mainzer * 4/4/17 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -197,13 +189,6 @@ done: * Programmer: Unknown * January 30, 1998 * - * Modifications: - * Robb Matzke, 1999-04-23 - * An error is reported for address overflows. The ADDR output - * argument is optional. - * - * Robb Matzke, 1999-08-06 - * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */ haddr_t @@ -235,16 +220,6 @@ H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off) * Programmer: Unknown * January 30, 1998 * - * Modifications: - * Robb Matzke, 1999-04-23 - * An error is reported for address overflows. The ADDR output - * argument is optional. - * - * Robb Matzke, 1999-07-28 - * The ADDR argument is passed by value. - * - * Robb Matzke, 1999-08-06 - * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */ herr_t @@ -290,9 +265,6 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/) * Programmer: rky * 19981207 * - * Modifications: - * Robb Matzke, 1999-08-09 - * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */ herr_t @@ -345,9 +317,6 @@ done: * Programmer: rky * 19981207 * - * Modifications: - * Robb Matzke, 1999-08-09 - * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h index 2d62c79..da9f59b 100644 --- a/src/H5FDmpi.h +++ b/src/H5FDmpi.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 30, 2004 * * Purpose: The public header file for common items for all MPI VFL drivers diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 3d2e0cf..9475093 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 29, 1999 * * Purpose: This is the MPI-2 I/O driver. diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index 6ee0a1a..9d02153 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the mpio driver. diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 72f4da5..fbca8e4 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 10, 1997 * * Purpose: Implements a file driver which dispatches I/O requests to @@ -1234,14 +1234,6 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * If the TYPE is H5FD_MEM_DEFAULT, simply find the biggest - * EOA of individual file because the EOA for the whole file - * is meaningless. - * *------------------------------------------------------------------------- */ static haddr_t @@ -1334,17 +1326,6 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 10 January 2007 - * EOA for the whole file is discarded because it's meaningless - * for MULTI file. This function only sets eoa for individual - * file. - * - * Raymond Lu - * 21 June 2011 - * Backward compatibility of EOA. Please the comment in the - * code. *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index 0bd5718..b3c3c62 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the "multi" driver. diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index 22b5d17..8ffffd1 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 3, 2008 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 2e3d3ce..7d5b66d 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 26, 1999 */ #ifndef _H5FDprivate_H diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 61bf212..7297cf8 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 26, 1999 */ #ifndef _H5FDpublic_H diff --git a/src/H5FDros3.c b/src/H5FDros3.c index d99272c..38e34a0 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -13,7 +13,7 @@ /* * Read-Only S3 Virtual File Driver (VFD) * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2017-10-13 * * Purpose: @@ -212,66 +212,67 @@ typedef struct H5FD_ros3_t { * Only included if it may be used -- ROS3 VFD is enabled. * */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) /* Prototypes */ -static herr_t H5FD_ros3_term(void); -static void *H5FD_ros3_fapl_get(H5FD_t *_file); -static void *H5FD_ros3_fapl_copy(const void *_old_fa); -static herr_t H5FD_ros3_fapl_free(void *_fa); -static H5FD_t *H5FD_ros3_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__ros3_term(void); +static void *H5FD__ros3_fapl_get(H5FD_t *_file); +static void *H5FD__ros3_fapl_copy(const void *_old_fa); +static herr_t H5FD__ros3_fapl_free(void *_fa); +static H5FD_t *H5FD__ros3_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_ros3_close(H5FD_t *_file); -static int H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_ros3_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_ros3_get_handle(H5FD_t *_file, hid_t fapl, +static herr_t H5FD__ros3_close(H5FD_t *_file); +static int H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__ros3_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__ros3_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_ros3_truncate(H5FD_t *_file, hid_t dxpl_id, +static herr_t H5FD__ros3_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_ros3_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_ros3_unlock(H5FD_t *_file); -static herr_t H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa); +static herr_t H5FD__ros3_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__ros3_unlock(H5FD_t *_file); + +static herr_t H5FD__ros3_validate_config(const H5FD_ros3_fapl_t * fa); static const H5FD_class_t H5FD_ros3_g = { "ros3", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_ros3_term, /* terminate */ + H5FD__ros3_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ sizeof(H5FD_ros3_fapl_t), /* fapl_size */ - H5FD_ros3_fapl_get, /* fapl_get */ - H5FD_ros3_fapl_copy, /* fapl_copy */ - H5FD_ros3_fapl_free, /* fapl_free */ + H5FD__ros3_fapl_get, /* fapl_get */ + H5FD__ros3_fapl_copy, /* fapl_copy */ + H5FD__ros3_fapl_free, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_ros3_open, /* open */ - H5FD_ros3_close, /* close */ - H5FD_ros3_cmp, /* cmp */ - H5FD_ros3_query, /* query */ + H5FD__ros3_open, /* open */ + H5FD__ros3_close, /* close */ + H5FD__ros3_cmp, /* cmp */ + H5FD__ros3_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_ros3_get_eoa, /* get_eoa */ - H5FD_ros3_set_eoa, /* set_eoa */ - H5FD_ros3_get_eof, /* get_eof */ - H5FD_ros3_get_handle, /* get_handle */ - H5FD_ros3_read, /* read */ - H5FD_ros3_write, /* write */ + H5FD__ros3_get_eoa, /* get_eoa */ + H5FD__ros3_set_eoa, /* set_eoa */ + H5FD__ros3_get_eof, /* get_eof */ + H5FD__ros3_get_handle, /* get_handle */ + H5FD__ros3_read, /* read */ + H5FD__ros3_write, /* write */ NULL, /* flush */ - H5FD_ros3_truncate, /* truncate */ - H5FD_ros3_lock, /* lock */ - H5FD_ros3_unlock, /* unlock */ + H5FD__ros3_truncate, /* truncate */ + H5FD__ros3_lock, /* lock */ + H5FD__ros3_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -297,14 +298,11 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - if (H5FD_ros3_init() < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, - "unable to initialize ros3 VFD") - } + if(H5FD_ros3_init() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize ros3 VFD") done: FUNC_LEAVE_NOAPI(ret_value) - } /* end H5FD__init_package() */ @@ -335,7 +333,7 @@ H5FD_ros3_init(void) HDfprintf(stdout, "H5FD_ros3_init() called.\n"); #endif - if (H5I_VFL != H5I_get_type(H5FD_ROS3_g)) + if(H5I_VFL != H5I_get_type(H5FD_ROS3_g)) H5FD_ROS3_g = H5FD_register(&H5FD_ros3_g, sizeof(H5FD_class_t), FALSE); #if ROS3_STATS @@ -343,6 +341,7 @@ H5FD_ros3_init(void) */ for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) { unsigned long long value = 0; + ROS3_STATS_POW(bin_i, &value) ros3_stats_boundaries[bin_i] = value; } @@ -353,12 +352,11 @@ H5FD_ros3_init(void) done: FUNC_LEAVE_NOAPI(ret_value) - } /* end H5FD_ros3_init() */ /*--------------------------------------------------------------------------- - * Function: H5FD_ros3_term + * Function: H5FD__ros3_term * * Purpose: Shut down the VFD * @@ -369,20 +367,19 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_term(void) +H5FD__ros3_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_term() called.\n"); + HDfprintf(stdout, "H5FD__ros3_term() called.\n"); #endif /* Reset VFL ID */ H5FD_ROS3_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) - -} /* end H5FD_ros3_term() */ +} /* end H5FD__ros3_term() */ /*------------------------------------------------------------------------- @@ -401,8 +398,7 @@ H5FD_ros3_term(void) *------------------------------------------------------------------------- */ herr_t -H5Pset_fapl_ros3(hid_t fapl_id, - H5FD_ros3_fapl_t *fa) +H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa) { H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = FAIL; @@ -417,25 +413,21 @@ H5Pset_fapl_ros3(hid_t fapl_id, #endif plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (plist == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ - "not a file access property list") - } + if(plist == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (FAIL == H5FD_ros3_validate_config(fa)) { + if(FAIL == H5FD__ros3_validate_config(fa)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid ros3 config") - } ret_value = H5P_set_driver(plist, H5FD_ROS3, (void *)fa); done: FUNC_LEAVE_API(ret_value) - } /* end H5Pset_fapl_ros3() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_validate_config() + * Function: H5FD__ros3_validate_config() * * Purpose: Test to see if the supplied instance of H5FD_ros3_fapl_t * contains internally consistant data. Return SUCCEED if so, @@ -455,34 +447,25 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa) +H5FD__ros3_validate_config(const H5FD_ros3_fapl_t * fa) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(fa != NULL); - if ( fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Unknown H5FD_ros3_fapl_t version"); - } + if(fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version"); - /* if set to authenticate, region and id cannot be empty strings - */ - if (fa->authenticate == TRUE) { - if ((fa->aws_region[0] == '\0') || - (fa->secret_id[0] == '\0')) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Inconsistent authentication information"); - } - } + /* if set to authenticate, region and id cannot be empty strings */ + if(fa->authenticate == TRUE) + if((fa->aws_region[0] == '\0') || (fa->secret_id[0] == '\0')) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Inconsistent authentication information"); done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_validate_config() */ +} /* end H5FD__ros3_validate_config() */ /*------------------------------------------------------------------------- @@ -498,13 +481,10 @@ done: * Programmer: John Mainzer * 9/10/17 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_ros3(hid_t fapl_id, - H5FD_ros3_fapl_t *fa_out) +H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out) { const H5FD_ros3_fapl_t *fa = NULL; H5P_genplist_t *plist = NULL; @@ -517,35 +497,30 @@ H5Pget_fapl_ros3(hid_t fapl_id, HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n"); #endif - if (fa_out == NULL) { + if(fa_out == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL") - } plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (plist == NULL) { + if(plist == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - if (H5FD_ROS3 != H5P_peek_driver(plist)) { + if(H5FD_ROS3 != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") - } fa = (const H5FD_ros3_fapl_t *)H5P_peek_driver_info(plist); - if (fa == NULL) { + if(fa == NULL) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") - } /* Copy the ros3 fapl data out */ HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t)); done: FUNC_LEAVE_API(ret_value) - } /* end H5Pget_fapl_ros3() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_fapl_get + * Function: H5FD__ros3_fapl_get * * Purpose: Gets a file access property list which could be used to * create an identical file. @@ -557,24 +532,20 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_ros3_fapl_get(H5FD_t *_file) +H5FD__ros3_fapl_get(H5FD_t *_file) { H5FD_ros3_t *file = (H5FD_ros3_t*)_file; H5FD_ros3_fapl_t *fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC fa = (H5FD_ros3_fapl_t *)H5MM_calloc(sizeof(H5FD_ros3_fapl_t)); - if (fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed") - } + if(fa == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy the fields of the structure */ HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t)); @@ -583,18 +554,16 @@ H5FD_ros3_fapl_get(H5FD_t *_file) ret_value = fa; done: - if (ret_value == NULL) { - if (fa != NULL) { + if(ret_value == NULL) + if(fa != NULL) H5MM_xfree(fa); - } - } - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_ros3_fapl_get() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD__ros3_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_fapl_copy + * Function: H5FD__ros3_fapl_copy * * Purpose: Copies the ros3-specific file access properties. * @@ -605,41 +574,35 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_ros3_fapl_copy(const void *_old_fa) +H5FD__ros3_fapl_copy(const void *_old_fa) { const H5FD_ros3_fapl_t *old_fa = (const H5FD_ros3_fapl_t*)_old_fa; H5FD_ros3_fapl_t *new_fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC new_fa = (H5FD_ros3_fapl_t *)H5MM_malloc(sizeof(H5FD_ros3_fapl_t)); - if (new_fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed"); - } + if(new_fa == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t)); ret_value = new_fa; done: - if (ret_value == NULL) { - if (new_fa != NULL) { + if(ret_value == NULL) + if(new_fa != NULL) H5MM_xfree(new_fa); - } - } - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_ros3_fapl_copy() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD__ros3_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_fapl_free + * Function: H5FD__ros3_fapl_free * * Purpose: Frees the ros3-specific file access properties. * @@ -648,27 +611,23 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_fapl_free(void *_fa) +H5FD__ros3_fapl_free(void *_fa) { H5FD_ros3_fapl_t *fa = (H5FD_ros3_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fa != NULL); /* sanity check */ H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) - -} /* end H5FD_ros3_fapl_free() */ +} /* end H5FD__ros3_fapl_free() */ #if ROS3_STATS - /*---------------------------------------------------------------------------- * * Function: ros3_reset_stats() @@ -696,18 +655,16 @@ ros3_reset_stats(H5FD_ros3_t *file) unsigned i = 0; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG HDprintf("ros3_reset_stats() called\n"); #endif - if (file == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file was null"); - } + if(file == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null"); - for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { + for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { file->raw[i].bytes = 0; file->raw[i].count = 0; file->raw[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN; @@ -721,15 +678,13 @@ ros3_reset_stats(H5FD_ros3_t *file) done: FUNC_LEAVE_NOAPI(ret_value); - } /* end ros3_reset_stats() */ - #endif /* ROS3_STATS */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_open() + * Function: H5FD__ros3_open() * * Purpose: * @@ -759,11 +714,7 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_ros3_open( - const char *url, - unsigned flags, - hid_t fapl_id, - haddr_t maxaddr) +H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_ros3_t *file = NULL; struct tm *now = NULL; @@ -773,117 +724,89 @@ H5FD_ros3_open( H5FD_ros3_fapl_t fa; H5FD_t *ret_value = NULL; - - - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_open() called.\n"); + HDfprintf(stdout, "H5FD__ros3_open() called.\n"); #endif /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); /* Check arguments */ - if (!url || !*url) + if(!url || !*url) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") - if (0 == maxaddr || HADDR_UNDEF == maxaddr) + if(0 == maxaddr || HADDR_UNDEF == maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") - if (ADDR_OVERFLOW(maxaddr)) + if(ADDR_OVERFLOW(maxaddr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr") - if (flags != H5F_ACC_RDONLY) - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, - "only Read-Only access allowed") + if(flags != H5F_ACC_RDONLY) + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed") - if (FAIL == H5Pget_fapl_ros3(fapl_id, &fa)) { + if(FAIL == H5Pget_fapl_ros3(fapl_id, &fa)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list") - } - if (CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "unable to initialize curl global (placeholder flags)") - } + if(CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to initialize curl global (placeholder flags)") /* open file; procedure depends on whether or not the fapl instructs to * authenticate requests or not. */ - if (fa.authenticate == TRUE) { + if(fa.authenticate == TRUE) { /* compute signing key (part of AWS/S3 REST API) * can be re-used by user/key for 7 days after creation. * find way to re-use/share */ now = gmnow(); HDassert( now != NULL ); - if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "problem while writing iso8601 timestamp") - } - if (FAIL == H5FD_s3comms_signing_key(signing_key, - (const char *)fa.secret_key, - (const char *)fa.aws_region, - (const char *)iso8601now) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "problem while computing signing key") - } - - handle = H5FD_s3comms_s3r_open( - url, - (const char *)fa.aws_region, - (const char *)fa.secret_id, - (const unsigned char *)signing_key); - } else { + if(ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while writing iso8601 timestamp") + if(FAIL == H5FD_s3comms_signing_key(signing_key, (const char *)fa.secret_key, + (const char *)fa.aws_region, (const char *)iso8601now)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while computing signing key") + + handle = H5FD_s3comms_s3r_open( url, (const char *)fa.aws_region, + (const char *)fa.secret_id, (const unsigned char *)signing_key); + } + else handle = H5FD_s3comms_s3r_open(url, NULL, NULL, NULL); - } /* if/else should authenticate */ - if (handle == NULL) { + if(handle == NULL) /* If we want to check CURL's say on the matter in a controlled * fashion, this is the place to do it, but would need to make a * few minor changes to s3comms `s3r_t` and `s3r_read()`. */ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open"); - } - /* create new file struct - */ + /* create new file struct */ file = H5FL_CALLOC(H5FD_ros3_t); - if (file == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "unable to allocate file struct") - } + if(file == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") file->s3r_handle = handle; HDmemcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t)); #if ROS3_STATS - if (FAIL == ros3_reset_stats(file)) { - HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, - "unable to reset file statistics") - } + if(FAIL == ros3_reset_stats(file)) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, "unable to reset file statistics") #endif /* ROS3_STATS */ ret_value = (H5FD_t*)file; done: - if (ret_value == NULL) { - if (handle != NULL) { - if (FAIL == H5FD_s3comms_s3r_close(handle)) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "unable to close s3 file handle") - } - } - if (file != NULL) { + if(ret_value == NULL) { + if(handle != NULL) + if(FAIL == H5FD_s3comms_s3r_close(handle)) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close s3 file handle") + if(file != NULL) file = H5FL_FREE(H5FD_ros3_t, file); - } curl_global_cleanup(); /* early cleanup because open failed */ } /* end if null return value (error) */ FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_open() */ +} /* end H5FD__ros3_open() */ #if ROS3_STATS - /*---------------------------------------------------------------------------- * * Function: ros3_fprint_stats() @@ -939,8 +862,7 @@ done: *---------------------------------------------------------------------------- */ static herr_t -ros3_fprint_stats(FILE *stream, - const H5FD_ros3_t *file) +ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) { herr_t ret_value = SUCCEED; parsed_url_t *purl = NULL; @@ -959,26 +881,16 @@ ros3_fprint_stats(FILE *stream, unsigned suffix_i = 0; const char suffixes[] = { ' ', 'K', 'M', 'G', 'T', 'P' }; + FUNC_ENTER_STATIC - - FUNC_ENTER_NOAPI_NOINIT - - if (stream == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file stream cannot be null" ); - } - if (file == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file cannot be null"); - } - if (file->s3r_handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "s3 request handle cannot be null"); - } - if (file->s3r_handle->purl == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "parsed url structure cannot be null"); - } + if(stream == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null" ); + if(file == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null"); + if(file->s3r_handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "s3 request handle cannot be null"); + if(file->s3r_handle->purl == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "parsed url structure cannot be null"); purl = file->s3r_handle->purl; /****************** @@ -986,9 +898,9 @@ ros3_fprint_stats(FILE *stream, ******************/ HDfprintf(stream, "stats for %s://%s", purl->scheme, purl->host); - if (purl->port != NULL && purl->port[0] != '\0') + if(purl->port != NULL && purl->port[0] != '\0') HDfprintf(stream, ":%s", purl->port); - if (purl->query != NULL && purl->query[0] != '\0') { + if(purl->query != NULL && purl->query[0] != '\0') { if (purl->path != NULL && purl->path[0] != '\0') HDfprintf(stream, "/%s", purl->path); else @@ -1003,23 +915,27 @@ ros3_fprint_stats(FILE *stream, * AGGREGATE STATS * *******************/ - for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { + for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { const ros3_statsbin *r = &file->raw[i]; const ros3_statsbin *m = &file->meta[i]; - if (m->min < min_meta) min_meta = m->min; - if (r->min < min_raw) min_raw = r->min; - if (m->max > max_meta) max_meta = m->max; - if (r->max > max_raw) max_raw = r->max; + if(m->min < min_meta) + min_meta = m->min; + if(r->min < min_raw) + min_raw = r->min; + if(m->max > max_meta) + max_meta = m->max; + if(r->max > max_raw) + max_raw = r->max; count_raw += r->count; count_meta += m->count; bytes_raw += r->bytes; bytes_meta += m->bytes; } - if (count_raw > 0) + if(count_raw > 0) average_raw = (double)bytes_raw / (double)count_raw; - if (count_meta > 0) + if(count_meta > 0) average_meta = (double)bytes_meta / (double)count_meta; /****************** @@ -1031,7 +947,7 @@ ros3_fprint_stats(FILE *stream, HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta, bytes_raw); - if (count_raw + count_meta == 0) + if(count_raw + count_meta == 0) goto done; /************************* @@ -1040,21 +956,21 @@ ros3_fprint_stats(FILE *stream, HDfprintf(stream, "SIZES meta raw\n"); HDfprintf(stream, " min "); - if (count_meta == 0) { + if(count_meta == 0) HDfprintf(stream, " 0.000 "); - } else { + else { re_dub = (double)min_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); } - if (count_raw == 0) { + if(count_raw == 0) HDfprintf(stream, " 0.000 \n"); - } else { + else { re_dub = (double)min_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); @@ -1062,26 +978,26 @@ ros3_fprint_stats(FILE *stream, HDfprintf(stream, " avg "); re_dub = (double)average_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)average_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); HDfprintf(stream, " max "); re_dub = (double)max_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)max_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); @@ -1095,7 +1011,7 @@ ros3_fprint_stats(FILE *stream, HDfprintf(stream, " up-to meta raw meta raw meta raw\n"); - for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { + for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { const ros3_statsbin *m; const ros3_statsbin *r; unsigned long long range_end = 0; @@ -1110,46 +1026,46 @@ ros3_fprint_stats(FILE *stream, m = &file->meta[i]; r = &file->raw[i]; - if (r->count == 0 && m->count == 0) + if(r->count == 0 && m->count == 0) continue; range_end = ros3_stats_boundaries[i]; - if (i == ROS3_STATS_BIN_COUNT) { + if(i == ROS3_STATS_BIN_COUNT) { range_end = ros3_stats_boundaries[i-1]; HDfprintf(stream, ">"); - } else { - HDfprintf(stream, " "); } + else + HDfprintf(stream, " "); bm_val = (double)m->bytes; - for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) + for(suffix_i = 0; bm_val >= 1024.0; suffix_i++) bm_val /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); bm_suffix = suffixes[suffix_i]; br_val = (double)r->bytes; - for (suffix_i = 0; br_val >= 1024.0; suffix_i++) + for(suffix_i = 0; br_val >= 1024.0; suffix_i++) br_val /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); br_suffix = suffixes[suffix_i]; - if (m->count > 0) + if(m->count > 0) am_val = (double)(m->bytes) / (double)(m->count); - for (suffix_i = 0; am_val >= 1024.0; suffix_i++) + for(suffix_i = 0; am_val >= 1024.0; suffix_i++) am_val /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); am_suffix = suffixes[suffix_i]; - if (r->count > 0) + if(r->count > 0) ar_val = (double)(r->bytes) / (double)(r->count); - for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) + for(suffix_i = 0; ar_val >= 1024.0; suffix_i++) ar_val /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); ar_suffix = suffixes[suffix_i]; re_dub = (double)range_end; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); @@ -1163,7 +1079,7 @@ ros3_fprint_stats(FILE *stream, am_val, am_suffix, /* metadata average */ ar_val, ar_suffix); /* rawdata average */ - fflush(stream); + HDfflush(stream); } done: @@ -1175,7 +1091,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_close() + * Function: H5FD__ros3_close() * * Purpose: * @@ -1191,52 +1107,45 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file) +H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_close() called.\n"); + HDfprintf(stdout, "H5FD__ros3_close() called.\n"); #endif - /* Sanity checks - */ + /* Sanity checks */ HDassert(file != NULL); HDassert(file->s3r_handle != NULL); /* Close the underlying request handle */ - if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) { - HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to close S3 request handle") - } + if(FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) + HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle") #if ROS3_STATS /* TODO: mechanism to re-target stats printout */ - if (ros3_fprint_stats(stdout, file) == FAIL) { - HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, - "problem while writing file statistics") - } + if(ros3_fprint_stats(stdout, file) == FAIL) + HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics") #endif /* ROS3_STATS */ - /* Release the file info - */ + /* Release the file info */ file = H5FL_FREE(H5FD_ros3_t, file); done: curl_global_cleanup(); /* cleanup to answer init on open */ FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_close() */ +} /* end H5FD__ros3_close() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_cmp() + * Function: H5FD__ros3_cmp() * * Purpose: * @@ -1265,9 +1174,7 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_ros3_cmp( - const H5FD_t *_f1, - const H5FD_t *_f2) +H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_ros3_t *f1 = (const H5FD_ros3_t *)_f1; const H5FD_ros3_t *f2 = (const H5FD_ros3_t *)_f2; @@ -1275,10 +1182,10 @@ H5FD_ros3_cmp( const parsed_url_t *purl2 = NULL; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_cmp() called.\n"); + HDfprintf(stdout, "H5FD__ros3_cmp() called.\n"); #endif HDassert(f1->s3r_handle != NULL); @@ -1294,113 +1201,80 @@ H5FD_ros3_cmp( HDassert(purl2->host != NULL); /* URL: SCHEME */ - if (HDstrcmp(purl1->scheme, purl2->scheme)) { + if(HDstrcmp(purl1->scheme, purl2->scheme)) HGOTO_DONE(-1); - } /* URL: HOST */ - if (HDstrcmp(purl1->host, purl2->host)) { + if(HDstrcmp(purl1->host, purl2->host)) HGOTO_DONE(-1); - } /* URL: PORT */ - if (purl1->port && purl2->port) { - if (HDstrcmp(purl1->port, purl2->port)) { + if(purl1->port && purl2->port) { + if(HDstrcmp(purl1->port, purl2->port)) HGOTO_DONE(-1); - } } - else - if (purl1->port) { + else if(purl1->port) HGOTO_DONE(-1); - } - else - if (purl2->port) { + else if(purl2->port) HGOTO_DONE(-1); - } /* URL: PATH */ - if (purl1->path && purl2->path) { - if (HDstrcmp(purl1->path, purl2->path)) { + if(purl1->path && purl2->path) { + if(HDstrcmp(purl1->path, purl2->path)) HGOTO_DONE(-1); - } } - else - if (purl1->path && !purl2->path) { + else if(purl1->path && !purl2->path) HGOTO_DONE(-1); - } - else - if (purl2->path && !purl1->path) { + else if(purl2->path && !purl1->path) HGOTO_DONE(-1); - } /* URL: QUERY */ - if (purl1->query && purl2->query) { - if (HDstrcmp(purl1->query, purl2->query)) { + if(purl1->query && purl2->query) { + if(HDstrcmp(purl1->query, purl2->query)) HGOTO_DONE(-1); - } } - else - if (purl1->query && !purl2->query) { + else if(purl1->query && !purl2->query) HGOTO_DONE(-1); - } - else - if (purl2->query && !purl1->query) { + else if(purl2->query && !purl1->query) HGOTO_DONE(-1); - } /* FAPL: AWS_REGION */ - if (f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') { - if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) { + if(f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') { + if(HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) HGOTO_DONE(-1); - } } - else - if (f1->fa.aws_region[0] != '\0') { + else if(f1->fa.aws_region[0] != '\0') HGOTO_DONE(-1); - } - else - if (f2->fa.aws_region[0] != '\0') { + else if(f2->fa.aws_region[0] != '\0') HGOTO_DONE(-1); - } /* FAPL: SECRET_ID */ - if (f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') { - if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) { + if(f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') { + if(HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) HGOTO_DONE(-1); - } } - else - if (f1->fa.secret_id[0] != '\0') { + else if(f1->fa.secret_id[0] != '\0') HGOTO_DONE(-1); - } - else - if (f2->fa.secret_id[0] != '\0') { + else if(f2->fa.secret_id[0] != '\0') HGOTO_DONE(-1); - } /* FAPL: SECRET_KEY */ - if (f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') { - if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) { + if(f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') { + if(HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) HGOTO_DONE(-1); - } } - else - if (f1->fa.secret_key[0] != '\0') { + else if(f1->fa.secret_key[0] != '\0') HGOTO_DONE(-1); - } - else - if (f2->fa.secret_key[0] != '\0') { + else if(f2->fa.secret_key[0] != '\0') HGOTO_DONE(-1); - } done: FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_ros3_cmp() */ +} /* H5FD__ros3_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_query + * Function: H5FD__ros3_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -1419,30 +1293,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, - unsigned long *flags /* out */) +H5FD__ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_query() called.\n"); + HDfprintf(stdout, "H5FD__ros3_query() called.\n"); #endif /* Set the VFL feature flags that this driver supports */ - if (flags) { + if(flags) { *flags = 0; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_DATA_SIEVE; } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) - -} /* H5FD_ros3_query() */ +} /* H5FD__ros3_query() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_get_eoa() + * Function: H5FD__ros3_get_eoa() * * Purpose: * @@ -1460,25 +1332,23 @@ H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, *------------------------------------------------------------------------- */ static haddr_t -H5FD_ros3_get_eoa(const H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_get_eoa() called.\n"); + HDfprintf(stdout, "H5FD__ros3_get_eoa() called.\n"); #endif FUNC_LEAVE_NOAPI(file->eoa) - -} /* end H5FD_ros3_get_eoa() */ +} /* end H5FD__ros3_get_eoa() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_set_eoa() + * Function: H5FD__ros3_set_eoa() * * Purpose: * @@ -1494,28 +1364,25 @@ H5FD_ros3_get_eoa(const H5FD_t *_file, *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_set_eoa(H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - haddr_t addr) +H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_set_eoa() called.\n"); + HDfprintf(stdout, "H5FD__ros3_set_eoa() called.\n"); #endif file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) - -} /* H5FD_ros3_set_eoa() */ +} /* H5FD__ros3_set_eoa() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_get_eof() + * Function: H5FD__ros3_get_eof() * * Purpose: * @@ -1532,25 +1399,23 @@ H5FD_ros3_set_eoa(H5FD_t *_file, *------------------------------------------------------------------------- */ static haddr_t -H5FD_ros3_get_eof(const H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_get_eof() called.\n"); + HDfprintf(stdout, "H5FD__ros3_get_eof() called.\n"); #endif FUNC_LEAVE_NOAPI(H5FD_s3comms_s3r_get_filesize(file->s3r_handle)) - -} /* end H5FD_ros3_get_eof() */ +} /* end H5FD__ros3_get_eof() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_get_handle() + * Function: H5FD__ros3_get_handle() * * Purpose: * @@ -1566,34 +1431,31 @@ H5FD_ros3_get_eof(const H5FD_t *_file, *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_get_handle(H5FD_t *_file, - hid_t H5_ATTR_UNUSED fapl, - void **file_handle) +H5FD__ros3_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, + void **file_handle) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_get_handle() called.\n"); + HDfprintf(stdout, "H5FD__ros3_get_handle() called.\n"); #endif - if (!file_handle) { + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") - } *file_handle = file->s3r_handle; done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_get_handle() */ +} /* end H5FD__ros3_get_handle() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_read() + * Function: H5FD__ros3_read() * * Purpose * @@ -1614,12 +1476,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_read(H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, /* start offset */ - size_t size, /* length of read */ - void *buf) /* out */ +H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, + void *buf) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; size_t filesize = 0; @@ -1631,10 +1490,10 @@ H5FD_ros3_read(H5FD_t *_file, #endif /* ROS3_STATS */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_read() called.\n"); + HDfprintf(stdout, "H5FD__ros3_read() called.\n"); #endif HDassert(file != NULL); @@ -1643,40 +1502,32 @@ H5FD_ros3_read(H5FD_t *_file, filesize = H5FD_s3comms_s3r_get_filesize(file->s3r_handle); - if ((addr > filesize) || ((addr + size) > filesize)) { + if((addr > filesize) || ((addr + size) > filesize)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address") - } - if (H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL) { + if(H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read") - } #if ROS3_STATS - /* Find which "bin" this read fits in. Can be "overflow" bin. - */ - for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) { - if ((unsigned long long)size < ros3_stats_boundaries[bin_i]) { + /* Find which "bin" this read fits in. Can be "overflow" bin. */ + for(bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) + if((unsigned long long)size < ros3_stats_boundaries[bin_i]) break; - } - } bin = (type == H5FD_MEM_DRAW) ? &file->raw[bin_i] : &file->meta[bin_i]; - /* Store collected stats in appropriate bin - */ - if (bin->count == 0) { + /* Store collected stats in appropriate bin */ + if(bin->count == 0) { bin->min = size; bin->max = size; } else { - if (size < bin->min) { + if(size < bin->min) bin->min = size; - } - if (size > bin->max) { + if(size > bin->max) bin->max = size; - } } bin->count++; bin->bytes += (unsigned long long)size; @@ -1685,13 +1536,12 @@ H5FD_ros3_read(H5FD_t *_file, done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_read() */ +} /* end H5FD__ros3_read() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_write() + * Function: H5FD__ros3_write() * * Purpose: * @@ -1708,33 +1558,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_write(H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t H5_ATTR_UNUSED addr, - size_t H5_ATTR_UNUSED size, - const void H5_ATTR_UNUSED *buf) +H5FD__ros3_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr, + size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_write() called.\n"); + HDfprintf(stdout, "H5FD__ros3_write() called.\n"); #endif - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "cannot write to read-only file.") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file.") done: FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_ros3_write() */ +} /* H5FD__ros3_write() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_truncate() + * Function: H5FD__ros3_truncate() * * Purpose: * @@ -1753,30 +1598,27 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED closing) +H5FD__ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, + hbool_t H5_ATTR_UNUSED closing) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_truncate() called.\n"); + HDfprintf(stdout, "H5FD__ros3_truncate() called.\n"); #endif - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "cannot truncate read-only file.") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file.") done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_truncate() */ +} /* end H5FD__ros3_truncate() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_lock() + * Function: H5FD__ros3_lock() * * Purpose: * @@ -1796,18 +1638,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, +H5FD__ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw) { - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_ENTER_STATIC_NOERR -} /* end H5FD_ros3_lock() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FD__ros3_lock() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_unlock() + * Function: H5FD__ros3_unlock() * * Purpose: * @@ -1824,12 +1666,12 @@ H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file) +H5FD__ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file) { - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_ENTER_STATIC_NOERR -} /* end H5FD_ros3_unlock() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FD__ros3_unlock() */ #endif /* H5_HAVE_ROS3_VFD */ diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index d9d4c88..e79ee0d 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -148,9 +148,8 @@ curlwritecallback(char *ptr, size_t product = (size * nmemb); size_t written = 0; - if (sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC) { + if(sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC) return written; - } if (size > 0) { HDmemcpy(&(sds->data[sds->size]), ptr, product); @@ -159,7 +158,6 @@ curlwritecallback(char *ptr, } return written; - } /* end curlwritecallback() */ @@ -236,22 +234,19 @@ H5FD_s3comms_hrb_node_set( FUNC_ENTER_NOAPI_NOINIT #if S3COMMS_DEBUG - HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.\n"); + HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set."); HDprintf("NAME: %s\n", name); HDprintf("VALUE: %s\n", value); HDprintf("LIST:\n->"); - for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) { + for(node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) HDfprintf(stdout, "{%s}\n->", node_ptr->cat); - } HDprintf("(null)\n"); - fflush(stdout); + HDfflush(stdout); node_ptr = NULL; #endif - if (name == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to operate on null name.\n"); - } + if(name == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to operate on null name"); namelen = HDstrlen(name); /*********************** @@ -261,20 +256,17 @@ H5FD_s3comms_hrb_node_set( /* copy and lowercase name */ lowername = (char *)H5MM_malloc(sizeof(char) * (namelen + 1)); - if (lowername == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for lowercase name copy.\n"); - } - for (i = 0; i < namelen; i++) { - lowername[i] = (char)tolower((int)name[i]); - } + if(lowername == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for lowercase name copy."); + for(i = 0; i < namelen; i++) + lowername[i] = (char)HDtolower((int)name[i]); lowername[namelen] = 0; /* If value supplied, copy name, value, and concatenated "name: value". * If NULL, we will be removing a node or doing nothing, so no need for * copies */ - if (value != NULL) { + if(value != NULL) { int ret = 0; size_t valuelen = HDstrlen(value); size_t catlen = namelen + valuelen + 2; /* +2 from ": " */ @@ -282,38 +274,28 @@ H5FD_s3comms_hrb_node_set( namecpy = (char *)H5MM_malloc(sizeof(char) * (namelen + 1)); - if (namecpy == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for name copy.\n"); - } + if(namecpy == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy."); HDmemcpy(namecpy, name, (namelen + 1)); valuecpy = (char *)H5MM_malloc(sizeof(char) * (valuelen + 1)); - if (valuecpy == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for value copy.\n"); - } + if(valuecpy == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy."); HDmemcpy(valuecpy, value, (valuelen + 1)); nvcat = (char *)H5MM_malloc(sizeof(char) * catwrite); - if (nvcat == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for concatenated string.\n"); - } + if(nvcat == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for concatenated string."); ret = HDsnprintf(nvcat, catwrite, "%s: %s", name, value); - if (ret < 0 || (size_t)ret > catlen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot concatenate `%s: %s", name, value); - } + if(ret < 0 || (size_t)ret > catlen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot concatenate `%s: %s", name, value); HDassert( catlen == HDstrlen(nvcat) ); /* create new_node, should we need it */ new_node = (hrb_node_t *)H5MM_malloc(sizeof(hrb_node_t)); - if (new_node == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for new set.\n"); - } + if(new_node == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for new set."); new_node->magic = S3COMMS_HRB_NODE_MAGIC; new_node->name = NULL; @@ -327,14 +309,12 @@ H5FD_s3comms_hrb_node_set( * ACT ON LIST * ***************/ - if (*L == NULL) { - if (value == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "trying to remove node from empty list"); - } + if(*L == NULL) { + if(value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list"); else { #if S3COMMS_DEBUG -HDprintf("CREATE NEW\n"); fflush(stdout); +HDprintf("CREATE NEW\n"); HDfflush(stdout); #endif /******************* * CREATE NEW LIST * @@ -358,13 +338,13 @@ HDprintf("CREATE NEW\n"); fflush(stdout); /* Check whether to modify/remove first node in list */ - if (strcmp(lowername, node_ptr->lowername) == 0) { + if(HDstrcmp(lowername, node_ptr->lowername) == 0) { is_looking = FALSE; if (value == NULL) { #if S3COMMS_DEBUG -HDprintf("REMOVE HEAD\n"); fflush(stdout); +HDprintf("REMOVE HEAD\n"); HDfflush(stdout); #endif /*************** * REMOVE HEAD * @@ -373,41 +353,41 @@ HDprintf("REMOVE HEAD\n"); fflush(stdout); *L = node_ptr->next; #if S3COMMS_DEBUG -HDprintf("FREEING CAT (node)\n"); fflush(stdout); +HDprintf("FREEING CAT (node)\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr->cat); #if S3COMMS_DEBUG -HDprintf("FREEING LOWERNAME (node)\n"); fflush(stdout); +HDprintf("FREEING LOWERNAME (node)\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr->lowername); #if S3COMMS_DEBUG -HDprintf("FREEING NAME (node)\n"); fflush(stdout); +HDprintf("FREEING NAME (node)\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr->name); #if S3COMMS_DEBUG -HDprintf("FREEING VALUE (node)\n"); fflush(stdout); +HDprintf("FREEING VALUE (node)\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr->value); #if S3COMMS_DEBUG HDprintf("MAGIC OK? %s\n", (node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO"); -fflush(stdout); +HDfflush(stdout); #endif HDassert( node_ptr->magic == S3COMMS_HRB_NODE_MAGIC ); node_ptr->magic += 1ul; #if S3COMMS_DEBUG -HDprintf("FREEING POINTER\n"); fflush(stdout); +HDprintf("FREEING POINTER\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr); #if S3COMMS_DEBUG -HDprintf("FREEING WORKING LOWERNAME\n"); fflush(stdout); +HDprintf("FREEING WORKING LOWERNAME\n"); HDfflush(stdout); #endif H5MM_xfree(lowername); lowername = NULL; } else { #if S3COMMS_DEBUG -HDprintf("MODIFY HEAD\n"); fflush(stdout); +HDprintf("MODIFY HEAD\n"); HDfflush(stdout); #endif /*************** * MODIFY HEAD * @@ -429,17 +409,15 @@ HDprintf("MODIFY HEAD\n"); fflush(stdout); } } else - if (strcmp(lowername, node_ptr->lowername) < 0) { + if (HDstrcmp(lowername, node_ptr->lowername) < 0) { is_looking = FALSE; - if (value == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "trying to remove a node 'before' head"); - } + if(value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head"); else { #if S3COMMS_DEBUG -HDprintf("PREPEND NEW HEAD\n"); fflush(stdout); +HDprintf("PREPEND NEW HEAD\n"); HDfflush(stdout); #endif /******************* * INSERT NEW HEAD * @@ -458,24 +436,22 @@ HDprintf("PREPEND NEW HEAD\n"); fflush(stdout); * SEARCH LIST * ***************/ - while (is_looking) { - if (node_ptr->next == NULL) { + while(is_looking) { + if(node_ptr->next == NULL) { is_looking = FALSE; - if (value == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "trying to remove absent node"); - } + if(value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); else { #if S3COMMS_DEBUG -HDprintf("APPEND A NODE\n"); fflush(stdout); +HDprintf("APPEND A NODE\n"); HDfflush(stdout); #endif /******************* * APPEND NEW NODE * *******************/ - HDassert( strcmp(lowername, node_ptr->lowername) > 0 ); + HDassert( HDstrcmp(lowername, node_ptr->lowername) > 0 ); new_node->name = namecpy; new_node->value = valuecpy; new_node->lowername = lowername; @@ -484,23 +460,21 @@ HDprintf("APPEND A NODE\n"); fflush(stdout); } } else - if (strcmp(lowername, node_ptr->next->lowername) < 0) { + if(HDstrcmp(lowername, node_ptr->next->lowername) < 0) { is_looking = FALSE; - if (value == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "trying to remove absent node"); - } + if(value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); else { #if S3COMMS_DEBUG -HDprintf("INSERT A NODE\n"); fflush(stdout); +HDprintf("INSERT A NODE\n"); HDfflush(stdout); #endif /******************* * INSERT NEW NODE * *******************/ - HDassert( strcmp(lowername, node_ptr->lowername) > 0 ); + HDassert( HDstrcmp(lowername, node_ptr->lowername) > 0 ); new_node->name = namecpy; new_node->value = valuecpy; new_node->lowername = lowername; @@ -510,11 +484,11 @@ HDprintf("INSERT A NODE\n"); fflush(stdout); } } else - if (strcmp(lowername, node_ptr->next->lowername) == 0) { + if(HDstrcmp(lowername, node_ptr->next->lowername) == 0) { is_looking = FALSE; - if (value == NULL) { + if(value == NULL) { /***************** * REMOVE A NODE * *****************/ @@ -523,7 +497,7 @@ HDprintf("INSERT A NODE\n"); fflush(stdout); node_ptr->next = tmp->next; #if S3COMMS_DEBUG -HDprintf("REMOVE A NODE\n"); fflush(stdout); +HDprintf("REMOVE A NODE\n"); HDfflush(stdout); #endif H5MM_xfree(tmp->cat); H5MM_xfree(tmp->lowername); @@ -539,7 +513,7 @@ HDprintf("REMOVE A NODE\n"); fflush(stdout); } else { #if S3COMMS_DEBUG -HDprintf("MODIFY A NODE\n"); fflush(stdout); +HDprintf("MODIFY A NODE\n"); HDfflush(stdout); #endif /***************** * MODIFY A NODE * @@ -572,14 +546,17 @@ HDprintf("MODIFY A NODE\n"); fflush(stdout); } /* end while is_looking */ done: - if (ret_value == FAIL) { - /* clean up - */ - if (nvcat != NULL) { H5MM_xfree(nvcat); } - if (namecpy != NULL) { H5MM_xfree(namecpy); } - if (lowername != NULL) { H5MM_xfree(lowername); } - if (valuecpy != NULL) { H5MM_xfree(valuecpy); } - if (new_node != NULL) { + if(ret_value == FAIL) { + /* clean up */ + if(nvcat != NULL) + H5MM_xfree(nvcat); + if(namecpy != NULL) + H5MM_xfree(namecpy); + if(lowername != NULL) + H5MM_xfree(lowername); + if(valuecpy != NULL) + H5MM_xfree(valuecpy); + if(new_node != NULL) { HDassert( new_node->magic == S3COMMS_HRB_NODE_MAGIC ); new_node->magic += 1ul; H5MM_xfree(new_node); @@ -638,12 +615,10 @@ H5FD_s3comms_hrb_destroy(hrb_t **_buf) HDfprintf(stdout, "called H5FD_s3comms_hrb_destroy.\n"); #endif - if (_buf != NULL && *_buf != NULL) { + if(_buf != NULL && *_buf != NULL) { buf = *_buf; - if (buf->magic != S3COMMS_HRB_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "pointer's magic does not match.\n"); - } + if(buf->magic != S3COMMS_HRB_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pointer's magic does not match."); H5MM_xfree(buf->verb); H5MM_xfree(buf->version); @@ -707,53 +682,38 @@ H5FD_s3comms_hrb_init_request(const char *_verb, HDfprintf(stdout, "called H5FD_s3comms_hrb_init_request.\n"); #endif - if (_resource == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "resource string cannot be null.\n"); - } + if(_resource == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "resource string cannot be null."); - /* populate valid NULLs with defaults - */ - if (_verb == NULL) { + /* populate valid NULLs with defaults */ + if(_verb == NULL) _verb = "GET"; - } - - if (_http_version == NULL) { + if(_http_version == NULL) _http_version = "HTTP/1.1"; - } - /* malloc space for and prepare structure - */ + /* malloc space for and prepare structure */ request = (hrb_t *)H5MM_malloc(sizeof(hrb_t)); - if (request == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "no space for request structure"); - } + if(request == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for request structure"); request->magic = S3COMMS_HRB_MAGIC; request->body = NULL; request->body_len = 0; request->first_header = NULL; - - /* malloc and copy strings for the structure - */ + /* malloc and copy strings for the structure */ reslen = HDstrlen(_resource); if (_resource[0] == '/') { res = (char *)H5MM_malloc(sizeof(char) * (reslen+1)); - if (res == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "no space for resource string"); - } + if(res == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string"); HDmemcpy(res, _resource, (reslen+1)); } else { res = (char *)H5MM_malloc(sizeof(char) * (reslen+2)); - if (res == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "no space for resource string"); - } + if(res == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string"); *res = '/'; HDmemcpy((&res[1]), _resource, (reslen+1)); HDassert( (reslen+1) == HDstrlen(res) ); @@ -761,24 +721,18 @@ H5FD_s3comms_hrb_init_request(const char *_verb, verblen = HDstrlen(_verb) + 1; verb = (char *)H5MM_malloc(sizeof(char) * verblen); - if (verb == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "no space for verb string"); - } + if(verb == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for verb string"); HDstrncpy(verb, _verb, verblen); vrsnlen = HDstrlen(_http_version) + 1; vrsn = (char *)H5MM_malloc(sizeof(char) * vrsnlen); - if (vrsn == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "no space for http-version string"); - } + if(vrsn == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for http-version string"); HDstrncpy(vrsn, _http_version, vrsnlen); - - /* place new copies into structure - */ + /* place new copies into structure */ request->resource = res; request->verb = verb; request->version = vrsn; @@ -786,13 +740,16 @@ H5FD_s3comms_hrb_init_request(const char *_verb, ret_value = request; done: - /* if there is an error, clean up after ourselves - */ + /* if there is an error, clean up after ourselves */ if (ret_value == NULL) { - if (request != NULL) H5MM_xfree(request); - if (vrsn != NULL) H5MM_xfree(vrsn); - if (verb != NULL) H5MM_xfree(verb); - if (res != NULL) H5MM_xfree(res); + if(request != NULL) + H5MM_xfree(request); + if(vrsn != NULL) + H5MM_xfree(vrsn); + if(verb != NULL) + H5MM_xfree(verb); + if(res != NULL) + H5MM_xfree(res); } FUNC_LEAVE_NOAPI(ret_value) @@ -836,14 +793,10 @@ H5FD_s3comms_s3r_close(s3r_t *handle) HDfprintf(stdout, "called H5FD_s3comms_s3r_close.\n"); #endif - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle cannot be null.\n"); - } - if (handle->magic != S3COMMS_S3R_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has invalid magic.\n"); - } + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null."); + if(handle->magic != S3COMMS_S3R_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic."); curl_easy_cleanup(handle->curlhandle); @@ -854,10 +807,8 @@ H5FD_s3comms_s3r_close(s3r_t *handle) HDassert( handle->httpverb != NULL ); H5MM_xfree(handle->httpverb); - if (FAIL == H5FD_s3comms_free_purl(handle->purl)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to release parsed url structure") - } + if(FAIL == H5FD_s3comms_free_purl(handle->purl)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to release parsed url structure") H5MM_xfree(handle); @@ -893,9 +844,8 @@ H5FD_s3comms_s3r_get_filesize(s3r_t *handle) FUNC_ENTER_NOAPI_NOINIT_NOERR - if (handle != NULL) { + if(handle != NULL) ret_value = handle->filesize; - } FUNC_LEAVE_NOAPI(ret_value) } /* H5FD_s3comms_s3r_get_filesize */ @@ -953,58 +903,33 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) HDfprintf(stdout, "called H5FD_s3comms_s3r_getsize.\n"); #endif - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle cannot be null.\n"); - } - if (handle->magic != S3COMMS_S3R_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has invalid magic.\n"); - } - if (handle->curlhandle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has bad (null) curlhandle.\n") - } + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null."); + if(handle->magic != S3COMMS_S3R_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic."); + if(handle->curlhandle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.") /******************** * PREPARE FOR HEAD * ********************/ curlh = handle->curlhandle; + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, 1L)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_NOBODY, - 1L) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option (CURLOPT_NOBODY). " - "(placeholder flags)"); - } - - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_HEADERDATA, - &sds) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option (CURLOPT_HEADERDATA). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, &sds)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA)."); HDassert( handle->httpverb == NULL ); handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16); - if (handle->httpverb == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "unable to allocate space for S3 request HTTP verb"); - } + if(handle->httpverb == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for S3 request HTTP verb"); HDmemcpy(handle->httpverb, "HEAD", 5); headerresponse = (char *)H5MM_malloc(sizeof(char) * CURL_MAX_HTTP_HEADER); - if (headerresponse == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "unable to allocate space for curl header response"); - } + if(headerresponse == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for curl header response"); sds.data = headerresponse; /******************* @@ -1015,65 +940,43 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) * but, with a NULL destination and NOBODY and HEADERDATA supplied above, * only http metadata will be sent by server and recorded by s3comms */ - if (FAIL == - H5FD_s3comms_s3r_read(handle, 0, 0, NULL) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem in reading during getsize.\n"); - } + if(FAIL == H5FD_s3comms_s3r_read(handle, 0, 0, NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize."); - if (sds.size > CURL_MAX_HTTP_HEADER) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "HTTP metadata buffer overrun\n"); - } else if (sds.size == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "No HTTP metadata\n"); + if(sds.size > CURL_MAX_HTTP_HEADER) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun"); + else if (sds.size == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata"); #if S3COMMS_DEBUG - } else { + else HDfprintf(stderr, "GETSIZE: OK\n"); #endif - } /****************** * PARSE RESPONSE * ******************/ - start = strstr(headerresponse, - "\r\nContent-Length: "); - if (start == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not find \"Content-Length\" in response.\n"); - } + start = HDstrstr(headerresponse, "\r\nContent-Length: "); + if(start == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find \"Content-Length\" in response."); - /* move "start" to beginning of value in line; find end of line - */ + /* move "start" to beginning of value in line; find end of line */ start = start + HDstrlen("\r\nContent-Length: "); - end = strstr(start, "\r\n"); - if (end == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not find end of content length line"); - } + end = HDstrstr(start, "\r\n"); + if(end == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find end of content length line"); /* place null terminator at end of numbers */ *end = '\0'; - content_length = strtoumax((const char *)start, - NULL, - 0); - - if (UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX) { - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t\n"); - } + content_length = HDstrtoumax((const char *)start, NULL, 0); + if(UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t"); - if (content_length == 0 || - errno == ERANGE) /* errno set by strtoumax*/ - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not convert found \"Content-Length\" response (\"%s\")", - start); /* range is null-terminated, remember */ - } + if(content_length == 0 || errno == ERANGE) /* errno set by HDstrtoumax*/ + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not convert found \"Content-Length\" response (\"%s\")", start); /* range is null-terminated, remember */ handle->filesize = (size_t)content_length; @@ -1081,32 +984,17 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) * UNDO HEAD SETTINGS * **********************/ - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_NOBODY, - NULL) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option (CURLOPT_NOBODY). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_HEADERDATA, - NULL) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option (CURLOPT_HEADERDATA). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA)."); done: H5MM_xfree(headerresponse); sds.magic += 1; /* set to bad magic */ FUNC_LEAVE_NOAPI(ret_value); - } /* H5FD_s3comms_s3r_getsize */ @@ -1167,26 +1055,19 @@ H5FD_s3comms_s3r_open(const char *url, HDfprintf(stdout, "called H5FD_s3comms_s3r_open.\n"); #endif + if(url == NULL || url[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "url cannot be null."); - - if (url == NULL || url[0] == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "url cannot be null.\n"); - } - - if (FAIL == H5FD_s3comms_parse_url(url, &purl)) { + if(FAIL == H5FD_s3comms_parse_url(url, &purl)) /* probably a malformed url, but could be internal error */ - HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL, - "unable to create parsed url structure"); - } + HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL, "unable to create parsed url structure"); + HDassert( purl != NULL ); /* if above passes, this must be true */ HDassert( purl->magic == S3COMMS_PARSED_URL_MAGIC ); handle = (s3r_t *)H5MM_malloc(sizeof(s3r_t)); - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "could not malloc space for handle.\n"); - } + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle."); handle->magic = S3COMMS_S3R_MAGIC; handle->purl = purl; @@ -1200,50 +1081,35 @@ H5FD_s3comms_s3r_open(const char *url, * RECORD AUTHENTICATION INFORMATION * *************************************/ - if ((region != NULL && *region != '\0') || - (id != NULL && *id != '\0') || - (signing_key != NULL)) - { - /* if one exists, all three must exist - */ - if (region == NULL || region[0] == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "region cannot be null.\n"); - } - if (id == NULL || id[0] == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "secret id cannot be null.\n"); - } - if (signing_key == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "signing key cannot be null.\n"); - } + if((region != NULL && *region != '\0') || + (id != NULL && *id != '\0') || + (signing_key != NULL)) { - /* copy strings - */ + /* if one exists, all three must exist */ + if(region == NULL || region[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "region cannot be null."); + if(id == NULL || id[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "secret id cannot be null."); + if(signing_key == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "signing key cannot be null."); + + /* copy strings */ tmplen = HDstrlen(region) + 1; handle->region = (char *)H5MM_malloc(sizeof(char) * tmplen); - if (handle->region == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "could not malloc space for handle region copy.\n"); - } + if(handle->region == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy."); HDmemcpy(handle->region, region, tmplen); tmplen = HDstrlen(id) + 1; handle->secret_id = (char *)H5MM_malloc(sizeof(char) * tmplen); - if (handle->secret_id == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "could not malloc space for handle ID copy.\n"); - } + if(handle->secret_id == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy."); HDmemcpy(handle->secret_id, id, tmplen); tmplen = SHA256_DIGEST_LENGTH; - handle->signing_key = - (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen); - if (handle->signing_key == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "could not malloc space for handle key copy.\n"); - } + handle->signing_key = (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen); + if(handle->signing_key == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy."); HDmemcpy(handle->signing_key, signing_key, tmplen); } /* if authentication information provided */ @@ -1252,61 +1118,23 @@ H5FD_s3comms_s3r_open(const char *url, ************************/ curlh = curl_easy_init(); + if(curlh == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem creating curl easy handle!"); - if (curlh == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "problem creating curl easy handle!\n"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPGET, 1L)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTPGET)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_HTTPGET, - 1L) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_HTTPGET). " - "(placeholder flags)"); - } - - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_HTTP_VERSION, - CURL_HTTP_VERSION_1_1) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_HTTP_VERSION). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTP_VERSION)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_FAILONERROR, - 1L) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_FAILONERROR). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_FAILONERROR, 1L)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_FAILONERROR)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_WRITEFUNCTION, - curlwritecallback) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_WRITEFUNCTION). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEFUNCTION, curlwritecallback)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_WRITEFUNCTION)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_URL, - url) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_URL). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_URL, url)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_URL)."); #if S3COMMS_CURL_VERBOSITY > 1 /* CURL will print (to stdout) information for each operation @@ -1322,12 +1150,8 @@ H5FD_s3comms_s3r_open(const char *url, * GET FILE SIZE * *******************/ - if (FAIL == - H5FD_s3comms_s3r_getsize(handle) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "problem in H5FD_s3comms_s3r_getsize.\n"); - } + if(FAIL == H5FD_s3comms_s3r_getsize(handle)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem in H5FD_s3comms_s3r_getsize."); /********************* * FINAL PREPARATION * @@ -1339,27 +1163,22 @@ H5FD_s3comms_s3r_open(const char *url, ret_value = handle; done: - if (ret_value == NULL) { - if (curlh != NULL) { + if(ret_value == NULL) { + if(curlh != NULL) curl_easy_cleanup(curlh); - } - if (FAIL == H5FD_s3comms_free_purl(purl)) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "unable to free parsed url structure") - } - if (handle != NULL) { + if(FAIL == H5FD_s3comms_free_purl(purl)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to free parsed url structure") + if(handle != NULL) { H5MM_xfree(handle->region); H5MM_xfree(handle->secret_id); H5MM_xfree(handle->signing_key); - if (handle->httpverb != NULL) { + if(handle->httpverb != NULL) H5MM_xfree(handle->httpverb); - } H5MM_xfree(handle); } } FUNC_LEAVE_NOAPI(ret_value) - } /* H5FD_s3comms_s3r_open */ @@ -1433,27 +1252,17 @@ H5FD_s3comms_s3r_read(s3r_t *handle, * ABSOLUTELY NECESSARY SANITY-CHECKS * **************************************/ - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle cannot be null.\n"); - } - if (handle->magic != S3COMMS_S3R_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has invalid magic.\n"); - } - if (handle->curlhandle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has bad (null) curlhandle.\n") - } - if (handle->purl == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has bad (null) url.\n") - } + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null."); + if(handle->magic != S3COMMS_S3R_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic."); + if(handle->curlhandle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.") + if(handle->purl == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) url.") HDassert( handle->purl->magic == S3COMMS_PARSED_URL_MAGIC ); - if (offset > handle->filesize || (len + offset) > handle->filesize) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to read past EoF") - } + if(offset > handle->filesize || (len + offset) > handle->filesize) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to read past EoF") curlh = handle->curlhandle; @@ -1461,26 +1270,16 @@ H5FD_s3comms_s3r_read(s3r_t *handle, * PREPARE WRITEDATA * *********************/ - if (dest != NULL) { - sds = (struct s3r_datastruct *)H5MM_malloc( - sizeof(struct s3r_datastruct)); - if (sds == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "could not malloc destination datastructure.\n"); - } + if(dest != NULL) { + sds = (struct s3r_datastruct *)H5MM_malloc(sizeof(struct s3r_datastruct)); + if(sds == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc destination datastructure."); sds->magic = S3COMMS_CALLBACK_DATASTRUCT_MAGIC; sds->data = (char *)dest; sds->size = 0; - if (CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_WRITEDATA, - sds) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, - "error while setting CURL option (CURLOPT_WRITEDATA). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEDATA, sds)) + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "error while setting CURL option (CURLOPT_WRITEDATA)."); } /********************* @@ -1488,34 +1287,22 @@ H5FD_s3comms_s3r_read(s3r_t *handle, *********************/ if (len > 0) { - rangebytesstr = (char *)H5MM_malloc(sizeof(char) * \ - (S3COMMS_MAX_RANGE_STRING_SIZE+1) ); - if (rangebytesstr == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "could not malloc range format string.\n"); - } - ret = HDsnprintf(rangebytesstr, - (S3COMMS_MAX_RANGE_STRING_SIZE), + rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE+1) ); + if(rangebytesstr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string."); + ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), "bytes="H5_PRINTF_HADDR_FMT"-"H5_PRINTF_HADDR_FMT, - offset, - offset + len - 1); - if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to format HTTP Range value"); - } else if (offset > 0) { - rangebytesstr = (char *)H5MM_malloc(sizeof(char) * \ - (S3COMMS_MAX_RANGE_STRING_SIZE+1)); - if (rangebytesstr == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "could not malloc range format string.\n"); - } - ret = HDsnprintf(rangebytesstr, - (S3COMMS_MAX_RANGE_STRING_SIZE), - "bytes="H5_PRINTF_HADDR_FMT"-", - offset); - if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to format HTTP Range value"); + offset, offset + len - 1); + if(ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value"); + } else if(offset > 0) { + rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE+1)); + if(rangebytesstr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string."); + ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), + "bytes="H5_PRINTF_HADDR_FMT"-", offset); + if(ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value"); } /******************* @@ -1523,26 +1310,18 @@ H5FD_s3comms_s3r_read(s3r_t *handle, *******************/ if (handle->signing_key == NULL) { - /* Do not authenticate. - */ - if (rangebytesstr != NULL) { - /* Pass in range directly - */ + /* Do not authenticate. */ + if(rangebytesstr != NULL) { + /* Pass in range directly */ char *bytesrange_ptr = NULL; /* pointer past "bytes=" portion */ - bytesrange_ptr = strchr(rangebytesstr, '='); + bytesrange_ptr = HDstrchr(rangebytesstr, '='); HDassert( bytesrange_ptr != NULL ); bytesrange_ptr++; /* move to first char past '=' */ HDassert( *bytesrange_ptr != '\0' ); - if (CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_RANGE, - bytesrange_ptr) ) - { - HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL, - "error while setting CURL option (CURLOPT_RANGE). "); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, bytesrange_ptr)) + HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL, "error while setting CURL option (CURLOPT_RANGE). "); } } else { /* authenticate request @@ -1575,30 +1354,18 @@ H5FD_s3comms_s3r_read(s3r_t *handle, /**** VERIFY INFORMATION EXISTS ****/ - if (handle->region == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null region.\n"); - } - if (handle->secret_id == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null secret_id.\n"); - } - if (handle->signing_key == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null signing_key.\n"); - } - if (handle->httpverb == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null httpverb.\n"); - } - if (handle->purl->host == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null host.\n"); - } - if (handle->purl->path == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null resource.\n"); - } + if(handle->region == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null region."); + if(handle->secret_id == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null secret_id."); + if(handle->signing_key == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null signing_key."); + if(handle->httpverb == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null httpverb."); + if(handle->purl->host == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null host."); + if(handle->purl->path == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null resource."); /**** CREATE HTTP REQUEST STRUCTURE (hrb_t) ****/ @@ -1606,198 +1373,93 @@ H5FD_s3comms_s3r_read(s3r_t *handle, (const char *)handle->httpverb, (const char *)handle->purl->path, "HTTP/1.1"); - if (request == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not allocate hrb_t request.\n"); - } + if(request == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not allocate hrb_t request."); HDassert( request->magic == S3COMMS_HRB_MAGIC ); now = gmnow(); - if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not format ISO8601 time.\n"); - } + if(ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not format ISO8601 time."); - if (FAIL == - H5FD_s3comms_hrb_node_set( - &headers, - "x-amz-date", - (const char *)iso8601now) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set x-amz-date header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + if(FAIL == H5FD_s3comms_hrb_node_set( &headers, "x-amz-date", (const char *)iso8601now)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-date header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC ); - if (FAIL == - H5FD_s3comms_hrb_node_set( - &headers, - "x-amz-content-sha256", - (const char *)EMPTY_SHA256) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set x-amz-content-sha256 header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + if(FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-content-sha256", (const char *)EMPTY_SHA256)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-content-sha256 header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC ); - if (rangebytesstr != NULL) { - if (FAIL == - H5FD_s3comms_hrb_node_set( - &headers, - "Range", - (const char *)rangebytesstr) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set range header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + if(rangebytesstr != NULL) { + if(FAIL == H5FD_s3comms_hrb_node_set( &headers, "Range", rangebytesstr)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set range header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC ); } - if (FAIL == - H5FD_s3comms_hrb_node_set( - &headers, - "Host", - (const char *)handle->purl->host) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set host header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + if(FAIL == H5FD_s3comms_hrb_node_set(&headers, "Host", handle->purl->host)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set host header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC ); request->first_header = headers; /**** COMPUTE AUTHORIZATION ****/ - if (FAIL == /* buffer1 -> canonical request */ - H5FD_s3comms_aws_canonical_request( - buffer1, - 512, - signed_headers, - 48, - request) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "(placeholder flags)\n"); - } - if ( FAIL == /* buffer2->string-to-sign */ - H5FD_s3comms_tostringtosign(buffer2, - buffer1, - iso8601now, - handle->region) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "(placeholder flags)\n"); - } - if (FAIL == /* buffer1 -> signature */ - H5FD_s3comms_HMAC_SHA256(handle->signing_key, - SHA256_DIGEST_LENGTH, - buffer2, - HDstrlen(buffer2), - buffer1) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "(placeholder flags)\n"); - } + /* buffer1 -> canonical request */ + if(FAIL == H5FD_s3comms_aws_canonical_request(buffer1, 512, signed_headers, 48, request)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad canonical request"); + /* buffer2->string-to-sign */ + if(FAIL == H5FD_s3comms_tostringtosign(buffer2, buffer1, iso8601now, handle->region)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad string-to-sign"); + /* buffer1 -> signature */ + if(FAIL == H5FD_s3comms_HMAC_SHA256(handle->signing_key, SHA256_DIGEST_LENGTH, buffer2, HDstrlen(buffer2), buffer1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad signature"); iso8601now[8] = 0; /* trim to yyyyMMDD */ - ret = S3COMMS_FORMAT_CREDENTIAL(buffer2, - handle->secret_id, - iso8601now, - handle->region, - "s3"); - if (ret == 0 || ret >= S3COMMS_MAX_CREDENTIAL_SIZE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to format aws4 credential string"); - - ret = HDsnprintf( - authorization, - 512, + ret = S3COMMS_FORMAT_CREDENTIAL(buffer2, handle->secret_id, iso8601now, handle->region, "s3"); + if(ret == 0 || ret >= S3COMMS_MAX_CREDENTIAL_SIZE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format aws4 credential string"); + + ret = HDsnprintf( authorization, 512, "AWS4-HMAC-SHA256 Credential=%s,SignedHeaders=%s,Signature=%s", - buffer2, - signed_headers, - buffer1); - if (ret <= 0 || ret >= 512) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to format aws4 authorization string"); - } + buffer2, signed_headers, buffer1); + if(ret <= 0 || ret >= 512) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format aws4 authorization string"); - /* append authorization header to http request buffer - */ - if (H5FD_s3comms_hrb_node_set( - &headers, - "Authorization", - (const char *)authorization) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set Authorization header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + /* append authorization header to http request buffer */ + if(H5FD_s3comms_hrb_node_set(&headers, "Authorization", (const char *)authorization) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set Authorization header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); - /* update hrb's "first header" pointer - */ + /* update hrb's "first header" pointer */ request->first_header = headers; /**** SET CURLHANDLE HTTP HEADERS FROM GENERATED DATA ****/ node = request->first_header; - while (node != NULL) { + while(node != NULL) { HDassert( node->magic == S3COMMS_HRB_NODE_MAGIC ); - curlheaders = curl_slist_append(curlheaders, - (const char *)node->cat); - if (curlheaders == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not append header to curl slist. " - "(placeholder flags)\n"); - } + curlheaders = curl_slist_append(curlheaders, (const char *)node->cat); + if(curlheaders == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not append header to curl slist."); node = node->next; } - /* sanity-check - */ - if (curlheaders == NULL) { + /* sanity-check */ + if(curlheaders == NULL) /* above loop was probably never run */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "curlheaders was never populated.\n"); - } - - /* finally, set http headers in curl handle - */ - if (curl_easy_setopt( - curlh, - CURLOPT_HTTPHEADER, - curlheaders) - != CURLE_OK) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option " - "(CURLOPT_HTTPHEADER). (placeholder flags)"); - } + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "curlheaders was never populated."); + /* finally, set http headers in curl handle */ + if(curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, curlheaders) != CURLE_OK) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HTTPHEADER)."); } /* end if should authenticate (info provided) */ /******************* @@ -1813,107 +1475,79 @@ H5FD_s3comms_s3r_read(s3r_t *handle, char curlerrbuf[CURL_ERROR_SIZE]; curlerrbuf[0] = '\0'; - if (CURLE_OK != - curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem setting error buffer") - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem setting error buffer") p_status = curl_easy_perform(curlh); - if (p_status != CURLE_OK) { - if (CURLE_OK != - curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem getting response code") - } + if(p_status != CURLE_OK) { + if(CURLE_OK != curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem getting response code") HDfprintf(stderr, "CURL ERROR CODE: %d\nHTTP CODE: %d\n", p_status, httpcode); HDfprintf(stderr, "%s\n", curl_easy_strerror(p_status)); - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, - "problem while performing request.\n"); - } - if (CURLE_OK != - curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem unsetting error buffer") + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "problem while performing request."); } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem unsetting error buffer") } /* verbose error reporting */ #else p_status = curl_easy_perform(curlh); - if (p_status != CURLE_OK) { - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, - "curl cannot perform request\n") - } + if(p_status != CURLE_OK) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "curl cannot perform request") #endif #if S3COMMS_DEBUG - if (dest != NULL) { + if(dest != NULL) { HDfprintf(stderr, "len: %d\n", (int)len); HDfprintf(stderr, "CHECKING FOR BUFFER OVERFLOW\n"); - if (sds == NULL) { + if(sds == NULL) HDfprintf(stderr, "sds is NULL!\n"); - } else { HDfprintf(stderr, "sds: 0x%lx\n", (long long)sds); HDfprintf(stderr, "sds->size: %d\n", (int)sds->size); - if (len > sds->size) { + if(len > sds->size) HDfprintf(stderr, "buffer overwrite\n"); - } } } - else { + else HDfprintf(stderr, "performed on entire file\n"); - } #endif done: /* clean any malloc'd resources */ - if (curlheaders != NULL) { + if(curlheaders != NULL) { curl_slist_free_all(curlheaders); curlheaders = NULL; } - if (rangebytesstr != NULL) { + if(rangebytesstr != NULL) { H5MM_xfree(rangebytesstr); rangebytesstr = NULL; } - if (sds != NULL) { + if(sds != NULL) { H5MM_xfree(sds); sds = NULL; } - if (request != NULL) { - while (headers != NULL) - if (FAIL == - H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL)) - { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot release header node") - } + if(request != NULL) { + while(headers != NULL) + if(FAIL == H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header node") HDassert( NULL == headers ); - if (FAIL == H5FD_s3comms_hrb_destroy(&request)) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot release header request structure") - } + if(FAIL == H5FD_s3comms_hrb_destroy(&request)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header request structure") HDassert( NULL == request ); } - if (curlh != NULL) { + if(curlh != NULL) { /* clear any Range */ - if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL) ) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot unset CURLOPT_RANGE") - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot unset CURLOPT_RANGE") /* clear headers */ - if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL) ) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot unset CURLOPT_HTTPHEADER") - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot unset CURLOPT_HTTPHEADER") } FUNC_LEAVE_NOAPI(ret_value); @@ -1951,9 +1585,8 @@ gmnow(void) struct tm *ret_value = NULL; /* Doctor assert, checks against error in time() */ - if ( (time_t)(-1) != time(now_ptr) ) { - ret_value = gmtime(now_ptr); - } + if((time_t)(-1) != HDtime(now_ptr)) + ret_value = HDgmtime(now_ptr); HDassert( ret_value != NULL ); @@ -2035,102 +1668,66 @@ H5FD_s3comms_aws_canonical_request( HDfprintf(stdout, "called H5FD_s3comms_aws_canonical_request.\n"); #endif - if (http_request == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hrb object cannot be null.\n"); - } + if(http_request == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hrb object cannot be null."); HDassert( http_request->magic == S3COMMS_HRB_MAGIC ); - if (canonical_request_dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "canonical request destination cannot be null.\n"); - } + if(canonical_request_dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request destination cannot be null."); - if (signed_headers_dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "signed headers destination cannot be null.\n"); - } + if(signed_headers_dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "signed headers destination cannot be null."); - /* HTTP verb, resource path, and query string lines - */ + /* HTTP verb, resource path, and query string lines */ cr_len = (HDstrlen(http_request->verb) + HDstrlen(http_request->resource) + HDstrlen(query_params) + (size_t)3); /* three newline chars */ - if (cr_len >= cr_size) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "not enough space in canonical request"); - } - ret = HDsnprintf( /* TODO: compiler warning */ - canonical_request_dest, - (cr_size-1), + if(cr_len >= cr_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request"); + /* TODO: compiler warning */ + ret = HDsnprintf(canonical_request_dest, (cr_size - 1), "%s\n%s\n%s\n", - http_request->verb, - http_request->resource, - query_params); - if (ret < 0 || (size_t)ret >= cr_size) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to compose canonical request first line"); - } + http_request->verb, http_request->resource, query_params); + if(ret < 0 || (size_t)ret >= cr_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to compose canonical request first line"); - /* write in canonical headers, building signed headers concurrently - */ + /* write in canonical headers, building signed headers concurrently */ node = http_request->first_header; /* assumed sorted */ - while (node != NULL) { + while(node != NULL) { HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC); - ret = HDsnprintf( - tmpstr, - 256, - "%s:%s\n", - node->lowername, - node->value); - if (ret < 0 || ret >= 256) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to concatenate HTTP header %s:%s", - node->lowername, - node->value); - } + ret = HDsnprintf( tmpstr, 256, "%s:%s\n", node->lowername, node->value); + if(ret < 0 || ret >= 256) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to concatenate HTTP header %s:%s", node->lowername, node->value); cr_len += HDstrlen(tmpstr); - if (cr_len + 1 > cr_size) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "not enough space in canonical request"); - } - strcat(canonical_request_dest, tmpstr); - - ret = HDsnprintf( - tmpstr, - 256, - "%s;", - node->lowername); - if (ret < 0 || ret >= 256) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to append semicolon to lowername %s", - node->lowername); - } + if(cr_len + 1 > cr_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request"); + HDstrcat(canonical_request_dest, tmpstr); + + ret = HDsnprintf( tmpstr, 256, "%s;", node->lowername); + if(ret < 0 || ret >= 256) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to append semicolon to lowername %s", node->lowername); sh_len += HDstrlen(tmpstr); - if (sh_len + 1 > sh_size) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "not enough space in signed headers"); - } - strcat(signed_headers_dest, tmpstr); + if(sh_len + 1 > sh_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in signed headers"); + HDstrcat(signed_headers_dest, tmpstr); node = node->next; } /* end while node is not NULL */ - /* remove tailing ';' from signed headers sequence - */ + /* remove trailing ';' from signed headers sequence */ signed_headers_dest[HDstrlen(signed_headers_dest) - 1] = '\0'; /* append signed headers and payload hash * NOTE: at present, no HTTP body is handled, per the nature of * requests/range-gets */ - strcat(canonical_request_dest, "\n"); - strcat(canonical_request_dest, signed_headers_dest); - strcat(canonical_request_dest, "\n"); - strcat(canonical_request_dest, EMPTY_SHA256); + HDstrcat(canonical_request_dest, "\n"); + HDstrcat(canonical_request_dest, signed_headers_dest); + HDstrcat(canonical_request_dest, "\n"); + HDstrcat(canonical_request_dest, EMPTY_SHA256); done: FUNC_LEAVE_NOAPI(ret_value); @@ -2184,30 +1781,20 @@ H5FD_s3comms_bytes_to_hex( HDfprintf(stdout, "called H5FD_s3comms_bytes_to_hex.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hex destination cannot be null.\n") - } - if (msg == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "bytes sequence cannot be null.\n") - } + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hex destination cannot be null.") + if(msg == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bytes sequence cannot be null.") for (i = 0; i < msg_len; i++) { - int chars_written = HDsnprintf(&(dest[i * 2]), - 3, /* 'X', 'X', '\n' */ - (lowercase == TRUE) ? "%02x" : "%02X", - msg[i]); - if (chars_written != 2) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem while writing hex chars for %c", - msg[i]); - } + int chars_written = HDsnprintf(&(dest[i * 2]), 3, /* 'X', 'X', '\n' */ + (lowercase == TRUE) ? "%02x" : "%02X", msg[i]); + if(chars_written != 2) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem while writing hex chars for %c", msg[i]); } done: FUNC_LEAVE_NOAPI(ret_value); - } /* end H5FD_s3comms_bytes_to_hex() */ @@ -2239,13 +1826,18 @@ H5FD_s3comms_free_purl(parsed_url_t *purl) HDprintf("called H5FD_s3comms_free_purl.\n"); #endif - if (purl != NULL) { + if(purl != NULL) { HDassert( purl->magic == S3COMMS_PARSED_URL_MAGIC ); - if (purl->scheme != NULL) { H5MM_xfree(purl->scheme); } - if (purl->host != NULL) { H5MM_xfree(purl->host); } - if (purl->port != NULL) { H5MM_xfree(purl->port); } - if (purl->path != NULL) { H5MM_xfree(purl->path); } - if (purl->query != NULL) { H5MM_xfree(purl->query); } + if(purl->scheme != NULL) + H5MM_xfree(purl->scheme); + if(purl->host != NULL) + H5MM_xfree(purl->host); + if(purl->port != NULL) + H5MM_xfree(purl->port); + if(purl->path != NULL) + H5MM_xfree(purl->path); + if(purl->query != NULL) + H5MM_xfree(purl->query); purl->magic += 1ul; H5MM_xfree(purl); } @@ -2302,29 +1894,14 @@ H5FD_s3comms_HMAC_SHA256( HDfprintf(stdout, "called H5FD_s3comms_HMAC_SHA256.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination cannot be null."); - } + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null."); - HMAC(EVP_sha256(), - key, - (int)key_len, - (const unsigned char *)msg, - msg_len, - md, - &md_len); - - if (H5FD_s3comms_bytes_to_hex( - dest, - (const unsigned char *)md, - (size_t)md_len, - true) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not convert to hex string."); - } + HMAC(EVP_sha256(), key, (int)key_len, (const unsigned char *)msg, + msg_len, md, &md_len); + + if(H5FD_s3comms_bytes_to_hex(dest, (const unsigned char *)md, (size_t)md_len, true) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not convert to hex string."); done: FUNC_LEAVE_NOAPI(ret_value); @@ -2407,93 +1984,73 @@ H5FD__s3comms_load_aws_creds_from_file( int found_setting = 0; char *line_buffer = &(buffer[0]); - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if S3COMMS_DEBUG HDfprintf(stdout, "called load_aws_creds_from_file.\n"); #endif /* format target line for start of profile */ - if (32 < HDsnprintf(profile_line, 32, "[%s]", profile_name)) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format profile label") - } + if(32 < HDsnprintf(profile_line, 32, "[%s]", profile_name)) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format profile label") /* look for start of profile */ do { /* clear buffer */ - for (buffer_i=0; buffer_i < 128; buffer_i++) { + for(buffer_i=0; buffer_i < 128; buffer_i++) buffer[buffer_i] = 0; - } line_buffer = fgets(line_buffer, 128, file); - if (line_buffer == NULL) { /* reached end of file */ + if(line_buffer == NULL) /* reached end of file */ goto done; - } - } while (strncmp(line_buffer, profile_line, HDstrlen(profile_line))); + } while (HDstrncmp(line_buffer, profile_line, HDstrlen(profile_line))); /* extract credentials from lines */ do { /* clear buffer */ - for (buffer_i=0; buffer_i < 128; buffer_i++) { + for(buffer_i=0; buffer_i < 128; buffer_i++) buffer[buffer_i] = 0; - } /* collect a line from file */ line_buffer = fgets(line_buffer, 128, file); - if (line_buffer == NULL) { + if(line_buffer == NULL) goto done; /* end of file */ - } /* loop over names to see if line looks like assignment */ - for (setting_i = 0; setting_i < setting_count; setting_i++) { + for(setting_i = 0; setting_i < setting_count; setting_i++) { size_t setting_name_len = 0; const char *setting_name = NULL; char line_prefix[128]; setting_name = setting_names[setting_i]; setting_name_len = HDstrlen(setting_name); - if (HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format line prefix") - } + if(HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format line prefix") /* found a matching name? */ - if (!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) { + if(!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) { found_setting = 1; /* skip NULL destination buffer */ - if (setting_pointers[setting_i] == NULL) { + if(setting_pointers[setting_i] == NULL) break; - } /* advance to end of name in string */ do { line_buffer++; } while (*line_buffer != 0 && *line_buffer != '='); - if (*line_buffer == 0 || *(line_buffer+1) == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "incomplete assignment in file") - } + if(*line_buffer == 0 || *(line_buffer+1) == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incomplete assignment in file") line_buffer++; /* was pointing at '='; advance */ /* copy line buffer into out pointer */ - if (HDstrncpy( - setting_pointers[setting_i], - (const char *)line_buffer, - HDstrlen(line_buffer)) - == NULL) - { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to copy line into pointer") - } + HDstrncpy(setting_pointers[setting_i], (const char *)line_buffer, HDstrlen(line_buffer)); /* "trim" tailing whitespace by replacing with null terminator*/ buffer_i = 0; - while (!isspace(setting_pointers[setting_i][buffer_i])) { + while(!HDisspace(setting_pointers[setting_i][buffer_i])) buffer_i++; - } setting_pointers[setting_i][buffer_i] = '\0'; break; /* have read setting; don't compare with others */ @@ -2561,76 +2118,46 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, #else ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("HOME")) ; #endif - if (ret < 0 || (size_t)ret >= 117) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format home-aws path") - } + if(ret < 0 || (size_t)ret >= 117) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format home-aws path") ret = HDsnprintf(filepath, 128, "%s%s", awspath, "credentials"); - if (ret < 0 || (size_t)ret >= 128) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format credentials path") - } - - credfile = fopen(filepath, "r"); - if (credfile != NULL) { - if (H5FD__s3comms_load_aws_creds_from_file( - credfile, - profile_name, - key_id_out, - secret_access_key_out, - aws_region_out) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to load from aws credentials") - } - if (fclose(credfile) == EOF) { - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, - "unable to close credentials file") - } + if(ret < 0 || (size_t)ret >= 128) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format credentials path") + + credfile = HDfopen(filepath, "r"); + if(credfile != NULL) { + if(H5FD__s3comms_load_aws_creds_from_file(credfile, profile_name, key_id_out, + secret_access_key_out, aws_region_out) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws credentials") + if(HDfclose(credfile) == EOF) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close credentials file") credfile = NULL; } /* end if credential file opened */ ret = HDsnprintf(filepath, 128, "%s%s", awspath, "config"); - if (ret < 0 || (size_t)ret >= 128) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format config path") - } - credfile = fopen(filepath, "r"); - if (credfile != NULL) { - if (H5FD__s3comms_load_aws_creds_from_file( - credfile, - profile_name, + if(ret < 0 || (size_t)ret >= 128) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format config path") + credfile = HDfopen(filepath, "r"); + if(credfile != NULL) { + if(H5FD__s3comms_load_aws_creds_from_file( credfile, profile_name, (*key_id_out == 0) ? key_id_out : NULL, (*secret_access_key_out == 0) ? secret_access_key_out : NULL, - (*aws_region_out == 0) ? aws_region_out : NULL) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to load from aws config") - } - if (fclose(credfile) == EOF) { - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, - "unable to close config file") - } + (*aws_region_out == 0) ? aws_region_out : NULL) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws config") + if(HDfclose(credfile) == EOF) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close config file") credfile = NULL; } /* end if credential file opened */ /* fail if not all three settings were loaded */ - if (*key_id_out == 0 || - *secret_access_key_out == 0 || - *aws_region_out == 0) - { + if(*key_id_out == 0 || *secret_access_key_out == 0 || *aws_region_out == 0) ret_value = FAIL; - } done: - if (credfile != NULL) { - if (fclose(credfile) == EOF) { - HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL, - "problem error-closing aws configuration file") - } - } + if(credfile != NULL) + if(HDfclose(credfile) == EOF) + HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL, "problem error-closing aws configuration file") + FUNC_LEAVE_NOAPI(ret_value); } /* end H5FD_s3comms_load_aws_profile() */ @@ -2675,16 +2202,14 @@ H5FD_s3comms_nlowercase( HDfprintf(stdout, "called H5FD_s3comms_nlowercase.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination cannot be null.\n"); - } + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null."); - if (len > 0) { + if(len > 0) { HDmemcpy(dest, s, len); do { len--; - dest[len] = (char)tolower( (int)dest[len] ); + dest[len] = (char)HDtolower((int)dest[len]); } while (len > 0); } @@ -2743,18 +2268,14 @@ H5FD_s3comms_parse_url( HDprintf("called H5FD_s3comms_parse_url.\n"); #endif - if (str == NULL || *str == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "invalid url string"); - } + if(str == NULL || *str == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid url string"); urllen = (long int)HDstrlen(str); purl = (parsed_url_t *)H5MM_malloc(sizeof(parsed_url_t)); - if (purl == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for parsed_url_t"); - } + if(purl == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for parsed_url_t"); purl->magic = S3COMMS_PARSED_URL_MAGIC; purl->scheme = NULL; purl->host = NULL; @@ -2767,38 +2288,27 @@ H5FD_s3comms_parse_url( ***************/ tmpstr = HDstrchr(curstr, ':'); - if (tmpstr == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "invalid SCHEME construction: probably not URL"); - } + if(tmpstr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction: probably not URL"); len = tmpstr - curstr; HDassert( (0 <= len) && (len < urllen) ); - /* check for restrictions - */ - for (i = 0; i < len; i++) { + /* check for restrictions */ + for(i = 0; i < len; i++) { /* scheme = [a-zA-Z+-.]+ (terminated by ":") */ - if (!isalpha(curstr[i]) && - '+' != curstr[i] && - '-' != curstr[i] && - '.' != curstr[i]) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "invalid SCHEME construction"); - } + if(!HDisalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] && + '.' != curstr[i]) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction"); } - /* copy lowercased scheme to structure - */ + + /* copy lowercased scheme to structure */ purl->scheme = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->scheme == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for SCHEME"); - } + if(purl->scheme == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for SCHEME"); (void)HDstrncpy(purl->scheme, curstr, (size_t)len); purl->scheme[len] = '\0'; - for ( i = 0; i < len; i++ ) { - purl->scheme[i] = (char)tolower(purl->scheme[i]); - } + for(i = 0; i < len; i++ ) + purl->scheme[i] = (char)HDtolower(purl->scheme[i]); /* Skip "://" */ tmpstr += 3; @@ -2808,46 +2318,33 @@ H5FD_s3comms_parse_url( * READ HOST * *************/ - if (*curstr == '[') { + if(*curstr == '[') { /* IPv6 */ - while (']' != *tmpstr) { - if (tmpstr == 0) { /* end of string reached! */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "reached end of URL: incomplete IPv6 HOST"); - } + while(']' != *tmpstr) { + /* end of string reached! */ + if(tmpstr == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reached end of URL: incomplete IPv6 HOST"); tmpstr++; } tmpstr++; } /* end if (IPv6) */ else { - while (0 != *tmpstr) { - if (':' == *tmpstr || - '/' == *tmpstr || - '?' == *tmpstr) - { + while(0 != *tmpstr) { + if(':' == *tmpstr || '/' == *tmpstr || '?' == *tmpstr) break; - } tmpstr++; } } /* end else (IPv4) */ len = tmpstr - curstr; - if (len == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "HOST substring cannot be empty"); - } - else - if (len > urllen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem with length of HOST substring"); - } + if(len == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty"); + else if(len > urllen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of HOST substring"); - /* copy host - */ + /* copy host */ purl->host = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->host == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for HOST"); - } + if(purl->host == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for HOST"); (void)HDstrncpy(purl->host, curstr, (size_t)len); purl->host[len] = 0; @@ -2855,36 +2352,24 @@ H5FD_s3comms_parse_url( * READ PORT * *************/ - if (':' == *tmpstr) { + if(':' == *tmpstr) { tmpstr += 1; /* advance past ':' */ curstr = tmpstr; - while ((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr)) { + while((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr)) tmpstr++; - } len = tmpstr - curstr; - if (len == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "PORT element cannot be empty"); - } - else - if (len > urllen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem with length of PORT substring"); - } - for (i = 0; i < len; i ++) { - if (!isdigit(curstr[i])) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "PORT is not a decimal string"); - } - } - - /* copy port - */ + if(len == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty"); + else if(len > urllen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PORT substring"); + for(i = 0; i < len; i ++) + if(!HDisdigit(curstr[i])) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT is not a decimal string"); + + /* copy port */ purl->port = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->port == NULL) { /* cannot malloc */ - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for PORT"); - } + if(purl->port == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PORT"); (void)HDstrncpy(purl->port, curstr, (size_t)len); purl->port[len] = 0; } /* end if PORT element */ @@ -2893,27 +2378,21 @@ H5FD_s3comms_parse_url( * READ PATH * *************/ - if ('/' == *tmpstr) { + if('/' == *tmpstr) { /* advance past '/' */ tmpstr += 1; curstr = tmpstr; - /* seek end of PATH - */ - while ((0 != *tmpstr) && ('?' != *tmpstr)) { + /* seek end of PATH */ + while((0 != *tmpstr) && ('?' != *tmpstr)) tmpstr++; - } len = tmpstr - curstr; - if (len > urllen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem with length of PATH substring"); - } - if (len > 0) { + if(len > urllen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PATH substring"); + if(len > 0) { purl->path = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->path == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for PATH"); - } /* cannot malloc path pointer */ + if(purl->path == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH"); (void)HDstrncpy(purl->path, curstr, (size_t)len); purl->path[len] = 0; } @@ -2923,25 +2402,19 @@ H5FD_s3comms_parse_url( * READ QUERY * **************/ - if ('?' == *tmpstr) { + if('?' == *tmpstr) { tmpstr += 1; curstr = tmpstr; - while (0 != *tmpstr) { + while(0 != *tmpstr) tmpstr++; - } len = tmpstr - curstr; - if (len == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "QUERY cannot be empty"); - } else if (len > urllen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem with length of QUERY substring"); - } + if(len == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty"); + else if(len > urllen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of QUERY substring"); purl->query = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->query == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for QUERY"); - } /* cannot malloc path pointer */ + if(purl->query == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for QUERY"); (void)HDstrncpy(purl->query, curstr, (size_t)len); purl->query[len] = 0; } /* end if QUERY exists */ @@ -2950,9 +2423,9 @@ H5FD_s3comms_parse_url( ret_value = SUCCEED; done: - if (ret_value == FAIL) { + if(ret_value == FAIL) H5FD_s3comms_free_purl(purl); - } + FUNC_LEAVE_NOAPI(ret_value); } /* end H5FD_s3comms_parse_url() */ @@ -3016,9 +2489,8 @@ H5FD_s3comms_percent_encode_char( HDfprintf(stdout, "called H5FD_s3comms_percent_encode_char.\n"); #endif - if (repr == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.\n") - } + if(repr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.") #if S3COMMS_DEBUG H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, FALSE); @@ -3026,7 +2498,7 @@ H5FD_s3comms_percent_encode_char( HDfprintf(stdout, " CHAR-HEX: \"%s\"\n", hex); #endif - if (c <= (unsigned char)0x7f) { + if(c <= (unsigned char)0x7f) { /* character represented in a single "byte" * and single percent-code */ @@ -3035,11 +2507,8 @@ H5FD_s3comms_percent_encode_char( #endif *repr_len = 3; chars_written = HDsnprintf(repr, 4, "%%%02X", c); - if (chars_written < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot write char %c", - c); - } + if(chars_written < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c); } /* end if single-byte unicode char */ else { /* multi-byte, multi-percent representation @@ -3092,16 +2561,9 @@ H5FD_s3comms_percent_encode_char( acc += (stack_size > 2) ? 0x20 : 0; /* 0x00100000 */ acc += (stack_size > 3) ? 0x10 : 0; /* 0x00010000 */ stack_size--; - chars_written = HDsnprintf( - repr, - 4, - "%%%02X", - (unsigned char)(acc + stack[stack_size])); - if (chars_written < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot write char %c", - c); - } + chars_written = HDsnprintf( repr, 4, "%%%02X", (unsigned char)(acc + stack[stack_size])); + if(chars_written < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c); *repr_len += 3; /************************ @@ -3109,17 +2571,11 @@ H5FD_s3comms_percent_encode_char( ************************/ /* 10xxxxxx */ - for (i = 0; i < stack_size; i++) { - chars_written = HDsnprintf( - &repr[i*3 + 3], - 4, - "%%%02X", - (unsigned char)(0x80 + stack[stack_size - 1 - i])); - if (chars_written < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot write char %c", - c); - } + for(i = 0; i < stack_size; i++) { + chars_written = HDsnprintf( &repr[i*3 + 3], 4, + "%%%02X", (unsigned char)(0x80 + stack[stack_size - 1 - i])); + if(chars_written < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c); *repr_len += 3; } /* end for each continuation byte */ } /* end else (multi-byte) */ @@ -3190,38 +2646,24 @@ H5FD_s3comms_signing_key( HDfprintf(stdout, "called H5FD_s3comms_signing_key.\n"); #endif - if (md == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Destination `md` cannot be NULL.\n") - } - if (secret == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "`secret` cannot be NULL.\n") - } - if (region == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "`region` cannot be NULL.\n") - } - if (iso8601now == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "`iso8601now` cannot be NULL.\n") - } + if(md == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Destination `md` cannot be NULL.") + if(secret == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`secret` cannot be NULL.") + if(region == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`region` cannot be NULL.") + if(iso8601now == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`iso8601now` cannot be NULL.") AWS4_secret_len = 4 + HDstrlen(secret) + 1; AWS4_secret = (char*)H5MM_malloc(sizeof(char *) * AWS4_secret_len); - if (AWS4_secret == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Could not allocate space.\n") - } + if(AWS4_secret == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Could not allocate space.") - /* prepend "AWS4" to start of the secret key - */ + /* prepend "AWS4" to start of the secret key */ ret = HDsnprintf(AWS4_secret, AWS4_secret_len,"%s%s", "AWS4", secret); - if ((size_t)ret != (AWS4_secret_len - 1)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem writing AWS4+secret `%s`", - secret); - } + if((size_t)ret != (AWS4_secret_len - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem writing AWS4+secret `%s`", secret); /* hash_func, key, len(key), msg, len(msg), digest_dest, digest_len_dest * we know digest length, so ignore via NULL @@ -3320,37 +2762,26 @@ H5FD_s3comms_tostringtosign( HDfprintf(stdout, "called H5FD_s3comms_tostringtosign.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination buffer cannot be null.\n") - } - if (req == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "canonical request cannot be null.\n") - } - if (now == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Timestring cannot be NULL.\n") - } - if (region == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Region cannot be NULL.\n") - } + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer cannot be null.") + if(req == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request cannot be null.") + if(now == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Timestring cannot be NULL.") + if(region == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Region cannot be NULL.") - for (i = 0; i < 128; i++) { + for(i = 0; i < 128; i++) tmp[i] = '\0'; - } - for (i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) { + for(i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) { checksum[i] = '\0'; hexsum[i] = '\0'; } HDstrncpy(day, now, 8); day[8] = '\0'; ret = HDsnprintf(tmp, 127, "%s/%s/s3/aws4_request", day, region); - if (ret <= 0 || ret >= 127) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem adding day and region to string") - } + if(ret <= 0 || ret >= 127) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem adding day and region to string") HDmemcpy((dest + d), "AWS4-HMAC-SHA256\n", 17); d = 17; @@ -3363,24 +2794,14 @@ H5FD_s3comms_tostringtosign( d += HDstrlen(tmp); dest[d++] = '\n'; - SHA256((const unsigned char *)req, - HDstrlen(req), - checksum); + SHA256((const unsigned char *)req, HDstrlen(req), checksum); - if (H5FD_s3comms_bytes_to_hex( - hexsum, - (const unsigned char *)checksum, - SHA256_DIGEST_LENGTH, - true) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not create hex string"); - } + if(H5FD_s3comms_bytes_to_hex(hexsum, (const unsigned char *)checksum, + SHA256_DIGEST_LENGTH, true) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not create hex string"); - for (i = 0; i < SHA256_DIGEST_LENGTH * 2; i++) { + for(i = 0; i < SHA256_DIGEST_LENGTH * 2; i++) dest[d++] = hexsum[i]; - } dest[d] = '\0'; @@ -3432,21 +2853,16 @@ H5FD_s3comms_trim(char *dest, HDfprintf(stdout, "called H5FD_s3comms_trim.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination cannot be null.") - } - if (s == NULL) { + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.") + if(s == NULL) s_len = 0; - } - if (s_len > 0) { + if(s_len > 0) { /* Find first non-whitespace character from start; * reduce total length per character. */ - while ((s_len > 0) && - isspace((unsigned char)s[0]) && s_len > 0) - { + while((s_len > 0) && HDisspace((unsigned char)s[0]) && s_len > 0) { s++; s_len--; } @@ -3455,14 +2871,13 @@ H5FD_s3comms_trim(char *dest, * reduce length per-character. * If length is 0 already, there is no non-whitespace character. */ - if (s_len > 0) { + if(s_len > 0) { do { s_len--; - } while( isspace((unsigned char)s[s_len]) ); + } while(HDisspace((unsigned char)s[s_len])); s_len++; - /* write output into dest - */ + /* write output into dest */ HDmemcpy(dest, s, s_len); } } @@ -3534,54 +2949,36 @@ H5FD_s3comms_uriencode( HDfprintf(stdout, "H5FD_s3comms_uriencode called.\n"); #endif - if (s == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "source string cannot be NULL"); - } - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination cannot be NULL"); - } + if(s == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source string cannot be NULL"); + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be NULL"); /* Write characters to destination, converting to percent-encoded * "hex-utf-8" strings if necessary. * e.g., '$' -> "%24" */ - for (s_off = 0; s_off < s_len; s_off++) { + for(s_off = 0; s_off < s_len; s_off++) { c = s[s_off]; - if (isalnum(c) || - c == '.' || - c == '-' || - c == '_' || - c == '~' || - (c == '/' && encode_slash == FALSE)) - { + if(HDisalnum(c) || c == '.' || c == '-' || c == '_' || + c == '~' || (c == '/' && encode_slash == FALSE)) dest[dest_off++] = c; - } else { hex_off = 0; - if (H5FD_s3comms_percent_encode_char( - hex_buffer, - (const unsigned char)c, - &hex_len) - == FAIL) - { + if(H5FD_s3comms_percent_encode_char(hex_buffer, (const unsigned char)c, + &hex_len) == FAIL) { hex_buffer[0] = c; hex_buffer[1] = 0; - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to percent-encode character \'%s\' " - "at %d in \"%s\"", hex_buffer, (int)s_off, s); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to percent-encode character \'%s\' " "at %d in \"%s\"", hex_buffer, (int)s_off, s); } - for (hex_off = 0; hex_off < hex_len; hex_off++) { + for(hex_off = 0; hex_off < hex_len; hex_off++) dest[dest_off++] = hex_buffer[hex_off]; - } } /* end else (not a regular character) */ } /* end for each character */ - if (dest_off < s_len) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "buffer overflow"); + if(dest_off < s_len) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buffer overflow"); *n_written = dest_off; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 3551905..f2ceb3b 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 29, 1999 * * Purpose: The POSIX unbuffered file driver using only the HDF5 public @@ -95,7 +95,6 @@ typedef struct H5FD_sec2_t { * a single file. */ hbool_t fam_to_single; - } H5FD_sec2_t; /* @@ -113,37 +112,37 @@ typedef struct H5FD_sec2_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - HADDR_UNDEF==(A)+(Z) || \ - (HDoff_t)((A)+(Z))<(HDoff_t)(A)) + HADDR_UNDEF == (A) + (Z) || \ + (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) /* Prototypes */ -static herr_t H5FD_sec2_term(void); -static H5FD_t *H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__sec2_term(void); +static H5FD_t *H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_sec2_close(H5FD_t *_file); -static int H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_sec2_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__sec2_close(H5FD_t *_file); +static int H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__sec2_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__sec2_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_sec2_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_sec2_unlock(H5FD_t *_file); +static herr_t H5FD__sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__sec2_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__sec2_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_sec2_g = { "sec2", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_sec2_term, /* terminate */ + H5FD__sec2_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ @@ -154,23 +153,23 @@ static const H5FD_class_t H5FD_sec2_g = { 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_sec2_open, /* open */ - H5FD_sec2_close, /* close */ - H5FD_sec2_cmp, /* cmp */ - H5FD_sec2_query, /* query */ + H5FD__sec2_open, /* open */ + H5FD__sec2_close, /* close */ + H5FD__sec2_cmp, /* cmp */ + H5FD__sec2_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_sec2_get_eoa, /* get_eoa */ - H5FD_sec2_set_eoa, /* set_eoa */ - H5FD_sec2_get_eof, /* get_eof */ - H5FD_sec2_get_handle, /* get_handle */ - H5FD_sec2_read, /* read */ - H5FD_sec2_write, /* write */ + H5FD__sec2_get_eoa, /* get_eoa */ + H5FD__sec2_set_eoa, /* set_eoa */ + H5FD__sec2_get_eof, /* get_eof */ + H5FD__sec2_get_handle, /* get_handle */ + H5FD__sec2_read, /* read */ + H5FD__sec2_write, /* write */ NULL, /* flush */ - H5FD_sec2_truncate, /* truncate */ - H5FD_sec2_lock, /* lock */ - H5FD_sec2_unlock, /* unlock */ + H5FD__sec2_truncate, /* truncate */ + H5FD__sec2_lock, /* lock */ + H5FD__sec2_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -235,7 +234,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_sec2_term + * Function: H5FD__sec2_term * * Purpose: Shut down the VFD * @@ -247,15 +246,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_term(void) +H5FD__sec2_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_SEC2_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_sec2_term() */ +} /* end H5FD__sec2_term() */ /*------------------------------------------------------------------------- @@ -292,7 +291,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_sec2_open + * Function: H5FD__sec2_open * * Purpose: Create and/or opens a file as an HDF5 file. * @@ -307,7 +306,7 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) +H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_sec2_t *file = NULL; /* sec2 VFD info */ int fd = -1; /* File descriptor */ @@ -318,7 +317,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) h5_stat_t sb; H5FD_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); @@ -407,11 +406,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_open() */ +} /* end H5FD__sec2_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_close + * Function: H5FD__sec2_close * * Purpose: Closes an HDF5 file. * @@ -424,12 +423,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_close(H5FD_t *_file) +H5FD__sec2_close(H5FD_t *_file) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(file); @@ -443,11 +442,11 @@ H5FD_sec2_close(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_close() */ +} /* end H5FD__sec2_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_cmp + * Function: H5FD__sec2_cmp * * Purpose: Compares two files belonging to this driver using an * arbitrary (but consistent) ordering. @@ -462,13 +461,13 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_sec2_t *f1 = (const H5FD_sec2_t *)_f1; const H5FD_sec2_t *f2 = (const H5FD_sec2_t *)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #ifdef H5_HAVE_WIN32_API if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1) @@ -497,11 +496,11 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_cmp() */ +} /* end H5FD__sec2_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_query + * Function: H5FD__sec2_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -514,11 +513,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) +H5FD__sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; /* sec2 VFD info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ /* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as @@ -543,11 +542,11 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_sec2_query() */ +} /* end H5FD__sec2_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_get_eoa + * Function: H5FD__sec2_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -561,18 +560,18 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) -} /* end H5FD_sec2_get_eoa() */ +} /* end H5FD__sec2_get_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_set_eoa + * Function: H5FD__sec2_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -586,20 +585,20 @@ H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) +H5FD__sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_sec2_set_eoa() */ +} /* end H5FD__sec2_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_get_eof + * Function: H5FD__sec2_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the filesystem end-of-file or the HDF5 end-of-address @@ -614,18 +613,18 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eof) -} /* end H5FD_sec2_get_eof() */ +} /* end H5FD__sec2_get_eof() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_get_handle + * Function: H5FD__sec2_get_handle * * Purpose: Returns the file handle of sec2 file driver. * @@ -637,12 +636,12 @@ H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) +H5FD__sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -651,11 +650,11 @@ H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handl done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_get_handle() */ +} /* end H5FD__sec2_get_handle() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_read + * Function: H5FD__sec2_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -671,14 +670,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, +H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf /*out*/) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -691,17 +690,15 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS #ifndef H5_HAVE_PREADWRITE /* Seek to the correct location (if we don't have pread) */ - if(addr != file->pos || OP_READ != file->op) { + if(addr != file->pos || OP_READ != file->op) if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - } #endif /* H5_HAVE_PREADWRITE */ /* Read data, being careful of interrupted system calls, partial results, * and the end of the file. */ while(size > 0) { - h5_posix_io_t bytes_in = 0; /* # of bytes to read */ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ @@ -758,11 +755,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_read() */ +} /* end H5FD__sec2_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_write + * Function: H5FD__sec2_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -776,14 +773,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, +H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -796,17 +793,15 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU #ifndef H5_HAVE_PREADWRITE /* Seek to the correct location (if we don't have pwrite) */ - if(addr != file->pos || OP_WRITE != file->op) { + if(addr != file->pos || OP_WRITE != file->op) if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - } #endif /* H5_HAVE_PREADWRITE */ /* Write the data, being careful of interrupted system calls and partial * results */ while(size > 0) { - h5_posix_io_t bytes_in = 0; /* # of bytes to write */ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ @@ -859,11 +854,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_write() */ +} /* end H5FD__sec2_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_truncate + * Function: H5FD__sec2_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -876,12 +871,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -928,11 +923,11 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_truncate() */ +} /* end H5FD__sec2_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_lock + * Function: H5FD__sec2_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -946,13 +941,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_lock(H5FD_t *_file, hbool_t rw) +H5FD__sec2_lock(H5FD_t *_file, hbool_t rw) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -969,11 +964,11 @@ H5FD_sec2_lock(H5FD_t *_file, hbool_t rw) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_lock() */ +} /* end H5FD__sec2_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_unlock + * Function: H5FD__sec2_unlock * * Purpose: To remove the existing lock on the file * @@ -984,12 +979,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_unlock(H5FD_t *_file) +H5FD__sec2_unlock(H5FD_t *_file) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1002,5 +997,5 @@ H5FD_sec2_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_unlock() */ +} /* end H5FD__sec2_unlock() */ diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h index a4ade0b..d669582 100644 --- a/src/H5FDsec2.h +++ b/src/H5FDsec2.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the sec2 driver. diff --git a/src/H5FDspace.c b/src/H5FDspace.c index e1f0cb2..22d7e22 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -15,7 +15,7 @@ * * Created: H5FDspace.c * Jan 3 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Space allocation routines for the file driver code. * @@ -84,7 +84,7 @@ H5FL_DEFINE(H5FD_free_t); /*------------------------------------------------------------------------- - * Function: H5FD_extend + * Function: H5FD__extend * * Purpose: Extend the EOA space of a file. * @@ -99,12 +99,12 @@ H5FL_DEFINE(H5FD_free_t); *------------------------------------------------------------------------- */ static haddr_t -H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) +H5FD__extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) { haddr_t eoa; /* Address of end-of-allocated space */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(file); @@ -129,7 +129,7 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_extend() */ +} /* end H5FD__extend() */ /*------------------------------------------------------------------------- @@ -203,7 +203,7 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver allocation request failed") } /* end if */ else { - ret_value = H5FD_extend(file, type, size + extra); + ret_value = H5FD__extend(file, type, size + extra); if(!H5F_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver eoa update request failed") } /* end else */ @@ -439,7 +439,7 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_ /* Check if the block is exactly at the end of the file */ if(H5F_addr_eq(blk_end, eoa)) { /* Extend the object by extending the underlying file */ - if(HADDR_UNDEF == H5FD_extend(file, type, extra_requested)) + if(HADDR_UNDEF == H5FD__extend(file, type, extra_requested)) HGOTO_ERROR(H5E_VFL, H5E_CANTEXTEND, FAIL, "driver extend request failed") /* Mark EOA info dirty in cache, so change will get encoded */ diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 4ed3c4a..18a8735 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -27,8 +27,6 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5FDsec2.h" /* Generic Functions */ -#include "H5FDstdio.h" /* Generic Functions */ #include "H5Pprivate.h" /* Property lists */ /* The driver identification number, initialized at runtime */ @@ -83,9 +81,8 @@ typedef struct H5FD_splitter_t { #define H5FD_SPLITTER_WO_ERROR(file, funcname, errmajor, errminor, ret, mesg) \ { \ H5FD__splitter_log_error((file), (funcname), (mesg)); \ - if (FALSE == (file)->fa.ignore_wo_errs) { \ + if(FALSE == (file)->fa.ignore_wo_errs) \ HGOTO_ERROR((errmajor), (errminor), (ret), (mesg)) \ - } \ } #define H5FD_SPLITTER_DEBUG_OP_CALLS 0 /* debugging print toggle; 0 disables */ @@ -93,7 +90,7 @@ typedef struct H5FD_splitter_t { #if H5FD_SPLITTER_DEBUG_OP_CALLS #define H5FD_SPLITTER_LOG_CALL(name) do { \ HDprintf("called %s()\n", (name)); \ - fflush(stdout); \ + HDfflush(stdout); \ } while (0) #else #define H5FD_SPLITTER_LOG_CALL(name) /* no-op */ @@ -103,73 +100,75 @@ typedef struct H5FD_splitter_t { /* Print error messages from W/O channel to log file */ static herr_t H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char *msg); - static int H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr); /* Prototypes */ -static herr_t H5FD_splitter_term(void); -static hsize_t H5FD_splitter_sb_size(H5FD_t *_file); -static herr_t H5FD_splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); -static herr_t H5FD_splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); -static void *H5FD_splitter_fapl_get(H5FD_t *_file); -static void *H5FD_splitter_fapl_copy(const void *_old_fa); -static herr_t H5FD_splitter_fapl_free(void *_fapl); -static H5FD_t *H5FD_splitter_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_splitter_close(H5FD_t *_file); -static int H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_splitter_query(const H5FD_t *_file, unsigned long *flags /* out */); -static herr_t H5FD_splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map); -static haddr_t H5FD_splitter_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); -static herr_t H5FD_splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); -static haddr_t H5FD_splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type); -static herr_t H5FD_splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr); -static haddr_t H5FD_splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type); -static herr_t H5FD_splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle); -static herr_t H5FD_splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_splitter_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_splitter_unlock(H5FD_t *_file); +static herr_t H5FD__splitter_term(void); +static hsize_t H5FD__splitter_sb_size(H5FD_t *_file); +static herr_t H5FD__splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); +static herr_t H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); +static void *H5FD__splitter_fapl_get(H5FD_t *_file); +static void *H5FD__splitter_fapl_copy(const void *_old_fa); +static herr_t H5FD__splitter_fapl_free(void *_fapl); +static H5FD_t *H5FD__splitter_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); +static herr_t H5FD__splitter_close(H5FD_t *_file); +static int H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */); +static herr_t H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map); +static haddr_t H5FD__splitter_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); +static herr_t H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); +static haddr_t H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type); +static herr_t H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr); +static haddr_t H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type); +static herr_t H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle); +static herr_t H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf); +static herr_t H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); +static herr_t H5FD__splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__splitter_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__splitter_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_splitter_g = { "splitter", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_splitter_term, /* terminate */ - H5FD_splitter_sb_size, /* sb_size */ - H5FD_splitter_sb_encode, /* sb_encode */ - H5FD_splitter_sb_decode, /* sb_decode */ + H5FD__splitter_term, /* terminate */ + H5FD__splitter_sb_size, /* sb_size */ + H5FD__splitter_sb_encode, /* sb_encode */ + H5FD__splitter_sb_decode, /* sb_decode */ sizeof(H5FD_splitter_fapl_t), /* fapl_size */ - H5FD_splitter_fapl_get, /* fapl_get */ - H5FD_splitter_fapl_copy, /* fapl_copy */ - H5FD_splitter_fapl_free, /* fapl_free */ + H5FD__splitter_fapl_get, /* fapl_get */ + H5FD__splitter_fapl_copy, /* fapl_copy */ + H5FD__splitter_fapl_free, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_splitter_open, /* open */ - H5FD_splitter_close, /* close */ - H5FD_splitter_cmp, /* cmp */ - H5FD_splitter_query, /* query */ - H5FD_splitter_get_type_map, /* get_type_map */ - H5FD_splitter_alloc, /* alloc */ - H5FD_splitter_free, /* free */ - H5FD_splitter_get_eoa, /* get_eoa */ - H5FD_splitter_set_eoa, /* set_eoa */ - H5FD_splitter_get_eof, /* get_eof */ - H5FD_splitter_get_handle, /* get_handle */ - H5FD_splitter_read, /* read */ - H5FD_splitter_write, /* write */ - H5FD_splitter_flush, /* flush */ - H5FD_splitter_truncate, /* truncate */ - H5FD_splitter_lock, /* lock */ - H5FD_splitter_unlock, /* unlock */ + H5FD__splitter_open, /* open */ + H5FD__splitter_close, /* close */ + H5FD__splitter_cmp, /* cmp */ + H5FD__splitter_query, /* query */ + H5FD__splitter_get_type_map, /* get_type_map */ + H5FD__splitter_alloc, /* alloc */ + H5FD__splitter_free, /* free */ + H5FD__splitter_get_eoa, /* get_eoa */ + H5FD__splitter_set_eoa, /* set_eoa */ + H5FD__splitter_get_eof, /* get_eof */ + H5FD__splitter_get_handle, /* get_handle */ + H5FD__splitter_read, /* read */ + H5FD__splitter_write, /* write */ + H5FD__splitter_flush, /* flush */ + H5FD__splitter_truncate, /* truncate */ + H5FD__splitter_lock, /* lock */ + H5FD__splitter_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; /* Declare a free list to manage the H5FD_splitter_t struct */ H5FL_DEFINE_STATIC(H5FD_splitter_t); +/* Declare a free list to manage the H5FD_splitter_fapl_t struct */ +H5FL_DEFINE_STATIC(H5FD_splitter_fapl_t); + /*------------------------------------------------------------------------- * Function: H5FD__init_package @@ -186,11 +185,10 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD__init_package"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (H5FD_splitter_init() < 0) { + if(H5FD_splitter_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize splitter VFD") - } done: FUNC_LEAVE_NOAPI(ret_value) @@ -214,11 +212,10 @@ H5FD_splitter_init(void) FUNC_ENTER_NOAPI(FAIL) - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_init"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (H5I_VFL != H5I_get_type(H5FD_SPLITTER_g)) { + if(H5I_VFL != H5I_get_type(H5FD_SPLITTER_g)) H5FD_SPLITTER_g = H5FDregister(&H5FD_splitter_g); - } ret_value = H5FD_SPLITTER_g; @@ -228,7 +225,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_splitter_term + * Function: H5FD__splitter_term * * Purpose: Shut down the splitter VFD. * @@ -236,17 +233,17 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_term(void) +H5FD__splitter_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_term"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Reset VFL ID */ H5FD_SPLITTER_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_splitter_term() */ +} /* end H5FD__splitter_term() */ /*------------------------------------------------------------------------- @@ -265,25 +262,22 @@ H5FD__copy_plist(hid_t fapl_id, int ret_value = 0; H5P_genplist_t *plist_ptr = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD__copy_plist"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(id_out_ptr != NULL); - if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) { + if(FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list"); - } plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id); - if (NULL == plist_ptr) { + if(NULL == plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "unable to get property list"); - } *id_out_ptr = H5P_copy_plist(plist_ptr, FALSE); - if (H5I_INVALID_HID == *id_out_ptr) { + if(H5I_INVALID_HID == *id_out_ptr) HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, -1, "unable to copy file access property list"); - } done: FUNC_LEAVE_NOAPI(ret_value); @@ -302,28 +296,21 @@ done: herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) { - H5FD_splitter_fapl_t info; + H5FD_splitter_fapl_t *info = NULL; H5P_genplist_t *plist_ptr = NULL; herr_t ret_value = SUCCEED; - H5Eclear2(H5E_DEFAULT); - FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Dr", fapl_id, vfd_config); - H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (H5FD_SPLITTER_MAGIC != vfd_config->magic) { + if(H5FD_SPLITTER_MAGIC != vfd_config->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)") - } - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invlaid config (version number mismatch)") - } - - if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) { + if(H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid config (version number mismatch)") + if(NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid property list") - } - /* Make sure that the W/O channel supports write-only capability. * Some drivers (e.g. family or multi) do revision of the superblock @@ -331,55 +318,54 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) * Uses the feature flag H5FD_FEAT_DEFAULT_VFD_COMPATIBLE as the * determining attribute. */ - if (H5P_DEFAULT != vfd_config->wo_fapl_id) { + if(H5P_DEFAULT != vfd_config->wo_fapl_id) { H5FD_class_t *wo_driver = NULL; H5FD_driver_prop_t wo_driver_prop; H5P_genplist_t *wo_plist_ptr = NULL; unsigned long wo_driver_flags = 0; wo_plist_ptr = (H5P_genplist_t *)H5I_object(vfd_config->wo_fapl_id); - if (NULL == wo_plist_ptr) { + if(NULL == wo_plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) { + if(H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info") - } wo_driver = (H5FD_class_t *)H5I_object(wo_driver_prop.driver_id); - if (NULL == wo_driver) { + if(NULL == wo_driver) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list") - } - if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) { + if(H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't query VFD flags") - } - if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) { + if(0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unsuitable W/O driver") - } } /* end if W/O VFD is non-default */ + info = H5FL_CALLOC(H5FD_splitter_fapl_t); + if(NULL == info) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate file access property list struct") - info.ignore_wo_errs = vfd_config->ignore_wo_errs; - HDstrncpy(info.wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); - HDstrncpy(info.log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); - info.rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ - info.wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info->ignore_wo_errs = vfd_config->ignore_wo_errs; + HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); + info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ /* Set non-default channel FAPL IDs in splitter configuration info */ - if (H5P_DEFAULT != vfd_config->rw_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) { + if(H5P_DEFAULT != vfd_config->rw_fapl_id) { + if(FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - info.rw_fapl_id = vfd_config->rw_fapl_id; + info->rw_fapl_id = vfd_config->rw_fapl_id; } - if (H5P_DEFAULT != vfd_config->wo_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) { + if(H5P_DEFAULT != vfd_config->wo_fapl_id) { + if(FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - info.wo_fapl_id = vfd_config->wo_fapl_id; + info->wo_fapl_id = vfd_config->wo_fapl_id; } - ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, &info); + ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, info); done: + if(info) + info = H5FL_FREE(H5FD_splitter_fapl_t, info); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_fapl_splitter() */ @@ -406,48 +392,39 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Dr", fapl_id, config_out); - H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) { + if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (config_out == NULL) { + if(config_out == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null") - } - if (H5FD_SPLITTER_MAGIC != config_out->magic) { + if(H5FD_SPLITTER_MAGIC != config_out->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)") - } - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) { + if(H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)") - } /* Pre-set out FAPL IDs with intent to replace these values */ config_out->rw_fapl_id = H5I_INVALID_HID; config_out->wo_fapl_id = H5I_INVALID_HID; /* Check and get the splitter fapl */ - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) { + if(NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) { + if(H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") - } - if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) { + if(NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info") - } HDstrncpy(config_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) { + if(H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL"); - } - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) { + if(H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL"); - } done: FUNC_LEAVE_API(ret_value) @@ -455,7 +432,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_splitter_flush + * Function: H5FD__splitter_flush * * Purpose: Flushes all data to disk for both channels. * @@ -463,32 +440,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_flush"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Public API for dxpl "context" */ - if (H5FDflush(file->rw_file, dxpl_id, closing) < 0) { + if(H5FDflush(file->rw_file, dxpl_id, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush R/W file") - } - if (H5FDflush(file->wo_file, dxpl_id, closing) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_flush", - H5E_VFL, H5E_CANTFLUSH, FAIL, - "unable to flush W/O file") - } + if(H5FDflush(file->wo_file, dxpl_id, closing) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_flush() */ +} /* end H5FD__splitter_flush() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_read + * Function: H5FD__splitter_read * * Purpose: Reads SIZE bytes of data from the R/W channel, beginning at * address ADDR into buffer BUF according to data transfer @@ -502,45 +475,37 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_read( - H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, - size_t size, - void *buf /*out*/) +H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_read"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(file && file->pub.cls); HDassert(buf); /* Check for overflow conditions */ - if (!H5F_addr_defined(addr)) { + if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %llu", (unsigned long long)addr) - } - if (REGION_OVERFLOW(addr, size)) { + if(REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu", (unsigned long long)addr) - } /* Only read from R/W channel */ /* Public API for dxpl "context" */ - if (H5FDread(file->rw_file, type, dxpl_id, addr, size, buf) < 0) { + if(H5FDread(file->rw_file, type, dxpl_id, addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "Reading from R/W channel failed") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_read() */ +} /* end H5FD__splitter_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_write + * Function: H5FD__splitter_write * * Purpose: Writes SIZE bytes of data to R/W and W/O channels, beginning * at address ADDR from buffer BUF according to data transfer @@ -550,38 +515,34 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) +H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, + haddr_t addr, size_t size, const void *buf) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; H5P_genplist_t *plist_ptr = NULL; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_write"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id))) { + if(NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - } /* Write to each file */ /* Public API for dxpl "context" */ - if (H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0) { + if(H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "R/W file write failed") - } - if (H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_write", - H5E_VFL, H5E_WRITEERROR, FAIL, - "unable to write W/O file") - } + if(H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_write() */ +} /* end H5FD__splitter_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_fapl_get + * Function: H5FD__splitter_fapl_get * * Purpose: Returns a file access property list which indicates how the * specified file is being accessed. The return list could be @@ -593,23 +554,23 @@ done: *------------------------------------------------------------------------- */ static void * -H5FD_splitter_fapl_get(H5FD_t *_file) +H5FD__splitter_fapl_get(H5FD_t *_file) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_get"); + H5FD_SPLITTER_LOG_CALL(FUNC); - ret_value = H5FD_splitter_fapl_copy(&(file->fa)); + ret_value = H5FD__splitter_fapl_copy(&(file->fa)); FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD__splitter_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_fapl_copy + * Function: H5FD__splitter_fapl_copy * * Purpose: Copies the file access properties. * @@ -618,56 +579,45 @@ H5FD_splitter_fapl_get(H5FD_t *_file) *------------------------------------------------------------------------- */ static void * -H5FD_splitter_fapl_copy(const void *_old_fa) +H5FD__splitter_fapl_copy(const void *_old_fa) { const H5FD_splitter_fapl_t *old_fa_ptr = (const H5FD_splitter_fapl_t *)_old_fa; H5FD_splitter_fapl_t *new_fa_ptr = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_copy"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(old_fa_ptr); - new_fa_ptr = (H5FD_splitter_fapl_t *)H5MM_calloc(sizeof(H5FD_splitter_fapl_t)); - if (NULL == new_fa_ptr) { + new_fa_ptr = H5FL_CALLOC(H5FD_splitter_fapl_t); + if(NULL == new_fa_ptr) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL") - } - if (HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t)) == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to shallow-copy info") - } - if (HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX) == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to copy write-only channel file path") - } - if (HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX) == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to copy log file path") - } + HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t)); + HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0) { + if(H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy R/W FAPL"); - } - if (H5FD__copy_plist(old_fa_ptr->wo_fapl_id, &(new_fa_ptr->wo_fapl_id)) < 0) { + if(H5FD__copy_plist(old_fa_ptr->wo_fapl_id, &(new_fa_ptr->wo_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy W/O FAPL"); - } ret_value = (void *)new_fa_ptr; done: - if (NULL == ret_value) { - if (new_fa_ptr) { - H5MM_free(new_fa_ptr); - } - } + if(NULL == ret_value) + if(new_fa_ptr) + new_fa_ptr = H5FL_FREE(H5FD_splitter_fapl_t, new_fa_ptr); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_fapl_copy() */ +} /* end H5FD__splitter_fapl_copy() */ /*-------------------------------------------------------------------------- - * Function: H5FD_splitter_fapl_free + * Function: H5FD__splitter_fapl_free * * Purpose: Releases the file access lists * @@ -675,35 +625,33 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_fapl_free(void *_fapl) +H5FD__splitter_fapl_free(void *_fapl) { H5FD_splitter_fapl_t *fapl = (H5FD_splitter_fapl_t*)_fapl; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_free"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(fapl); - if (H5I_dec_ref(fapl->rw_fapl_id) < 0) { + if(H5I_dec_ref(fapl->rw_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close R/W FAPL ID") - } - if (H5I_dec_ref(fapl->wo_fapl_id) < 0) { + if(H5I_dec_ref(fapl->wo_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close W/O FAPL ID") - } /* Free the property list */ - H5MM_free(fapl); + fapl = H5FL_FREE(H5FD_splitter_fapl_t, fapl); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_fapl_free() */ +} /* end H5FD__splitter_fapl_free() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_open + * Function: H5FD__splitter_open * * Purpose: Create and/or opens a file as an HDF5 file. * @@ -714,123 +662,99 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, haddr_t maxaddr) +H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, haddr_t maxaddr) { H5FD_splitter_t *file_ptr = NULL; /* Splitter VFD info */ const H5FD_splitter_fapl_t *fapl_ptr = NULL; /* Driver-specific property list */ H5P_genplist_t *plist_ptr = NULL; H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_open"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ - if (!name || !*name) { + if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") - } - if (0 == maxaddr || HADDR_UNDEF == maxaddr) { + if(0 == maxaddr || HADDR_UNDEF == maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") - } - if (ADDR_OVERFLOW(maxaddr)) { + if(ADDR_OVERFLOW(maxaddr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr") - } - if ( (H5P_FILE_ACCESS_DEFAULT == splitter_fapl_id) || - (H5FD_SPLITTER != H5Pget_driver(splitter_fapl_id)) ) - { + if((H5P_FILE_ACCESS_DEFAULT == splitter_fapl_id) || + (H5FD_SPLITTER != H5Pget_driver(splitter_fapl_id)) ) /* presupposes that H5P_FILE_ACCESS_DEFAULT is not a splitter */ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "driver is not splitter") - } file_ptr = (H5FD_splitter_t *)H5FL_CALLOC(H5FD_splitter_t); - if (NULL == file_ptr) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") - } + if(NULL == file_ptr) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct") file_ptr->fa.rw_fapl_id = H5I_INVALID_HID; file_ptr->fa.wo_fapl_id = H5I_INVALID_HID; /* Get the driver-specific file access properties */ plist_ptr = (H5P_genplist_t *)H5I_object(splitter_fapl_id); - if (NULL == plist_ptr) { + if(NULL == plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - } fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr); - if (NULL == fapl_ptr) { + if(NULL == fapl_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get VFL driver info") - } /* Copy simpler info */ - if (HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX) == NULL) { - HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "unable to copy write-only path") - } - if (HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX) == NULL) { - HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "unable to copy logfile path") - } + HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); file_ptr->fa.ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O channel FAPLs. */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(file_ptr->fa.rw_fapl_id)) < 0) { + if(H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(file_ptr->fa.rw_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy R/W FAPL"); - } - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(file_ptr->fa.wo_fapl_id)) < 0) { + if(H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(file_ptr->fa.wo_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy W/O FAPL"); - } /* Prepare log file if necessary. * If application wants to ignore the errors from W/O channel and * provided a name for the log file, then open it */ - if (!file_ptr->logfp) { - if (file_ptr->fa.log_file_path[0] != '\0') { + if(!file_ptr->logfp) { + if(file_ptr->fa.log_file_path[0] != '\0') { file_ptr->logfp = HDfopen(file_ptr->fa.log_file_path, "w"); - if (file_ptr->logfp == NULL) { + if(file_ptr->logfp == NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open log file") - } } /* end if logfile path given */ } /* end if logfile pointer/handle does not exist */ file_ptr->rw_file = H5FD_open(name, flags, fapl_ptr->rw_fapl_id, HADDR_UNDEF); - if (!file_ptr->rw_file) { + if(!file_ptr->rw_file) HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open R/W file") - } file_ptr->wo_file = H5FD_open(fapl_ptr->wo_path, flags, fapl_ptr->wo_fapl_id, HADDR_UNDEF); - if (!file_ptr->wo_file) { - H5FD_SPLITTER_WO_ERROR(file_ptr, "H5FD_splitter_open", - H5E_VFL, H5E_CANTOPENFILE, NULL, - "unable to open W/O file") - } + if(!file_ptr->wo_file) + H5FD_SPLITTER_WO_ERROR(file_ptr, FUNC, H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open W/O file") ret_value = (H5FD_t*)file_ptr; done: - if (NULL == ret_value) { - if (file_ptr) { - if (H5I_INVALID_HID != file_ptr->fa.rw_fapl_id) { + if(NULL == ret_value) { + if(file_ptr) { + if(H5I_INVALID_HID != file_ptr->fa.rw_fapl_id) H5I_dec_ref(file_ptr->fa.rw_fapl_id); - } - if (H5I_INVALID_HID != file_ptr->fa.wo_fapl_id) { + if(H5I_INVALID_HID != file_ptr->fa.wo_fapl_id) H5I_dec_ref(file_ptr->fa.wo_fapl_id); - } - if (file_ptr->rw_file) { + if(file_ptr->rw_file) H5FD_close(file_ptr->rw_file); - } - if (file_ptr->wo_file) { + if(file_ptr->wo_file) H5FD_close(file_ptr->wo_file); - } - if (file_ptr->logfp) { + if(file_ptr->logfp) HDfclose(file_ptr->logfp); - } H5FL_FREE(H5FD_splitter_t, file_ptr); } } /* end if error */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_open() */ +} /* end H5FD__splitter_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_close + * Function: H5FD__splitter_close * * Purpose: Closes files on both read-write and write-only channels. * @@ -839,39 +763,31 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_close(H5FD_t *_file) +H5FD__splitter_close(H5FD_t *_file) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_close"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); - if (H5I_dec_ref(file->fa.rw_fapl_id) < 0) { + if(H5I_dec_ref(file->fa.rw_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close R/W FAPL") - } - if (H5I_dec_ref(file->fa.wo_fapl_id) < 0) { + if(H5I_dec_ref(file->fa.wo_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close W/O FAPL") - } - if (file->rw_file) { - if (H5FD_close(file->rw_file) == FAIL) { + if(file->rw_file) + if(H5FD_close(file->rw_file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close R/W file") - } - } - if (file->wo_file) { - if (H5FD_close(file->wo_file) == FAIL) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_close", - H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to close W/O file") - } - } + if(file->wo_file) + if(H5FD_close(file->wo_file) == FAIL) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close W/O file") - if (file->logfp) { + if(file->logfp) { HDfclose(file->logfp); file->logfp = NULL; } @@ -882,11 +798,11 @@ H5FD_splitter_close(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_close() */ +} /* end H5FD__splitter_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_get_eoa + * Function: H5FD__splitter_get_eoa * * Purpose: Returns the end-of-address marker for the file. The EOA * marker is the first address past the last byte allocated in @@ -898,30 +814,29 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file; haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_eoa"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if ((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF) { + if((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, HADDR_UNDEF, "unable to get eoa") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_get_eoa */ +} /* end H5FD__splitter_get_eoa */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_set_eoa + * Function: H5FD__splitter_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -931,37 +846,33 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) +H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_set_eoa";) + H5FD_SPLITTER_LOG_CALL(FUNC) /* Sanity check */ HDassert(file); HDassert(file->rw_file); HDassert(file->wo_file); - if (H5FD_set_eoa(file->rw_file, type, addr) < 0) { + if(H5FD_set_eoa(file->rw_file, type, addr) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "H5FDset_eoa failed for R/W file") - } - if (H5FD_set_eoa(file->wo_file, type, addr) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_set_eoa", - H5E_VFL, H5E_CANTSET, FAIL, - "unable to set EOA for W/O file") - } + if(H5FD_set_eoa(file->wo_file, type, addr) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTSET, FAIL, "unable to set EOA for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_set_eoa() */ +} /* end H5FD__splitter_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_get_eof + * Function: H5FD__splitter_get_eof * * Purpose: Returns the end-of-address marker for the file. The EOA * marker is the first address past the last byte allocated in @@ -973,30 +884,29 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_eof"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if (HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type))) { + if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "unable to get eof") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_get_eof */ +} /* end H5FD__splitter_get_eof */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_truncate + * Function: H5FD__splitter_truncate * * Purpose: Notify driver to truncate the file back to the allocated size. * @@ -1004,36 +914,32 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_truncate"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(file); HDassert(file->rw_file); HDassert(file->wo_file); - if (H5FDtruncate(file->rw_file, dxpl_id, closing) < 0) { + if(H5FDtruncate(file->rw_file, dxpl_id, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate R/W file") - } - if (H5FDtruncate(file->wo_file, dxpl_id, closing) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_truncate", - H5E_VFL, H5E_CANTUPDATE, FAIL, - "unable to truncate W/O file") - } + if(H5FDtruncate(file->wo_file, dxpl_id, closing) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_truncate */ +} /* end H5FD__splitter_truncate */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_sb_size + * Function: H5FD__splitter_sb_size * * Purpose: Obtains the number of bytes required to store the driver file * access data in the HDF5 superblock. @@ -1047,29 +953,28 @@ done: *------------------------------------------------------------------------- */ static hsize_t -H5FD_splitter_sb_size(H5FD_t *_file) +H5FD__splitter_sb_size(H5FD_t *_file) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; hsize_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_size"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if (file->rw_file) { + if(file->rw_file) ret_value = H5FD_sb_size(file->rw_file); - } FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_sb_size */ +} /* end H5FD__splitter_sb_size */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_sb_encode + * Function: H5FD__splitter_sb_encode * * Purpose: Encode driver-specific data into the output arguments. * @@ -1077,30 +982,29 @@ H5FD_splitter_sb_size(H5FD_t *_file) *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) +H5FD__splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_encode"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if (file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0) { + if(file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTENCODE, FAIL, "unable to encode the superblock in R/W file") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_sb_encode */ +} /* end H5FD__splitter_sb_encode */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_sb_decode + * Function: H5FD__splitter_sb_decode * * Purpose: Decodes the driver information block. * @@ -1110,30 +1014,29 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) +H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_decode"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if (H5FD_sb_load(file->rw_file, name, buf) < 0) { + if(H5FD_sb_load(file->rw_file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, FAIL, "unable to decode the superblock in R/W file") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_sb_decode */ +} /* end H5FD__splitter_sb_decode */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_cmp + * Function: H5FD__splitter_cmp * * Purpose: Compare the keys of two files. * @@ -1142,15 +1045,15 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_splitter_t *f1 = (const H5FD_splitter_t *)_f1; const H5FD_splitter_t *f2 = (const H5FD_splitter_t *)_f2; herr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_cmp"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(f1); HDassert(f2); @@ -1158,11 +1061,11 @@ H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) ret_value = H5FD_cmp(f1->rw_file, f2->rw_file); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_cmp */ +} /* end H5FD__splitter_cmp */ /*-------------------------------------------------------------------------- - * Function: H5FD_splitter_get_handle + * Function: H5FD__splitter_get_handle * * Purpose: Returns a pointer to the file handle of low-level virtual * file driver. @@ -1171,17 +1074,15 @@ H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) *-------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_get_handle( - H5FD_t *_file, - hid_t H5_ATTR_UNUSED fapl, - void **file_handle) +H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, + void **file_handle) { H5FD_splitter_t *file = (H5FD_splitter_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_handle"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); @@ -1189,18 +1090,16 @@ H5FD_splitter_get_handle( HDassert(file_handle); /* Only do for R/W channel */ - if (H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0) - { + if(H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to get handle of R/W file") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_get_handle */ +} /* end H5FD__splitter_get_handle */ /*-------------------------------------------------------------------------- - * Function: H5FD_splitter_lock + * Function: H5FD__splitter_lock * * Purpose: Sets a file lock. * @@ -1208,37 +1107,32 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_lock(H5FD_t *_file, hbool_t rw) +H5FD__splitter_lock(H5FD_t *_file, hbool_t rw) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_lock"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(file); HDassert(file->rw_file); /* Place the lock on each file */ - if (H5FD_lock(file->rw_file, rw) < 0) { + if(H5FD_lock(file->rw_file, rw) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock R/W file") - } - if (file->wo_file != NULL) { - if (H5FD_lock(file->wo_file, rw) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock", - H5E_VFL, H5E_CANTLOCK, FAIL, - "unable to lock W/O file") - } - } + if(file->wo_file != NULL) + if(H5FD_lock(file->wo_file, rw) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_lock */ +} /* end H5FD__splitter_lock */ /*-------------------------------------------------------------------------- - * Function: H5FD_splitter_unlock + * Function: H5FD__splitter_unlock * * Purpose: Removes a file lock. * @@ -1246,37 +1140,33 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_unlock(H5FD_t *_file) +H5FD__splitter_unlock(H5FD_t *_file) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_unlock"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(file->rw_file); /* Remove the lock on each file */ - if (H5FD_unlock(file->rw_file) < 0) { + if(H5FD_unlock(file->rw_file) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock R/W file") - } - if (file->wo_file != NULL) { - if (H5FD_unlock(file->wo_file) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, - "unable to unlock W/O file") - } - } + if(file->wo_file != NULL) + if(H5FD_unlock(file->wo_file) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_unlock */ +} /* end H5FD__splitter_unlock */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_query + * Function: H5FD__splitter_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -1285,40 +1175,37 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_query(const H5FD_t *_file, unsigned long *flags /* out */) +H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */) { const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_query"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (file) { + if(file) { HDassert(file); HDassert(file->rw_file); - if (H5FDquery(file->rw_file, flags) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, - "unable to query R/W file"); - } + if(H5FDquery(file->rw_file, flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to query R/W file"); } else { /* There is no file. Because this is a pure passthrough VFD, * it has no features of its own. */ - if (flags) { + if(flags) *flags = 0; - } } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_query() */ +} /* end H5FD__splitter_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_alloc + * Function: H5FD__splitter_alloc * * Purpose: Allocate file memory. * @@ -1326,37 +1213,33 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) +H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_alloc"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(file->rw_file); /* Allocate memory for each file, only return the return value for R/W file. */ - if ((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF) { + if((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate for R/W file") - } - if (H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_alloc", - H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, - "unable to alloc for W/O file") - } + if(H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to alloc for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_alloc() */ +} /* end H5FD__splitter_alloc() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_get_type_map + * Function: H5FD__splitter_get_type_map * * Purpose: Retrieve the memory type mapping for this file * @@ -1364,31 +1247,30 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) +H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) { const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_type_map"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(file->rw_file); /* Retrieve memory type mapping for R/W channel only */ - if (H5FD_get_fs_type_map(file->rw_file, type_map) < 0) { + if(H5FD_get_fs_type_map(file->rw_file, type_map) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to allocate for R/W file") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_get_type_map() */ +} /* end H5FD__splitter_get_type_map() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_free + * Function: H5FD__splitter_free * * Purpose: Free the resources for the splitter VFD. * @@ -1396,32 +1278,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) +H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_free"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(file->rw_file); - if (H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0) { + if(H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free for R/W file") - } - if (H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_free", - H5E_VFL, H5E_CANTINIT, FAIL, - "unable to free for W/O file") - } + if(H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, FAIL, "unable to free for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_free() */ +} /* end H5FD__splitter_free() */ /*------------------------------------------------------------------------- @@ -1435,33 +1313,29 @@ done: static herr_t H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char *msg) { - size_t size = 0; - char *s = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD__splitter_log_error"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(atfunc && *atfunc); HDassert(msg && *msg); - if (file->logfp != NULL) { - size = strlen(atfunc) + strlen(msg) + 3; /* ':', ' ', '\n' */ - s = (char *)malloc(sizeof(char) * (size+1)); - if (NULL == s) { + if(file->logfp != NULL) { + size_t size; + char *s; + + size = HDstrlen(atfunc) + HDstrlen(msg) + 3; /* ':', ' ', '\n' */ + s = (char *)HDmalloc(sizeof(char) * (size + 1)); + if(NULL == s) ret_value = FAIL; - } - else - if (size < (size_t)HDsnprintf(s, size+1, "%s: %s\n", atfunc, msg)) { + else if(size < (size_t)HDsnprintf(s, size+1, "%s: %s\n", atfunc, msg)) ret_value = FAIL; - } - else - if (size != HDfwrite(s, 1, size, file->logfp)) { + else if(size != HDfwrite(s, 1, size, file->logfp)) ret_value = FAIL; - } HDfree(s); } diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index d29a1b4..1d401c2 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 22, 1997 * * Purpose: The C STDIO virtual file driver which only uses calls from stdio.h. diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h index f99aacf..9a5bc78 100644 --- a/src/H5FDstdio.h +++ b/src/H5FDstdio.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the sec2 driver. diff --git a/src/H5FDtest.c b/src/H5FDtest.c index 2eb176d..7afc1bf 100644 --- a/src/H5FDtest.c +++ b/src/H5FDtest.c @@ -110,6 +110,5 @@ H5FD__supports_swmr_test(const char *vfd_name) ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2"); FUNC_LEAVE_NOAPI(ret_value) - } /* end H5FD__supports_swmr_test() */ diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h index 5cf68a1..5e23712 100644 --- a/src/H5FDwindows.h +++ b/src/H5FDwindows.h @@ -12,8 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Scott Wegner - * Based on code by Robb Matzke + * Programmer: Scott Wegner + * Based on code by Robb Matzke * Thursday, May 24 2007 * * Purpose: The public header file for the windows driver. diff --git a/src/H5FL.c b/src/H5FL.c index 66d27fb..e50616a 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, March 23, 2000 * * Purpose: Manage priority queues of free-lists (of blocks of bytes). diff --git a/src/H5FLmodule.h b/src/H5FLmodule.h index 48b8d2b..dbce75c 100644 --- a/src/H5FLmodule.h +++ b/src/H5FLmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 94a51e5..a2c019a 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -15,12 +15,10 @@ * * Created: H5FLprivate.h * Mar 23 2000 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private non-prototype header. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef _H5FLprivate_H diff --git a/src/H5FS.c b/src/H5FS.c index 6d574c0..cb60c0e 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 2, 2006 * * Purpose: Free space tracking functions. @@ -787,9 +787,6 @@ H5FS__dirty(H5FS_t *fspace) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE -#ifdef QAK -HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC); -#endif /* QAK */ /* Sanity check */ HDassert(fspace); @@ -1206,9 +1203,6 @@ void H5FS__assert(const H5FS_t *fspace) { FUNC_ENTER_PACKAGE_NOERR -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace->tot_sect_count); -#endif /* QAK */ /* Checks for section info, if it's available */ if(fspace->sinfo) { @@ -1224,9 +1218,6 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace-> HDassert(fspace->tot_sect_count >= fspace->serial_sect_count); HDassert(fspace->tot_sect_count >= fspace->ghost_sect_count); HDassert(fspace->tot_sect_count == (fspace->serial_sect_count + fspace->ghost_sect_count)); -#ifdef QAK - HDassert(fspace->serial_sect_count > 0 || fspace->ghost_sect_count == 0); -#endif /* QAK */ FUNC_LEAVE_NOAPI_VOID } /* end H5FS__assert() */ diff --git a/src/H5FScache.c b/src/H5FScache.c index c3e3998..ed468b4 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -15,7 +15,7 @@ * * Created: H5FScache.c * May 2 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement file free space metadata cache methods. * @@ -163,7 +163,6 @@ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -235,7 +234,6 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 18 2013 * *------------------------------------------------------------------------- @@ -350,7 +348,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -796,7 +793,6 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@lbl.gov * January 3, 2017 * *------------------------------------------------------------------------- @@ -860,7 +856,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -1032,7 +1027,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_cnt_size = H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ old_tot_sect_count = fspace->tot_sect_count; @@ -1132,7 +1127,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1300,7 +1294,7 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, /* Set up user data for iterator */ udata.sinfo = sinfo; udata.image = ℑ - udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); + udata.sect_cnt_size = H5VM__limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); /* Iterate over all the bins */ for(bin = 0; bin < sinfo->nbins; bin++) diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index c615b68..9708e9e 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -15,7 +15,7 @@ * * Created: H5FSdbg.c * May 9 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Dump debugging information about a free space manager * diff --git a/src/H5FSint.c b/src/H5FSint.c index 6ba5748..926b818 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -15,7 +15,7 @@ * * Created: H5FSint.c * Fall 2012 - * Dana Robinson + * Dana Robinson * * Purpose: Internal routines for free space managers. * diff --git a/src/H5FSmodule.h b/src/H5FSmodule.h index b2869dd..88c663b 100644 --- a/src/H5FSmodule.h +++ b/src/H5FSmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 2c56ab6..0cc328e 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 2, 2006 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index d2e1f90..e02a8e2 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -15,7 +15,7 @@ * * Created: H5FSprivate.h * May 2 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible file free space routines. * diff --git a/src/H5FSsection.c b/src/H5FSsection.c index d783901..269f63c 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 31, 2006 * * Purpose: Free space tracking functions. @@ -144,10 +144,10 @@ HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set non-zero values */ - sinfo->nbins = H5VM_log2_gen(fspace->max_sect_size); + sinfo->nbins = H5VM__log2_gen(fspace->max_sect_size); sinfo->sect_prefix_size = H5FS_SINFO_PREFIX_SIZE(f); sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8; - sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size); + sinfo->sect_len_size = H5VM__limit_enc_size((uint64_t)fspace->max_sect_size); #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size); HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr); @@ -518,12 +518,6 @@ H5FS__sect_serialize_size(H5FS_t *fspace) /* Check arguments. */ HDassert(fspace); -#ifdef QAK -HDfprintf(stderr, "%s: Check 1.0 - fspace->sect_size = %Hu\n", "H5FS__sect_serialize_size", fspace->sect_size); -HDfprintf(stderr, "%s: fspace->serial_sect_count = %Zu\n", "H5FS__sect_serialize_size", fspace->serial_sect_count); -HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", "H5FS__sect_serialize_size", fspace->alloc_sect_size); -HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size", fspace->sinfo->serial_size_count); -#endif /* QAK */ /* Compute the size of the buffer required to serialize all the sections */ if(fspace->serial_sect_count > 0) { @@ -533,11 +527,7 @@ HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_se sect_buf_size = fspace->sinfo->sect_prefix_size; /* Count for each differently sized serializable section */ -#ifdef QAK -HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size", fspace->sinfo->serial_size_count); -HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS__sect_serialize_size", fspace->serial_sect_count); -#endif /* QAK */ - sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_buf_size += fspace->sinfo->serial_size_count * H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); /* Size for each differently sized serializable section */ sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size; @@ -604,10 +594,6 @@ H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, fspace->serial_sect_count++; /* Increment amount of space required to serialize all sections */ -#ifdef QAK -HDfprintf(stderr, "%s: sinfo->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size); -HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); -#endif /* QAK */ fspace->sinfo->serial_size += cls->serial_size; /* Update the free space sections' serialized size */ @@ -664,10 +650,6 @@ H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls) fspace->serial_sect_count--; /* Decrement amount of space required to serialize all sections */ -#ifdef QAK -HDfprintf(stderr, "%s: fspace->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size); -HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); -#endif /* QAK */ fspace->sinfo->serial_size -= cls->serial_size; /* Update the free space sections' serialized size */ @@ -710,9 +692,6 @@ H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node * the bin's skiplist is also a skiplist...) */ sinfo->bins[bin].tot_sect_count--; -#ifdef QAK -HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count); -#endif /* QAK */ /* Check for 'ghost' or 'serializable' section */ if(cls->flags & H5FS_CLS_GHOST_OBJ) { @@ -798,7 +777,7 @@ H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(cls); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM_log2_gen(sect->size); + bin = H5VM__log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?") @@ -853,9 +832,6 @@ H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, if(!(cls->flags & H5FS_CLS_SEPAR_OBJ)) { H5FS_section_info_t *tmp_sect_node; /* Temporary section node */ -#ifdef QAK -HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); -#endif /* QAK */ tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, §->addr); if(tmp_sect_node == NULL || tmp_sect_node != sect) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list") @@ -866,9 +842,6 @@ HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't increase free space section size on disk") /* Decrement amount of free space managed */ -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ fspace->tot_space -= sect->size; done: @@ -982,9 +955,6 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC -#ifdef QAK -HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, sect->addr); -#endif /* QAK */ /* Check arguments. */ HDassert(sinfo); @@ -993,16 +963,15 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s HDassert(sect->size); /* Determine correct bin which holds items of the section's size */ - bin = H5VM_log2_gen(sect->size); + bin = H5VM__log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) { if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes") } /* end if */ - else { + else /* Check for node list of the correct size already */ fspace_node = (H5FS_node_t *)H5SL_search(sinfo->bins[bin].bin_list, §->size); - } /* end else */ /* Check if we need to create a new skip list for nodes of this size */ if(fspace_node == NULL) { @@ -1030,9 +999,6 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s /* (Different from the # of items in the bin's skiplist, since each node on * the bin's skiplist is also a skiplist...) */ -#ifdef QAK -HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count); -#endif /* QAK */ sinfo->bins[bin].tot_sect_count++; if(cls->flags & H5FS_CLS_GHOST_OBJ) { sinfo->bins[bin].ghost_sect_count++; @@ -1095,9 +1061,6 @@ H5FS__sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, /* Add section to the address-ordered list of sections, if allowed */ if(!(cls->flags & H5FS_CLS_SEPAR_OBJ)) { -#ifdef QAK -HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); -#endif /* QAK */ if(fspace->sinfo->merge_list == NULL) if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for merging free space sections") @@ -1146,21 +1109,12 @@ H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) cls = &fspace->sect_cls[sect->type]; /* Add section to size tracked data structures */ -#ifdef QAK -HDfprintf(stderr, "%s: Check 1.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ if(H5FS__sect_link_size(fspace->sinfo, cls, sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to size tracking data structures") -#ifdef QAK -HDfprintf(stderr, "%s: Check 2.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ /* Update rest of free space manager data structures for section addition */ if(H5FS__sect_link_rest(fspace, cls, sect, flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to non-size tracking data structures") -#ifdef QAK -HDfprintf(stderr, "%s: Check 3.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1304,9 +1258,6 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) } while(modified); } /* end if */ HDassert(*sect); -#ifdef QAK -HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size, (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); -#endif /* QAK */ /* Loop until no more shrinking */ do { @@ -1319,10 +1270,6 @@ HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sec if((status = (*sect_cls->can_shrink)(*sect, op_data)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container") if(status > 0) { -#ifdef QAK -HDfprintf(stderr, "%s: Can shrink!\n", FUNC); -#endif /* QAK */ - /* Remove SECT from free-space manager */ /* (only possible to happen on second+ pass through loop) */ if(remove_sect) { @@ -1365,18 +1312,7 @@ HDfprintf(stderr, "%s: Can shrink!\n", FUNC); if(remove_sect && (*sect != NULL)) *sect = NULL; -#ifdef QAK -HDfprintf(stderr, "%s: Done shrinking\n", FUNC); -if(*sect) - HDfprintf(stderr, "%s: (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size, (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); -else - HDfprintf(stderr, "%s: *sect = %p\n", FUNC, *sect); -#endif /* QAK */ - done: -#ifdef QAK -HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); -#endif /* QAK */ FUNC_LEAVE_NOAPI(ret_value) } /* H5FS__sect_merge() */ @@ -1704,12 +1640,8 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node HDassert(node); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM_log2_gen(request); + bin = H5VM__log2_gen(request); HDassert(bin < fspace->sinfo->nbins); -#ifdef QAK -HDfprintf(stderr, "%s: fspace->sinfo->nbins = %u\n", FUNC, fspace->sinfo->nbins); -HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); -#endif /* QAK */ alignment = fspace->alignment; if(!((alignment > 1) && (request >= fspace->align_thres))) alignment = 0; /* no alignment */ @@ -1841,10 +1773,6 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t ** FUNC_ENTER_NOAPI(FAIL) -#ifdef QAK -HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request); -#endif /* QAK */ - /* Check arguments. */ HDassert(fspace); HDassert(fspace->nclasses); @@ -1852,11 +1780,6 @@ HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request); HDassert(node); /* Check for any sections on free space list */ -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count); -HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", FUNC, fspace->serial_sect_count); -HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_sect_count); -#endif /* QAK */ if(fspace->tot_sect_count > 0) { /* Get a pointer to the section info */ if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) @@ -1871,9 +1794,6 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se if(ret_value > 0) { /* Note that we've modified the section info */ sinfo_modified = TRUE; -#ifdef QAK -HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = %u\n", FUNC, (*node)->size, (*node)->addr, (*node)->type); -#endif /* QAK */ } /* end if */ } /* end if */ @@ -1890,7 +1810,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FS_iterate_sect_cb + * Function: H5FS__iterate_sect_cb * * Purpose: Skip list iterator callback to iterate over free space sections * of a particular size @@ -1903,13 +1823,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) +H5FS__iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { H5FS_section_info_t *sect_info = (H5FS_section_info_t *)_item; /* Free space section to work on */ H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect_info); @@ -1922,11 +1842,11 @@ H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_iterate_sect_cb() */ +} /* H5FS__iterate_sect_cb() */ /*------------------------------------------------------------------------- - * Function: H5FS_iterate_node_cb + * Function: H5FS__iterate_node_cb * * Purpose: Skip list iterator callback to iterate over free space sections * in a bin @@ -1939,13 +1859,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) +H5FS__iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { H5FS_node_t *fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */ H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace_node); @@ -1954,12 +1874,12 @@ H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) /* Iterate through all the sections of this size */ HDassert(fspace_node->sect_list); - if(H5SL_iterate(fspace_node->sect_list, H5FS_iterate_sect_cb, udata) < 0) + if(H5SL_iterate(fspace_node->sect_list, H5FS__iterate_sect_cb, udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_iterate_node_cb() */ +} /* H5FS__iterate_node_cb() */ /*------------------------------------------------------------------------- @@ -1987,10 +1907,6 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data) HDassert(fspace); HDassert(op); -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count); -#endif /* QAK */ - /* Set up user data for iterator */ udata.fspace = fspace; udata.op = op; @@ -2006,14 +1922,11 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_c sinfo_valid = TRUE; /* Iterate over all the bins */ -#ifdef QAK -HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC); -#endif /* QAK */ for(bin = 0; bin < fspace->sinfo->nbins; bin++) { /* Check if there are any sections in this bin */ if(fspace->sinfo->bins[bin].bin_list) { /* Iterate over list of section size nodes for bin */ - if(H5SL_iterate(fspace->sinfo->bins[bin].bin_list, H5FS_iterate_node_cb, &udata) < 0) + if(H5SL_iterate(fspace->sinfo->bins[bin].bin_list, H5FS__iterate_node_cb, &udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes") } /* end if */ } /* end for */ @@ -2098,10 +2011,6 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, old_class = sect->type; old_cls = &fspace->sect_cls[sect->type]; new_cls = &fspace->sect_cls[new_class]; -#ifdef QAK -HDfprintf(stderr, "%s: old_cls->flags = %x\n", FUNC, old_cls->flags); -HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags); -#endif /* QAK */ /* Check if the section's class change will affect the # of serializable or ghost sections */ if((old_cls->flags & H5FS_CLS_GHOST_OBJ) != (new_cls->flags & H5FS_CLS_GHOST_OBJ)) { @@ -2114,15 +2023,12 @@ HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags); to_ghost = FALSE; else to_ghost = TRUE; -#ifdef QAK -HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost); -#endif /* QAK */ /* Sanity check */ HDassert(fspace->sinfo->bins); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM_log2_gen(sect->size); + bin = H5VM__log2_gen(sect->size); HDassert(bin < fspace->sinfo->nbins); HDassert(fspace->sinfo->bins[bin].bin_list); @@ -2180,15 +2086,9 @@ HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost); to_mergable = TRUE; else to_mergable = FALSE; -#ifdef QAK -HDfprintf(stderr, "%s: to_mergable = %u\n", FUNC, to_mergable); -#endif /* QAK */ /* Add or remove section from merge list, as appropriate */ if(to_mergable) { -#ifdef QAK -HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); -#endif /* QAK */ if(fspace->sinfo->merge_list == NULL) if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for merging free space sections") @@ -2198,9 +2098,6 @@ HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUN else { H5FS_section_info_t *tmp_sect_node; /* Temporary section node */ -#ifdef QAK -HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); -#endif /* QAK */ tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, §->addr); if(tmp_sect_node == NULL || tmp_sect_node != sect) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list") @@ -2246,9 +2143,6 @@ H5FS__sect_assert(const H5FS_t *fspace) hsize_t separate_obj; /* The number of separate objects managed */ FUNC_ENTER_PACKAGE_NOERR -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fspace->tot_sect_count); -#endif /* QAK */ /* Initialize state */ separate_obj = 0; @@ -2305,9 +2199,6 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fsp /* Get section node & it's class */ sect = (H5FS_section_info_t *)H5SL_item(curr_sect_node); cls = &fspace->sect_cls[sect->type]; -#ifdef QAK -HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H5FS__sect_assert", sect->size, sect->addr, sect->type); -#endif /* QAK */ /* Sanity check section */ HDassert(H5F_addr_defined(sect->addr)); diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 74a170b..5ad7634 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -15,7 +15,7 @@ * * Created: H5Faccum.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File metadata "accumulator" routines. (Used to * cache small metadata I/Os and group them into a @@ -105,7 +105,6 @@ H5FL_BLK_DEFINE_STATIC(meta_accum); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -154,7 +153,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(new_size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -274,7 +273,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 11 2009 * *------------------------------------------------------------------------- @@ -298,7 +296,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)((size + accum->size) - 1))); + new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)((size + accum->size) - 1))); /* Check for accumulator getting too big */ if(new_size > H5F_ACCUM_MAX_SIZE) { @@ -413,7 +411,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -612,7 +609,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -656,7 +653,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t clear_size; /* Size of memory that needs clearing */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); /* Grow the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) @@ -704,7 +701,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) @@ -841,7 +838,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -1007,7 +1003,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -1050,7 +1045,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index 26452b6..2b368d5 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 19, 2011 * * Purpose: Each file has a small cache of global heap collections called diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index 535b43d..09f6829 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: File object debugging functions. @@ -39,7 +39,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 1 1997 * *------------------------------------------------------------------------- diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index a047161..76a0991 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Fdeprec.c * October 1 2009 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5F interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 77d29f5..c9a3a00 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -15,7 +15,7 @@ * * Created: H5Defc.c * December 13, 2010 - * Neil Fortner + * Neil Fortner * * Purpose: External file caching routines - implements a * cache of external files to minimize the number of diff --git a/src/H5Ffake.c b/src/H5Ffake.c index 67bd180..36fea5b 100644 --- a/src/H5Ffake.c +++ b/src/H5Ffake.c @@ -34,7 +34,6 @@ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 2, 2006 * *------------------------------------------------------------------------- @@ -79,7 +78,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 2, 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Fint.c b/src/H5Fint.c index 0bda894..f206199 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1854,7 +1854,7 @@ H5F__post_open(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F__flush() */ +} /* end H5F__post_open() */ /*------------------------------------------------------------------------- diff --git a/src/H5Fio.c b/src/H5Fio.c index 34dd0d6..7a901aa 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -15,7 +15,7 @@ * * Created: H5Fio.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File I/O routines. * @@ -86,7 +86,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- @@ -130,7 +129,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- @@ -175,7 +173,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- @@ -220,7 +217,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index 0481512..fb362fc 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 5e6b899..9d32fa5 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -627,7 +627,7 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) /*------------------------------------------------------------------------- - * Function: H5F_flush_mounts_recurse + * Function: H5F__flush_mounts_recurse * * Purpose: Flush a mount hierarchy, recursively * @@ -639,20 +639,20 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) *------------------------------------------------------------------------- */ static herr_t -H5F_flush_mounts_recurse(H5F_t *f) +H5F__flush_mounts_recurse(H5F_t *f) { unsigned nerrors = 0; /* Errors from recursive flushes */ unsigned u; /* Index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); /* Flush all child files, not stopping for errors */ for(u = 0; u < f->shared->mtab.nmounts; u++) - if(H5F_flush_mounts_recurse(f->shared->mtab.child[u].file) < 0) + if(H5F__flush_mounts_recurse(f->shared->mtab.child[u].file) < 0) nerrors++; /* Call the "real" flush routine, for this file */ @@ -665,7 +665,7 @@ H5F_flush_mounts_recurse(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_flush_mounts_recurse() */ +} /* end H5F__flush_mounts_recurse() */ /*------------------------------------------------------------------------- @@ -695,7 +695,7 @@ H5F_flush_mounts(H5F_t *f) f = f->parent; /* Flush the mounted file hierarchy */ - if(H5F_flush_mounts_recurse(f) < 0) + if(H5F__flush_mounts_recurse(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") done: diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 0c46f59..8189821 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -15,7 +15,7 @@ * * Created: H5Fmpi.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: MPI-related routines. * diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 46185ff..fe58fdb 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 28, 2000 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index c5d4c89..1cfd103 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -116,16 +116,16 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM__limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } # define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index e1b11c8..565f492 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -15,7 +15,7 @@ * * Created: H5Fquery.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File structure query routines. * @@ -763,7 +763,6 @@ H5F_sieve_buf_size(const H5F_t *f) * Failure: (should not happen) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jul 8 2005 * *------------------------------------------------------------------------- diff --git a/src/H5Fspace.c b/src/H5Fspace.c index 6baf163..3d969f9 100644 --- a/src/H5Fspace.c +++ b/src/H5Fspace.c @@ -15,7 +15,7 @@ * * Created: H5Fspace.c * Dec 30 2013 - * Quincey Koziol + * Quincey Koziol * * Purpose: Space allocation routines for the file. * diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 9fd2831..cf3f72a 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -318,7 +318,6 @@ done: * Failure: FAIL * * Programmer: Bill Wendling - * wendling@ncsa.uiuc.edu * Sept 12, 2003 * *------------------------------------------------------------------------- @@ -896,8 +895,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") } else { - if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) - { + if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) { #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ f->shared->sblock = NULL; #endif /* JRM */ @@ -1067,7 +1065,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sept 15, 2003 * *------------------------------------------------------------------------- diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 119548c..329bf21 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -15,7 +15,7 @@ * * Created: H5Fsuper_cache.c * Aug 15 2009 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement file superblock & driver info metadata cache methods. * @@ -309,7 +309,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -338,7 +337,6 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * November 17, 2016 * *------------------------------------------------------------------------- @@ -428,7 +426,6 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 18 2013 * *------------------------------------------------------------------------- @@ -621,7 +618,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 19, 2013 * *------------------------------------------------------------------------- @@ -654,7 +650,6 @@ H5F__cache_superblock_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 19 2013 * *------------------------------------------------------------------------- @@ -798,7 +793,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20, 2013 * *------------------------------------------------------------------------- @@ -833,7 +827,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20, 2013 * *------------------------------------------------------------------------- @@ -861,7 +854,6 @@ H5F__cache_drvrinfo_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *i * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * November 17, 2016 * *------------------------------------------------------------------------- @@ -905,7 +897,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20 2013 * *------------------------------------------------------------------------- @@ -966,7 +957,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20, 2013 * *------------------------------------------------------------------------- @@ -1000,7 +990,6 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20 2013 * *------------------------------------------------------------------------- @@ -1064,7 +1053,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20, 2013 * *------------------------------------------------------------------------- diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 49a2a22..97c7e3e 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -15,7 +15,7 @@ * * Created: H5Ftest.c * Jan 3 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: File testing routines. * diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 71e0b2d..918e18c 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -15,7 +15,7 @@ * * Created: H5Gbtree2.c * Sep 9 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: v2 B-tree callbacks for indexing fields on links * @@ -75,27 +75,27 @@ typedef struct H5G_fh_ud_cmp_t { /* v2 B-tree function callbacks */ /* v2 B-tree driver callbacks for 'creation order' index */ -static herr_t H5G_dense_btree2_corder_store(void *native, const void *udata); -static herr_t H5G_dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result); -static herr_t H5G_dense_btree2_corder_encode(uint8_t *raw, const void *native, +static herr_t H5G__dense_btree2_corder_store(void *native, const void *udata); +static herr_t H5G__dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result); +static herr_t H5G__dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); -static herr_t H5G_dense_btree2_corder_decode(const uint8_t *raw, void *native, +static herr_t H5G__dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, +static herr_t H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *record, const void *_udata); /* v2 B-tree driver callbacks for 'name' index */ -static herr_t H5G_dense_btree2_name_store(void *native, const void *udata); +static herr_t H5G__dense_btree2_name_store(void *native, const void *udata); static herr_t H5G__dense_btree2_name_compare(const void *rec1, const void *rec2, int *result); -static herr_t H5G_dense_btree2_name_encode(uint8_t *raw, const void *native, +static herr_t H5G__dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); -static herr_t H5G_dense_btree2_name_decode(const uint8_t *raw, void *native, +static herr_t H5G__dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, +static herr_t H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *record, const void *_udata); /* Fractal heap function callbacks */ -static herr_t H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); +static herr_t H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); /*********************/ @@ -108,11 +108,11 @@ const H5B2_class_t H5G_BT2_NAME[1]={{ /* B-tree class information */ sizeof(H5G_dense_bt2_name_rec_t), /* Size of native record */ NULL, /* Create client callback context */ NULL, /* Destroy client callback context */ - H5G_dense_btree2_name_store, /* Record storage callback */ - H5G__dense_btree2_name_compare, /* Record comparison callback */ - H5G_dense_btree2_name_encode, /* Record encoding callback */ - H5G_dense_btree2_name_decode, /* Record decoding callback */ - H5G_dense_btree2_name_debug /* Record debugging callback */ + H5G__dense_btree2_name_store, /* Record storage callback */ + H5G__dense_btree2_name_compare, /* Record comparison callback */ + H5G__dense_btree2_name_encode, /* Record encoding callback */ + H5G__dense_btree2_name_decode, /* Record decoding callback */ + H5G__dense_btree2_name_debug /* Record debugging callback */ }}; /* v2 B-tree class for indexing 'creation order' field of links */ @@ -122,11 +122,11 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ sizeof(H5G_dense_bt2_corder_rec_t), /* Size of native record */ NULL, /* Create client callback context */ NULL, /* Destroy client callback context */ - H5G_dense_btree2_corder_store, /* Record storage callback */ - H5G_dense_btree2_corder_compare, /* Record comparison callback */ - H5G_dense_btree2_corder_encode, /* Record encoding callback */ - H5G_dense_btree2_corder_decode, /* Record decoding callback */ - H5G_dense_btree2_corder_debug /* Record debugging callback */ + H5G__dense_btree2_corder_store, /* Record storage callback */ + H5G__dense_btree2_corder_compare, /* Record comparison callback */ + H5G__dense_btree2_corder_encode, /* Record encoding callback */ + H5G__dense_btree2_corder_decode, /* Record decoding callback */ + H5G__dense_btree2_corder_debug /* Record debugging callback */ }}; /*****************************/ @@ -141,7 +141,7 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ /*------------------------------------------------------------------------- - * Function: H5G_dense_fh_name_cmp + * Function: H5G__dense_fh_name_cmp * * Purpose: Compares the name of a link in a fractal heap to another * name @@ -149,19 +149,18 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) +H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_cmp_t *udata = (H5G_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */ H5O_link_t *lnk; /* Pointer to link created from heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -181,11 +180,11 @@ H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_fh_name_cmp() */ +} /* end H5G__dense_fh_name_cmp() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_store + * Function: H5G__dense_btree2_name_store * * Purpose: Store user information into native record for v2 B-tree * @@ -198,19 +197,19 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_store(void *_nrecord, const void *_udata) +H5G__dense_btree2_name_store(void *_nrecord, const void *_udata) { const H5G_bt2_ud_ins_t *udata = (const H5G_bt2_ud_ins_t *)_udata; H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Copy user information info native record */ nrecord->hash = udata->common.name_hash; H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_store() */ +} /* H5G__dense_btree2_name_store() */ /*------------------------------------------------------------------------- @@ -240,16 +239,6 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int HDassert(bt2_udata); HDassert(bt2_rec); -#ifdef QAK -{ -unsigned u; - -HDfprintf(stderr, "%s: bt2_udata = {'%s', %x}\n", "H5G__dense_btree2_name_compare", bt2_udata->name, (unsigned)bt2_udata->name_hash); -HDfprintf(stderr, "%s: bt2_rec = {%x, ", "H5G__dense_btree2_name_compare", (unsigned)bt2_rec->hash); -for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) - HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); -} -#endif /* QAK */ /* Check hash value */ if(bt2_udata->name_hash < bt2_rec->hash) *result = (-1); @@ -272,7 +261,7 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) fh_udata.cmp = 0; /* Check if the user's link and the B-tree's link have the same name */ - if(H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G_dense_fh_name_cmp, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G__dense_fh_name_cmp, &fh_udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Callback will set comparison value */ @@ -285,7 +274,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_encode + * Function: H5G__dense_btree2_name_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -298,22 +287,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Encode the record's fields */ UINT32ENCODE(raw, nrecord->hash) H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_encode() */ +} /* H5G__dense_btree2_name_encode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_decode + * Function: H5G__dense_btree2_name_decode * * Purpose: Decode raw disk form of record into native form * @@ -326,22 +315,22 @@ H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Decode the record's fields */ UINT32DECODE(raw, nrecord->hash) H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_decode() */ +} /* H5G__dense_btree2_name_decode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_debug + * Function: H5G__dense_btree2_name_debug * * Purpose: Debug native form of record * @@ -354,13 +343,13 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, +H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDfprintf(stream, "%*s%-*s {%x, ", indent, "", fwidth, "Record:", (unsigned)nrecord->hash); @@ -368,11 +357,11 @@ H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_debug() */ +} /* H5G__dense_btree2_name_debug() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_store + * Function: H5G__dense_btree2_corder_store * * Purpose: Store user information into native record for v2 B-tree * @@ -385,23 +374,23 @@ H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata) +H5G__dense_btree2_corder_store(void *_nrecord, const void *_udata) { const H5G_bt2_ud_ins_t *udata = (const H5G_bt2_ud_ins_t *)_udata; H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Copy user information info native record */ nrecord->corder = udata->common.corder; H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_store() */ +} /* H5G__dense_btree2_corder_store() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_compare + * Function: H5G__dense_btree2_corder_compare * * Purpose: Compare two native information records, according to some key * @@ -415,27 +404,17 @@ H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result) +H5G__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result) { const H5G_bt2_ud_common_t *bt2_udata = (const H5G_bt2_ud_common_t *)_bt2_udata; const H5G_dense_bt2_corder_rec_t *bt2_rec = (const H5G_dense_bt2_corder_rec_t *)_bt2_rec; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(bt2_udata); HDassert(bt2_rec); -#ifdef QAK -{ -unsigned u; - -HDfprintf(stderr, "%s: bt2_udata->corder = %Hd\n", "H5G_dense_btree2_corder_compare", (hsize_t)bt2_udata->corder); -HDfprintf(stderr, "%s: bt2_rec = {%Hu, ", "H5G_dense_btree2_corder_compare", (hsize_t)bt2_rec->corder); -for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) - HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); -} -#endif /* QAK */ /* Check creation order value */ if(bt2_udata->corder < bt2_rec->corder) *result = -1; @@ -445,11 +424,11 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) *result = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_compare() */ +} /* H5G__dense_btree2_corder_compare() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_encode + * Function: H5G__dense_btree2_corder_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -462,22 +441,22 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Encode the record's fields */ INT64ENCODE(raw, nrecord->corder) H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_encode() */ +} /* H5G__dense_btree2_corder_encode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_decode + * Function: H5G__dense_btree2_corder_decode * * Purpose: Decode raw disk form of record into native form * @@ -490,22 +469,22 @@ H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Decode the record's fields */ INT64DECODE(raw, nrecord->corder) H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_decode() */ +} /* H5G__dense_btree2_corder_decode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_debug + * Function: H5G__dense_btree2_corder_debug * * Purpose: Debug native form of record * @@ -518,13 +497,13 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, +H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDfprintf(stream, "%*s%-*s {%llu, ", indent, "", fwidth, "Record:", (unsigned long long)nrecord->corder); @@ -532,5 +511,5 @@ H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_debug() */ +} /* H5G__dense_btree2_corder_debug() */ diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 13a33a3..22b0488 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -15,7 +15,7 @@ * * Created: H5Gcache.c * Feb 5 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement group metadata cache methods. * diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 1a76012..d14ec20 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -15,7 +15,7 @@ * * Created: H5Gcompact.c * Sep 5 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for handling compact storage. * @@ -75,7 +75,6 @@ static herr_t H5G__compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 5 2005 * *------------------------------------------------------------------------- @@ -178,7 +177,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -257,7 +255,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_compact_remove_common_cb + * Function: H5G__compact_remove_common_cb * * Purpose: Common callback routine for deleting 'link' message for a * particular name. @@ -265,19 +263,18 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 5 2005 * *------------------------------------------------------------------------- */ static herr_t -H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) +H5G__compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */ H5G_iter_rm_t *udata = (H5G_iter_rm_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(lnk); @@ -295,7 +292,7 @@ H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, voi done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_remove_common_cb() */ +} /* end H5G__compact_remove_common_cb() */ /*------------------------------------------------------------------------- @@ -328,7 +325,7 @@ H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, udata.name = name; /* Iterate over the link messages to delete the right one */ - if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0) + if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message") done: @@ -376,7 +373,7 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, udata.name = ltable.lnks[n].name; /* Iterate over the link messages to delete the right one */ - if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0) + if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message") done: @@ -441,7 +438,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 20 2005 * *------------------------------------------------------------------------- @@ -487,7 +483,6 @@ done: * Return: Non-negative (TRUE/FALSE) on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 20 2005 * *------------------------------------------------------------------------- @@ -533,7 +528,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 6 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Gdense.c b/src/H5Gdense.c index a2ef55c..8545d73 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -15,7 +15,7 @@ * * Created: H5Gdense.c * Sep 9 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for operating on "dense" link storage for a * group in a file. @@ -250,7 +250,6 @@ typedef struct { * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2006 * *------------------------------------------------------------------------- @@ -294,17 +293,11 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) /* Retrieve the heap's address in the file */ if(H5HF_get_heap_addr(fheap, &(linfo->fheap_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get fractal heap address") -#ifdef QAK -HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr); -#endif /* QAK */ /* Retrieve the heap's ID length in the file */ if(H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") HDassert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN); -#ifdef QAK -HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); -#endif /* QAK */ /* Create the name index v2 B-tree */ HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam)); @@ -321,9 +314,6 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); /* Retrieve the v2 B-tree's address in the file */ if(H5B2_get_addr(bt2_name, &(linfo->name_bt2_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index") -#ifdef QAK -HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr); -#endif /* QAK */ /* Check if we should create a creation order index v2 B-tree */ if(linfo->index_corder) { @@ -342,9 +332,6 @@ HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr) /* Retrieve the v2 B-tree's address in the file */ if(H5B2_get_addr(bt2_corder, &(linfo->corder_bt2_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index") -#ifdef QAK -HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_addr); -#endif /* QAK */ } /* end if */ done: @@ -368,7 +355,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- @@ -394,17 +380,10 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) HDassert(f); HDassert(linfo); HDassert(lnk); -#ifdef QAK -HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr); -HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr); -#endif /* QAK */ /* Find out the size of buffer needed for serialized link */ if((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, FALSE, lnk)) == 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size") -#ifdef QAK -HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDstrlen(lnk->name), link_size); -#endif /* QAK */ /* Wrap the local buffer for serialized link */ if(NULL == (wb = H5WB_wrap(link_buf, sizeof(link_buf)))) @@ -472,26 +451,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_cb + * Function: H5G__dense_lookup_cb * * Purpose: Callback when a link is located in an index * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk) +H5G__dense_lookup_cb(const void *_lnk, void *_user_lnk) { const H5O_link_t *lnk = (const H5O_link_t *)_lnk; /* Record from B-tree */ H5O_link_t *user_lnk = (H5O_link_t *)_user_lnk; /* User data from v2 B-tree link lookup */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -505,7 +483,7 @@ H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_cb() */ +} /* end H5G__dense_lookup_cb() */ /*------------------------------------------------------------------------- @@ -516,7 +494,6 @@ done: * Return: Non-negative (TRUE/FALSE) on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- @@ -553,7 +530,7 @@ H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, udata.fheap = fheap; udata.name = name; udata.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0); - udata.found_op = H5G_dense_lookup_cb; /* v2 B-tree comparison callback */ + udata.found_op = H5G__dense_lookup_cb; /* v2 B-tree comparison callback */ udata.found_op_data = lnk; /* Find & copy the named link in the 'name' index */ @@ -572,7 +549,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_by_idx_fh_cb + * Function: H5G__dense_lookup_by_idx_fh_cb * * Purpose: Callback for fractal heap operator, to make copy of link when * when lookup up a link by index @@ -580,19 +557,18 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_lbi_t *udata = (H5G_fh_ud_lbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *tmp_lnk = NULL; /* Temporary pointer to link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information & keep a copy */ if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -608,31 +584,30 @@ done: H5O_msg_free(H5O_LINK_ID, tmp_lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_by_idx_fh_cb() */ +} /* end H5G__dense_lookup_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_by_idx_bt2_cb + * Function: H5G__dense_lookup_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage lookup by index * * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_lbi_t *bt2_udata = (H5G_bt2_ud_lbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_lbi_t fh_udata; /* User data for fractal heap 'op' callback */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Prepare user data for callback */ /* down */ @@ -640,12 +615,12 @@ H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.lnk = bt2_udata->lnk; /* Call fractal heap 'op' routine, to copy the link information */ - if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_lookup_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "link found callback failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_by_idx_bt2_cb() */ +} /* end H5G__dense_lookup_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- @@ -657,7 +632,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- @@ -727,7 +701,7 @@ H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, udata.lnk = lnk; /* Find & copy the link in the appropriate index */ - if(H5B2_index(bt2, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, order, n, H5G__dense_lookup_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in index") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ @@ -758,7 +732,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_build_table_cb + * Function: H5G__dense_build_table_cb * * Purpose: Callback routine for building table of links from dense * link storage. @@ -767,18 +741,17 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 25 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata) +H5G__dense_build_table_cb(const H5O_link_t *lnk, void *_udata) { H5G_dense_bt_ud_t *udata = (H5G_dense_bt_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(lnk); @@ -794,7 +767,7 @@ H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_build_table_cb() */ +} /* end H5G__dense_build_table_cb() */ /*------------------------------------------------------------------------- @@ -843,7 +816,7 @@ H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, udata.curr_lnk = 0; /* Iterate over the links in the group, building a table of the link messages */ - if(H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0) + if(H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G__dense_build_table_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Sort link table in correct iteration order */ @@ -859,7 +832,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_iterate_fh_cb + * Function: H5G__dense_iterate_fh_cb * * Purpose: Callback for fractal heap operator, to make user's callback * when iterating over links @@ -867,18 +840,17 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information & keep a copy */ /* (we make a copy instead of calling the user/library callback directly in @@ -892,30 +864,29 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_iterate_fh_cb() */ +} /* end H5G__dense_iterate_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_iterate_bt2_cb + * Function: H5G__dense_iterate_bt2_cb * * Purpose: v2 B-tree callback for dense link storage iterator * * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_it_t *bt2_udata = (H5G_bt2_ud_it_t *)_bt2_udata; /* User data for callback */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check for skipping links */ if(bt2_udata->skip > 0) @@ -928,7 +899,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.f = bt2_udata->f; /* Call fractal heap 'op' routine, to copy the link information */ - if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_iterate_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_iterate_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed") /* Make the callback */ @@ -948,7 +919,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_iterate_bt2_cb() */ +} /* end H5G__dense_iterate_bt2_cb() */ /*------------------------------------------------------------------------- @@ -959,14 +930,14 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ herr_t H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, - H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) + H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, + void *op_data) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_link_table_t ltable = {0, NULL}; /* Table of links */ @@ -1036,7 +1007,7 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if((ret_value = H5B2_iterate(bt2, H5G_dense_iterate_bt2_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, H5G__dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_SYM, H5E_BADITER, "link iteration failed"); /* Update the last link examined, if requested */ @@ -1067,7 +1038,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_get_name_by_idx_fh_cb + * Function: H5G__dense_get_name_by_idx_fh_cb * * Purpose: Callback for fractal heap operator, to retrieve name according * to an index @@ -1075,19 +1046,18 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_gnbi_t *udata = (H5G_fh_ud_gnbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *lnk; /* Pointer to link created from heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -1108,31 +1078,30 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_get_name_by_idx_fh_cb() */ +} /* end H5G__dense_get_name_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_get_name_by_idx_bt2_cb + * Function: H5G__dense_get_name_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage 'get name by idx' call * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_gnbi_t *bt2_udata = (H5G_bt2_ud_gnbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_gnbi_t fh_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Prepare user data for callback */ /* down */ @@ -1141,7 +1110,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.name_size = bt2_udata->name_size; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_get_name_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link found callback failed") /* Set the name's full length to return */ @@ -1149,7 +1118,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_get_name_by_idx_bt2_cb() */ +} /* end H5G__dense_get_name_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- @@ -1161,7 +1130,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- @@ -1231,7 +1199,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, udata.name_size = size; /* Retrieve the name according to the v2 B-tree's index order */ - if(H5B2_index(bt2, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, order, n, H5G__dense_get_name_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree") /* Set return value */ @@ -1271,27 +1239,26 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_fh_cb + * Function: H5G__dense_remove_fh_cb * * Purpose: Callback for fractal heap operator when removing links * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rm_t *udata = (H5G_fh_ud_rm_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *lnk = NULL; /* Pointer to link created from heap object */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -1332,31 +1299,30 @@ done: H5O_msg_free(H5O_LINK_ID, lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_fh_cb() */ +} /* end H5G__dense_remove_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_bt2_cb + * Function: H5G__dense_remove_bt2_cb * * Purpose: v2 B-tree callback for dense link storage record removal * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_remove_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_rm_t *bt2_udata = (H5G_bt2_ud_rm_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_rm_t fh_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->common.f; @@ -1365,7 +1331,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.replace_names = bt2_udata->replace_names; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->common.fheap, record->id, H5G_dense_remove_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->common.fheap, record->id, H5G__dense_remove_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") /* Remove record from fractal heap, if requested */ @@ -1375,7 +1341,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_bt2_cb() */ +} /* end H5G__dense_remove_bt2_cb() */ /*------------------------------------------------------------------------- @@ -1386,7 +1352,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- @@ -1430,7 +1395,7 @@ H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_ udata.replace_names = TRUE; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_remove(bt2, &udata, H5G__dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from name index v2 B-tree") done: @@ -1445,25 +1410,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_by_idx_fh_cb + * Function: H5G__dense_remove_by_idx_fh_cb * * Purpose: Callback for fractal heap operator when removing links by index * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 15 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -1473,24 +1437,23 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_by_idx_fh_cb() */ +} /* end H5G__dense_remove_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_by_idx_bt2_cb + * Function: H5G__dense_remove_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage record removal by index * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 15 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { H5G_bt2_ud_rmbi_t *bt2_udata = (H5G_bt2_ud_rmbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_rmbi_t fh_udata; /* User data for fractal heap 'op' callback */ @@ -1498,7 +1461,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) const uint8_t *heap_id; /* Heap ID for link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Determine the index being used */ if(bt2_udata->idx_type == H5_INDEX_NAME) { @@ -1521,7 +1484,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.lnk = NULL; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->fheap, heap_id, H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, heap_id, H5G__dense_remove_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") HDassert(fh_udata.lnk); @@ -1579,7 +1542,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for 'other' index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_by_idx_bt2_cb() */ +} /* end H5G__dense_remove_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- @@ -1591,7 +1554,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -1662,7 +1624,7 @@ H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_ful udata.grp_full_path_r = grp_full_path_r; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_by_idx(bt2, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) + if(H5B2_remove_by_idx(bt2, order, n, H5G__dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from indexed v2 B-tree") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ @@ -1700,7 +1662,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- @@ -1743,7 +1704,7 @@ H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) udata.replace_names = FALSE; /* Delete the name index, adjusting the ref. count on links removed */ - if(H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G__dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") /* Close the fractal heap */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 126456b..1d85eb7 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Gdeprec.c * June 21 2006 - * James Laird + * James Laird * * Purpose: Deprecated functions from the H5G interface. These * functions are here for compatibility purposes and may be @@ -986,7 +986,7 @@ H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, c H5G_trav_goi_t *udata = (H5G_trav_goi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC; + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(lnk == NULL && obj_loc == NULL) @@ -1082,7 +1082,7 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, HDassert(name && *name); /* Reset stat buffer */ - if (statbuf) + if(statbuf) HDmemset(statbuf, 0, sizeof(H5G_stat_t)); /* Set up user data for retrieving information */ @@ -1091,11 +1091,11 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, udata.loc_file = loc->oloc->file; /* Traverse the group hierarchy to locate the object to get info about */ - if (H5G_traverse(loc, name, (unsigned)(follow_link ? H5G_TARGET_NORMAL : (H5G_TARGET_SLINK | H5G_TARGET_UDLINK)), H5G__get_objinfo_cb, &udata) < 0) + if(H5G_traverse(loc, name, (unsigned)(follow_link ? H5G_TARGET_NORMAL : (H5G_TARGET_SLINK | H5G_TARGET_UDLINK)), H5G__get_objinfo_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist"); /* If we're pointing at a soft or UD link, get the real link length and type */ - if (statbuf && follow_link == 0) { + if(statbuf && follow_link == 0) { H5L_info2_t linfo; /* Link information buffer */ herr_t ret; diff --git a/src/H5Gent.c b/src/H5Gent.c index 19aef10..632ffa0 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 19, 1997 */ @@ -86,7 +86,6 @@ H5FL_BLK_EXTERN(str_buf); * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -128,7 +127,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -194,7 +192,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -234,7 +231,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -306,7 +302,6 @@ done: * Failure: Negative * * Programmer: Pedro Vicente - * pvn@ncsa.uiuc.edu * ???day, August ??, 2002 * * Notes: 'depth' parameter determines how much of the group entry @@ -385,7 +380,6 @@ H5G__ent_reset(H5G_entry_t *ent) * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 20 2005 * *------------------------------------------------------------------------- @@ -530,7 +524,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 29 1997 * *------------------------------------------------------------------------- diff --git a/src/H5Gint.c b/src/H5Gint.c index 0f9f9cb..c3c8719 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -15,7 +15,7 @@ * * Created: H5Gint.c * April 5 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: General use, "internal" routines for groups. * @@ -88,6 +88,7 @@ typedef struct { /********************/ static herr_t H5G__open_oid(H5G_t *grp); +static herr_t H5G__visit_cb(const H5O_link_t *lnk, void *_udata); /*********************/ @@ -179,7 +180,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 11 1997 * *------------------------------------------------------------------------- @@ -719,7 +719,7 @@ H5G_unmount(H5G_t *grp) /*------------------------------------------------------------------------- - * Function: H5G_iterate_cb + * Function: H5G__iterate_cb * * Purpose: Callback function for iterating over links in a group * @@ -732,12 +732,12 @@ H5G_unmount(H5G_t *grp) *------------------------------------------------------------------------- */ static herr_t -H5G_iterate_cb(const H5O_link_t *lnk, void *_udata) +H5G__iterate_cb(const H5O_link_t *lnk, void *_udata) { H5G_iter_appcall_ud_t *udata = (H5G_iter_appcall_ud_t *)_udata; /* User data for callback */ herr_t ret_value = H5_ITER_ERROR; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(lnk); @@ -770,7 +770,7 @@ H5G_iterate_cb(const H5O_link_t *lnk, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_iterate_cb() */ +} /* end H5G__iterate_cb() */ /*------------------------------------------------------------------------- @@ -818,7 +818,7 @@ H5G_iterate(H5G_loc_t *loc, const char *group_name, udata.op_data = op_data; /* Call the real group iteration routine */ - if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata)) < 0) + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G__iterate_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "error iterating over links") done: @@ -835,7 +835,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_free_visit_visited + * Function: H5G__free_visit_visited * * Purpose: Free the key for an object visited during a group traversal * @@ -847,18 +847,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) +H5G__free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR item = H5FL_FREE(H5_obj_t, item); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_free_visit_visited() */ +} /* end H5G__free_visit_visited() */ /*------------------------------------------------------------------------- - * Function: H5G_visit_cb + * Function: H5G__visit_cb * * Purpose: Callback function for recursively visiting links from a group * @@ -871,7 +871,7 @@ H5G_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static herr_t -H5G_visit_cb(const H5O_link_t *lnk, void *_udata) +H5G__visit_cb(const H5O_link_t *lnk, void *_udata) { H5G_iter_visit_ud_t *udata = (H5G_iter_visit_ud_t *)_udata; /* User data for callback */ H5L_info2_t info; /* Link info */ @@ -884,7 +884,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) size_t len_needed; /* Length of path string needed */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(lnk); @@ -998,7 +998,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) udata->curr_loc = &obj_loc; /* Iterate over links in group */ - ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata); + ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G__visit_cb, udata); /* Restore location */ udata->curr_loc = old_loc; @@ -1016,7 +1016,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_visit_cb() */ +} /* end H5G__visit_cb() */ /*------------------------------------------------------------------------- @@ -1140,14 +1140,14 @@ H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, } /* end if */ /* Call the link iteration routine */ - if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata)) < 0) + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G__visit_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't visit links") done: /* Release user data resources */ H5MM_xfree(udata.path); if(udata.visited) - H5SL_destroy(udata.visited, H5G_free_visit_visited, NULL); + H5SL_destroy(udata.visited, H5G__free_visit_visited, NULL); /* Release the group opened */ if(gid != H5I_INVALID_HID) { diff --git a/src/H5Glink.c b/src/H5Glink.c index cbe5307..8b8377a 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -63,10 +63,10 @@ /* Local Prototypes */ /********************/ -static int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2); /*********************/ @@ -86,7 +86,7 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_name_inc + * Function: H5G__link_cmp_name_inc * * Purpose: Callback routine for comparing two link names, in * increasing alphabetic order @@ -103,16 +103,16 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); *------------------------------------------------------------------------- */ static int -H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) +H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk1)->name, ((const H5O_link_t *)lnk2)->name)) -} /* end H5G_link_cmp_name_inc() */ +} /* end H5G__link_cmp_name_inc() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_name_dec + * Function: H5G__link_cmp_name_dec * * Purpose: Callback routine for comparing two link names, in * decreasing alphabetic order @@ -129,16 +129,16 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) +H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk2)->name, ((const H5O_link_t *)lnk1)->name)) -} /* end H5G_link_cmp_name_dec() */ +} /* end H5G__link_cmp_name_dec() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_corder_inc + * Function: H5G__link_cmp_corder_inc * * Purpose: Callback routine for comparing two link creation orders, in * increasing order @@ -154,11 +154,11 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) +H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2) { int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder) ret_value = -1; @@ -168,11 +168,11 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) ret_value = 0; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_cmp_corder_inc() */ +} /* end H5G__link_cmp_corder_inc() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_corder_dec + * Function: H5G__link_cmp_corder_dec * * Purpose: Callback routine for comparing two link creation orders, in * decreasing order @@ -188,11 +188,11 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) +H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2) { int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder) ret_value = 1; @@ -202,7 +202,7 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) ret_value = 0; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_cmp_corder_dec() */ +} /* end H5G__link_cmp_corder_dec() */ /*------------------------------------------------------------------------- @@ -434,18 +434,18 @@ H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, /* Pick appropriate sorting routine */ if(idx_type == H5_INDEX_NAME) { if(order == H5_ITER_INC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_inc); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_inc); else if(order == H5_ITER_DEC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_dec); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_dec); else HDassert(order == H5_ITER_NATIVE); } /* end if */ else { HDassert(idx_type == H5_INDEX_CRT_ORDER); if(order == H5_ITER_INC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_inc); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_inc); else if(order == H5_ITER_DEC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_dec); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_dec); else HDassert(order == H5_ITER_NATIVE); } /* end else */ diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 2461c51..3109b49 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -621,7 +621,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_exists_cb + * Function: H5G__loc_exists_cb * * Purpose: Callback for checking if an object exists * @@ -633,13 +633,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_exists_t *udata = (H5G_loc_exists_t *)_udata; /* User data passed in */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check if the name in this group resolved to a valid object */ if(obj_loc == NULL) @@ -655,7 +655,7 @@ H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UN *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_loc_exists_cb() */ +} /* end H5G__loc_exists_cb() */ /*------------------------------------------------------------------------- @@ -687,7 +687,7 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name) udata.exists = FALSE; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G__loc_exists_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't check if object exists") /* Set return value */ diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h index 19ea982..883aa6d 100644 --- a/src/H5Gmodule.h +++ b/src/H5Gmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Gname.c b/src/H5Gname.c index e1004de..95b85b4 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -81,14 +81,14 @@ typedef struct H5G_gnba_iter_t { /* Local Prototypes */ /********************/ -static htri_t H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r); -static H5RS_str_t *H5G_build_fullpath(const char *prefix, const char *name); +static htri_t H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r); +static H5RS_str_t *H5G__build_fullpath(const char *prefix, const char *name); #ifdef NOT_YET -static H5RS_str_t *H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r); +static H5RS_str_t *H5G__build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r); #endif /* NOT_YET */ -static herr_t H5G_name_move_path(H5RS_str_t **path_r_ptr, +static herr_t H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, const char *dst_path); -static int H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); /*********************/ @@ -208,7 +208,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_common_path + * Function: H5G__common_path * * Purpose: Determine if one path is a valid prefix of another path * @@ -222,14 +222,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) +H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) { const char *fullpath; /* Pointer to actual fullpath string */ const char *prefix; /* Pointer to actual prefix string */ size_t nchars1,nchars2; /* Number of characters in components */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get component of each name */ fullpath=H5RS_get_str(fullpath_r); @@ -270,11 +270,11 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_common_path() */ +} /* end H5G__common_path() */ /*------------------------------------------------------------------------- - * Function: H5G_build_fullpath + * Function: H5G__build_fullpath * * Purpose: Build a full path from a prefix & base pair of strings * @@ -287,7 +287,7 @@ done: *------------------------------------------------------------------------- */ static H5RS_str_t * -H5G_build_fullpath(const char *prefix, const char *name) +H5G__build_fullpath(const char *prefix, const char *name) { char *full_path; /* Full user path built */ size_t orig_path_len; /* Original length of the path */ @@ -296,7 +296,7 @@ H5G_build_fullpath(const char *prefix, const char *name) unsigned need_sep; /* Flag to indicate if separator is needed */ H5RS_str_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(prefix); @@ -331,7 +331,7 @@ H5G_build_fullpath(const char *prefix, const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_build_fullpath() */ +} /* end H5G__build_fullpath() */ /*------------------------------------------------------------------------- @@ -363,7 +363,7 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) HDassert(prefix); /* Create reference counted string for path */ - ret_value = H5G_build_fullpath(prefix, name); + ret_value = H5G__build_fullpath(prefix, name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_build_fullpath_refstr_str() */ @@ -385,13 +385,13 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) *------------------------------------------------------------------------- */ static H5RS_str_t * -H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r) +H5G__build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r) { const char *prefix; /* Pointer to raw string of prefix */ const char *name; /* Pointer to raw string of name */ H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get the pointer to the prefix */ prefix = H5RS_get_str(prefix_r); @@ -400,10 +400,10 @@ H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *n name = H5RS_get_str(name_r); /* Create reference counted string for path */ - ret_value = H5G_build_fullpath(prefix, name); + ret_value = H5G__build_fullpath(prefix, name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_build_fullpath_refstr_refstr() */ +} /* end H5G__build_fullpath_refstr_refstr() */ #endif /* NOT_YET */ @@ -663,7 +663,7 @@ H5G_name_free(H5G_name_t *name) /*------------------------------------------------------------------------- - * Function: H5G_name_move_path + * Function: H5G__name_move_path * * Purpose: Update a user or canonical path after an object moves * @@ -676,7 +676,7 @@ H5G_name_free(H5G_name_t *name) *------------------------------------------------------------------------- */ static herr_t -H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, +H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, const char *dst_path) { const char *path; /* Path to update */ @@ -684,7 +684,7 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char size_t full_suffix_len; /* Length of full suffix */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(path_r_ptr && *path_r_ptr); @@ -762,11 +762,11 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_name_move_path() */ +} /* end H5G__name_move_path() */ /*------------------------------------------------------------------------- - * Function: H5G_name_replace_cb + * Function: H5G__name_replace_cb * * Purpose: H5I_iterate callback function to replace group entry names * @@ -779,7 +779,7 @@ done: *------------------------------------------------------------------------- */ static int -H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) +H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) { const H5G_names_t *names = (const H5G_names_t *)key; /* Get operation's information */ H5O_loc_t *oloc; /* Object location for object that the ID refers to */ @@ -788,7 +788,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) hbool_t obj_in_child = FALSE; /* Flag to indicate that the object is in the child mount hier. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_ptr); @@ -907,7 +907,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) else { /* Check if the source is along the entry's path */ /* (But not actually the entry itself) */ - if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r) && + if(H5G__common_path(obj_path->full_path_r, names->src_full_path_r) && H5RS_cmp(obj_path->full_path_r, names->src_full_path_r)) { /* Hide the user path */ (obj_path->obj_hidden)++; @@ -957,7 +957,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) } /* end if */ else { /* Check if file being unmounted was hiding the object */ - if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r) && + if(H5G__common_path(obj_path->full_path_r, names->src_full_path_r) && H5RS_cmp(obj_path->full_path_r, names->src_full_path_r)) { /* Un-hide the user path */ (obj_path->obj_hidden)--; @@ -971,7 +971,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) */ case H5G_NAME_DELETE: /* Check if the location being unlinked is in the path for the current object */ - if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r)) { + if(H5G__common_path(obj_path->full_path_r, names->src_full_path_r)) { /* Free paths for object */ H5G_name_free(obj_path); } /* end if */ @@ -983,7 +983,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) */ case H5G_NAME_MOVE: /* Link move case, check for relative names case */ /* Check if the src object moved is in the current object's path */ - if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r)) { + if(H5G__common_path(obj_path->full_path_r, names->src_full_path_r)) { const char *full_path; /* Full path of current object */ const char *full_suffix; /* Suffix of full path, after src_path */ size_t full_suffix_len; /* Length of suffix of full path after src_path*/ @@ -1012,7 +1012,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) /* Update the user path, if one exists */ if(obj_path->user_path_r) - if(H5G_name_move_path(&(obj_path->user_path_r), full_suffix, src_path, dst_path) < 0) + if(H5G__name_move_path(&(obj_path->user_path_r), full_suffix, src_path, dst_path) < 0) HGOTO_ERROR(H5E_SYM, H5E_PATH, FAIL, "can't build user path name") /* Build new full path */ @@ -1040,7 +1040,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5G_name_replace_cb() */ +} /* end H5G__name_replace_cb() */ /*------------------------------------------------------------------------- @@ -1166,17 +1166,17 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, /* Search through group IDs */ if(search_group) - if(H5I_iterate(H5I_GROUP, H5G_name_replace_cb, &names, FALSE) < 0) + if(H5I_iterate(H5I_GROUP, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over groups") /* Search through dataset IDs */ if(search_dataset) - if(H5I_iterate(H5I_DATASET, H5G_name_replace_cb, &names, FALSE) < 0) + if(H5I_iterate(H5I_DATASET, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datasets") /* Search through datatype IDs */ if(search_datatype) - if(H5I_iterate(H5I_DATATYPE, H5G_name_replace_cb, &names, FALSE) < 0) + if(H5I_iterate(H5I_DATATYPE, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datatypes") } /* end if */ } /* end if */ @@ -1187,7 +1187,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_get_name_by_addr_cb + * Function: H5G__get_name_by_addr_cb * * Purpose: Callback for retrieving object's name by address * @@ -1201,7 +1201,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, +H5G__get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, void *_udata) { H5G_gnba_iter_t *udata = (H5G_gnba_iter_t *)_udata; /* User data for iteration */ @@ -1211,7 +1211,7 @@ H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, hbool_t obj_found = FALSE; /* Object at 'path' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(path); @@ -1261,7 +1261,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_get_name_by_addr_cb() */ +} /* end H5G__get_name_by_addr_cb() */ /*------------------------------------------------------------------------- @@ -1310,7 +1310,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size) udata.path = NULL; /* Visit all the links in the file */ - if((status = H5G_visit(&root_loc, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G_get_name_by_addr_cb, &udata)) < 0) + if((status = H5G_visit(&root_loc, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G__get_name_by_addr_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, (-1), "group traversal failed while looking for object name") else if(status > 0) found_obj = TRUE; diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 2e7b367..5578f83 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -75,21 +75,21 @@ typedef struct H5G_node_key_t { /********************/ /* B-tree callbacks */ -static H5UC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata); +static H5UC_t *H5G__node_get_shared(const H5F_t *f, const void *_udata); static herr_t H5G__node_create(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p/*out*/); -static int H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key); -static int H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static htri_t H5G_node_found(H5F_t *f, haddr_t addr, const void *_lt_key, +static int H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key); +static int H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key); +static htri_t H5G__node_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata); static H5B_ins_t H5G__node_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p/*out*/); -static H5B_ins_t H5G_node_remove(H5F_t *f, haddr_t addr, void *lt_key, +static H5B_ins_t H5G__node_remove(H5F_t *f, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata, void *rt_key, hbool_t *rt_key_changed); -static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); -static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); -static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, +static herr_t H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); +static herr_t H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); +static herr_t H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata); @@ -101,19 +101,19 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, H5B_class_t H5B_SNODE[1] = {{ H5B_SNODE_ID, /*id */ sizeof(H5G_node_key_t), /*sizeof_nkey */ - H5G_node_get_shared, /*get_shared */ + H5G__node_get_shared, /*get_shared */ H5G__node_create, /*new */ - H5G_node_cmp2, /*cmp2 */ - H5G_node_cmp3, /*cmp3 */ - H5G_node_found, /*found */ + H5G__node_cmp2, /*cmp2 */ + H5G__node_cmp3, /*cmp3 */ + H5G__node_found, /*found */ H5G__node_insert, /*insert */ TRUE, /*follow min branch? */ TRUE, /*follow max branch? */ H5B_RIGHT, /*critical key */ - H5G_node_remove, /*remove */ - H5G_node_decode_key, /*decode */ - H5G_node_encode_key, /*encode */ - H5G_node_debug_key /*debug */ + H5G__node_remove, /*remove */ + H5G__node_decode_key, /*decode */ + H5G__node_encode_key, /*encode */ + H5G__node_debug_key /*debug */ }}; /* Declare a free list to manage the H5G_node_t struct */ @@ -134,7 +134,7 @@ H5FL_SEQ_DEFINE(H5G_entry_t); /*------------------------------------------------------------------------- - * Function: H5G_node_get_shared + * Function: H5G__node_get_shared * * Purpose: Returns the shared B-tree info for the specified UDATA. * @@ -148,19 +148,19 @@ H5FL_SEQ_DEFINE(H5G_entry_t); *------------------------------------------------------------------------- */ static H5UC_t * -H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) +H5G__node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); /* Return the pointer to the ref-count object */ FUNC_LEAVE_NOAPI(H5F_GRP_BTREE_SHARED(f)) -} /* end H5G_node_get_shared() */ +} /* end H5G__node_get_shared() */ /*------------------------------------------------------------------------- - * Function: H5G_node_decode_key + * Function: H5G__node_decode_key * * Purpose: Decodes a raw key into a native key. * @@ -172,11 +172,11 @@ H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) *------------------------------------------------------------------------- */ static herr_t -H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) +H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { H5G_node_key_t *key = (H5G_node_key_t *) _key; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(shared); HDassert(raw); @@ -185,11 +185,11 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) H5F_DECODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_decode_key() */ +} /* end H5G__node_decode_key() */ /*------------------------------------------------------------------------- - * Function: H5G_node_encode_key + * Function: H5G__node_encode_key * * Purpose: Encodes a native key into a raw key. * @@ -201,11 +201,11 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) *------------------------------------------------------------------------- */ static herr_t -H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) +H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { const H5G_node_key_t *key = (const H5G_node_key_t *) _key; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(shared); HDassert(raw); @@ -214,11 +214,11 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) H5F_ENCODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_encode_key() */ +} /* end H5G__node_encode_key() */ /*------------------------------------------------------------------------- - * Function: H5G_node_debug_key + * Function: H5G__node_debug_key * * Purpose: Prints a key. * @@ -230,13 +230,13 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) *------------------------------------------------------------------------- */ static herr_t -H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, +H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata) { const H5G_node_key_t *key = (const H5G_node_key_t *) _key; const H5G_bt_common_t *udata = (const H5G_bt_common_t *) _udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(key); @@ -255,7 +255,7 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Cannot get name; heap address not specified\n"); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_debug_key() */ +} /* end H5G__node_debug_key() */ /*------------------------------------------------------------------------- @@ -361,7 +361,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_node_cmp2 + * Function: H5G__node_cmp2 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY). * The UDATA pointer supplies extra data not contained in the @@ -381,7 +381,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) +H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key) { H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata; H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; @@ -389,7 +389,7 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) const char *s1, *s2; int ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(udata && udata->heap); @@ -407,11 +407,11 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_node_cmp2() */ +} /* H5G__node_cmp2() */ /*------------------------------------------------------------------------- - * Function: H5G_node_cmp3 + * Function: H5G__node_cmp3 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY) * against another key (not necessarily the same type) @@ -435,7 +435,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) +H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key) { H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata; H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; @@ -443,7 +443,7 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) const char *s; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(udata && udata->heap); @@ -465,11 +465,11 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_cmp3() */ +} /* end H5G__node_cmp3() */ /*------------------------------------------------------------------------- - * Function: H5G_node_found + * Function: H5G__node_found * * Purpose: The B-tree search engine has found the symbol table node * which contains the requested symbol if the symbol exists. @@ -494,7 +494,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, +H5G__node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) { H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; @@ -504,7 +504,7 @@ H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, const char *s; htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -548,7 +548,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_found() */ +} /* end H5G__node_found() */ /*------------------------------------------------------------------------- @@ -720,7 +720,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_node_remove + * Function: H5G__node_remove * * Purpose: The B-tree removal engine has found the symbol table node * which should contain the name which is being removed. This @@ -748,7 +748,7 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key/*in,out*/, +H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key/*in,out*/, hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, void *_udata/*in,out*/, void *_rt_key/*in,out*/, hbool_t *rt_key_changed/*out*/) @@ -761,7 +761,7 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key/*in, int cmp = 1; H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(f); @@ -926,7 +926,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_remove() */ +} /* end H5G__node_remove() */ /*------------------------------------------------------------------------- diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 1892182..c2d7fe6 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -15,7 +15,7 @@ * * Created: H5Gobj.c * Sep 5 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for abstract handling of objects in groups. * @@ -85,7 +85,7 @@ typedef struct { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned idx, +static herr_t H5G__obj_compact_to_dense_cb(const void *_mesg, unsigned idx, void *_udata); static herr_t H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo); @@ -114,7 +114,6 @@ static herr_t H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *l * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 29 2005 * *------------------------------------------------------------------------- @@ -169,7 +168,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 29 2005 * *------------------------------------------------------------------------- @@ -304,7 +302,6 @@ done: * Failure: FAIL if error occurred * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 11 2007 * *------------------------------------------------------------------------- @@ -360,7 +357,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_obj_compact_to_dense_cb + * Function: H5G__obj_compact_to_dense_cb * * Purpose: Callback routine for converting "compact" to "dense" * link storage form. @@ -368,19 +365,18 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static herr_t -H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) +H5G__obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */ H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->oh_addr) + FUNC_ENTER_STATIC_TAG(udata->oh_addr) /* check arguments */ HDassert(lnk); @@ -392,11 +388,11 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void done: FUNC_LEAVE_NOAPI_TAG(ret_value) -} /* end H5G_obj_compact_to_dense_cb() */ +} /* end H5G__obj_compact_to_dense_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_stab_to_new_cb + * Function: H5G__obj_stab_to_new_cb * * Purpose: Callback routine for converting "symbol table" link storage to * "new format" storage (either "compact" or "dense" storage). @@ -404,18 +400,17 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 16 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) +H5G__obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) { H5G_obj_stab_it_ud1_t *udata = (H5G_obj_stab_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(lnk); @@ -428,7 +423,7 @@ H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_stab_to_new_cb() */ +} /* end H5G__obj_stab_to_new_cb() */ /*------------------------------------------------------------------------- @@ -443,7 +438,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -529,7 +523,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Iterate over the 'link' messages, inserting them into the dense link storage */ op.op_type = H5O_MESG_OP_APP; - op.u.app_op = H5G_obj_compact_to_dense_cb; + op.u.app_op = H5G__obj_compact_to_dense_cb; if(H5O_msg_iterate(grp_oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") @@ -561,7 +555,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, udata.grp_oloc = grp_oloc; /* Iterate through all links in "old format" group and insert them into new format */ - if(H5G__stab_iterate(grp_oloc, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) + if(H5G__stab_iterate(grp_oloc, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G__obj_stab_to_new_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over old format links") /* Remove the symbol table message from the group */ @@ -710,7 +704,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 27 2006 * *------------------------------------------------------------------------- @@ -1102,7 +1095,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 26 2005 * *------------------------------------------------------------------------- @@ -1155,7 +1147,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 6 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 8ad03d0..9289ab5 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, September 18, 1997 * * Purpose: This file contains declarations which are visible diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 501c883..96e695d 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -15,7 +15,7 @@ * * Created: H5Gprivate.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Library-visible declarations. * diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 170b74d..3f74d45 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -15,7 +15,7 @@ * * Created: H5Gpublic.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5G package * diff --git a/src/H5Groot.c b/src/H5Groot.c index 36aa8f6..79b7075 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -15,7 +15,7 @@ * * Created: H5Groot.c * Apr 8 2009 - * Neil Fortner + * Neil Fortner * * Purpose: Functions for operating on the root group. * @@ -137,7 +137,6 @@ H5G_rootof(H5F_t *f) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 11 1997 * *------------------------------------------------------------------------- @@ -370,7 +369,6 @@ H5G_root_free(H5G_t *grp) * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 5 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Gstab.c b/src/H5Gstab.c index e8d38b9..1ca28ef 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, September 19, 1997 * */ @@ -127,7 +127,6 @@ typedef struct H5G_bt_it_lbi_t { * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Nov 7 2005 * *------------------------------------------------------------------------- @@ -194,7 +193,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 1 1997 * *------------------------------------------------------------------------- @@ -249,7 +247,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@uiuc.edu * Nov 7 2005 * *------------------------------------------------------------------------- @@ -304,7 +301,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 1 1997 * *------------------------------------------------------------------------- @@ -683,7 +679,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_stab_get_name_by_idx_cb + * Function: H5G__stab_get_name_by_idx_cb * * Purpose: Callback for B-tree iteration 'by index' info query to * retrieve the name of a link @@ -697,14 +693,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) { H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; size_t name_off; /* Offset of name in heap */ const char *name; /* Pointer to name string in heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(ent); @@ -721,7 +717,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_get_name_by_idx_cb */ +} /* end H5G__stab_get_name_by_idx_cb */ /*------------------------------------------------------------------------- @@ -778,7 +774,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t /* Set iteration information */ udata.common.idx = n; udata.common.num_objs = 0; - udata.common.op = H5G_stab_get_name_by_idx_cb; + udata.common.op = H5G__stab_get_name_by_idx_cb; udata.heap = heap; udata.name = NULL; udata_valid = TRUE; @@ -815,7 +811,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_stab_lookup_cb + * Function: H5G__stab_lookup_cb * * Purpose: B-tree 'find' callback to retrieve location for an object * @@ -829,12 +825,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_lookup_cb(const H5G_entry_t *ent, void *_udata) { H5G_stab_fnd_ud_t *udata = (H5G_stab_fnd_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check for setting link info */ if(udata->lnk) @@ -844,7 +840,7 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_lookup_cb() */ +} /* end H5G__stab_lookup_cb() */ /*------------------------------------------------------------------------- @@ -855,7 +851,6 @@ done: * Return: Non-negative (TRUE/FALSE) on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 20 2005 * *------------------------------------------------------------------------- @@ -892,7 +887,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk) /* Set up the user data for actual B-tree find operation */ bt_udata.common.name = name; bt_udata.common.heap = heap; - bt_udata.op = H5G_stab_lookup_cb; + bt_udata.op = H5G__stab_lookup_cb; bt_udata.op_data = &udata; /* Search the B-tree */ @@ -909,7 +904,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_stab_lookup_by_idx_cb + * Function: H5G__stab_lookup_by_idx_cb * * Purpose: Callback for B-tree iteration 'by index' info query to * retrieve the link @@ -923,13 +918,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) { H5G_bt_it_lbi_t *udata = (H5G_bt_it_lbi_t *)_udata; const char *name; /* Pointer to name string in heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(ent); @@ -946,7 +941,7 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_lookup_by_idx_cb */ +} /* end H5G__stab_lookup_by_idx_cb */ /*------------------------------------------------------------------------- @@ -957,7 +952,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- @@ -1000,7 +994,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ /* Set iteration information */ udata.common.idx = n; udata.common.num_objs = 0; - udata.common.op = H5G_stab_lookup_by_idx_cb; + udata.common.op = H5G__stab_lookup_by_idx_cb; udata.heap = heap; udata.lnk = lnk; udata.found = FALSE; @@ -1040,7 +1034,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Mar 17, 2009 * *------------------------------------------------------------------------- diff --git a/src/H5Gtest.c b/src/H5Gtest.c index f9ab6f2..03efc7e 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, October 17, 2005 * * Purpose: Group testing functions. @@ -814,7 +814,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * April 6 2011 * *------------------------------------------------------------------------- diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 5a4380d..15088d9 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -15,7 +15,7 @@ * * Created: H5Gtraverse.c * Sep 13 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for traversing group hierarchy * @@ -355,7 +355,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2006 * *------------------------------------------------------------------------- @@ -464,7 +463,6 @@ done: * resolved. * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 11 1997 * *------------------------------------------------------------------------- @@ -811,7 +809,6 @@ done: * traversed. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 13 2005 * *------------------------------------------------------------------------- @@ -835,7 +832,7 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver /* Retrieve the original # of soft / UD links that are able to be traversed * (So that multiple calls to H5G_traverse don't incorrectly look - * like they've traversed too many. Nested calls, like in H5L_move(), + * like they've traversed too many. Nested calls, like in H5L__move(), * may need their own mechanism to set & reset the # of links to traverse) */ if(H5CX_get_nlinks(&orig_nlinks) < 0) diff --git a/src/H5HF.c b/src/H5HF.c index 5d52ca4..2e437ad 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -15,7 +15,7 @@ * * Created: H5HF.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements a "fractal heap" for storing variable- * length objects in a file. @@ -88,53 +88,51 @@ H5FL_DEFINE_STATIC(H5HF_t); /*------------------------------------------------------------------------- - * Function: H5HF_op_read + * Function: H5HF__op_read * * Purpose: Performs a 'read' operation for a heap 'op' callback * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_op_read(const void *obj, size_t obj_len, void *op_data) +H5HF__op_read(const void *obj, size_t obj_len, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Perform "read", using memcpy() */ H5MM_memcpy(op_data, obj, obj_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_op_read() */ +} /* end H5HF__op_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_op_write + * Function: H5HF__op_write * * Purpose: Performs a 'write' operation for a heap 'op' callback * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_op_write(const void *obj, size_t obj_len, void *op_data) +H5HF__op_write(const void *obj, size_t obj_len, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Perform "write", using memcpy() */ H5MM_memcpy((void *)obj, op_data, obj_len); /* Casting away const OK -QAK */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_op_write() */ +} /* end H5HF__op_write() */ /*------------------------------------------------------------------------- @@ -146,7 +144,6 @@ H5HF_op_write(const void *obj, size_t obj_len, void *op_data) * NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 24 2006 * *------------------------------------------------------------------------- @@ -168,7 +165,7 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam) HDassert(cparam); /* Create shared fractal heap header */ - if(HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, cparam))) + if(HADDR_UNDEF == (fh_addr = H5HF__hdr_create(f, cparam))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header") /* Allocate fractal heap wrapper */ @@ -181,11 +178,11 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam) /* Point fractal heap wrapper at header and bump it's ref count */ fh->hdr = hdr; - if(H5HF_hdr_incr(fh->hdr) < 0) + if(H5HF__hdr_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Increment # of files using this heap header */ - if(H5HF_hdr_fuse_incr(fh->hdr) < 0) + if(H5HF__hdr_fuse_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") /* Set file pointer for this heap open context */ @@ -214,7 +211,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 18 2006 * *------------------------------------------------------------------------- @@ -248,11 +244,11 @@ H5HF_open(H5F_t *f, haddr_t fh_addr) /* Point fractal heap wrapper at header */ fh->hdr = hdr; - if(H5HF_hdr_incr(fh->hdr) < 0) + if(H5HF__hdr_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Increment # of files using this heap header */ - if(H5HF_hdr_fuse_incr(fh->hdr) < 0) + if(H5HF__hdr_fuse_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") /* Set file pointer for this heap open context */ @@ -280,7 +276,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -311,7 +306,6 @@ H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p) * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 18 2006 * *------------------------------------------------------------------------- @@ -343,7 +337,6 @@ H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p) * filled in), negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 24 2006 * *------------------------------------------------------------------------- @@ -381,7 +374,7 @@ H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id/*out*/) /* Check for 'tiny' object */ else if(size <= hdr->tiny_max_len) { /* Store 'tiny' object in heap */ - if(H5HF_tiny_insert(hdr, size, obj, id) < 0) + if(H5HF__tiny_insert(hdr, size, obj, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'tiny' object in fractal heap") } /* end if */ else { @@ -409,7 +402,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 9 2006 * *------------------------------------------------------------------------- @@ -442,7 +434,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) /* Check type of object in heap */ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { - if(H5HF_man_get_obj_len(fh->hdr, id, obj_len_p) < 0) + if(H5HF__man_get_obj_len(fh->hdr, id, obj_len_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'managed' object's length") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { @@ -450,7 +442,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's length") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { - if(H5HF_tiny_get_obj_len(fh->hdr, id, obj_len_p) < 0) + if(H5HF__tiny_get_obj_len(fh->hdr, id, obj_len_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'tiny' object's length") } /* end if */ else { @@ -471,7 +463,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 20 2015 * *------------------------------------------------------------------------- @@ -533,7 +524,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 18 2006 * *------------------------------------------------------------------------- @@ -577,7 +567,7 @@ H5HF_read(H5HF_t *fh, const void *_id, void *obj/*out*/) } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Read 'tiny' object from file */ - if(H5HF_tiny_read(fh->hdr, id, obj) < 0) + if(H5HF__tiny_read(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read 'tiny' object from fractal heap") } /* end if */ else { @@ -610,7 +600,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- @@ -681,7 +670,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 11 2006 * *------------------------------------------------------------------------- @@ -725,7 +713,7 @@ H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data) } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Operate on 'tiny' object from file */ - if(H5HF_tiny_op(fh->hdr, id, op, op_data) < 0) + if(H5HF__tiny_op(fh->hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on 'tiny' object from fractal heap") } /* end if */ else { @@ -746,7 +734,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 15 2006 * *------------------------------------------------------------------------- @@ -790,7 +777,7 @@ H5HF_remove(H5HF_t *fh, const void *_id) } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Remove 'tiny' object from heap statistics */ - if(H5HF_tiny_remove(fh->hdr, id) < 0) + if(H5HF__tiny_remove(fh->hdr, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove 'tiny' object from fractal heap") } /* end if */ else { @@ -811,7 +798,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -831,7 +817,7 @@ H5HF_close(H5HF_t *fh) HDassert(fh); /* Decrement file reference & check if this is the last open fractal heap using the shared heap header */ - if(0 == H5HF_hdr_fuse_decr(fh->hdr)) { + if(0 == H5HF__hdr_fuse_decr(fh->hdr)) { /* Set the shared heap header's file context for this operation */ fh->hdr->f = fh->f; @@ -850,8 +836,8 @@ H5HF_close(H5HF_t *fh) * a reference loop and the objects couldn't be removed from * the metadata cache - QAK) */ - if(H5HF_man_iter_ready(&fh->hdr->next_block)) - if(H5HF_man_iter_reset(&fh->hdr->next_block) < 0) + if(H5HF__man_iter_ready(&fh->hdr->next_block)) + if(H5HF__man_iter_reset(&fh->hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Shut down the huge object information */ @@ -873,10 +859,10 @@ H5HF_close(H5HF_t *fh) } /* end if */ /* Decrement the reference count on the heap header */ - /* (don't put in H5HF_hdr_fuse_decr() as the heap header may be evicted + /* (don't put in H5HF__hdr_fuse_decr() as the heap header may be evicted * immediately -QAK) */ - if(H5HF_hdr_decr(fh->hdr) < 0) + if(H5HF__hdr_decr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") /* Check for pending heap deletion */ @@ -908,7 +894,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 4 2006 * *------------------------------------------------------------------------- diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 479c2bd..756ddb5 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -15,7 +15,7 @@ * * Created: H5HFbtree2.c * Aug 7 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: v2 B-tree callbacks for "huge" object tracker * diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 8dbdf25..31430f9 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -15,7 +15,7 @@ * * Created: H5HFcache.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement fractal heap metadata cache methods. * @@ -255,7 +255,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- @@ -305,7 +304,6 @@ H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- @@ -353,7 +351,7 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) * * Note also that the value returned by this function presumes that * there is no I/O filtering data in the header. If there is, the - * size reported will be too small, and H5C_load_entry() + * size reported will be too small, and H5C__load_entry() * will have to make two tries to load the fractal heap header. * * Return: Success: SUCCEED @@ -507,7 +505,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, HDassert(dirty); /* Allocate space for the fractal heap data structure */ - if(NULL == (hdr = H5HF_hdr_alloc(udata->f))) + if(NULL == (hdr = H5HF__hdr_alloc(udata->f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Deserialize the fractal heap header's prefix */ @@ -591,7 +589,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, HDassert((size_t)(image - (const uint8_t *)_image) == hdr->heap_size); /* Finish initialization of heap header */ - if(H5HF_hdr_finish_init(hdr) < 0) + if(H5HF__hdr_finish_init(hdr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, NULL, "can't finish initializing shared fractal heap header") /* Set return value */ @@ -599,7 +597,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, done: if(!ret_value && hdr) - if(H5HF_hdr_free(hdr) < 0) + if(H5HF__hdr_free(hdr) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -879,7 +877,7 @@ H5HF__cache_hdr_free_icr(void *_thing) HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); HDassert(hdr->rc == 0); - if(H5HF_hdr_free(hdr) < 0) + if(H5HF__hdr_free(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "unable to release fractal heap header") done: @@ -1009,7 +1007,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED /* Share common heap information */ iblock->hdr = hdr; - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Set block's internal information */ @@ -1049,7 +1047,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED iblock->par_entry = udata->par_info->entry; if(iblock->parent) { /* Share parent block */ - if(H5HF_iblock_incr(iblock->parent) < 0) + if(H5HF__iblock_incr(iblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") /* Set max. # of rows in this block */ @@ -1144,7 +1142,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED done: if(!ret_value && iblock) - if(H5HF_man_iblock_dest(iblock) < 0) + if(H5HF__man_iblock_dest(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) @@ -1280,7 +1278,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, hdr->man_dtable.table_addr = iblock_addr; /* Mark that heap header was modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { @@ -1295,7 +1293,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, par_iblock->ents[par_entry].addr = iblock_addr; /* Mark that parent was modified */ - if(H5HF_iblock_dirty(par_iblock) < 0) + if(H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ @@ -1559,7 +1557,7 @@ H5HF__cache_iblock_free_icr(void *thing) HDassert(iblock->hdr); /* Destroy fractal heap indirect block */ - if(H5HF_man_iblock_dest(iblock) < 0) + if(H5HF__man_iblock_dest(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") done: @@ -1792,7 +1790,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Share common heap information */ dblock->hdr = hdr; - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Set block's internal information */ @@ -1885,7 +1883,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, dblock->par_entry = par_info->entry; if(dblock->parent) { /* Share parent block */ - if(H5HF_iblock_incr(dblock->parent) < 0) + if(H5HF__iblock_incr(dblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ @@ -1915,7 +1913,7 @@ done: /* Cleanup on error */ if(!ret_value && dblock) - if(H5HF_man_dblock_dest(dblock) < 0) + if(H5HF__man_dblock_dest(dblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) @@ -2269,7 +2267,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Check if heap header was modified */ if(hdr_changed) - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { /* the direct block's parent is an indirect block */ @@ -2321,7 +2319,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Check if parent was modified */ if(par_changed) - if(H5HF_iblock_dirty(par_iblock) < 0) + if(H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ } /* end if */ @@ -2357,7 +2355,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, hdr->man_dtable.table_addr = dblock_addr; /* Mark that heap header was modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { /* the direct block's parent is an indirect block */ @@ -2371,7 +2369,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, par_iblock->ents[par_entry].addr = dblock_addr; /* Mark that parent was modified */ - if(H5HF_iblock_dirty(par_iblock) < 0) + if(H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ } /* end if */ @@ -2574,7 +2572,7 @@ H5HF__cache_dblock_free_icr(void *_thing) HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); /* Destroy fractal heap direct block */ - if(H5HF_man_dblock_dest(dblock) < 0) + if(H5HF__man_dblock_dest(dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") done: diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 22de0c4..f6c7f0e 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -15,7 +15,7 @@ * * Created: H5HFdbg.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Dump debugging information about a fractal heap * @@ -78,7 +78,7 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, +static herr_t H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth); @@ -105,7 +105,6 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 20 2015 * *------------------------------------------------------------------------- @@ -172,22 +171,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_dtable_debug + * Function: H5HF__dtable_debug * * Purpose: Prints debugging info about a doubling table * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 28 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth) +H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -240,7 +238,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi dtable->num_id_first_row); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_debug() */ +} /* end H5HF__dtable_debug() */ /*------------------------------------------------------------------------- @@ -251,7 +249,6 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 23 2012 * *------------------------------------------------------------------------- @@ -328,7 +325,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i hdr->tiny_nobjs); HDfprintf(stream, "%*sManaged Objects Doubling-Table Info...\n", indent, ""); - H5HF_dtable_debug(&hdr->man_dtable, stream, indent + 3, MAX(0, fwidth - 3)); + H5HF__dtable_debug(&hdr->man_dtable, stream, indent + 3, MAX(0, fwidth - 3)); /* Print information about I/O filters */ if(hdr->filter_len > 0) { @@ -371,7 +368,6 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 24 2006 * *------------------------------------------------------------------------- @@ -416,7 +412,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 13 2006 * *------------------------------------------------------------------------- @@ -500,7 +495,6 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 28 2006 * *------------------------------------------------------------------------- @@ -627,7 +621,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 23 2012 * *------------------------------------------------------------------------- @@ -709,10 +702,10 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, unsigned first_row_bits; /* Number of bits used bit addresses in first row */ unsigned num_indirect_rows; /* Number of rows of blocks in each indirect block */ - first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM_log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM__log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { - num_indirect_rows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; + num_indirect_rows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); @@ -759,7 +752,6 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 7 2006 * *------------------------------------------------------------------------- @@ -817,7 +809,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 13 2006 * *------------------------------------------------------------------------- @@ -849,11 +840,6 @@ H5HF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth, "Section size:", sect->sect_info.size); -#ifdef QAK - HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth, - "Section state:", - (sect->sect_info.state == H5FS_SECT_LIVE ? "live" : "serialized")); -#endif /* QAK */ /* Dump section-specific debugging information */ if(H5FS_sect_debug(udata->fspace, _sect, udata->stream, udata->indent + 3, MAX(0, udata->fwidth - 3)) < 0) @@ -872,7 +858,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 9 2006 * *------------------------------------------------------------------------- diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index a6560e2..96392c1 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -15,7 +15,7 @@ * * Created: H5HFdblock.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Direct block routines for fractal heaps. * @@ -86,7 +86,6 @@ H5FL_DEFINE(H5HF_direct_t); * Return: Pointer to new direct block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- @@ -119,7 +118,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, /* Share common heap information */ dblock->hdr = hdr; - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") /* Set info for direct block */ @@ -162,7 +161,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, /* Attach to parent indirect block, if there is one */ dblock->parent = par_iblock; if(dblock->parent) { - if(H5HF_man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0) + if(H5HF__man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach direct block to parent indirect block") dblock->fd_parent = par_iblock; } /* end if */ @@ -171,7 +170,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, dblock->par_entry = par_entry; /* Create a new 'single' section for the free space in the block */ - if(NULL == (sec_node = H5HF_sect_single_new((dblock->block_off + H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)), + if(NULL == (sec_node = H5HF__sect_single_new((dblock->block_off + H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)), free_space, dblock->parent, dblock->par_entry))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create section for new direct block's free space") @@ -190,7 +189,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add fractal heap direct block to cache") /* Increase the allocated heap size */ - if(H5HF_hdr_inc_alloc(hdr, dblock->size) < 0) + if(H5HF__hdr_inc_alloc(hdr, dblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size") /* Set the address of of direct block, if requested */ @@ -200,7 +199,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, done: if(ret_value < 0) if(dblock) - if(H5HF_man_dblock_dest(dblock) < 0) + if(H5HF__man_dblock_dest(dblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) @@ -219,7 +218,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 17 2006 * *------------------------------------------------------------------------- @@ -272,7 +270,7 @@ H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, HDassert(hdr->man_dtable.cparam.start_block_size == dblock->size); /* Sanity check block iterator */ - HDassert(!H5HF_man_iter_ready(&hdr->next_block)); + HDassert(!H5HF__man_iter_ready(&hdr->next_block)); /* Reset header information back to "empty heap" state */ if(H5HF__hdr_empty(hdr) < 0) @@ -334,7 +332,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 13 2006 * *------------------------------------------------------------------------- @@ -359,7 +356,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, if(request < hdr->man_dtable.cparam.start_block_size) min_dblock_size = hdr->man_dtable.cparam.start_block_size; else { - min_dblock_size = ((size_t)1) << (1 + H5VM_log2_gen((uint64_t)request)); + min_dblock_size = ((size_t)1) << (1 + H5VM__log2_gen((uint64_t)request)); HDassert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size); } /* end else */ @@ -383,7 +380,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, } /* end if */ /* Extend heap to cover new direct block */ - if(H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) + if(H5HF__hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") } /* end if */ /* Root entry already exists, allocate direct block from root indirect block */ @@ -398,7 +395,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "unable to update block iterator") /* Retrieve information about current iterator position */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") HDassert(next_row < iblock->nrows); H5_CHECKED_ASSIGN(next_size, size_t, hdr->man_dtable.row_block_size[next_row], hsize_t); @@ -410,7 +407,7 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "skipping direct block sizes not su } /* end if */ /* Advance "next block" iterator to next direct block entry */ - if(H5HF_hdr_inc_iter(hdr, (hsize_t)next_size, 1) < 0) + if(H5HF__hdr_inc_iter(hdr, (hsize_t)next_size, 1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment 'next block' iterator") /* Create new direct block at current location*/ @@ -432,7 +429,6 @@ done: * Return: Pointer to direct block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -515,7 +511,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 8 2006 * *------------------------------------------------------------------------- @@ -546,7 +541,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Look up row & column for object */ - if(H5HF_dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0) + if(H5HF__dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") /* Set initial indirect block info */ @@ -564,7 +559,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting parent indirect block */ /* Compute # of rows in child indirect block */ - nrows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; + nrows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; HDassert(nrows < iblock->nrows); /* child must be smaller than parent */ /* Compute indirect block's entry */ @@ -595,7 +590,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, did_protect = new_did_protect; /* Look up row & column in new indirect block for object */ - if(H5HF_dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0) + if(H5HF__dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") HDassert(row < iblock->nrows); /* child must be smaller than parent */ } /* end while */ @@ -624,7 +619,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- @@ -682,24 +676,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_dest + * Function: H5HF__man_dblock_dest * * Purpose: Destroys a fractal heap direct block in memory. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_dest(H5HF_direct_t *dblock) +H5HF__man_dblock_dest(H5HF_direct_t *dblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -708,7 +701,7 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) /* Decrement reference count on shared fractal heap info */ HDassert(dblock->hdr != NULL); - if(H5HF_hdr_decr(dblock->hdr) < 0) + if(H5HF__hdr_decr(dblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if(dblock->parent) if(H5HF__iblock_decr(dblock->parent) < 0) @@ -722,5 +715,5 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_dest() */ +} /* end H5HF__man_dblock_dest() */ diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index 6e9429a..ad317c9 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -15,7 +15,7 @@ * * Created: H5HFdtable.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: "Doubling table" routines for fractal heaps. * @@ -75,27 +75,26 @@ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_init + * Function: H5HF__dtable_init * * Purpose: Initialize values for doubling table * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 6 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_init(H5HF_dtable_t *dtable) +H5HF__dtable_init(H5HF_dtable_t *dtable) { hsize_t tmp_block_size; /* Temporary block size */ hsize_t acc_block_off; /* Accumulated block offset */ size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -103,10 +102,10 @@ H5HF_dtable_init(H5HF_dtable_t *dtable) HDassert(dtable); /* Compute/cache some values */ - dtable->start_bits = H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size); - dtable->first_row_bits = dtable->start_bits + H5VM_log2_of2(dtable->cparam.width); + dtable->start_bits = H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size); + dtable->first_row_bits = dtable->start_bits + H5VM__log2_of2(dtable->cparam.width); dtable->max_root_rows = (dtable->cparam.max_index - dtable->first_row_bits) + 1; - dtable->max_direct_bits = H5VM_log2_of2((uint32_t)dtable->cparam.max_direct_size); + dtable->max_direct_bits = H5VM__log2_of2((uint32_t)dtable->cparam.max_direct_size); dtable->max_direct_rows = (dtable->max_direct_bits - dtable->start_bits) + 2; dtable->num_id_first_row = dtable->cparam.start_block_size * dtable->cparam.width; dtable->max_dir_blk_off_size = H5HF_SIZEOF_OFFSET_LEN(dtable->cparam.max_direct_size); @@ -133,26 +132,25 @@ H5HF_dtable_init(H5HF_dtable_t *dtable) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_dtable_init() */ +} /* end H5HF__dtable_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_lookup + * Function: H5HF__dtable_lookup * * Purpose: Compute the row & col of an offset in a doubling-table * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 6 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col) +H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -160,9 +158,6 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi HDassert(dtable); HDassert(row); HDassert(col); -#ifdef QAK -HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off); -#endif /* QAK */ /* Check for offset in first row */ if(off < dtable->num_id_first_row) { @@ -170,37 +165,33 @@ HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off); H5_CHECKED_ASSIGN(*col, unsigned, (off / dtable->cparam.start_block_size), hsize_t); } /* end if */ else { - unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */ + unsigned high_bit = H5VM__log2_gen(off); /* Determine the high bit in the offset */ hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */ -#ifdef QAK -HDfprintf(stderr, "%s: high_bit = %u, off_mask = %Hu\n", "H5HF_dtable_lookup", high_bit, off_mask); -#endif /* QAK */ *row = (high_bit - dtable->first_row_bits) + 1; H5_CHECKED_ASSIGN(*col, unsigned, ((off - off_mask) / dtable->row_block_size[*row]), hsize_t); } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_lookup() */ +} /* end H5HF__dtable_lookup() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_dest + * Function: H5HF__dtable_dest * * Purpose: Release information for doubling table * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_dest(H5HF_dtable_t *dtable) +H5HF__dtable_dest(H5HF_dtable_t *dtable) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -220,28 +211,27 @@ H5HF_dtable_dest(H5HF_dtable_t *dtable) H5MM_xfree(dtable->row_max_dblock_free); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_dest() */ +} /* end H5HF__dtable_dest() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_size_to_row + * Function: H5HF__dtable_size_to_row * * Purpose: Compute row that can hold block of a certain size * * Return: Non-negative on success (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 25 2006 * *------------------------------------------------------------------------- */ unsigned -H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) +H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) { unsigned row = 0; /* Row where block will fit */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -251,58 +241,56 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) if(block_size == dtable->cparam.start_block_size) row = 0; else - row = (H5VM_log2_of2((uint32_t)block_size) - H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; + row = (H5VM__log2_of2((uint32_t)block_size) - H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; FUNC_LEAVE_NOAPI(row) -} /* end H5HF_dtable_size_to_row() */ +} /* end H5HF__dtable_size_to_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_size_to_rows + * Function: H5HF__dtable_size_to_rows * * Purpose: Compute # of rows of indirect block of a given size * * Return: Non-negative on success (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- */ unsigned -H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) +H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) { unsigned rows = 0; /* # of rows required for indirect block */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. */ HDassert(dtable); - rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1; + rows = (H5VM__log2_gen(size) - dtable->first_row_bits) + 1; FUNC_LEAVE_NOAPI(rows) -} /* end H5HF_dtable_size_to_rows() */ +} /* end H5HF__dtable_size_to_rows() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_span_size + * Function: H5HF__dtable_span_size * * Purpose: Compute the size covered by a span of entries * * Return: Non-zero span size on success/zero on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 25 2006 * *------------------------------------------------------------------------- */ hsize_t -H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, +H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col, unsigned num_entries) { unsigned start_entry; /* Entry for first block covered */ @@ -311,7 +299,7 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned end_entry; /* Entry for last block covered */ hsize_t acc_span_size = 0; /* Accumulated span size */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -326,10 +314,6 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, end_entry = (start_entry + num_entries) - 1; end_row = end_entry / dtable->cparam.width; end_col = end_entry % dtable->cparam.width; -#ifdef QAK -HDfprintf(stderr, "%s: start_row = %u, start_col = %u, start_entry = %u\n", "H5HF_sect_indirect_span_size", start_row, start_col, start_entry); -HDfprintf(stderr, "%s: end_row = %u, end_col = %u, end_entry = %u\n", "H5HF_sect_indirect_span_size", end_row, end_col, end_entry); -#endif /* QAK */ /* Initialize accumulated span size */ acc_span_size = 0; @@ -362,9 +346,6 @@ HDfprintf(stderr, "%s: end_row = %u, end_col = %u, end_entry = %u\n", "H5HF_sect ((end_col - start_col) + 1); } /* end else */ -#ifdef QAK -HDfprintf(stderr, "%s: acc_span_size = %Hu\n", "H5HF_dtable_span_size", acc_span_size); -#endif /* QAK */ FUNC_LEAVE_NOAPI(acc_span_size) -} /* end H5HF_sect_indirect_span_size() */ +} /* end H5HF__dtable_span_size() */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 5750a03..4a645cd 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -15,7 +15,7 @@ * * Created: H5HFhdr.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Heap header routines for fractal heaps. * @@ -46,7 +46,7 @@ #ifndef NDEBUG /* Limit on the size of the max. direct block size */ /* (This is limited to 32-bits currently, because I think it's unlikely to - * need to be larger, the 32-bit limit for H5VM_log2_of2(n), and + * need to be larger, the 32-bit limit for H5VM__log2_of2(n), and * some offsets/sizes are encoded with a maximum of 32-bits - QAK) */ #define H5HF_MAX_DIRECT_SIZE_LIMIT ((hsize_t)2 * 1024 * 1024 * 1024) @@ -94,25 +94,24 @@ H5FL_DEFINE_STATIC(H5HF_hdr_t); /*------------------------------------------------------------------------- - * Function: H5HF_hdr_alloc + * Function: H5HF__hdr_alloc * * Purpose: Allocate shared fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ H5HF_hdr_t * -H5HF_hdr_alloc(H5F_t *f) +H5HF__hdr_alloc(H5F_t *f) { H5HF_hdr_t *hdr = NULL; /* Shared fractal heap header */ H5HF_hdr_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -133,7 +132,7 @@ H5HF_hdr_alloc(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_alloc() */ +} /* end H5HF__hdr_alloc() */ /*------------------------------------------------------------------------- @@ -145,13 +144,12 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) +H5HF__hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) { hsize_t acc_heap_size; /* Accumumated heap space */ hsize_t iblock_size; /* Size of indirect block to calculate for */ @@ -160,7 +158,7 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) unsigned curr_row; /* Current row in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -189,28 +187,27 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) hdr->man_dtable.row_max_dblock_free[iblock_row] = max_dblock_free; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_compute_free_space() */ +} /* end H5HF__hdr_compute_free_space() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init_phase1 + * Function: H5HF__hdr_finish_init_phase1 * * Purpose: First phase to finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -219,38 +216,37 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Compute/cache some values */ hdr->heap_off_size = (uint8_t)H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index); - if(H5HF_dtable_init(&hdr->man_dtable) < 0) + if(H5HF__dtable_init(&hdr->man_dtable) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info") /* Set the size of heap IDs */ hdr->heap_len_size = (uint8_t)MIN(hdr->man_dtable.max_dir_blk_off_size, - H5VM_limit_enc_size((uint64_t)hdr->max_man_size)); + H5VM__limit_enc_size((uint64_t)hdr->max_man_size)); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init_phase1() */ +} /* end H5HF__hdr_finish_init_phase1() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init_phase2 + * Function: H5HF__hdr_finish_init_phase2 * * Purpose: Second phase to finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -265,46 +261,45 @@ H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr) H5_CHECKED_ASSIGN(hdr->man_dtable.row_max_dblock_free[u], size_t, hdr->man_dtable.row_tot_dblock_free[u], hsize_t); } /* end if */ else - if(H5HF_hdr_compute_free_space(hdr, u) < 0) + if(H5HF__hdr_compute_free_space(hdr, u) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize direct block free space for indirect block") } /* end for */ /* Initialize the block iterator for searching for free space */ - if(H5HF_man_iter_init(&hdr->next_block) < 0) + if(H5HF__man_iter_init(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize space search block iterator") /* Initialize the information for tracking 'huge' objects */ - if(H5HF_huge_init(hdr) < 0) + if(H5HF__huge_init(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize info for tracking huge objects") /* Initialize the information for tracking 'tiny' objects */ - if(H5HF_tiny_init(hdr) < 0) + if(H5HF__tiny_init(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize info for tracking tiny objects") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init_phase2() */ +} /* end H5HF__hdr_finish_init_phase2() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init + * Function: H5HF__hdr_finish_init * * Purpose: Finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -312,39 +307,38 @@ H5HF_hdr_finish_init(H5HF_hdr_t *hdr) HDassert(hdr); /* First phase of header final initialization */ - if(H5HF_hdr_finish_init_phase1(hdr) < 0) + if(H5HF__hdr_finish_init_phase1(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #1 of header final initialization") /* Second phase of header final initialization */ - if(H5HF_hdr_finish_init_phase2(hdr) < 0) + if(H5HF__hdr_finish_init_phase2(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #2 of header final initialization") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init() */ +} /* end H5HF__hdr_finish_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_create + * Function: H5HF__hdr_create * * Purpose: Create new fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ haddr_t -H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) +H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam) { H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */ size_t dblock_overhead; /* Direct block's overhead */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -377,7 +371,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) #endif /* NDEBUG */ /* Allocate & basic initialization for the shared header */ - if(NULL == (hdr = H5HF_hdr_alloc(f))) + if(NULL == (hdr = H5HF__hdr_alloc(f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info") #ifndef NDEBUG @@ -401,7 +395,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) /* First phase of header final initialization */ /* (doesn't need ID length set up) */ - if(H5HF_hdr_finish_init_phase1(hdr) < 0) + if(H5HF__hdr_finish_init_phase1(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #1 of header final initialization") /* Copy any I/O filter pipeline */ @@ -484,7 +478,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) /* Second phase of header final initialization */ /* (needs ID and filter lengths set up) */ - if(H5HF_hdr_finish_init_phase2(hdr) < 0) + if(H5HF__hdr_finish_init_phase2(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #2 of header final initialization") /* Extra checking for possible gap between max. direct block size minus @@ -506,11 +500,11 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) done: if(!H5F_addr_defined(ret_value) && hdr) - if(H5HF_hdr_free(hdr) < 0) + if(H5HF__hdr_free(hdr) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, HADDR_UNDEF, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_create() */ +} /* end H5HF__hdr_create() */ /*------------------------------------------------------------------------- @@ -521,7 +515,6 @@ done: * Return: Pointer to indirect block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 5 2010 * *------------------------------------------------------------------------- @@ -564,24 +557,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_incr + * Function: H5HF__hdr_incr * * Purpose: Increment component reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_incr(H5HF_hdr_t *hdr) +H5HF__hdr_incr(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -596,28 +588,27 @@ H5HF_hdr_incr(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_incr() */ +} /* end H5HF__hdr_incr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_decr + * Function: H5HF__hdr_decr * * Purpose: Decrement component reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_decr(H5HF_hdr_t *hdr) +H5HF__hdr_decr(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -635,26 +626,25 @@ H5HF_hdr_decr(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_decr() */ +} /* end H5HF__hdr_decr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_fuse_incr + * Function: H5HF__hdr_fuse_incr * * Purpose: Increment file reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 1 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) +H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(hdr); @@ -663,26 +653,25 @@ H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) hdr->file_rc++; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_hdr_fuse_incr() */ +} /* end H5HF__hdr_fuse_incr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_fuse_decr + * Function: H5HF__hdr_fuse_decr * * Purpose: Decrement file reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 1 2006 * *------------------------------------------------------------------------- */ size_t -H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr) +H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(hdr); @@ -692,37 +681,35 @@ H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr) hdr->file_rc--; FUNC_LEAVE_NOAPI(hdr->file_rc) -} /* end H5HF_hdr_fuse_decr() */ +} /* end H5HF__hdr_fuse_decr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_dirty + * Function: H5HF__hdr_dirty * * Purpose: Mark heap header as dirty * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_dirty(H5HF_hdr_t *hdr) +H5HF__hdr_dirty(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); /* Resize pinned header in cache if I/O filter is present. */ - if(hdr->filter_len > 0) { + if(hdr->filter_len > 0) if(H5AC_resize_entry(hdr, (size_t)hdr->heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize fractal heap header") - } /* end if */ /* Mark header as dirty in cache */ if(H5AC_mark_entry_dirty(hdr) < 0) @@ -730,28 +717,27 @@ H5HF_hdr_dirty(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_dirty() */ +} /* end H5HF__hdr_dirty() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_adj_free + * Function: H5HF__hdr_adj_free * * Purpose: Adjust the free space for a heap * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 9 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) +H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -763,33 +749,32 @@ H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + amt); /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_adj_free() */ +} /* end H5HF__hdr_adj_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_adjust_heap + * Function: H5HF__hdr_adjust_heap * * Purpose: Adjust heap space * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 10 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) +H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -804,31 +789,30 @@ H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + extra_free); /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_adjust_heap() */ +} /* end H5HF__hdr_adjust_heap() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_inc_alloc + * Function: H5HF__hdr_inc_alloc * * Purpose: Increase allocated size of heap * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 23 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) +H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -840,28 +824,27 @@ H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) hdr->man_alloc_size += alloc_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_hdr_inc_alloc() */ +} /* end H5HF__hdr_inc_alloc() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_start_iter + * Function: H5HF__hdr_start_iter * * Purpose: Start "next block" iterator at an offset/entry in the heap * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 30 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry) +H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -870,7 +853,7 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, HDassert(iblock); /* Set up "next block" iterator at correct location */ - if(H5HF_man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0) + if(H5HF__man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator") /* Set the offset of the iterator in the heap */ @@ -878,28 +861,27 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_start_iter() */ +} /* end H5HF__hdr_start_iter() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_reset_iter + * Function: H5HF__hdr_reset_iter * * Purpose: Reset "next block" iterator * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) +H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -907,7 +889,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) HDassert(hdr); /* Reset "next block" iterator */ - if(H5HF_man_iter_reset(&hdr->next_block) < 0) + if(H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Set the offset of the iterator in the heap */ @@ -915,7 +897,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_reset_iter() */ +} /* end H5HF__hdr_reset_iter() */ /*------------------------------------------------------------------------- @@ -926,7 +908,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 3 2006 * *------------------------------------------------------------------------- @@ -951,11 +932,11 @@ H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, /* Compute the span within the heap to skip */ row = start_entry / hdr->man_dtable.cparam.width; col = start_entry % hdr->man_dtable.cparam.width; - sect_size = H5HF_dtable_span_size(&hdr->man_dtable, row, col, nentries); + sect_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries); HDassert(sect_size > 0); /* Advance the new block iterator */ - if(H5HF_hdr_inc_iter(hdr, sect_size, nentries) < 0) + if(H5HF__hdr_inc_iter(hdr, sect_size, nentries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size") /* Add 'indirect' section for blocks skipped in this row */ @@ -978,7 +959,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 14 2006 * *------------------------------------------------------------------------- @@ -1009,17 +989,17 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned min_dblock_row; /* Minimum row for direct block size request */ /* Compute min. row for direct block requested */ - min_dblock_row = H5HF_dtable_size_to_row(&hdr->man_dtable, min_dblock_size); + min_dblock_row = H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size); /* Initialize block iterator, if necessary */ - if(!H5HF_man_iter_ready(&hdr->next_block)) { + if(!H5HF__man_iter_ready(&hdr->next_block)) { /* Start iterator with previous offset of iterator */ if(H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") } /* end if */ /* Get information about current iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") /* Check for skipping over blocks in the current block */ @@ -1039,7 +1019,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") /* Get information about new iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") } /* end if */ @@ -1057,16 +1037,16 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ else { /* Move iterator up one level */ - if(H5HF_man_iter_up(&hdr->next_block) < 0) + if(H5HF__man_iter_up(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Increment location of next block at this level */ - if(H5HF_man_iter_next(hdr, &hdr->next_block, 1) < 0) + if(H5HF__man_iter_next(hdr, &hdr->next_block, 1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't advance fractal heap block location") } /* end else */ /* Get information about new iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") /* Indicate that we walked up */ @@ -1081,7 +1061,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) HDassert(!H5F_addr_defined(iblock->ents[next_entry].addr)); /* Compute # of rows in next child indirect block to use */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[next_row]); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[next_row]); /* Check for skipping over indirect blocks */ /* (that don't have direct blocks large enough to hold direct block size requested) */ @@ -1090,7 +1070,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned child_entry; /* Entry of child indirect block */ /* Compute # of rows needed in child indirect block */ - child_rows_needed = (H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; + child_rows_needed = (H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; HDassert(child_rows_needed > child_nrows); child_entry = (next_row + (child_rows_needed - child_nrows)) * hdr->man_dtable.cparam.width; if(child_entry > (iblock->nrows * hdr->man_dtable.cparam.width)) @@ -1114,7 +1094,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Move iterator down one level (pins indirect block) */ - if(H5HF_man_iter_down(&hdr->next_block, new_iblock) < 0) + if(H5HF__man_iter_down(&hdr->next_block, new_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Check for skipping over rows and add free section for skipped rows */ @@ -1135,7 +1115,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end else */ /* Get information about new iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") /* Indicate that we walked down */ @@ -1150,24 +1130,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_inc_iter + * Function: H5HF__hdr_inc_iter * * Purpose: Advance "next block" iterator * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 23 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) +H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1177,7 +1156,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) /* Advance the iterator for the current location within the indirect block */ if(hdr->next_block.curr) - if(H5HF_man_iter_next(hdr, &hdr->next_block, nentries) < 0) + if(H5HF__man_iter_next(hdr, &hdr->next_block, nentries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Increment the offset of the iterator in the heap */ @@ -1185,7 +1164,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_inc_iter() */ +} /* end H5HF__hdr_inc_iter() */ /*------------------------------------------------------------------------- @@ -1197,7 +1176,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -1219,7 +1197,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) HDassert(hdr); /* Initialize block iterator, if necessary */ - if(!H5HF_man_iter_ready(&hdr->next_block)) + if(!H5HF__man_iter_ready(&hdr->next_block)) /* Start iterator with previous offset of iterator */ if(H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") @@ -1227,7 +1205,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) /* Walk backwards through heap, looking for direct block to place iterator after */ /* Get information about current iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator information") /* Move current iterator position backwards once */ @@ -1253,11 +1231,11 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) /* Check for parent of current indirect block */ if(iblock->parent) { /* Move iterator to parent of current block */ - if(H5HF_man_iter_up(&hdr->next_block) < 0) + if(H5HF__man_iter_up(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to move current block iterator location up") /* Get information about current iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator information") /* Move current iterator position backwards once */ @@ -1271,7 +1249,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) hdr->man_iter_off = 0; /* Reset 'next block' iterator */ - if(H5HF_man_iter_reset(&hdr->next_block) < 0) + if(H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") } /* end else */ } /* end if */ @@ -1287,7 +1265,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) curr_entry++; /* Set the current location of the iterator to next entry after the existing direct block */ - if(H5HF_man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) + if(H5HF__man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "unable to set current block iterator location") /* Update iterator offset */ @@ -1301,18 +1279,18 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) unsigned child_nrows; /* # of rows in child block */ /* Compute # of rows in next child indirect block to use */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); /* Lock child indirect block */ if(NULL == (child_iblock = H5HF__man_iblock_protect(hdr, iblock->ents[curr_entry].addr, child_nrows, iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Set the current location of the iterator */ - if(H5HF_man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) + if(H5HF__man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "unable to set current block iterator location") /* Walk down into child indirect block (pins child block) */ - if(H5HF_man_iter_down(&hdr->next_block, child_iblock) < 0) + if(H5HF__man_iter_down(&hdr->next_block, child_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Update iterator location */ @@ -1342,7 +1320,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 17 2006 * *------------------------------------------------------------------------- @@ -1358,10 +1335,9 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr) HDassert(hdr); /* Reset block iterator, if necessary */ - if(H5HF_man_iter_ready(&hdr->next_block)) { - if(H5HF_man_iter_reset(&hdr->next_block) < 0) + if(H5HF__man_iter_ready(&hdr->next_block)) + if(H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") - } /* end if */ /* Shrink managed heap size */ hdr->man_size = 0; @@ -1378,7 +1354,7 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr) hdr->total_man_free = 0; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark header as dirty") done: @@ -1387,24 +1363,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_free + * Function: H5HF__hdr_free * * Purpose: Free shared fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_free(H5HF_hdr_t *hdr) +H5HF__hdr_free(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1412,7 +1387,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr) HDassert(hdr); /* Free the block size lookup table for the doubling table */ - if(H5HF_dtable_dest(&hdr->man_dtable) < 0) + if(H5HF__dtable_dest(&hdr->man_dtable) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap doubling table") /* Release any I/O pipeline filter information */ @@ -1425,7 +1400,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_free() */ +} /* end H5HF__hdr_free() */ /*------------------------------------------------------------------------- @@ -1436,7 +1411,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 5 2007 * *------------------------------------------------------------------------- diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index d496d62..065e7c3 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -15,7 +15,7 @@ * * Created: H5HFhuge.c * Aug 7 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for "huge" objects in fractal heap * @@ -67,7 +67,7 @@ static herr_t H5HF__huge_bt2_create(H5HF_hdr_t *hdr); /* Local 'huge' object support routines */ -static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr); +static hsize_t H5HF__huge_new_id(H5HF_hdr_t *hdr); static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_operator_t op, void *op_data); @@ -95,7 +95,6 @@ static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- @@ -168,22 +167,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_huge_init + * Function: H5HF__huge_init * * Purpose: Initialize information for tracking 'huge' objects * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_huge_init(H5HF_hdr_t *hdr) +H5HF__huge_init(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -196,10 +194,6 @@ H5HF_huge_init(H5HF_hdr_t *hdr) * the file in the heap ID (which will speed up accessing it) and we don't * have any I/O pipeline filters. */ -#ifdef QAK -HDfprintf(stderr, "%s: hdr->id_len = %u\n", "H5HF_huge_init", (unsigned)hdr->id_len); -HDfprintf(stderr, "%s: hdr->filter_len = %u\n", "H5HF_huge_init", (unsigned)hdr->filter_len); -#endif /* QAK */ if(hdr->filter_len > 0) { if((hdr->id_len - 1) >= (unsigned)(hdr->sizeof_addr + hdr->sizeof_size + 4 + hdr->sizeof_size)) { /* Indicate that v2 B-tree doesn't have to be used to locate object */ @@ -238,11 +232,11 @@ HDfprintf(stderr, "%s: hdr->filter_len = %u\n", "H5HF_huge_init", (unsigned)hdr- hdr->huge_bt2 = NULL; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_huge_init() */ +} /* end H5HF__huge_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_new_id + * Function: H5HF__huge_new_id * * Purpose: Determine a new ID for an indirectly accessed 'huge' object * (either filtered or not) @@ -250,18 +244,17 @@ HDfprintf(stderr, "%s: hdr->filter_len = %u\n", "H5HF_huge_init", (unsigned)hdr- * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 15 2006 * *------------------------------------------------------------------------- */ static hsize_t -H5HF_huge_new_id(H5HF_hdr_t *hdr) +H5HF__huge_new_id(H5HF_hdr_t *hdr) { hsize_t new_id; /* New object's ID */ hsize_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -287,7 +280,7 @@ H5HF_huge_new_id(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_new_id() */ +} /* end H5HF__huge_new_id() */ /*------------------------------------------------------------------------- @@ -298,7 +291,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- @@ -314,9 +306,6 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE -#ifdef QAK -HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); -#endif /* QAK */ /* * Check arguments. @@ -362,10 +351,6 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); if(H5Z_pipeline(&(hdr->pline), 0, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &write_size, &write_buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") -#ifdef QAK -HDfprintf(stderr, "%s: nbytes = %Zu, write_size = %Zu, write_buf = %p\n", FUNC, nbytes, write_size, write_buf); -HDfprintf(stderr, "%s: obj_size = %Zu, obj = %p\n", FUNC, obj_size, obj); -#endif /* QAK */ /* Update size of object on disk */ write_size = nbytes; @@ -399,9 +384,6 @@ HDfprintf(stderr, "%s: obj_size = %Zu, obj = %p\n", FUNC, obj_size, obj); obj_rec.len = write_size; obj_rec.filter_mask = filter_mask; obj_rec.obj_size = obj_size; -#ifdef QAK -HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len, obj_rec.filter_mask, obj_rec.obj_size); -#endif /* QAK */ /* Insert record for object in v2 B-tree */ if(H5B2_insert(hdr->huge_bt2, &obj_rec) < 0) @@ -420,9 +402,6 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_ /* Initialize record for tracking object in v2 B-tree */ obj_rec.addr = obj_addr; obj_rec.len = write_size; -#ifdef QAK -HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); -#endif /* QAK */ /* Insert record for object in v2 B-tree */ if(H5B2_insert(hdr->huge_bt2, &obj_rec) < 0) @@ -441,7 +420,7 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); hsize_t new_id; /* New ID for object */ /* Get new ID for object */ - if(0 == (new_id = H5HF_huge_new_id(hdr))) + if(0 == (new_id = H5HF__huge_new_id(hdr))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't generate new ID for object") if(hdr->filter_len > 0) { @@ -451,9 +430,6 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); filt_indir_rec.filter_mask = filter_mask; filt_indir_rec.obj_size = obj_size; filt_indir_rec.id = new_id; -#ifdef QAK -HDfprintf(stderr, "%s: filt_indir_rec = {%a, %Hu, %x, %Hu, %Hu}\n", FUNC, filt_indir_rec.addr, filt_indir_rec.len, filt_indir_rec.filter_mask, filt_indir_rec.obj_size, filt_indir_rec.id); -#endif /* QAK */ /* Set pointer to record to insert */ ins_rec = &filt_indir_rec; @@ -463,9 +439,6 @@ HDfprintf(stderr, "%s: filt_indir_rec = {%a, %Hu, %x, %Hu, %Hu}\n", FUNC, filt_i indir_rec.addr = obj_addr; indir_rec.len = write_size; indir_rec.id = new_id; -#ifdef QAK -HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indir_rec.len, indir_rec.id); -#endif /* QAK */ /* Set pointer to record to insert */ ins_rec = &indir_rec; @@ -485,7 +458,7 @@ HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indi hdr->huge_nobjs++; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: @@ -501,7 +474,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -592,7 +564,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -678,7 +649,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -829,7 +799,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 21 2007 * *------------------------------------------------------------------------- @@ -907,7 +876,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sept 11 2006 * *------------------------------------------------------------------------- @@ -943,7 +911,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sept 11 2006 * *------------------------------------------------------------------------- @@ -980,7 +947,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -1072,7 +1038,7 @@ H5HF__huge_remove(H5HF_hdr_t *hdr, const uint8_t *id) hdr->huge_nobjs--; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: @@ -1088,7 +1054,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -1134,7 +1099,7 @@ H5HF__huge_term(H5HF_hdr_t *hdr) hdr->huge_ids_wrapped = FALSE; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ @@ -1152,7 +1117,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 07eb9cd..1c40d53 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -15,7 +15,7 @@ * * Created: H5HFiblock.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Indirect block routines for fractal heaps. * @@ -99,7 +99,6 @@ H5FL_SEQ_DEFINE(H5HF_indirect_ptr_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 17 2006 * *------------------------------------------------------------------------- @@ -166,7 +165,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 17 2006 * *------------------------------------------------------------------------- @@ -191,24 +189,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_iblock_incr + * Function: H5HF__iblock_incr * * Purpose: Increment reference count on shared indirect block * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_incr(H5HF_indirect_t *iblock) +H5HF__iblock_incr(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(iblock); @@ -224,7 +221,7 @@ H5HF_iblock_incr(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_incr() */ +} /* end H5HF__iblock_incr() */ /*------------------------------------------------------------------------- @@ -235,7 +232,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- @@ -299,8 +295,8 @@ H5HF__iblock_decr(H5HF_indirect_t *iblock) } /* end if */ else { /* Destroy the indirect block */ - if(H5HF_man_iblock_dest(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") + if(H5HF__man_iblock_dest(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") } /* end else */ } /* end if */ @@ -310,24 +306,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_iblock_dirty + * Function: H5HF__iblock_dirty * * Purpose: Mark indirect block as dirty * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_dirty(H5HF_indirect_t *iblock) +H5HF__iblock_dirty(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(iblock); @@ -338,7 +333,7 @@ H5HF_iblock_dirty(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_dirty() */ +} /* end H5HF__iblock_dirty() */ /*------------------------------------------------------------------------- @@ -349,7 +344,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -377,7 +371,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) nrows = hdr->man_dtable.cparam.start_root_rows; - block_row_off = H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); + block_row_off = H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); if(block_row_off > 0) block_row_off++; /* Account for the pair of initial rows of the initial block size */ rows_needed = 1 + block_row_off; @@ -418,7 +412,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") dblock->fd_parent = iblock; - if(H5HF_man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0) + if(H5HF__man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach root direct block to parent indirect block") /* Check for I/O filters on this heap */ @@ -443,7 +437,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ /* Start iterator at correct location */ - if(H5HF_hdr_start_iter(hdr, iblock, (hsize_t)(have_direct_block ? hdr->man_dtable.cparam.start_block_size : 0), have_direct_block) < 0) + if(H5HF__hdr_start_iter(hdr, iblock, (hsize_t)(have_direct_block ? hdr->man_dtable.cparam.start_block_size : 0), have_direct_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator") /* Check for skipping over direct blocks, in order to get to large enough block */ @@ -454,7 +448,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") /* Mark indirect block as modified */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Unprotect root indirect block (it's pinned by the iterator though) */ @@ -476,7 +470,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) acc_dblock_free -= hdr->man_dtable.row_tot_dblock_free[0]; /* Extend heap to cover new root indirect block */ - if(H5HF_hdr_adjust_heap(hdr, hdr->man_dtable.row_block_off[nrows], (hssize_t)acc_dblock_free) < 0) + if(H5HF__hdr_adjust_heap(hdr, hdr->man_dtable.row_block_off[nrows], (hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") done: @@ -492,7 +486,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -518,7 +511,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) FUNC_ENTER_PACKAGE /* Get "new block" iterator information */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") next_size = hdr->man_dtable.row_block_size[next_row]; @@ -538,7 +531,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) skip_direct_rows = TRUE; /* Make certain we allocate at least the required row for the block requested */ - min_nrows = 1 + H5HF_dtable_size_to_row(&hdr->man_dtable, min_dblock_size); + min_nrows = 1 + H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size); /* Set the information for the next block, of the appropriate size */ new_next_entry = (min_nrows - 1) * hdr->man_dtable.cparam.width; @@ -644,7 +637,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ /* Mark indirect block as dirty */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Update other shared header info */ @@ -652,7 +645,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) hdr->man_dtable.table_addr = new_addr; /* Extend heap to cover new root indirect block */ - if(H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], (hssize_t)acc_dblock_free) < 0) + if(H5HF__hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], (hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") done: @@ -668,7 +661,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jun 12 2006 * *------------------------------------------------------------------------- @@ -697,7 +689,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; /* Compute new # of rows in root indirect block */ - new_nrows = (unsigned)1 << (1 + H5VM_log2_gen((uint64_t)max_child_row)); + new_nrows = (unsigned)1 << (1 + H5VM__log2_gen((uint64_t)max_child_row)); /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ @@ -769,7 +761,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) } /* end if */ /* Mark indirect block as dirty */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Update other shared header info */ @@ -777,7 +769,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) hdr->man_dtable.table_addr = new_addr; /* Shrink heap to only cover new root indirect block */ - if(H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], -(hssize_t)acc_dblock_free) < 0) + if(H5HF__hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], -(hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce space to cover root direct block") done: @@ -796,7 +788,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -856,11 +847,11 @@ H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock) hdr->man_dtable.table_addr = dblock_addr; /* Reset 'next block' iterator */ - if(H5HF_hdr_reset_iter(hdr, (hsize_t)dblock_size) < 0) + if(H5HF__hdr_reset_iter(hdr, (hsize_t)dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Extend heap to just cover first direct block */ - if(H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) + if(H5HF__hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") /* Scan free space sections to reset any 'parent' pointers */ @@ -886,7 +877,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -919,11 +909,11 @@ H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") /* Get a pointer to the indirect block covering the section */ - if(NULL == (iblock = H5HF_sect_row_get_iblock(old_sec_node))) + if(NULL == (iblock = H5HF__sect_row_get_iblock(old_sec_node))) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve indirect block for row section") /* Hold indirect block in memory, until direct block can point to it */ - if(H5HF_iblock_incr(iblock) < 0) + if(H5HF__iblock_incr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") iblock_held = TRUE; @@ -953,7 +943,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 6 2006 * *------------------------------------------------------------------------- @@ -986,7 +975,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, /* Share common heap information */ iblock->hdr = hdr; - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") /* Set info for indirect block */ @@ -1050,7 +1039,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, iblock->par_entry = par_entry; if(iblock->parent) { /* Attach new block to parent */ - if(H5HF_man_iblock_attach(iblock->parent, par_entry, *addr_p) < 0) + if(H5HF__man_iblock_attach(iblock->parent, par_entry, *addr_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach indirect block to parent indirect block") /* Compute the indirect block's offset in the heap's address space */ @@ -1080,7 +1069,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, done: if(ret_value < 0) if(iblock) - if(H5HF_man_iblock_dest(iblock) < 0) + if(H5HF__man_iblock_dest(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) @@ -1095,7 +1084,6 @@ done: * Return: Pointer to indirect block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -1226,7 +1214,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 17 2006 * *------------------------------------------------------------------------- @@ -1273,24 +1260,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_attach + * Function: H5HF__man_iblock_attach * * Purpose: Attach a child block (direct or indirect) to an indirect block * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 30 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_addr) +H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_addr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1300,7 +1286,7 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad HDassert(!H5F_addr_defined(iblock->ents[entry].addr)); /* Increment the reference count on this indirect block */ - if(H5HF_iblock_incr(iblock) < 0) + if(H5HF__iblock_incr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Point at the child block */ @@ -1329,12 +1315,12 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad iblock->nchildren++; /* Mark indirect block as modified */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_attach() */ +} /* end H5HF__man_iblock_attach() */ /*------------------------------------------------------------------------- @@ -1345,7 +1331,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -1451,7 +1436,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) /* If the indirect block wasn't removed already (by reverting it) */ if(!iblock->removed_from_cache) { /* Mark indirect block as modified */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Check for last child being removed from indirect block */ @@ -1551,22 +1536,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_entry_addr + * Function: H5HF__man_iblock_entry_addr * * Purpose: Retrieve the address of an indirect block's child * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr) +H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -1578,7 +1562,7 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi *child_addr = iblock->ents[entry].addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iblock_entry_addr() */ +} /* end H5HF__man_iblock_entry_addr() */ /*------------------------------------------------------------------------- @@ -1593,7 +1577,6 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- @@ -1653,7 +1636,7 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row]; /* Compute # of rows in next child indirect block to use */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, row_block_size); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, row_block_size); /* Delete child indirect block */ if(H5HF__man_iblock_delete(hdr, iblock->ents[entry].addr, child_nrows, iblock, entry) < 0) @@ -1739,10 +1722,10 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, size_t u; /* Local index variable */ entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width; - first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM_log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM__log2_of2(hdr->man_dtable.cparam.width); num_indirect_rows = - (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; + (H5VM__log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) { size_t v; /* Local index variable */ @@ -1774,7 +1757,6 @@ done: * Return: Non-negative on success / Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Jan 14 2018 * *------------------------------------------------------------------------- @@ -1799,7 +1781,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, HDassert(ret_entry); /* Look up row & column for object */ - if(H5HF_dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) + if(H5HF__dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") /* Sanity check - first lookup must be an indirect block */ @@ -1823,7 +1805,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, prev_col = col; /* Look up row & column in new indirect block for object */ - if(H5HF_dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0) + if(H5HF__dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") } /* end while */ @@ -1841,24 +1823,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_dest + * Function: H5HF__man_iblock_dest * * Purpose: Destroys a fractal heap indirect block in memory. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 6 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_dest(H5HF_indirect_t *iblock) +H5HF__man_iblock_dest(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1868,7 +1849,7 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) /* Decrement reference count on shared info */ HDassert(iblock->hdr); - if(H5HF_hdr_decr(iblock->hdr) < 0) + if(H5HF__hdr_decr(iblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if(iblock->parent) if(H5HF__iblock_decr(iblock->parent) < 0) @@ -1887,5 +1868,5 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_dest() */ +} /* end H5HF__man_iblock_dest() */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index ceebc3b..002ff01 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -15,7 +15,7 @@ * * Created: H5HFiter.c * Apr 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Block iteration routines for fractal heaps. * @@ -77,7 +77,7 @@ H5FL_DEFINE(H5HF_block_loc_t); /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_init + * Function: H5HF__man_iter_init * * Purpose: Initialize a block iterator for walking over all the blocks * in a fractal heap. (initialization finishes when iterator is @@ -86,15 +86,14 @@ H5FL_DEFINE(H5HF_block_loc_t); * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_init(H5HF_block_iter_t *biter) +H5HF__man_iter_init(H5HF_block_iter_t *biter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -105,7 +104,7 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) HDmemset(biter, 0, sizeof(H5HF_block_iter_t)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_init() */ +} /* end H5HF__man_iter_init() */ /*------------------------------------------------------------------------- @@ -117,7 +116,6 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- @@ -212,7 +210,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, /* Compute # of rows in context indirect block */ child_size = hdr->man_dtable.row_block_size[biter->curr->up->row]; - iblock_nrows = (H5VM_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; + iblock_nrows = (H5VM__log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; } /* end else */ /* Load indirect block for this context location */ @@ -223,7 +221,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, biter->curr->context = iblock; /* Hold the indirect block with the location */ - if(H5HF_iblock_incr(biter->curr->context) < 0) + if(H5HF__iblock_incr(biter->curr->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Release the current indirect block */ @@ -265,22 +263,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_set_entry + * Function: H5HF__man_iter_set_entry * * Purpose: Set the current entry for the iterator * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry) +H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -293,11 +290,11 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne biter->curr->col = entry % hdr->man_dtable.cparam.width; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_set_entry() */ +} /* end H5HF__man_iter_set_entry() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_start_entry + * Function: H5HF__man_iter_start_entry * * Purpose: Initialize a block iterator to a particular location within * an indirect block @@ -305,19 +302,18 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, +H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, unsigned start_entry) { H5HF_block_loc_t *new_loc = NULL; /* Pointer to new block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -339,7 +335,7 @@ H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, new_loc->up = NULL; /* Increment reference count on indirect block */ - if(H5HF_iblock_incr(new_loc->context) < 0) + if(H5HF__iblock_incr(new_loc->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Make new location the current location */ @@ -353,11 +349,11 @@ done: new_loc = H5FL_FREE(H5HF_block_loc_t, new_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_start_entry() */ +} /* end H5HF__man_iter_start_entry() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_reset + * Function: H5HF__man_iter_reset * * Purpose: Reset a block iterator to it's initial state, freeing any * location context it currently has @@ -365,17 +361,16 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_reset(H5HF_block_iter_t *biter) +H5HF__man_iter_reset(H5HF_block_iter_t *biter) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -414,26 +409,25 @@ H5HF_man_iter_reset(H5HF_block_iter_t *biter) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_reset() */ +} /* end H5HF__man_iter_reset() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_next + * Function: H5HF__man_iter_next * * Purpose: Advance to the next block within the current block of the heap * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) +H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -450,29 +444,28 @@ H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) /* HDassert(biter->curr->row <= biter->curr->context->nrows); */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_next() */ +} /* end H5HF__man_iter_next() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_up + * Function: H5HF__man_iter_up * * Purpose: Move iterator up one level * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_up(H5HF_block_iter_t *biter) +H5HF__man_iter_up(H5HF_block_iter_t *biter) { H5HF_block_loc_t *up_loc; /* Pointer to 'up' block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -498,29 +491,28 @@ H5HF_man_iter_up(H5HF_block_iter_t *biter) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_up() */ +} /* end H5HF__man_iter_up() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_down + * Function: H5HF__man_iter_down * * Purpose: Move iterator down one level * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) +H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) { H5HF_block_loc_t *down_loc = NULL; /* Pointer to new 'down' block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -542,7 +534,7 @@ H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) down_loc->up = biter->curr; /* Increment reference count on indirect block */ - if(H5HF_iblock_incr(down_loc->context) < 0) + if(H5HF__iblock_incr(down_loc->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Make down location the current location */ @@ -553,27 +545,26 @@ done: down_loc = H5FL_FREE(H5HF_block_loc_t, down_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_down() */ +} /* end H5HF__man_iter_down() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_curr + * Function: H5HF__man_iter_curr * * Purpose: Retrieve information about the current block iterator location * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, +H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, H5HF_indirect_t **block) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -592,66 +583,25 @@ H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, *block = biter->curr->context; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_curr() */ - - -/*------------------------------------------------------------------------- - * Function: H5HF_man_iter_offset - * - * Purpose: Retrieve offset of iterator in heap - * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Apr 25 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset) -{ - hsize_t curr_offset; /* For computing offset in heap */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* - * Check arguments. - */ - HDassert(biter); - HDassert(biter->ready); - HDassert(biter->curr->context); - HDassert(offset); - - /* Compute the offset in the heap */ - curr_offset = biter->curr->context->block_off; - curr_offset += hdr->man_dtable.row_block_off[biter->curr->row]; - curr_offset += biter->curr->col * hdr->man_dtable.row_block_size[biter->curr->row]; - - /* Assign the return value */ - *offset = curr_offset; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_offset() */ +} /* end H5HF__man_iter_curr() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_ready + * Function: H5HF__man_iter_ready * * Purpose: Query if iterator is ready to use * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 25 2006 * *------------------------------------------------------------------------- */ hbool_t -H5HF_man_iter_ready(H5HF_block_iter_t *biter) +H5HF__man_iter_ready(H5HF_block_iter_t *biter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -659,5 +609,5 @@ H5HF_man_iter_ready(H5HF_block_iter_t *biter) HDassert(biter); FUNC_LEAVE_NOAPI(biter->ready) -} /* end H5HF_man_iter_ready() */ +} /* end H5HF__man_iter_ready() */ diff --git a/src/H5HFman.c b/src/H5HFman.c index ea00546..7a2f93c 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -15,7 +15,7 @@ * * Created: H5HFman.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: "Managed" object routines for fractal heaps. * @@ -97,7 +97,6 @@ static herr_t H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 13 2006 * *------------------------------------------------------------------------- @@ -154,7 +153,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) HDassert(sec_node->sect_info.state == H5FS_SECT_LIVE); /* Retrieve direct block address from section */ - if(H5HF_sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0) + if(H5HF__sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Lock direct block */ @@ -197,7 +196,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) hdr->man_nobjs++; /* Reduce space available in heap (marks header dirty) */ - if(H5HF_hdr_adj_free(hdr, -(ssize_t)obj_size) < 0) + if(H5HF__hdr_adj_free(hdr, -(ssize_t)obj_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap") done: @@ -215,22 +214,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_get_obj_len + * Function: H5HF__man_get_obj_len * * Purpose: Get the size of a managed heap object * * Return: SUCCEED (Can't fail) * - * Programmer: Dana Robinson (derobins@hdfgroup.org) + * Programmer: Dana Robinson * August 2012 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) +H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -249,7 +248,7 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) UINT64DECODE_VAR(id, *obj_len_p, hdr->heap_len_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_get_obj_len() */ +} /* end H5HF__man_get_obj_len() */ /*------------------------------------------------------------------------- @@ -260,7 +259,6 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) * Return: SUCCEED (Can't fail) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 20 2015 * *------------------------------------------------------------------------- @@ -296,7 +294,6 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 17 2006 * *------------------------------------------------------------------------- @@ -445,7 +442,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 17 2006 * *------------------------------------------------------------------------- @@ -465,7 +461,7 @@ H5HF__man_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine routine */ - if(H5HF__man_op_real(hdr, id, H5HF_op_read, obj, 0) < 0) + if(H5HF__man_op_real(hdr, id, H5HF__op_read, obj, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: @@ -481,7 +477,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- @@ -502,7 +497,7 @@ H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) /* Call the internal 'op' routine routine */ /* (Casting away const OK - QAK) */ - if(H5HF__man_op_real(hdr, id, H5HF_op_write, (void *)obj, H5HF_OP_MODIFY) < 0) + if(H5HF__man_op_real(hdr, id, H5HF__op_write, (void *)obj, H5HF_OP_MODIFY) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: @@ -518,7 +513,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sept 11 2006 * *------------------------------------------------------------------------- @@ -554,7 +548,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 15 2006 * *------------------------------------------------------------------------- @@ -643,7 +636,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "object overruns end of direct block") /* Create free space section node */ - if(NULL == (sec_node = H5HF_sect_single_new(obj_off, obj_len, iblock, dblock_entry))) + if(NULL == (sec_node = H5HF__sect_single_new(obj_off, obj_len, iblock, dblock_entry))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create section for direct block's free space") /* Unlock indirect block */ @@ -654,7 +647,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) } /* end if */ /* Increase space available in heap (marks header dirty) */ - if(H5HF_hdr_adj_free(hdr, (ssize_t)obj_len) < 0) + if(H5HF__hdr_adj_free(hdr, (ssize_t)obj_len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap") /* Update statistics about heap */ diff --git a/src/H5HFmodule.h b/src/H5HFmodule.h index dd6576a..0334673 100644 --- a/src/H5HFmodule.h +++ b/src/H5HFmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 83e46fc..ca05798 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * * Purpose: This file contains declarations which are visible only within @@ -134,7 +134,7 @@ /* Compute the # of bytes required to store an offset into a given buffer size */ #define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) -#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM_log2_of2((unsigned)(l))) +#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM__log2_of2((unsigned)(l))) /* Heap ID bit flags */ /* Heap ID version (2 bits: 6-7) */ @@ -220,9 +220,6 @@ typedef struct H5HF_dtable_t { /* Fractal heap free list info (forward decl - defined in H5HFflist.c) */ typedef struct H5HF_freelist_t H5HF_freelist_t; -/* Forward decl indirect block info */ -typedef struct H5HF_indirect_t H5HF_indirect_t; - /* Fractal heap block location */ typedef struct H5HF_block_loc_t { /* Necessary table fields */ @@ -293,7 +290,7 @@ typedef struct H5HF_free_section_t { /* (Each fractal heap header has certain information that is shared across all * the instances of blocks in that fractal heap) */ -typedef struct H5HF_hdr_t { +struct H5HF_hdr_t { /* Information for H5AC cache functions, _must_ be first field in structure */ H5AC_info_t cache_info; @@ -358,7 +355,7 @@ typedef struct H5HF_hdr_t { uint8_t heap_off_size; /* Size of heap offsets (in bytes) */ uint8_t heap_len_size; /* Size of heap ID lengths (in bytes) */ hbool_t checked_filters; /* TRUE if pipeline passes can_apply checks */ -} H5HF_hdr_t; +}; /* Common indirect block doubling table entry */ /* (common between entries pointing to direct & indirect child blocks) */ @@ -606,46 +603,45 @@ H5FL_BLK_EXTERN(direct_block); /******************************/ /* Doubling table routines */ -H5_DLL herr_t H5HF_dtable_init(H5HF_dtable_t *dtable); -H5_DLL herr_t H5HF_dtable_dest(H5HF_dtable_t *dtable); -H5_DLL herr_t H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, +H5_DLL herr_t H5HF__dtable_init(H5HF_dtable_t *dtable); +H5_DLL herr_t H5HF__dtable_dest(H5HF_dtable_t *dtable); +H5_DLL herr_t H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col); -H5_DLL unsigned H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size); -H5_DLL unsigned H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size); -H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, +H5_DLL unsigned H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size); +H5_DLL unsigned H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size); +H5_DLL hsize_t H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col, unsigned num_entries); /* Heap header routines */ -H5_DLL H5HF_hdr_t * H5HF_hdr_alloc(H5F_t *f); -H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam); +H5_DLL H5HF_hdr_t * H5HF__hdr_alloc(H5F_t *f); +H5_DLL haddr_t H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam); H5_DLL H5HF_hdr_t *H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags); -H5_DLL herr_t H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_finish_init(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_incr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_decr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr); -H5_DLL size_t H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_dirty(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt); -H5_DLL herr_t H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free); -H5_DLL herr_t H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size); -H5_DLL herr_t H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry); +H5_DLL herr_t H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_finish_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_incr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_decr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr); +H5_DLL size_t H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_dirty(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt); +H5_DLL herr_t H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free); +H5_DLL herr_t H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size); +H5_DLL herr_t H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry); H5_DLL herr_t H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); H5_DLL herr_t H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries); +H5_DLL herr_t H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries); H5_DLL herr_t H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr); -H5_DLL herr_t H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off); +H5_DLL herr_t H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off); H5_DLL herr_t H5HF__hdr_empty(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_free(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_free(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__hdr_delete(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr); /* Indirect block routines */ -H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__iblock_incr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF__iblock_decr(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__iblock_dirty(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size); H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, @@ -659,10 +655,10 @@ H5_DLL H5HF_indirect_t *H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock hbool_t must_protect, unsigned flags, hbool_t *did_protect); H5_DLL herr_t H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, hbool_t did_protect); -H5_DLL herr_t H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, +H5_DLL herr_t H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr); H5_DLL herr_t H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry); -H5_DLL herr_t H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, +H5_DLL herr_t H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr); H5_DLL herr_t H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry); @@ -670,7 +666,7 @@ H5_DLL herr_t H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size/*out*/); H5_DLL herr_t H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t *ret_par_block_off, unsigned *ret_entry); -H5_DLL herr_t H5HF_man_iblock_dest(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__man_iblock_dest(H5HF_indirect_t *iblock); /* Direct block routines */ H5_DLL herr_t H5HF__man_dblock_new(H5HF_hdr_t *fh, size_t request, @@ -688,12 +684,12 @@ H5_DLL herr_t H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, unsigned flags); H5_DLL herr_t H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size); -H5_DLL herr_t H5HF_man_dblock_dest(H5HF_direct_t *dblock); +H5_DLL herr_t H5HF__man_dblock_dest(H5HF_direct_t *dblock); /* Managed object routines */ H5_DLL herr_t H5HF__man_insert(H5HF_hdr_t *fh, size_t obj_size, const void *obj, void *id); -H5_DLL herr_t H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, +H5_DLL herr_t H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); H5_DLL void H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p); @@ -704,7 +700,7 @@ H5_DLL herr_t H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t o H5_DLL herr_t H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id); /* 'Huge' object routines */ -H5_DLL herr_t H5HF_huge_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__huge_init(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *id); H5_DLL herr_t H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, @@ -731,46 +727,32 @@ H5_DLL herr_t H5HF__huge_bt2_filt_dir_found(const void *nrecord, void *op_data); H5_DLL herr_t H5HF__huge_bt2_filt_dir_remove(const void *nrecord, void *op_data); /* 'Tiny' object routines */ -H5_DLL herr_t H5HF_tiny_init(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, +H5_DLL herr_t H5HF__tiny_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *id); -H5_DLL herr_t H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, +H5_DLL herr_t H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); -H5_DLL herr_t H5HF_tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); -H5_DLL herr_t H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, +H5_DLL herr_t H5HF__tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); +H5_DLL herr_t H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); - -/* Debugging routines for dumping file structures */ -H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, - FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, - FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, - FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec); -H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, - FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, - FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows); +H5_DLL herr_t H5HF__tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Block iteration routines */ -H5_DLL herr_t H5HF_man_iter_init(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_init(H5HF_block_iter_t *biter); H5_DLL herr_t H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t offset); -H5_DLL herr_t H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, +H5_DLL herr_t H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, unsigned start_entry); -H5_DLL herr_t H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry); -H5_DLL herr_t H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, +H5_DLL herr_t H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries); -H5_DLL herr_t H5HF_man_iter_up(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_man_iter_reset(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, +H5_DLL herr_t H5HF__man_iter_up(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__man_iter_reset(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, H5HF_indirect_t **block); -H5_DLL herr_t H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, - hsize_t *offset); -H5_DLL hbool_t H5HF_man_iter_ready(H5HF_block_iter_t *biter); +H5_DLL hbool_t H5HF__man_iter_ready(H5HF_block_iter_t *biter); /* Free space manipulation routines */ H5_DLL herr_t H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create); @@ -789,24 +771,24 @@ H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class); /* Free space section routines */ -H5_DLL H5HF_free_section_t *H5HF_sect_single_new(hsize_t sect_off, +H5_DLL H5HF_free_section_t *H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry); H5_DLL herr_t H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -H5_DLL herr_t H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size); H5_DLL herr_t H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, size_t amt); H5_DLL herr_t H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); H5_DLL herr_t H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entry_p); -H5_DLL H5HF_indirect_t *H5HF_sect_row_get_iblock(H5HF_free_section_t *sect); +H5_DLL H5HF_indirect_t *H5HF__sect_row_get_iblock(H5HF_free_section_t *sect); H5_DLL herr_t H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); H5_DLL herr_t H5HF__sect_single_free(H5FS_section_info_t *sect); /* Internal operator callbacks */ -H5_DLL herr_t H5HF_op_read(const void *obj, size_t obj_len, void *op_data); -H5_DLL herr_t H5HF_op_write(const void *obj, size_t obj_len, void *op_data); +H5_DLL herr_t H5HF__op_read(const void *obj, size_t obj_len, void *op_data); +H5_DLL herr_t H5HF__op_write(const void *obj, size_t obj_len, void *op_data); /* Testing routines */ #ifdef H5HF_TESTING diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index 4eec1c1..4919b90 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -15,7 +15,7 @@ * * Created: H5HFprivate.h * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible fractal heap routines. * @@ -86,8 +86,10 @@ typedef struct H5HF_stat_t { hsize_t tiny_nobjs; /* Number of 'tiny' objects in heap */ } H5HF_stat_t; -/* Fractal heap info (forward decl - defined in H5HFpkg.h) */ +/* Fractal heap info (forward decls - defined in H5HFpkg.h) */ typedef struct H5HF_t H5HF_t; +typedef struct H5HF_hdr_t H5HF_hdr_t; +typedef struct H5HF_indirect_t H5HF_indirect_t; /* Typedef for 'op' operations */ typedef herr_t (*H5HF_operator_t)(const void *obj/*in*/, size_t obj_len, @@ -128,5 +130,17 @@ H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, int indent H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); #endif /* H5HF_DEBUGGING */ +/* Debugging routines for dumping file structures */ +H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, + FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, + FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, + FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec); +H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, + FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, + FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows); + #endif /* _H5HFprivate_H */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index a0f984b..b2d1e3c 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 1, 2006 * * Purpose: Free space section routines for fractal heaps @@ -68,12 +68,12 @@ typedef struct { /********************/ /* Shared routines */ -static herr_t H5HF_sect_init_cls(H5FS_section_class_t *cls, +static herr_t H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr); -static herr_t H5HF_sect_term_cls(H5FS_section_class_t *cls); -static H5HF_free_section_t *H5HF_sect_node_new(unsigned sect_type, +static herr_t H5FS__sect_term_cls(H5FS_section_class_t *cls); +static H5HF_free_section_t *H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t state); -static herr_t H5HF_sect_node_free(H5HF_free_section_t *sect, +static herr_t H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent); /* 'single' section routines */ @@ -99,12 +99,12 @@ static herr_t H5HF__sect_single_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *sect); /* 'row' section routines */ -static H5HF_free_section_t *H5HF_sect_row_create(haddr_t sect_off, +static H5HF_free_section_t *H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect); static herr_t H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_row_parent_removed(H5HF_free_section_t *sect); -static herr_t H5HF_sect_row_from_single(H5HF_hdr_t *hdr, +static herr_t H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock); static herr_t H5HF__sect_row_free_real(H5HF_free_section_t *sect); @@ -131,7 +131,7 @@ static herr_t H5HF__sect_row_debug(const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth); /* 'indirect' section routines */ -static H5HF_free_section_t *H5HF_sect_indirect_new(H5HF_hdr_t *hdr, +static H5HF_free_section_t *H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries); @@ -139,9 +139,9 @@ static herr_t H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t hbool_t first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col); -static H5HF_free_section_t *H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, +static H5HF_free_section_t *H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect); -static herr_t H5HF_sect_indirect_decr(H5HF_free_section_t *sect); +static herr_t H5HF__sect_indirect_decr(H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, @@ -152,28 +152,28 @@ static herr_t H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry); static herr_t H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static hbool_t H5HF_sect_indirect_is_first(H5HF_free_section_t *sect); -static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect); -static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect); -static H5HF_free_section_t * H5HF_sect_indirect_top(H5HF_free_section_t *sect); +static hbool_t H5HF__sect_indirect_is_first(H5HF_free_section_t *sect); +static H5HF_indirect_t * H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect); +static hsize_t H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect); +static H5HF_free_section_t *H5HF__sect_indirect_top(H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect1, H5HF_free_section_t *sect2); static herr_t H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, +static herr_t H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf); static H5FS_section_info_t *H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); -static herr_t H5HF_sect_indirect_free(H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, +static herr_t H5HF__sect_indirect_free(H5HF_free_section_t *sect); +static herr_t H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, +static herr_t H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth); /* 'indirect' section callbacks */ -static herr_t H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *udata); -static herr_t H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls); +static herr_t H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *udata); +static herr_t H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls); /*********************/ @@ -273,8 +273,8 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_INDIRECT[1] = {{ NULL, /* Class private info */ /* Class methods */ - H5HF_sect_indirect_init_cls, /* Initialize section class */ - H5HF_sect_indirect_term_cls, /* Terminate section class */ + H5HF__sect_indirect_init_cls, /* Initialize section class */ + H5HF__sect_indirect_term_cls, /* Terminate section class */ /* Object methods */ NULL, /* Add section */ @@ -306,7 +306,7 @@ H5FL_DEFINE(H5HF_free_section_t); /*------------------------------------------------------------------------- - * Function: H5HF_sect_init_cls + * Function: H5FS__sect_init_cls * * Purpose: Initialize the common class structure * @@ -319,12 +319,12 @@ H5FL_DEFINE(H5HF_free_section_t); *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) +H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) { H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -339,16 +339,16 @@ H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) cls->cls_private = cls_prvt; /* Increment reference count on heap header */ - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_init_cls() */ +} /* H5FS__sect_init_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_term_cls + * Function: H5FS__sect_term_cls * * Purpose: Terminate the common class structure * @@ -361,12 +361,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_term_cls(H5FS_section_class_t *cls) +H5FS__sect_term_cls(H5FS_section_class_t *cls) { H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -375,7 +375,7 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls) cls_prvt = (H5HF_sect_private_t *)cls->cls_private; /* Decrement reference count on heap header */ - if(H5HF_hdr_decr(cls_prvt->hdr) < 0) + if(H5HF__hdr_decr(cls_prvt->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") /* Free the class private information */ @@ -383,11 +383,11 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_term_cls() */ +} /* H5FS__sect_term_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_node_new + * Function: H5FS__sect_node_new * * Purpose: Allocate a free space section node of a particular type * @@ -401,13 +401,13 @@ done: *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, +H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state) { H5HF_free_section_t *new_sect; /* New section */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(H5F_addr_defined(sect_addr)); @@ -429,11 +429,11 @@ H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_node_new() */ +} /* H5FS__sect_node_new() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_node_free + * Function: H5HF__sect_node_free * * Purpose: Free a section node * @@ -447,11 +447,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) +H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); @@ -465,30 +465,29 @@ H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_node_free() */ +} /* H5HF__sect_node_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_new + * Function: H5HF__sect_single_new * * Purpose: Create a new 'single' section and return it to the caller * * Return: Pointer to new section on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 30 2006 * *------------------------------------------------------------------------- */ H5HF_free_section_t * -H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, +H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry) { H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -496,13 +495,13 @@ H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, HDassert(sect_size); /* Create free space section node */ - if(NULL == (sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_off, (hsize_t)sect_size, H5FS_SECT_LIVE))) + if(NULL == (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_off, (hsize_t)sect_size, H5FS_SECT_LIVE))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for single section") /* Set the 'single' specific fields */ sect->u.single.parent = parent; if(sect->u.single.parent) { - if(H5HF_iblock_incr(sect->u.single.parent) < 0) + if(H5HF__iblock_incr(sect->u.single.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ sect->u.single.par_entry = par_entry; @@ -517,7 +516,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_new() */ +} /* end H5HF__sect_single_new() */ /*------------------------------------------------------------------------- @@ -528,7 +527,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * October 24 2006 * *------------------------------------------------------------------------- @@ -556,7 +554,7 @@ H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Increment reference count on indirect block that free section is in */ - if(H5HF_iblock_incr(sec_iblock) < 0) + if(H5HF__iblock_incr(sec_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Check for refreshing existing parent information */ @@ -590,7 +588,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 8 2006 * *------------------------------------------------------------------------- @@ -631,23 +628,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_dblock_info + * Function: H5HF__sect_single_dblock_info * * Purpose: Retrieve the direct block information for a single section * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * October 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, +H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size) { - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -673,7 +669,7 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_sect_single_dblock_info() */ +} /* end H5HF__sect_single_dblock_info() */ /*------------------------------------------------------------------------- @@ -686,7 +682,6 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -752,7 +747,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) size_t dblock_overhead; /* Direct block's overhead */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect); @@ -760,7 +755,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(hdr); /* Retrieve direct block address from section */ - if(H5HF_sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0) + if(H5HF__sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Check for section occupying entire direct block */ @@ -776,7 +771,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(H5F_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr)); /* Convert 'single' section into 'row' section */ - if(H5HF_sect_row_from_single(hdr, sect, dblock) < 0) + if(H5HF__sect_row_from_single(hdr, sect, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't convert single section into row section") /* Destroy direct block */ @@ -876,7 +871,7 @@ H5HF__sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, HDassert(sect_size); /* Create free list section node */ - if(NULL == (new_sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_addr, sect_size, H5FS_SECT_SERIALIZED))) + if(NULL == (new_sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_addr, sect_size, H5FS_SECT_SERIALIZED))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "allocation failed for direct block free list section") /* Set return value */ @@ -1086,7 +1081,7 @@ H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") /* Retrieve direct block address from section */ - if(H5HF_sect_single_dblock_info(hdr, (*sect), &dblock_addr, &dblock_size) < 0) + if(H5HF__sect_single_dblock_info(hdr, (*sect), &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Protect the direct block for the section */ @@ -1140,14 +1135,13 @@ H5HF__sect_single_free(H5FS_section_info_t *_sect) HDassert(sect); /* Check for live reference to an indirect block */ - if(sect->sect_info.state == H5FS_SECT_LIVE) { + if(sect->sect_info.state == H5FS_SECT_LIVE) /* Get parent indirect block, if there was one */ if(sect->u.single.parent) parent = sect->u.single.parent; - } /* end if */ /* Release the section */ - if(H5HF_sect_node_free(sect, parent) < 0) + if(H5HF__sect_node_free(sect, parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: @@ -1194,7 +1188,7 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 HDassert(H5F_addr_defined(iblock->ents[sect->u.single.par_entry].addr)); /* Retrieve direct block address from section */ - status = H5HF_sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); + status = H5HF__sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); HDassert(status >= 0); HDassert(H5F_addr_eq(iblock->ents[sect->u.single.par_entry].addr, dblock_addr)); HDassert(dblock_size > 0); @@ -1239,7 +1233,7 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_create + * Function: H5HF__sect_row_create * * Purpose: Create a new 'row' section * @@ -1253,13 +1247,13 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, +H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect) { H5HF_free_section_t *sect = NULL; /* 'Row' section created */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect_size); @@ -1268,7 +1262,7 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, /* Create 'row' free space section node */ /* ("inherits" underlying indirect section's state) */ - if(NULL == (sect = H5HF_sect_node_new((unsigned)(is_first ? H5HF_FSPACE_SECT_FIRST_ROW : H5HF_FSPACE_SECT_NORMAL_ROW), sect_off, sect_size, under_sect->sect_info.state))) + if(NULL == (sect = H5FS__sect_node_new((unsigned)(is_first ? H5HF_FSPACE_SECT_FIRST_ROW : H5HF_FSPACE_SECT_NORMAL_ROW), sect_off, sect_size, under_sect->sect_info.state))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for row section") /* Set the 'row' specific fields */ @@ -1283,29 +1277,28 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_create() */ +} /* H5HF__sect_row_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_from_single + * Function: H5HF__sect_row_from_single * * Purpose: Convert a 'single' section into a 'row' section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, +H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1323,7 +1316,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, sect->u.row.checked_out = FALSE; /* Create indirect section that underlies the row section */ - if(NULL == (sect->u.row.under = H5HF_sect_indirect_for_row(hdr, dblock->parent, sect))) + if(NULL == (sect->u.row.under = H5HF__sect_indirect_for_row(hdr, dblock->parent, sect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "serializing row section not supported yet") /* Release single section's hold on underlying indirect block */ @@ -1332,7 +1325,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_from_single() */ +} /* end H5HF__sect_row_from_single() */ /*------------------------------------------------------------------------- @@ -1343,7 +1336,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -1391,7 +1383,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -1467,7 +1458,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -1501,24 +1491,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_get_iblock + * Function: H5HF__sect_row_get_iblock * * Purpose: Retrieve the indirect block for a row section * * Return: Pointer to indirect block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 9 2006 * *------------------------------------------------------------------------- */ H5HF_indirect_t * -H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) +H5HF__sect_row_get_iblock(H5HF_free_section_t *sect) { H5HF_indirect_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -1528,10 +1517,10 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); HDassert(sect->sect_info.state == H5FS_SECT_LIVE); - ret_value = H5HF_sect_indirect_get_iblock(sect->u.row.under); + ret_value = H5HF__sect_indirect_get_iblock(sect->u.row.under); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_get_iblock() */ +} /* end H5HF__sect_row_get_iblock() */ /*------------------------------------------------------------------------- @@ -1543,7 +1532,6 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) * Return: Non-negative on success / Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * February 4 2018 * *------------------------------------------------------------------------- @@ -1617,7 +1605,7 @@ H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) HDassert(hdr); /* Call common class initialization */ - if(H5HF_sect_init_cls(cls, hdr) < 0) + if(H5FS__sect_init_cls(cls, hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize common section class") /* First row sections actually are proxies for indirection sections on disk */ @@ -1659,7 +1647,7 @@ H5HF__sect_row_term_cls(H5FS_section_class_t *cls) HDassert(cls); /* Call common class termination */ - if(H5HF_sect_term_cls(cls) < 0) + if(H5FS__sect_term_cls(cls) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't terminate common section class") done: @@ -1700,7 +1688,7 @@ H5HF__sect_row_serialize(const H5FS_section_class_t *cls, /* Forward to indirect routine to serialize underlying section */ hdr = ((H5HF_sect_private_t *)(cls->cls_private))->hdr; - if(H5HF_sect_indirect_serialize(hdr, sect->u.row.under, buf) < 0) + if(H5HF__sect_indirect_serialize(hdr, sect->u.row.under, buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSERIALIZE, FAIL, "can't serialize row section's underlying indirect section") done: @@ -1785,22 +1773,20 @@ H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, HDassert(H5F_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); /* Get the top indirect section underlying each row */ - top_indir_sect1 = H5HF_sect_indirect_top(sect1->u.row.under); + top_indir_sect1 = H5HF__sect_indirect_top(sect1->u.row.under); HDassert(top_indir_sect1); - top_indir_sect2 = H5HF_sect_indirect_top(sect2->u.row.under); + top_indir_sect2 = H5HF__sect_indirect_top(sect2->u.row.under); HDassert(top_indir_sect2); /* Check if second section shares the same underlying indirect block as * the first section, but doesn't already have same underlying indirect * section. */ - if(top_indir_sect1 != top_indir_sect2) { - if(H5HF_sect_indirect_iblock_off(sect1->u.row.under) == H5HF_sect_indirect_iblock_off(sect2->u.row.under)) { + if(top_indir_sect1 != top_indir_sect2) + if(H5HF__sect_indirect_iblock_off(sect1->u.row.under) == H5HF__sect_indirect_iblock_off(sect2->u.row.under)) /* Check if second section adjoins first section */ if(H5F_addr_eq((top_indir_sect1->sect_info.addr + top_indir_sect1->u.indirect.span_size), top_indir_sect2->sect_info.addr)) HGOTO_DONE(TRUE) - } /* end if */ - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1846,7 +1832,7 @@ H5HF__sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, H5HF_free_section_t *top_indir_sect; /* Top indirect section for row */ /* Get the top indirect section underlying second row section */ - top_indir_sect = H5HF_sect_indirect_top(sect2->u.row.under); + top_indir_sect = H5HF__sect_indirect_top(sect2->u.row.under); /* Shrink away underlying indirect section */ if(H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) @@ -1934,7 +1920,7 @@ H5HF__sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) HDassert((*sect)->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Get the top indirect section underlying each row */ - top_indir_sect = H5HF_sect_indirect_top((*sect)->u.row.under); + top_indir_sect = H5HF__sect_indirect_top((*sect)->u.row.under); /* Shrink away underlying indirect section */ if(H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) @@ -1972,7 +1958,7 @@ H5HF__sect_row_free_real(H5HF_free_section_t *sect) HDassert(sect); /* Release the section */ - if(H5HF_sect_node_free(sect, NULL) < 0) + if(H5HF__sect_node_free(sect, NULL) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: @@ -2006,7 +1992,7 @@ H5HF__sect_row_free(H5FS_section_info_t *_sect) HDassert(sect->u.row.under); /* Decrement the ref. count on the row section's underlying indirect section */ - if(H5HF_sect_indirect_decr(sect->u.row.under) < 0) + if(H5HF__sect_indirect_decr(sect->u.row.under) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't detach section node") /* Release the section */ @@ -2069,10 +2055,10 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t HDassert(sect->u.row.row == indir_sect->u.indirect.row); /* Get the top indirect section underlying row */ - top_indir_sect = H5HF_sect_indirect_top(sect->u.row.under); + top_indir_sect = H5HF__sect_indirect_top(sect->u.row.under); /* Check that the row's underlying indirect section is valid */ - H5HF_sect_indirect_valid(hdr, top_indir_sect); + H5HF__sect_indirect_valid(hdr, top_indir_sect); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -2119,7 +2105,7 @@ H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Underlying indirect section:"); - H5HF_sect_indirect_debug(sect->u.row.under, stream, indent + 3, MAX(0, fwidth - 3)); + H5HF__sect_indirect_debug(sect->u.row.under, stream, indent + 3, MAX(0, fwidth - 3)); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -2127,24 +2113,23 @@ H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_iblock_off + * Function: H5HF__sect_indirect_iblock_off * * Purpose: Get the offset of the indirect block for the section * * Return: Offset of indirect block in "heap space" (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static hsize_t -H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) +H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect) { hsize_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -2154,28 +2139,27 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) ret_value = sect->sect_info.state == H5FS_SECT_LIVE ? sect->u.indirect.u.iblock->block_off : sect->u.indirect.u.iblock_off; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_iblock_off() */ +} /* end H5HF__sect_indirect_iblock_off() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_top + * Function: H5HF__sect_indirect_top * * Purpose: Get the "top" indirect section * * Return: Pointer to the top indirect section (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_top(H5HF_free_section_t *sect) +H5HF__sect_indirect_top(H5HF_free_section_t *sect) { H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -2183,16 +2167,16 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect) HDassert(sect); if(sect->u.indirect.parent) - ret_value = H5HF_sect_indirect_top(sect->u.indirect.parent); + ret_value = H5HF__sect_indirect_top(sect->u.indirect.parent); else ret_value = sect; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_top() */ +} /* end H5HF__sect_indirect_top() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_init_cls + * Function: H5HF__sect_indirect_init_cls * * Purpose: Initialize the "indirect" class structure * @@ -2206,19 +2190,19 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) +H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_udata; /* Fractal heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); HDassert(hdr); /* Call to common class initialization */ - if(H5HF_sect_init_cls(cls, hdr) < 0) + if(H5FS__sect_init_cls(cls, hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize common section class") /* Set the size of all serialized objects of this class of sections */ @@ -2226,11 +2210,11 @@ H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_init_cls() */ +} /* H5HF__sect_indirect_init_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_term_cls + * Function: H5HF__sect_indirect_term_cls * * Purpose: Terminate the "indirect" class structure * @@ -2244,26 +2228,26 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls) +H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); /* Call common class termination */ - if(H5HF_sect_term_cls(cls) < 0) + if(H5FS__sect_term_cls(cls) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't terminate common section class") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_term_cls() */ +} /* H5HF__sect_indirect_term_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_new + * Function: H5HF__sect_indirect_new * * Purpose: Create a new 'indirect' section for other routines to finish * initializing. @@ -2271,20 +2255,19 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, +H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2293,7 +2276,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, HDassert(nentries); /* Create free space section node */ - if(NULL == (sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, + if(NULL == (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, sect_size, (iblock ? H5FS_SECT_LIVE : H5FS_SECT_SERIALIZED)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for indirect section") @@ -2302,7 +2285,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, sect->u.indirect.u.iblock = iblock; sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width * sect->u.indirect.u.iblock->max_rows; - if(H5HF_iblock_incr(sect->u.indirect.u.iblock) < 0) + if(H5HF__iblock_incr(sect->u.indirect.u.iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ else { @@ -2314,7 +2297,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, sect->u.indirect.num_entries = nentries; /* Compute span size of indirect section */ - sect->u.indirect.span_size = H5HF_dtable_span_size(&hdr->man_dtable, + sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries); HDassert(sect->u.indirect.span_size > 0); @@ -2332,30 +2315,29 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_new() */ +} /* end H5HF__sect_indirect_new() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_for_row + * Function: H5HF__sect_indirect_for_row * * Purpose: Create the underlying indirect section for a new row section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, +H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2366,7 +2348,7 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, HDassert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows); /* Create free space section node */ - if(NULL == (sect = H5HF_sect_indirect_new(hdr, row_sect->sect_info.addr, + if(NULL == (sect = H5HF__sect_indirect_new(hdr, row_sect->sect_info.addr, row_sect->sect_info.size, iblock, iblock->block_off, row_sect->u.row.row, row_sect->u.row.col, row_sect->u.row.num_entries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section") @@ -2391,11 +2373,11 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, done: if(!ret_value && sect) - if(H5HF_sect_indirect_free(sect) < 0) + if(H5HF__sect_indirect_free(sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_for_row() */ +} /* end H5HF__sect_indirect_for_row() */ /*------------------------------------------------------------------------- @@ -2407,7 +2389,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -2521,7 +2502,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_free_section_t *row_sect = NULL; /* 'Row' free space section to add */ /* Create 'row' free space section node */ - if(NULL == (row_sect = H5HF_sect_row_create(curr_off, + if(NULL == (row_sect = H5HF__sect_row_create(curr_off, (hdr->man_dtable.row_block_size[u] - dblock_overhead), first_child, u, row_col, row_entries, sect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "creation failed for child row section") @@ -2558,7 +2539,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned v; /* Local index variable */ /* Compute info about row's indirect blocks for child section */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[u]); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[u]); child_nentries = child_nrows * hdr->man_dtable.cparam.width; /* Add an indirect section for each indirect block in the row */ @@ -2570,7 +2551,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, haddr_t child_iblock_addr; /* Child indirect block's address on disk */ /* Get the address of the child indirect block */ - if(H5HF_man_iblock_entry_addr(sect->u.indirect.u.iblock, curr_entry, &child_iblock_addr) < 0) + if(H5HF__man_iblock_entry_addr(sect->u.indirect.u.iblock, curr_entry, &child_iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve child indirect block's address") /* If the child indirect block's address is defined, protect it */ @@ -2585,7 +2566,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, child_iblock = NULL; /* Create free space section node */ - if(NULL == (child_sect = H5HF_sect_indirect_new(hdr, curr_off, (hsize_t)0, + if(NULL == (child_sect = H5HF__sect_indirect_new(hdr, curr_off, (hsize_t)0, child_iblock, curr_off, 0, 0, child_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -2658,7 +2639,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 3 2006 * *------------------------------------------------------------------------- @@ -2702,7 +2682,7 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start sect_off += hdr->man_dtable.row_block_size[start_row] * start_col; /* Create free space section node */ - if(NULL == (sect = H5HF_sect_indirect_new(hdr, sect_off, (hsize_t)0, iblock, + if(NULL == (sect = H5HF__sect_indirect_new(hdr, sect_off, (hsize_t)0, iblock, iblock->block_off, start_row, start_col, nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -2720,7 +2700,7 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start done: if(ret_value < 0 && sect) - if(H5HF_sect_indirect_free(sect) < 0) + if(H5HF__sect_indirect_free(sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) @@ -2728,24 +2708,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_decr + * Function: H5HF__sect_indirect_decr * * Purpose: Decrement ref. count on indirect section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_decr(H5HF_free_section_t *sect) +H5HF__sect_indirect_decr(H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2764,18 +2743,18 @@ H5HF_sect_indirect_decr(H5HF_free_section_t *sect) par_sect = sect->u.indirect.parent; /* Free indirect section */ - if(H5HF_sect_indirect_free(sect) < 0) + if(H5HF__sect_indirect_free(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") /* Decrement ref. count on indirect section's parent */ if(par_sect) - if(H5HF_sect_indirect_decr(par_sect) < 0) + if(H5HF__sect_indirect_decr(par_sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement ref. count on parent indirect section") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_decr() */ +} /* end H5HF__sect_indirect_decr() */ /*------------------------------------------------------------------------- @@ -2786,7 +2765,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 3 2006 * *------------------------------------------------------------------------- @@ -2832,7 +2810,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -2854,7 +2831,7 @@ H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indi HDassert(sect_iblock); /* Increment reference count on indirect block that free section is in */ - if(H5HF_iblock_incr(sect_iblock) < 0) + if(H5HF__iblock_incr(sect_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Set the pointer to the section's indirect block */ @@ -2891,7 +2868,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -2954,7 +2930,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */ /* Check if this section is the first section */ - is_first = H5HF_sect_indirect_is_first(sect); + is_first = H5HF__sect_indirect_is_first(sect); /* Remove this indirect section from parent indirect section */ if(H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) @@ -3069,7 +3045,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, } /* end else */ /* Create peer indirect section */ - if(NULL == (peer_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, + if(NULL == (peer_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, iblock, iblock_off, start_row, start_col, peer_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -3144,7 +3120,7 @@ done: /* Sanity check - we should only be here if an error occurred */ HDassert(ret_value < 0); - if(H5HF_sect_indirect_free(peer_sect) < 0) + if(H5HF__sect_indirect_free(peer_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") } /* end if */ @@ -3162,7 +3138,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -3203,7 +3178,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */ /* Check if this section is the first section */ - is_first = H5HF_sect_indirect_is_first(sect); + is_first = H5HF__sect_indirect_is_first(sect); /* Reduce parent indirect section */ if(H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) @@ -3298,7 +3273,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, /* Update the number of entries in current section & calculate it's span size */ /* (Will use this to compute the section address for the peer section */ sect->u.indirect.num_entries = new_nentries; - sect->u.indirect.span_size = H5HF_dtable_span_size(&hdr->man_dtable, + sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, sect->u.indirect.row, sect->u.indirect.col, new_nentries); HDassert(sect->u.indirect.span_size > 0); @@ -3308,7 +3283,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, peer_sect_addr += hdr->man_dtable.row_block_size[child_row]; /* Create peer indirect section */ - if(NULL == (peer_sect = H5HF_sect_indirect_new(hdr, peer_sect_addr, + if(NULL == (peer_sect = H5HF__sect_indirect_new(hdr, peer_sect_addr, sect->sect_info.size, iblock, iblock_off, peer_start_row, peer_start_col, peer_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -3370,7 +3345,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, /* Decrement # of sections which depend on this row */ /* (Must be last as section can be freed) */ - if(H5HF_sect_indirect_decr(sect) < 0) + if(H5HF__sect_indirect_decr(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement section's ref. count ") done: @@ -3380,7 +3355,7 @@ done: /* Sanity check - we should only be here if an error occurred */ HDassert(ret_value < 0); - if(H5HF_sect_indirect_free(peer_sect) < 0) + if(H5HF__sect_indirect_free(peer_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") } /* end if */ @@ -3389,24 +3364,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_is_first + * Function: H5HF__sect_indirect_is_first * * Purpose: Check if indirect section is first in all parents * * Return: Non-negative (TRUE/FALSE) on success/ * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 17 2006 * *------------------------------------------------------------------------- */ static hbool_t -H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) +H5HF__sect_indirect_is_first(H5HF_free_section_t *sect) { hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(sect); @@ -3414,13 +3388,13 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) /* Recurse to parent */ if(sect->u.indirect.parent) { if(sect->sect_info.addr == sect->u.indirect.parent->sect_info.addr) - ret_value = H5HF_sect_indirect_is_first(sect->u.indirect.parent); + ret_value = H5HF__sect_indirect_is_first(sect->u.indirect.parent); } /* end if */ else ret_value = TRUE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_is_first() */ +} /* end H5HF__sect_indirect_is_first() */ /*------------------------------------------------------------------------- @@ -3431,7 +3405,6 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -3476,22 +3449,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_get_iblock + * Function: H5HF__sect_indirect_get_iblock * * Purpose: Retrieve the indirect block for a indirect section * * Return: Pointer to indirect block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 9 2006 * *------------------------------------------------------------------------- */ static H5HF_indirect_t * -H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) +H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -3501,7 +3473,7 @@ H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) HDassert(sect->sect_info.state == H5FS_SECT_LIVE); FUNC_LEAVE_NOAPI(sect->u.indirect.u.iblock) -} /* end H5HF_sect_indirect_get_iblock() */ +} /* end H5HF__sect_indirect_get_iblock() */ /*------------------------------------------------------------------------- @@ -3545,9 +3517,9 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, HDassert(row_sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Set up indirect section information */ - sect1 = H5HF_sect_indirect_top(row_sect1->u.row.under); + sect1 = H5HF__sect_indirect_top(row_sect1->u.row.under); HDassert(sect1); - sect2 = H5HF_sect_indirect_top(row_sect2->u.row.under); + sect2 = H5HF__sect_indirect_top(row_sect2->u.row.under); HDassert(sect2); /* Sanity check some assumptions about the indirect sections */ @@ -3722,11 +3694,11 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, /* Decrement ref. count on second indirect section's parent */ HDassert(sect2->u.indirect.rc == 0); if(sect2->u.indirect.parent) - if(H5HF_sect_indirect_decr(sect2->u.indirect.parent) < 0) + if(H5HF__sect_indirect_decr(sect2->u.indirect.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement ref. count on parent indirect section") /* Free second indirect section */ - if(H5HF_sect_indirect_free(sect2) < 0) + if(H5HF__sect_indirect_free(sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") /* Re-add the second section's first row */ @@ -3806,7 +3778,7 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(par_row >= hdr->man_dtable.max_direct_rows); /* Create parent indirect section */ - if(NULL == (par_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, + if(NULL == (par_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, par_iblock, par_block_off, par_row, par_col, 1))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -3828,7 +3800,7 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) done: if(ret_value < 0) - if(par_sect && H5HF_sect_indirect_free(par_sect) < 0) + if(par_sect && H5HF__sect_indirect_free(par_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) @@ -3883,7 +3855,7 @@ H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free child section node") /* Free the indirect section itself */ - if(H5HF_sect_indirect_free(sect) < 0) + if(H5HF__sect_indirect_free(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") done: @@ -3892,7 +3864,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_serialize + * Function: H5HF__sect_indirect_serialize * * Purpose: Serialize a "live" indirect section into a buffer * @@ -3906,12 +3878,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, +H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -3921,7 +3893,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, /* Check if this indirect section has a parent & forward if this section is first */ if(sect->u.indirect.parent) { if(sect->sect_info.addr == sect->u.indirect.parent->sect_info.addr) - if(H5HF_sect_indirect_serialize(hdr, sect->u.indirect.parent, buf) < 0) + if(H5HF__sect_indirect_serialize(hdr, sect->u.indirect.parent, buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSERIALIZE, FAIL, "can't serialize indirect section's parent indirect section") } /* end if */ else { @@ -3945,7 +3917,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_serialize() */ +} /* H5HF__sect_indirect_serialize() */ /*------------------------------------------------------------------------- @@ -3997,7 +3969,7 @@ H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, UINT16DECODE(buf, nentries); /* Create free space section node */ - if(NULL == (new_sect = H5HF_sect_indirect_new(hdr, sect_addr, sect_size, + if(NULL == (new_sect = H5HF__sect_indirect_new(hdr, sect_addr, sect_size, NULL, iblock_off, start_row, start_col, nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section") @@ -4027,7 +3999,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_free + * Function: H5HF__sect_indirect_free * * Purpose: Free a 'indirect' section node * @@ -4041,12 +4013,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_free(H5HF_free_section_t *sect) +H5HF__sect_indirect_free(H5HF_free_section_t *sect) { H5HF_indirect_t *iblock = NULL; /* Indirect block for section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); @@ -4057,23 +4029,22 @@ H5HF_sect_indirect_free(H5HF_free_section_t *sect) sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents); /* Check for live reference to an indirect block */ - if(sect->sect_info.state == H5FS_SECT_LIVE) { + if(sect->sect_info.state == H5FS_SECT_LIVE) /* Get indirect block, if there was one */ if(sect->u.indirect.u.iblock) iblock = sect->u.indirect.u.iblock; - } /* end if */ /* Release the sections */ - if(H5HF_sect_node_free(sect, iblock) < 0) + if(H5HF__sect_node_free(sect, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_free() */ +} /* H5HF__sect_indirect_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_valid + * Function: H5HF__sect_indirect_valid * * Purpose: Check the validity of a section * @@ -4086,7 +4057,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) +H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) { unsigned start_row; /* Row for first block covered */ unsigned start_col; /* Column for first block covered */ @@ -4095,7 +4066,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) unsigned end_entry; /* Entry for last block covered */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check arguments */ HDassert(hdr); @@ -4167,16 +4138,16 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) } /* end if */ /* Recursively check child indirect section */ - H5HF_sect_indirect_valid(hdr, tmp_child_sect); + H5HF__sect_indirect_valid(hdr, tmp_child_sect); } /* end for */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_indirect_valid() */ +} /* H5HF__sect_indirect_valid() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_debug + * Function: H5HF__sect_indirect_debug * * Purpose: Dump debugging information about an indirect free space section * @@ -4190,10 +4161,10 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, +H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -4210,5 +4181,5 @@ H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, sect->u.indirect.num_entries); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_indirect_debug() */ +} /* H5HF__sect_indirect_debug() */ diff --git a/src/H5HFspace.c b/src/H5HFspace.c index ad5ff0f..b518996 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -15,7 +15,7 @@ * * Created: H5HFspace.c * May 2 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Space allocation routines for fractal heaps. * @@ -89,7 +89,6 @@ * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -153,7 +152,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 15 2006 * *------------------------------------------------------------------------- @@ -198,7 +196,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -237,7 +234,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_space_revert_root_cb + * Function: H5HF__space_revert_root_cb * * Purpose: Callback routine from iterator, to reset 'parent' pointers in * sections, when the heap is changing from having a root indirect @@ -247,18 +244,17 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 24 2012 * *------------------------------------------------------------------------- */ static herr_t -H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) +H5HF__space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -279,7 +275,7 @@ H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udat done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_revert_root_cb() */ +} /* end H5HF__space_revert_root_cb() */ /*------------------------------------------------------------------------- @@ -292,7 +288,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 23 2012 * *------------------------------------------------------------------------- @@ -312,7 +307,7 @@ H5HF__space_revert_root(const H5HF_hdr_t *hdr) /* Only need to scan the sections if the free space has been initialized */ if(hdr->fspace) /* Iterate over all sections, resetting the parent pointers in 'single' sections */ - if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0) + if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF__space_revert_root_cb, NULL) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to reset parent pointers") done: @@ -321,7 +316,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_space_create_root_cb + * Function: H5HF__space_create_root_cb * * Purpose: Callback routine from iterator, to set 'parent' pointers in * sections to newly created root indirect block, when the heap @@ -331,19 +326,18 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 24 2012 * *------------------------------------------------------------------------- */ static herr_t -H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) +H5HF__space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ H5HF_indirect_t *root_iblock = (H5HF_indirect_t *)_udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -357,7 +351,7 @@ H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); /* Increment ref. count on new root indirect block */ - if(H5HF_iblock_incr(root_iblock) < 0) + if(H5HF__iblock_incr(root_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on section's indirect block") /* Set parent info ("live" section must _NOT_ have a parent right now) */ @@ -370,7 +364,7 @@ H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_create_root_cb() */ +} /* end H5HF__space_create_root_cb() */ /*------------------------------------------------------------------------- @@ -384,7 +378,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 24 2012 * *------------------------------------------------------------------------- @@ -405,7 +398,7 @@ H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock) /* Only need to scan the sections if the free space has been initialized */ if(hdr->fspace) /* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect block */ - if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0) + if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF__space_create_root_cb, root_iblock) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to set parent pointers") done: @@ -422,7 +415,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14 2007 * *------------------------------------------------------------------------- @@ -467,7 +459,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 24 2006 * *------------------------------------------------------------------------- @@ -505,7 +496,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -529,9 +519,6 @@ H5HF__space_close(H5HF_hdr_t *hdr) /* Retrieve the number of sections for this heap */ if(H5FS_sect_stats(hdr->fspace, NULL, &nsects) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOUNT, FAIL, "can't query free space section count") -#ifdef QAK -HDfprintf(stderr, "%s: nsects = %Hu\n", FUNC, nsects); -#endif /* QAK */ /* Close the free space for the heap */ if(H5FS_close(hdr->f, hdr->fspace) < 0) @@ -560,7 +547,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 7 2006 * *------------------------------------------------------------------------- @@ -596,7 +582,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -607,9 +592,6 @@ H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16 herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ /* * Check arguments. diff --git a/src/H5HFstat.c b/src/H5HFstat.c index 7d18ba6..456fd60 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, March 6, 2006 * * Purpose: Fractal heap metadata statistics functions. diff --git a/src/H5HFtest.c b/src/H5HFtest.c index d6eecd7..14b20eb 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, February 3, 2006 * * Purpose: Fractal heap testing functions. @@ -189,13 +189,10 @@ H5HF_cmp_cparam_test(const H5HF_create_t *cparam1, const H5HF_create_t *cparam2) /* Don't worry about comparing the filter names right now... */ /* (they are expanded during the encode/decode process, but aren't copied - * during the H5Z_append operation, generating false positive failures) + * during the H5Z_append operation, generating false positive failures -QAK) */ -#ifdef QAK +#if 0 /* Check filter name */ -HDfprintf(stderr, "%s: Check 1.0\n", "H5HF_cmp_cparam_test"); -HDfprintf(stderr, "%s: cparam1->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u, (cparam1->pline.filter[u].name ? cparam1->pline.filter[u].name : "")); -HDfprintf(stderr, "%s: cparam2->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u, (cparam2->pline.filter[u].name ? cparam2->pline.filter[u].name : "")); if(!cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) HGOTO_DONE(-1) else if(cparam1->pline.filter[u].name && !cparam2->pline.filter[u].name) @@ -204,7 +201,7 @@ HDfprintf(stderr, "%s: cparam2->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam if((ret_value = HDstrcmp(cparam1->pline.filter[u].name, cparam2->pline.filter[u].name))) HGOTO_DONE(ret_value) } /* end if */ -#endif /* QAK */ +#endif /* Check # of filter parameters */ if(cparam1->pline.filter[u].cd_nelmts < cparam2->pline.filter[u].cd_nelmts) diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 113124c..21da6da 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -15,7 +15,7 @@ * * Created: H5HFtiny.c * Aug 14 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for "tiny" objects in fractal heap * @@ -63,7 +63,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, +static herr_t H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); @@ -83,22 +83,21 @@ static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, /*------------------------------------------------------------------------- - * Function: H5HF_tiny_init + * Function: H5HF__tiny_init * * Purpose: Initialize information for tracking 'tiny' objects * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 14 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_init(H5HF_hdr_t *hdr) +H5HF__tiny_init(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -126,33 +125,29 @@ H5HF_tiny_init(H5HF_hdr_t *hdr) } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_tiny_init() */ +} /* end H5HF__tiny_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_insert + * Function: H5HF__tiny_insert * * Purpose: Pack a 'tiny' object in a heap ID * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 14 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) +H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) { uint8_t *id = (uint8_t *)_id; /* Pointer to ID buffer */ size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT -#ifdef QAK -HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); -#endif /* QAK */ + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -185,33 +180,32 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); hdr->tiny_nobjs++; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_insert() */ +} /* end H5HF__tiny_insert() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_get_obj_len + * Function: H5HF__tiny_get_obj_len * * Purpose: Get the size of a 'tiny' object in a fractal heap * * Return: SUCCEED (Can't fail) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 14 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) +H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { size_t enc_obj_size; /* Encoded object size */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -233,30 +227,29 @@ H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) *obj_len_p = enc_obj_size + 1; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_tiny_get_obj_len() */ +} /* end H5HF__tiny_get_obj_len() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_op_real + * Function: H5HF__tiny_op_real * * Purpose: Internal routine to perform operation on 'tiny' object * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, +H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) { size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -266,8 +259,8 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, HDassert(op); /* Get the object's encoded length */ - /* H5HF_tiny_obj_len can't fail */ - ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size); + /* H5HF__tiny_obj_len can't fail */ + ret_value = H5HF__tiny_get_obj_len(hdr, id, &enc_obj_size); /* Advance past flag byte(s) */ if(!hdr->tiny_len_extended) @@ -285,28 +278,27 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_op_real() */ +} /* end H5HF__tiny_op_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_read + * Function: H5HF__tiny_read * * Purpose: Read a 'tiny' object from the heap * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) +H5HF__tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -316,34 +308,33 @@ H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine */ - if(H5HF_tiny_op_real(hdr, id, H5HF_op_read, obj) < 0) + if(H5HF__tiny_op_real(hdr, id, H5HF__op_read, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_read() */ +} /* end H5HF__tiny_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_op + * Function: H5HF__tiny_op * * Purpose: Operate directly on a 'tiny' object * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 11 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, +H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -353,34 +344,33 @@ H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, HDassert(op); /* Call the internal 'op' routine routine */ - if(H5HF_tiny_op_real(hdr, id, op, op_data) < 0) + if(H5HF__tiny_op_real(hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_op() */ +} /* end H5HF__tiny_op() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_remove + * Function: H5HF__tiny_remove * * Purpose: Remove a 'tiny' object from the heap statistics * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 14 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) +H5HF__tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) { size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -389,17 +379,17 @@ H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) HDassert(id); /* Get the object's encoded length */ - /* H5HF_tiny_obj_len can't fail */ - ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size); + /* H5HF__tiny_obj_len can't fail */ + ret_value = H5HF__tiny_get_obj_len(hdr, id, &enc_obj_size); /* Update statistics about heap */ hdr->tiny_size -= enc_obj_size; hdr->tiny_nobjs--; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_remove() */ +} /* end H5HF__tiny_remove() */ diff --git a/src/H5HG.c b/src/H5HG.c index f9d780c..dc945e0 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, March 27, 1998 * * Purpose: Operations on the global heap. The global heap is the set of @@ -763,7 +763,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HG_remove (H5F_t *f, H5HG_t *hobj) +H5HG_remove(H5F_t *f, H5HG_t *hobj) { H5HG_heap_t *heap = NULL; uint8_t *p = NULL, *obj_start = NULL; diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 7485aad..f85df33 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -15,7 +15,7 @@ * * Created: H5HGcache.c * Feb 5 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement global heap metadata cache methods. * diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index a5e5363..a0697aa 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: Global Heap object debugging functions. @@ -77,7 +77,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Mar 27, 1998 * *------------------------------------------------------------------------- diff --git a/src/H5HGmodule.h b/src/H5HGmodule.h index 1c68206..e661328 100644 --- a/src/H5HGmodule.h +++ b/src/H5HGmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index 3119de4..735b4fb 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: This file contains declarations which are visible diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index 573ef39..1a22d56 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, March 27, 1998 */ #ifndef _H5HGprivate_H diff --git a/src/H5HGquery.c b/src/H5HGquery.c index 35abc2e..005235c 100644 --- a/src/H5HGquery.c +++ b/src/H5HGquery.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, July 20, 2011 * * Purpose: Query routines for global heaps. diff --git a/src/H5HL.c b/src/H5HL.c index f290294..f628e93 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -15,7 +15,7 @@ * * Created: H5HL.c * Jul 16 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Heap functions for the local heaps used by symbol * tables to store names (among other things). diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 734ec5c..38cf060 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -15,7 +15,7 @@ * * Created: H5HLcache.c * Feb 5 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement local heap metadata cache methods. * diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index edb0261..c0ec68b 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: Local Heap object debugging functions. diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index c3fcffe..88348a0 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -15,7 +15,7 @@ * * Created: H5HLdblk.c * Summer 2012 - * Dana Robinson + * Dana Robinson * * Purpose: Data block routines for local heaps. * diff --git a/src/H5HLint.c b/src/H5HLint.c index cc3e3ea..17527c1 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -15,7 +15,7 @@ * * Created: H5HLint.c * Oct 12 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Local heap internal routines. * diff --git a/src/H5HLprfx.c b/src/H5HLprfx.c index 41c254a..8c4ffad 100644 --- a/src/H5HLprfx.c +++ b/src/H5HLprfx.c @@ -15,7 +15,7 @@ * * Created: H5HLprfx.c * Summer 2012 - * Dana Robinson + * Dana Robinson * * Purpose: Prefix routines for local heaps. * diff --git a/src/H5HP.c b/src/H5HP.c index 4ef5662..340457b 100644 --- a/src/H5HP.c +++ b/src/H5HP.c @@ -46,10 +46,10 @@ struct H5HP_t { }; /* Static functions */ -static herr_t H5HP_swim_max(H5HP_t *heap, size_t loc); -static herr_t H5HP_swim_min(H5HP_t *heap, size_t loc); -static herr_t H5HP_sink_max(H5HP_t *heap, size_t loc); -static herr_t H5HP_sink_min(H5HP_t *heap, size_t loc); +static herr_t H5HP__swim_max(H5HP_t *heap, size_t loc); +static herr_t H5HP__swim_min(H5HP_t *heap, size_t loc); +static herr_t H5HP__sink_max(H5HP_t *heap, size_t loc); +static herr_t H5HP__sink_min(H5HP_t *heap, size_t loc); /* Declare a free list to manage the H5HP_t struct */ H5FL_DEFINE_STATIC(H5HP_t); @@ -60,11 +60,11 @@ H5FL_SEQ_DEFINE_STATIC(H5HP_ent_t); /*-------------------------------------------------------------------------- NAME - H5HP_swim_max + H5HP__swim_max PURPOSE Restore heap condition by moving an object upward USAGE - herr_t H5HP_swim_max(heap, loc) + herr_t H5HP__swim_max(heap, loc) H5HP_t *heap; IN/OUT: Pointer to heap to modify size_t loc; IN: Location to start from @@ -80,13 +80,13 @@ H5FL_SEQ_DEFINE_STATIC(H5HP_ent_t); REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5HP_swim_max(H5HP_t *heap, size_t loc) +H5HP__swim_max(H5HP_t *heap, size_t loc) { int val; /* Temporary copy value of object to move in heap */ H5HP_info_t *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -113,16 +113,16 @@ H5HP_swim_max(H5HP_t *heap, size_t loc) heap->heap[loc].obj->heap_loc=loc; FUNC_LEAVE_NOAPI(ret_value); -} /* end H5HP_swim_max() */ +} /* end H5HP__swim_max() */ /*-------------------------------------------------------------------------- NAME - H5HP_swim_min + H5HP__swim_min PURPOSE Restore heap condition by moving an object upward USAGE - herr_t H5HP_swim_min(heap, loc) + herr_t H5HP__swim_min(heap, loc) H5HP_t *heap; IN/OUT: Pointer to heap to modify size_t loc; IN: Location to start from @@ -138,13 +138,13 @@ H5HP_swim_max(H5HP_t *heap, size_t loc) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5HP_swim_min(H5HP_t *heap, size_t loc) +H5HP__swim_min(H5HP_t *heap, size_t loc) { int val; /* Temporary copy value of object to move in heap */ H5HP_info_t *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -171,16 +171,16 @@ H5HP_swim_min(H5HP_t *heap, size_t loc) heap->heap[loc].obj->heap_loc=loc; FUNC_LEAVE_NOAPI(ret_value); -} /* end H5HP_swim_min() */ +} /* end H5HP__swim_min() */ /*-------------------------------------------------------------------------- NAME - H5HP_sink_max + H5HP__sink_max PURPOSE Restore heap condition by moving an object downward USAGE - herr_t H5HP_sink_max(heap, loc) + herr_t H5HP__sink_max(heap, loc) H5HP_t *heap; IN/OUT: Pointer to heap to modify size_t loc; IN: Location to start from @@ -196,13 +196,13 @@ H5HP_swim_min(H5HP_t *heap, size_t loc) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5HP_sink_max(H5HP_t *heap, size_t loc) +H5HP__sink_max(H5HP_t *heap, size_t loc) { int val; /* Temporary copy value of object to move in heap */ void *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -240,16 +240,16 @@ H5HP_sink_max(H5HP_t *heap, size_t loc) heap->heap[loc].obj->heap_loc = loc; FUNC_LEAVE_NOAPI(ret_value); -} /* end H5HP_sink_max() */ +} /* end H5HP__sink_max() */ /*-------------------------------------------------------------------------- NAME - H5HP_sink_min + H5HP__sink_min PURPOSE Restore heap condition by moving an object downward USAGE - herr_t H5HP_sink_min(heap, loc) + herr_t H5HP__sink_min(heap, loc) H5HP_t *heap; IN/OUT: Pointer to heap to modify size_t loc; IN: Location to start from @@ -265,13 +265,13 @@ H5HP_sink_max(H5HP_t *heap, size_t loc) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5HP_sink_min(H5HP_t *heap, size_t loc) +H5HP__sink_min(H5HP_t *heap, size_t loc) { int val; /* Temporary copy value of object to move in heap */ void *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -309,7 +309,7 @@ H5HP_sink_min(H5HP_t *heap, size_t loc) heap->heap[loc].obj->heap_loc = loc; FUNC_LEAVE_NOAPI(ret_value); -} /* end H5HP_sink_min() */ +} /* end H5HP__sink_min() */ /*-------------------------------------------------------------------------- @@ -493,11 +493,11 @@ H5HP_insert(H5HP_t *heap, int val, void *obj) /* Restore heap condition */ if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_swim_max(heap,heap->nobjs)<0) + if(H5HP__swim_max(heap,heap->nobjs)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_swim_min(heap,heap->nobjs)<0) + if(H5HP__swim_min(heap,heap->nobjs)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "unable to restore heap condition"); } /* end else */ @@ -619,11 +619,11 @@ H5HP_remove(H5HP_t *heap, int *val, void **obj) /* Restore heap condition, if there are objects on the heap */ if(heap->nobjs>0) { if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_sink_max(heap, (size_t)1) < 0) + if(H5HP__sink_max(heap, (size_t)1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_sink_min(heap, (size_t)1) < 0) + if(H5HP__sink_min(heap, (size_t)1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to restore heap condition"); } /* end else */ } /* end if */ @@ -695,21 +695,21 @@ H5HP_change(H5HP_t *heap, int val, void *_obj) /* Restore heap condition */ if(valtype==H5HP_MAX_HEAP) { - if(H5HP_sink_max(heap,obj_loc)<0) + if(H5HP__sink_max(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_swim_min(heap,obj_loc)<0) + if(H5HP__swim_min(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end else */ } /* end if */ else { if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_swim_max(heap,obj_loc)<0) + if(H5HP__swim_max(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_sink_min(heap,obj_loc)<0) + if(H5HP__sink_min(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end else */ } /* end else */ @@ -778,11 +778,11 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj) /* Restore heap condition */ if(H5HP_MAX_HEAP == heap->type) { - if(H5HP_swim_max(heap, obj_loc) < 0) + if(H5HP__swim_max(heap, obj_loc) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition") } /* end if */ else { - if(H5HP_sink_min(heap, obj_loc) < 0) + if(H5HP__sink_min(heap, obj_loc) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition") } /* end else */ @@ -851,11 +851,11 @@ H5HP_decr(H5HP_t *heap, unsigned amt, void *_obj) /* Restore heap condition */ if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_sink_max(heap,obj_loc)<0) + if(H5HP__sink_max(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_swim_min(heap,obj_loc)<0) + if(H5HP__swim_min(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end else */ diff --git a/src/H5Imodule.h b/src/H5Imodule.h index 60bda5a..9c56842 100644 --- a/src/H5Imodule.h +++ b/src/H5Imodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index 2c1d81f..54b7b43 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 15, 2003 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Itest.c b/src/H5Itest.c index 07c1965..a51f860 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, July 27, 2010 * * Purpose: ID testing functions. diff --git a/src/H5L.c b/src/H5L.c index 4ef045d..f6b361a 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -98,7 +98,7 @@ typedef struct { /* Local Prototypes */ /********************/ -static int H5L_find_class_idx(H5L_type_t id); +static int H5L__find_class_idx(H5L_type_t id); static herr_t H5L__link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); @@ -1559,7 +1559,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_find_class_idx + * Function: H5L__find_class_idx * * Purpose: Given a link class ID, return the offset in the global array * that holds all the registered link classes. @@ -1574,12 +1574,12 @@ done: *------------------------------------------------------------------------- */ static int -H5L_find_class_idx(H5L_type_t id) +H5L__find_class_idx(H5L_type_t id) { size_t i; /* Local index variable */ int ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR for(i = 0; i < H5L_table_used_g; i++) if(H5L_table_g[i].id == id) @@ -1587,7 +1587,7 @@ H5L_find_class_idx(H5L_type_t id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_find_class_idx */ +} /* end H5L__find_class_idx */ /*------------------------------------------------------------------------- @@ -1613,7 +1613,7 @@ H5L_find_class(H5L_type_t id) FUNC_ENTER_NOAPI(NULL) /* Get the index in the global table */ - if((idx = H5L_find_class_idx(id)) < 0) + if((idx = H5L__find_class_idx(id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, NULL, "unable to find link class") /* Set return value */ @@ -2054,7 +2054,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_create_hard + * Function: H5L__create_hard * * Purpose: Creates a hard link from NEW_NAME to CUR_NAME. * @@ -2066,7 +2066,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, +H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id) { char *norm_cur_name = NULL; /* Pointer to normalized current name */ @@ -2078,7 +2078,7 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, hbool_t loc_valid = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(cur_loc); @@ -2123,11 +2123,11 @@ done: H5MM_xfree(norm_cur_name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_create_hard() */ +} /* end H5L__create_hard() */ /*------------------------------------------------------------------------- - * Function: H5L_create_soft + * Function: H5L__create_soft * * Purpose: Creates a soft link from LINK_NAME to TARGET_PATH. * @@ -2139,14 +2139,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_create_soft(const char *target_path, const H5G_loc_t *link_loc, +H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id) { char *norm_target = NULL; /* Pointer to normalized current name */ H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(link_loc); @@ -2171,7 +2171,7 @@ done: H5MM_xfree(norm_target); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_create_soft() */ +} /* end H5L__create_soft() */ /*------------------------------------------------------------------------- @@ -2206,7 +2206,7 @@ H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, lnk.u.ud.udata = NULL; /* Make sure that this link class is registered */ - if(H5L_find_class_idx(type) < 0) + if(H5L__find_class_idx(type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "link class has not been registered with library") /* Fill in UD link-specific information in the link struct*/ @@ -2327,7 +2327,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_val + * Function: H5L__get_val * * Purpose: Returns the value of a symbolic link or the udata for a * user-defined link. @@ -2346,12 +2346,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size) +H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size) { H5L_trav_gv_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(loc); @@ -2367,7 +2367,7 @@ H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t siz done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_get_val() */ +} /* H5L__get_val() */ /*------------------------------------------------------------------------- @@ -2422,7 +2422,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_val_by_idx + * Function: H5L__get_val_by_idx * * Purpose: Internal routine to query a link value according to the * index within a group @@ -2435,13 +2435,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, +H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, void *buf/*out*/, size_t size) { H5L_trav_gvbi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -2460,7 +2460,7 @@ H5L_get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_val_by_idx() */ +} /* end H5L__get_val_by_idx() */ /*------------------------------------------------------------------------- @@ -2513,7 +2513,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_delete + * Function: H5L__delete * * Purpose: Delete a link from a group. * @@ -2525,12 +2525,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_delete(const H5G_loc_t *loc, const char *name) +H5L__delete(const H5G_loc_t *loc, const char *name) { char *norm_name = NULL; /* Pointer to normalized name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(loc); @@ -2550,7 +2550,7 @@ done: H5MM_xfree(norm_name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_delete() */ +} /* end H5L__delete() */ /*------------------------------------------------------------------------- @@ -2593,7 +2593,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_delete_by_idx + * Function: H5L__delete_by_idx * * Purpose: Internal routine to delete a link according to its index * within a group. @@ -2606,13 +2606,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, +H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { H5L_trav_rmbi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(loc); @@ -2629,7 +2629,7 @@ H5L_delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_delete_by_idx() */ +} /* end H5L__delete_by_idx() */ /*------------------------------------------------------------------------- @@ -2859,7 +2859,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_move + * Function: H5L__move * * Purpose: Atomically move or copy a link. * @@ -2879,7 +2879,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, +H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, hid_t lcpl_id) { unsigned dst_target_flags = H5G_TARGET_NORMAL; @@ -2888,7 +2888,7 @@ H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_lo H5L_trav_mv_t udata; /* User data for traversal */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(src_loc); @@ -2935,7 +2935,7 @@ H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_lo done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_move() */ +} /* end H5L__move() */ /*------------------------------------------------------------------------- @@ -3036,7 +3036,7 @@ done: * * Purpose: Returns whether a link exists in a group * - * Note: Same as H5L_exists, except that missing links are reported + * Note: Same as H5L__exists, except that missing links are reported * as 'FALSE' instead of causing failures * * Return: Non-negative (TRUE/FALSE) on success/Negative on failure @@ -3099,7 +3099,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_exists + * Function: H5L__exists * * Purpose: Returns whether a link exists in a group * @@ -3114,12 +3114,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5L_exists(const H5G_loc_t *loc, const char *name) +H5L__exists(const H5G_loc_t *loc, const char *name) { H5L_trav_le_t udata; /* User data for traversal */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* A path of "/" will always exist in a file */ if(0 == HDstrcmp(name, "/")) @@ -3135,7 +3135,7 @@ H5L_exists(const H5G_loc_t *loc, const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_exists() */ +} /* H5L__exists() */ /*------------------------------------------------------------------------- @@ -3260,7 +3260,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_info_by_idx + * Function: H5L__get_info_by_idx * * Purpose: Internal routine to retrieve link info according to an * index's order. @@ -3270,13 +3270,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, +H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo /*out*/) { H5L_trav_gibi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -3295,7 +3295,7 @@ H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_info_by_idx() */ +} /* end H5L__get_info_by_idx() */ /*------------------------------------------------------------------------- @@ -3339,7 +3339,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_name_by_idx + * Function: H5L__get_name_by_idx * * Purpose: Internal routine to retrieve link name according to an * index's order. @@ -3349,14 +3349,14 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5L_get_name_by_idx(const H5G_loc_t *loc, const char *group_name, +H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name /*out*/, size_t size) { H5L_trav_gnbi_t udata; /* User data for callback */ ssize_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -3379,7 +3379,7 @@ H5L_get_name_by_idx(const H5G_loc_t *loc, const char *group_name, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_name_by_idx() */ +} /* end H5L__get_name_by_idx() */ /*------------------------------------------------------------------------- @@ -3391,7 +3391,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 29 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 8a3e3e1..b8c7819 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -291,7 +291,7 @@ H5L__extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, siz const uint8_t *udata = (const uint8_t *)_udata; /* Pointer to external link buffer */ ssize_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check external link version & flags */ if(((*udata >> 4) & 0x0F) != H5L_EXT_VERSION) diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h index cba4de4..d80126d 100644 --- a/src/H5Lmodule.h +++ b/src/H5Lmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index f0e9cfc..34890a1 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Friday, December 1, 2005 * * Purpose: This file contains declarations which are visible @@ -51,9 +51,31 @@ /* Package Private Prototypes */ /******************************/ +H5_DLL herr_t H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id); +H5_DLL herr_t H5L__create_soft(const char *target_path, const H5G_loc_t *cur_loc, + const char *cur_name, hid_t lcpl_id); H5_DLL herr_t H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void * ud_data, size_t ud_data_size, H5L_type_t type, hid_t lcpl_id); +H5_DLL htri_t H5L__exists(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + H5L_info2_t *linfo /*out*/); +H5_DLL ssize_t H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + char *name /*out*/, size_t size); +H5_DLL herr_t H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, + size_t size); +H5_DLL herr_t H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + void *buf/*out*/, size_t size); +H5_DLL herr_t H5L__move(const H5G_loc_t *src_loc, const char *src_name, + const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, + hid_t lcpl_id); +H5_DLL herr_t H5L__delete(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info); diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index 0487557..df842f3 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -113,31 +113,9 @@ H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, hid_t lcpl_id); H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, H5O_obj_create_t *ocrt_info, hid_t lcpl_id); -H5_DLL herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, - const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id); -H5_DLL herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *cur_loc, - const char *cur_name, hid_t lcpl_id); -H5_DLL herr_t H5L_move(const H5G_loc_t *src_loc, const char *src_name, - const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, - hid_t lcpl_id); H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name); -H5_DLL htri_t H5L_exists(const H5G_loc_t *loc, const char *name); H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info2_t *linkbuf/*out*/); -H5_DLL herr_t H5L_delete(const H5G_loc_t *loc, const char *name); -H5_DLL herr_t H5L_delete_by_idx(const H5G_loc_t *loc, const char *name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - H5L_info2_t *linfo /*out*/); -H5_DLL ssize_t H5L_get_name_by_idx(const H5G_loc_t *loc, const char *group_name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - char *name /*out*/, size_t size); -H5_DLL herr_t H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, - size_t size); -H5_DLL herr_t H5L_get_val_by_idx(const H5G_loc_t *loc, const char *name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - void *buf/*out*/, size_t size); H5_DLL herr_t H5L_register_external(void); H5_DLL herr_t H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 3bac5ac..861fafc 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -57,7 +57,7 @@ extern "C" { * Values 64 to 255 are for "user-defined" link class types; these types are * defined by HDF5 but their behavior can be overridden by users. * Users who want to create new classes of links should contact the HDF5 - * development team at hdfhelp@ncsa.uiuc.edu . + * development team at help@hdfgroup.org. * These values can never change because they appear in HDF5 files. */ typedef enum { diff --git a/src/H5MF.c b/src/H5MF.c index fac6620..7de09cb 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -15,7 +15,7 @@ * * Created: H5MF.c * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: File memory management functions. * @@ -51,9 +51,11 @@ #define H5MF_FSPACE_EXPAND 120 /* Percent of "normal" size to expand serialized free space size */ #define H5MF_CHECK_FSM(FSM, CF) \ - HDassert(*CF == FALSE); \ - if(!H5F_addr_defined(FSM->addr) || !H5F_addr_defined(FSM->sect_addr)) \ - *CF = TRUE; + do { \ + HDassert(*CF == FALSE); \ + if(!H5F_addr_defined(FSM->addr) || !H5F_addr_defined(FSM->sect_addr)) \ + *CF = TRUE; \ + } while(0) /* For non-paged aggregation: map allocation request type to tracked free-space type */ /* F_SH -- pointer to H5F_shared_t; T -- H5FD_mem_t */ @@ -300,7 +302,6 @@ H5MF__alloc_to_fs_type(H5F_shared_t *f_sh, H5FD_mem_t alloc_type, hsize_t size, * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 8 2008 * *------------------------------------------------------------------------- @@ -380,7 +381,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 8 2008 * *------------------------------------------------------------------------- @@ -419,7 +419,7 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) fs_create.client = H5FS_CLIENT_FILE_ID; fs_create.shrink_percent = H5MF_FSPACE_SHRINK; fs_create.expand_percent = H5MF_FSPACE_EXPAND; - fs_create.max_sect_addr = 1 + H5VM_log2_gen((uint64_t)f->shared->maxaddr); + fs_create.max_sect_addr = 1 + H5VM__log2_gen((uint64_t)f->shared->maxaddr); fs_create.max_sect_size = f->shared->maxaddr; /* Set up alignment and threshold to use depending on TYPE */ @@ -466,7 +466,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 8 2008 * *------------------------------------------------------------------------- @@ -781,7 +780,6 @@ done: * Failure: HADDR_UNDEF * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 11 1997 * *------------------------------------------------------------------------- @@ -1086,7 +1084,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 17 1997 * *------------------------------------------------------------------------- @@ -1448,7 +1445,6 @@ H5MF__sects_dump(f, stderr); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 14 2008 * *------------------------------------------------------------------------- @@ -2173,7 +2169,7 @@ H5MF__close_shrink_eoa(H5F_t *f) } /* end for */ /* check the two aggregators */ - if((status = H5MF_aggrs_try_shrink_eoa(f)) < 0) + if((status = H5MF__aggrs_try_shrink_eoa(f)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; @@ -2503,7 +2499,7 @@ H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, hsize_t hnums = 0; /* # of sections */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -3334,35 +3330,31 @@ static herr_t H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, hbool_t *continue_alloc_fsm) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(f_sh); HDassert(continue_alloc_fsm); /* Check sm_hdr_fspace */ - if(sm_hdr_fspace && sm_hdr_fspace->serial_sect_count > 0 && sm_hdr_fspace->sinfo) { + if(sm_hdr_fspace && sm_hdr_fspace->serial_sect_count > 0 && sm_hdr_fspace->sinfo) H5MF_CHECK_FSM(sm_hdr_fspace, continue_alloc_fsm); - } /* end if */ if(!(*continue_alloc_fsm)) if(sm_sinfo_fspace && sm_sinfo_fspace != sm_hdr_fspace && - sm_sinfo_fspace->serial_sect_count > 0 && sm_sinfo_fspace->sinfo) { + sm_sinfo_fspace->serial_sect_count > 0 && sm_sinfo_fspace->sinfo) H5MF_CHECK_FSM(sm_hdr_fspace, continue_alloc_fsm); - } /* end if */ if(H5F_SHARED_PAGED_AGGR(f_sh) && !(*continue_alloc_fsm)) { /* Check lg_hdr_fspace */ - if(lg_hdr_fspace && lg_hdr_fspace->serial_sect_count > 0 && lg_hdr_fspace->sinfo) { + if(lg_hdr_fspace && lg_hdr_fspace->serial_sect_count > 0 && lg_hdr_fspace->sinfo) H5MF_CHECK_FSM(lg_hdr_fspace, continue_alloc_fsm); - } /* end if */ /* Check lg_sinfo_fspace */ if(!(*continue_alloc_fsm)) if(lg_sinfo_fspace && lg_sinfo_fspace != lg_hdr_fspace && - lg_sinfo_fspace->serial_sect_count > 0 && lg_sinfo_fspace->sinfo) { + lg_sinfo_fspace->serial_sect_count > 0 && lg_sinfo_fspace->sinfo) H5MF_CHECK_FSM(lg_sinfo_fspace, continue_alloc_fsm); - } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 0124555..ce7db6b 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 8, 2008 * * Purpose: Routines for aggregating free space allocations @@ -874,7 +874,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5MF_aggrs_try_shrink_eoa + * Function: H5MF__aggrs_try_shrink_eoa * * Purpose: Check the metadata & small block aggregators to see if * EOA shrink is possible; if so, shrink each aggregator @@ -887,13 +887,13 @@ done: *------------------------------------------------------------------------- */ htri_t -H5MF_aggrs_try_shrink_eoa(H5F_t *f) +H5MF__aggrs_try_shrink_eoa(H5F_t *f) { htri_t ma_status; /* Whether the metadata aggregator can shrink the EOA */ htri_t sda_status; /* Whether the small data aggregator can shrink the EOA */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -915,5 +915,5 @@ H5MF_aggrs_try_shrink_eoa(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MF_aggrs_try_shrink_eoa() */ +} /* end H5MF__aggrs_try_shrink_eoa() */ diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 43e2305..abdecce 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -15,7 +15,7 @@ * * Created: H5MFdbg.c * Jan 31 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File memory management debugging functions. * @@ -92,7 +92,6 @@ static herr_t H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * January 31 2008 * *------------------------------------------------------------------------- @@ -148,7 +147,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * January 31 2008 * *------------------------------------------------------------------------- @@ -209,7 +207,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 31 2008 * *------------------------------------------------------------------------- diff --git a/src/H5MFmodule.h b/src/H5MFmodule.h index 53daabf..6b3aba5 100644 --- a/src/H5MFmodule.h +++ b/src/H5MFmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index fc398db..7d72658 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 8, 2008 * * Purpose: This file contains declarations which are visible only within @@ -191,6 +191,7 @@ H5_DLL herr_t H5MF__sect_free(H5FS_section_info_t *sect); /* Block aggregator routines */ H5_DLL htri_t H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, haddr_t abs_blk_end, hsize_t extra_requested); +H5_DLL htri_t H5MF__aggrs_try_shrink_eoa(H5F_t *f); H5_DLL htri_t H5MF__aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr, const H5MF_free_section_t *sect, H5MF_shrink_type_t *shrink); H5_DLL herr_t H5MF__aggr_absorb(const H5F_t *f, H5F_blk_aggr_t *aggr, diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index acd773b..2e9ea99 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -15,7 +15,7 @@ * * Created: H5MFprivate.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Private header file for file memory management. * @@ -69,7 +69,6 @@ H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size); /* 'block aggregator' routines */ H5_DLL herr_t H5MF_free_aggrs(H5F_t *f); -H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f); /* Free space manager settling routines */ H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled); diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 715ece4..f69df41 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 8, 2008 * * Purpose: Free space section callbacks for file. @@ -112,7 +112,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{ NULL, /* Add section */ NULL, /* Serialize section */ H5MF__sect_deserialize, /* Deserialize section */ - H5MF__sect_simple_can_merge, /* Can sections merge? */ + H5MF__sect_simple_can_merge, /* Can sections merge? */ H5MF__sect_simple_merge, /* Merge sections */ H5MF__sect_simple_can_shrink, /* Can section shrink container?*/ H5MF__sect_simple_shrink, /* Shrink container w/section */ @@ -136,16 +136,16 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ /* Object methods */ H5MF__sect_small_add, /* Add section */ - NULL, /* Serialize section */ - H5MF__sect_deserialize, /* Deserialize section */ + NULL, /* Serialize section */ + H5MF__sect_deserialize, /* Deserialize section */ H5MF__sect_small_can_merge, /* Can sections merge? */ H5MF__sect_small_merge, /* Merge sections */ - NULL, /* Can section shrink container?*/ - NULL, /* Shrink container w/section */ + NULL, /* Can section shrink container?*/ + NULL, /* Shrink container w/section */ H5MF__sect_free, /* Free section */ H5MF__sect_valid, /* Check validity of section */ H5MF__sect_split, /* Split section node for alignment */ - NULL, /* Dump debugging for section */ + NULL, /* Dump debugging for section */ }}; /* Class info for "large" free space sections */ @@ -166,7 +166,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{ H5MF__sect_deserialize, /* Deserialize section */ H5MF__sect_large_can_merge, /* Can sections merge? */ H5MF__sect_large_merge, /* Merge sections */ - H5MF__sect_large_can_shrink, /* Can section shrink container?*/ + H5MF__sect_large_can_shrink, /* Can section shrink container?*/ H5MF__sect_large_shrink, /* Shrink container w/section */ H5MF__sect_free, /* Free section */ H5MF__sect_valid, /* Check validity of section */ @@ -199,7 +199,6 @@ H5FL_DEFINE(H5MF_free_section_t); * Return: Pointer to new section on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * January 8 2008 * *------------------------------------------------------------------------- diff --git a/src/H5MM.c b/src/H5MM.c index cceac4f..efe955a 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -15,7 +15,7 @@ * * Created: H5MM.c * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Memory management functions * diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index 0787eb2..b6c1002 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -15,7 +15,7 @@ * * Created: H5MMprivate.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Private header for memory management. * diff --git a/src/H5MMpublic.h b/src/H5MMpublic.h index 4e54c33..faa3032 100644 --- a/src/H5MMpublic.h +++ b/src/H5MMpublic.h @@ -13,15 +13,13 @@ /*------------------------------------------------------------------------- * - * Created: H5MMproto.h + * Created: H5MMpublic.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5MM (memory management) * package. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef _H5MMpublic_H diff --git a/src/H5MP.c b/src/H5MP.c index 7947e7d..e773655 100644 --- a/src/H5MP.c +++ b/src/H5MP.c @@ -15,7 +15,7 @@ * * Created: H5MP.c * May 2 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements memory pools. (Similar to Apache's APR * memory pools) @@ -82,7 +82,6 @@ H5FL_DEFINE(H5MP_pool_t); * Return: Pointer to the memory pool "header" on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2005 * *------------------------------------------------------------------------- @@ -125,26 +124,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5MP_new_page + * Function: H5MP__new_page * * Purpose: Allocate new page for a memory pool * * Return: Pointer to the page allocated on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 4 2005 * *------------------------------------------------------------------------- */ static H5MP_page_t * -H5MP_new_page(H5MP_pool_t *mp, size_t page_size) +H5MP__new_page(H5MP_pool_t *mp, size_t page_size) { H5MP_page_t *new_page; /* New page created */ H5MP_page_blk_t *first_blk; /* Pointer to first block in page */ H5MP_page_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mp); @@ -163,9 +161,6 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size) new_page->free_size = mp->max_size; new_page->fac_alloc = TRUE; } /* end else */ -#ifdef QAK -HDfprintf(stderr,"%s: Allocating new page = %p\n", FUNC, new_page); -#endif /* QAK */ /* Initialize page information */ first_blk = H5MP_PAGE_FIRST_BLOCK(new_page); @@ -191,7 +186,7 @@ HDfprintf(stderr,"%s: Allocating new page = %p\n", FUNC, new_page); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MP_new_page() */ +} /* end H5MP__new_page() */ /*------------------------------------------------------------------------- @@ -202,7 +197,6 @@ done: * Return: Pointer to the space allocated on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2005 * *------------------------------------------------------------------------- @@ -223,10 +217,6 @@ H5MP_malloc (H5MP_pool_t *mp, size_t request) /* Compute actual size needed */ needed = H5MP_BLOCK_ALIGN(request) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t)); -#ifdef QAK -HDfprintf(stderr,"%s: sizeof(H5MP_page_blk_t) = %Zu\n", FUNC, sizeof(H5MP_page_blk_t)); -HDfprintf(stderr,"%s: request = %Zu, needed = %Zu\n", FUNC, request, needed); -#endif /* QAK */ /* See if the request can be handled by existing free space */ if(needed <= mp->free_size) { @@ -275,7 +265,7 @@ HDfprintf(stderr,"%s: request = %Zu, needed = %Zu\n", FUNC, request, needed); (needed + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))) : mp->page_size; /* Allocate new page */ - if(NULL == (alloc_page = H5MP_new_page(mp, page_size))) + if(NULL == (alloc_page = H5MP__new_page(mp, page_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for page") /* Set the block to allocate from */ @@ -323,9 +313,6 @@ found: /* Set new space pointer for the return value */ ret_value = ((unsigned char *)alloc_free) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t)); -#ifdef QAK -HDfprintf(stderr,"%s: Allocating space from page, ret_value = %p\n", FUNC, ret_value); -#endif /* QAK */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -340,7 +327,6 @@ done: * Return: NULL on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 3 2005 * * Note: Should we release pages that have no used blocks? @@ -369,9 +355,6 @@ H5MP_free(H5MP_pool_t *mp, void *spc) /* Add it's space to the amount of free space in the page & pool */ spc_page = spc_blk->page; -#ifdef QAK -HDfprintf(stderr,"%s: Freeing from page = %p\n", "H5MP_free", spc_page); -#endif /* QAK */ spc_page->free_size += spc_blk->size; mp->free_size += spc_blk->size; @@ -429,7 +412,6 @@ HDfprintf(stderr,"%s: Freeing from page = %p\n", "H5MP_free", spc_page); * Return: Non-negative on success/negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 3 2005 * *------------------------------------------------------------------------- diff --git a/src/H5MPmodule.h b/src/H5MPmodule.h index 27f7706..19b137f 100644 --- a/src/H5MPmodule.h +++ b/src/H5MPmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5MPpkg.h b/src/H5MPpkg.h index 29a25fa..ee2eb34 100644 --- a/src/H5MPpkg.h +++ b/src/H5MPpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 2, 2005 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5MPprivate.h b/src/H5MPprivate.h index 009cb50..be97e5d 100644 --- a/src/H5MPprivate.h +++ b/src/H5MPprivate.h @@ -15,7 +15,7 @@ * * Created: H5MPprivate.h * May 2 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for memory pool routines. * diff --git a/src/H5MPtest.c b/src/H5MPtest.c index 0cba847..fa5b165 100644 --- a/src/H5MPtest.c +++ b/src/H5MPtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, May 3, 2005 * * Purpose: Memory pool testing functions. @@ -42,8 +42,6 @@ * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -74,8 +72,6 @@ H5MP_get_pool_free_size(const H5MP_pool_t *mp, size_t *free_size) * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -109,8 +105,6 @@ H5MP_get_pool_first_page(const H5MP_pool_t *mp, H5MP_page_t **page) * Programmer: Quincey Koziol * Wednesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t @@ -144,9 +138,6 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp) /* Check that the free space from the blocks on the free list * corresponds to space in page */ -#ifdef QAK -HDfprintf(stderr,"%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_free_size_correct", page_free, page->free_size); -#endif /* QAK */ if(page_free != page->free_size) HGOTO_DONE (FALSE) @@ -159,9 +150,6 @@ HDfprintf(stderr,"%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_f /* Check that the free space from the pages * corresponds to free space in pool */ -#ifdef QAK -HDfprintf(stderr,"%s: pool_free = %Zu, mp->free_size = %Zu\n", "H5MP_pool_is_free_size_correct", pool_free, mp->free_size); -#endif /* QAK */ if(pool_free != mp->free_size) HGOTO_DONE (FALSE) @@ -182,8 +170,6 @@ done: * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -214,8 +200,6 @@ H5MP_get_page_free_size(const H5MP_page_t *page, size_t *free_size) * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 2d95ee9..fb08048 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -15,7 +15,7 @@ * * Created: H5Oainfo.c * Mar 6 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Attribute Information messages. * @@ -36,12 +36,12 @@ /* PRIVATE PROTOTYPES */ static void *H5O__ainfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_ainfo_copy(const void *_mesg, void *_dest); -static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__ainfo_copy(const void *_mesg, void *_dest); +static size_t H5O__ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__ainfo_free(void *_mesg); static herr_t H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); -static herr_t H5O_ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, @@ -59,16 +59,16 @@ const H5O_msg_class_t H5O_MSG_AINFO[1] = {{ sizeof(H5O_ainfo_t), /*native message size */ 0, /* messages are sharable? */ H5O__ainfo_decode, /*decode message */ - H5O_ainfo_encode, /*encode message */ - H5O_ainfo_copy, /*copy the native value */ - H5O_ainfo_size, /*size of symbol table entry */ + H5O__ainfo_encode, /*encode message */ + H5O__ainfo_copy, /*copy the native value */ + H5O__ainfo_size, /*size of symbol table entry */ NULL, /*default reset method */ H5O__ainfo_free, /* free method */ H5O__ainfo_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ - H5O_ainfo_pre_copy_file, /* pre copy native value to file */ + H5O__ainfo_pre_copy_file, /* pre copy native value to file */ H5O__ainfo_copy_file, /* copy native value to file */ H5O__ainfo_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ @@ -97,7 +97,6 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- @@ -165,25 +164,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_ainfo_encode + * Function: H5O__ainfo_encode * * Purpose: Encodes a message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; unsigned char flags; /* Flags for encoding attribute info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -215,11 +213,11 @@ H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co HDassert(!H5F_addr_defined(ainfo->corder_bt2_addr)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ainfo_encode() */ +} /* end H5O__ainfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_copy + * Function: H5O__ainfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -228,19 +226,18 @@ H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- */ static void * -H5O_ainfo_copy(const void *_mesg, void *_dest) +H5O__ainfo_copy(const void *_mesg, void *_dest) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; H5O_ainfo_t *dest = (H5O_ainfo_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(ainfo); @@ -255,11 +252,11 @@ H5O_ainfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ainfo_copy() */ +} /* end H5O__ainfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_size + * Function: H5O__ainfo_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -269,18 +266,17 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- */ static size_t -H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = (size_t)(1 /* Version */ @@ -291,7 +287,7 @@ H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void + (ainfo->index_corder ? H5F_SIZEOF_ADDR(f) : 0)); /* Address of v2 B-tree for indexing creation order values of attributes */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ainfo_size() */ +} /* end H5O__ainfo_size() */ /*------------------------------------------------------------------------- @@ -358,7 +354,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_ainfo_pre_copy_file + * Function: H5O__ainfo_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files. @@ -372,10 +368,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, +H5O__ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(deleted); @@ -388,7 +384,7 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE *deleted = TRUE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ainfo_pre_copy_file() */ +} /* end H5O__ainfo_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -499,7 +495,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 8850ef6..3c19cf4 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -15,7 +15,7 @@ * * Created: H5Oalloc.c * Nov 17 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header allocation routines. * @@ -105,7 +105,6 @@ H5FL_EXTERN(H5O_cont_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 17 2006 * *------------------------------------------------------------------------- @@ -231,7 +230,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 17 2006 * *------------------------------------------------------------------------- @@ -332,7 +330,6 @@ H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 22 2006 * *------------------------------------------------------------------------- @@ -440,7 +437,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Nov 21 2005 * *------------------------------------------------------------------------- @@ -729,7 +725,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 21 2016 * *------------------------------------------------------------------------- @@ -878,7 +873,6 @@ H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, * Failure: Negative * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 21 2016 * *------------------------------------------------------------------------- @@ -1157,7 +1151,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 7 1997 * *------------------------------------------------------------------------- @@ -1208,7 +1201,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 21 2016 * *------------------------------------------------------------------------- @@ -1283,7 +1275,6 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -1369,7 +1360,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 22 2006 * *------------------------------------------------------------------------- @@ -1607,7 +1597,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 17 2005 * *------------------------------------------------------------------------- @@ -1958,7 +1947,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 10 2005 * *------------------------------------------------------------------------- @@ -2101,7 +2089,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 17 2005 * *------------------------------------------------------------------------- @@ -2286,7 +2273,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 4 2005 * *------------------------------------------------------------------------- @@ -2347,7 +2333,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Oct 20 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Oattr.c b/src/H5Oattr.c index e38ef5c..7fa4cad 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -24,13 +24,13 @@ #include "H5Spkg.h" /* Dataspaces */ /* PRIVATE PROTOTYPES */ -static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_attr_decode(H5F_t *f, H5O_t *open_oh, +static herr_t H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg); +static void *H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static void *H5O_attr_copy(const void *_mesg, void *_dest); -static size_t H5O_attr_size(const H5F_t *f, const void *_mesg); +static void *H5O__attr_copy(const void *_mesg, void *_dest); +static size_t H5O__attr_size(const H5F_t *f, const void *_mesg); static herr_t H5O__attr_free(void *mesg); -static herr_t H5O_attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, @@ -38,29 +38,29 @@ static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_ty static herr_t H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); -static herr_t H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); -static herr_t H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx); +static herr_t H5O__attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); +static herr_t H5O__attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx); static herr_t H5O__attr_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_ATTR -#define H5O_SHARED_DECODE H5O_attr_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_attr_decode -#define H5O_SHARED_ENCODE H5O_attr_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_attr_encode -#define H5O_SHARED_SIZE H5O_attr_shared_size -#define H5O_SHARED_SIZE_REAL H5O_attr_size +#define H5O_SHARED_DECODE H5O__attr_shared_decode +#define H5O_SHARED_DECODE_REAL H5O__attr_decode +#define H5O_SHARED_ENCODE H5O__attr_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__attr_encode +#define H5O_SHARED_SIZE H5O__attr_shared_size +#define H5O_SHARED_SIZE_REAL H5O__attr_size #define H5O_SHARED_DELETE H5O__attr_shared_delete #define H5O_SHARED_DELETE_REAL H5O__attr_delete #define H5O_SHARED_LINK H5O__attr_shared_link #define H5O_SHARED_LINK_REAL H5O__attr_link #define H5O_SHARED_COPY_FILE H5O__attr_shared_copy_file #define H5O_SHARED_COPY_FILE_REAL H5O__attr_copy_file -#define H5O_SHARED_POST_COPY_FILE H5O_attr_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__attr_shared_post_copy_file #define H5O_SHARED_POST_COPY_FILE_REAL H5O__attr_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_attr_shared_debug +#define H5O_SHARED_DEBUG H5O__attr_shared_debug #define H5O_SHARED_DEBUG_REAL H5O__attr_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -70,22 +70,22 @@ const H5O_msg_class_t H5O_MSG_ATTR[1] = {{ "attribute", /* message name for debugging */ sizeof(H5A_t), /* native message size */ H5O_SHARE_IS_SHARABLE, /* messages are sharable? */ - H5O_attr_shared_decode, /* decode message */ - H5O_attr_shared_encode, /* encode message */ - H5O_attr_copy, /* copy the native value */ - H5O_attr_shared_size, /* size of raw message */ + H5O__attr_shared_decode, /* decode message */ + H5O__attr_shared_encode, /* encode message */ + H5O__attr_copy, /* copy the native value */ + H5O__attr_shared_size, /* size of raw message */ H5O__attr_reset, /* reset method */ H5O__attr_free, /* free method */ H5O__attr_shared_delete, /* file delete method */ H5O__attr_shared_link, /* link method */ NULL, /* set share method */ NULL, /* can share method */ - H5O_attr_pre_copy_file, /* pre copy native value to file */ + H5O__attr_pre_copy_file, /* pre copy native value to file */ H5O__attr_shared_copy_file, /* copy native value to file */ - H5O_attr_shared_post_copy_file, /* post copy native value to file */ - H5O_attr_get_crt_index, /* get creation index */ - H5O_attr_set_crt_index, /* set creation index */ - H5O_attr_shared_debug /* debug the message */ + H5O__attr_shared_post_copy_file, /* post copy native value to file */ + H5O__attr_get_crt_index, /* get creation index */ + H5O__attr_set_crt_index, /* set creation index */ + H5O__attr_shared_debug /* debug the message */ }}; /* Flags for attribute flag encoding */ @@ -102,12 +102,12 @@ H5FL_EXTERN(H5S_extent_t); /*-------------------------------------------------------------------------- NAME - H5O_attr_decode + H5O__attr_decode PURPOSE Decode a attribute message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_attr_decode(f, mesg_flags, p) + void *H5O__attr_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct unsigned mesg_flags; IN: Message flags to influence decoding const uint8_t *p; IN: the raw information buffer @@ -119,7 +119,7 @@ H5FL_EXTERN(H5S_extent_t); function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, +H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5A_t *attr = NULL; @@ -131,7 +131,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned flags = 0; /* Attribute flags */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -267,16 +267,16 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_decode() */ +} /* end H5O__attr_decode() */ /*-------------------------------------------------------------------------- NAME - H5O_attr_encode + H5O__attr_encode PURPOSE Encode a simple attribute message USAGE - herr_t H5O_attr_encode(f, p, mesg) + herr_t H5O__attr_encode(f, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct const uint8 *p; IN: the raw information buffer const void *mesg; IN: Pointer to the simple datatype struct @@ -287,7 +287,7 @@ done: message in the "raw" disk form. --------------------------------------------------------------------------*/ static herr_t -H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) +H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg) { const H5A_t *attr = (const H5A_t *) mesg; size_t name_len; /* Attribute name length */ @@ -296,7 +296,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) unsigned flags = 0; /* Attribute flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -376,16 +376,16 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5O_attr_encode() */ +} /* end H5O__attr_encode() */ /*-------------------------------------------------------------------------- NAME - H5O_attr_copy + H5O__attr_copy PURPOSE Copies a message from MESG to DEST, allocating DEST if necessary. USAGE - void *H5O_attr_copy(mesg, dest) + void *H5O__attr_copy(mesg, dest) const void *mesg; IN: Pointer to the source attribute struct const void *dest; IN: Pointer to the destination attribute struct RETURNS @@ -395,11 +395,11 @@ done: allocating the destination structure if necessary. --------------------------------------------------------------------------*/ static void * -H5O_attr_copy(const void *_src, void *_dst) +H5O__attr_copy(const void *_src, void *_dst) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(_src); @@ -410,16 +410,16 @@ H5O_attr_copy(const void *_src, void *_dst) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_copy() */ +} /* end H5O__attr_copy() */ /*-------------------------------------------------------------------------- NAME - H5O_attr_size + H5O__attr_size PURPOSE Return the raw message size in bytes USAGE - size_t H5O_attr_size(f, mesg) + size_t H5O__attr_size(f, mesg) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source attribute struct RETURNS @@ -430,13 +430,13 @@ done: portion of the message). It doesn't take into account alignment. --------------------------------------------------------------------------*/ static size_t -H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) +H5O__attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) { const H5A_t *attr = (const H5A_t *)_mesg; size_t name_len; size_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(attr); @@ -471,7 +471,7 @@ H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) HDassert(0 && "Bad attribute version"); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_size() */ +} /* end H5O__attr_size() */ /*------------------------------------------------------------------------- @@ -605,7 +605,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_pre_copy_file + * Function: H5O__attr_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files for attribute messages. @@ -618,13 +618,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, +H5O__attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { const H5A_t *attr_src = (const H5A_t *)native_src; /* Source attribute */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(deleted); @@ -645,7 +645,7 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_pre_copy_file() */ +} /* end H5O__attr_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -723,7 +723,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_get_crt_index + * Function: H5O__attr_get_crt_index * * Purpose: Get creation index from the message * @@ -735,11 +735,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) +H5O__attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) { const H5A_t *attr = (const H5A_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(attr); HDassert(crt_idx); @@ -748,11 +748,11 @@ H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) *crt_idx = attr->shared->crt_idx; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_attr_get_crt_index() */ +} /* end H5O__attr_get_crt_index() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_set_crt_index + * Function: H5O__attr_set_crt_index * * Purpose: Set creation index from the message * @@ -764,11 +764,11 @@ H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) *------------------------------------------------------------------------- */ static herr_t -H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) +H5O__attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) { H5A_t *attr = (H5A_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(attr); @@ -776,7 +776,7 @@ H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) attr->shared->crt_idx = crt_idx; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_attr_set_crt_index() */ +} /* end H5O__attr_set_crt_index() */ /*-------------------------------------------------------------------------- diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index d498be5..416ee51 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -149,7 +149,6 @@ static herr_t H5O__attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg, * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 4 2006 * *------------------------------------------------------------------------- @@ -393,7 +392,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -541,7 +539,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- @@ -727,7 +724,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 2 2007 * *------------------------------------------------------------------------- @@ -802,7 +798,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 4 2006 * *------------------------------------------------------------------------- @@ -960,7 +955,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 5 2006 * *------------------------------------------------------------------------- @@ -1006,7 +1000,6 @@ H5O__attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 5 2006 * *------------------------------------------------------------------------- @@ -1468,7 +1461,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -1745,7 +1737,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -1928,48 +1919,3 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5O__attr_bh_info() */ -#ifndef H5_NO_DEPRECATED_SYMBOLS - -/*------------------------------------------------------------------------- - * Function: H5O__attr_count - * - * Purpose: Determine the # of attributes on an object - * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * Monday, December 11, 2006 - * - *------------------------------------------------------------------------- - */ -int -H5O__attr_count(const H5O_loc_t *loc) -{ - H5O_t *oh = NULL; /* Pointer to actual object header */ - hsize_t nattrs; /* Number of attributes */ - int ret_value = -1; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* Check arguments */ - HDassert(loc); - - /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Retrieve # of attributes on object */ - if(H5O__attr_count_real(loc->file, oh, &nattrs) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve attribute count") - - /* Set return value */ - ret_value = (int)nattrs; - -done: - if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O__attr_count */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - diff --git a/src/H5Obogus.c b/src/H5Obogus.c index f3cca0f..08b03b3 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -15,7 +15,7 @@ * * Created: H5Obogus.c * Jan 21 2003 - * Quincey Koziol + * Quincey Koziol * * Purpose: "bogus" message. This message is guaranteed to never * be found in a valid HDF5 file and is only used to @@ -39,8 +39,8 @@ /* PRIVATE PROTOTYPES */ static void *H5O__bogus_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static size_t H5O__bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__bogus_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -51,9 +51,9 @@ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ 0, /*native message size */ H5O_SHARE_IS_SHARABLE, /* messages are sharable? */ H5O__bogus_decode, /*decode message */ - H5O_bogus_encode, /*encode message */ + H5O__bogus_encode, /*encode message */ NULL, /*copy the native value */ - H5O_bogus_size, /*raw message size */ + H5O__bogus_size, /*raw message size */ NULL, /*free internal memory */ NULL, /*free method */ NULL, /* file delete method */ @@ -75,9 +75,9 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ 0, /*native message size */ H5O_SHARE_IS_SHARABLE, /* messages are sharable? */ H5O__bogus_decode, /*decode message */ - H5O_bogus_encode, /*encode message */ + H5O__bogus_encode, /*encode message */ NULL, /*copy the native value */ - H5O_bogus_size, /*raw message size */ + H5O__bogus_size, /*raw message size */ NULL, /*free internal memory */ NULL, /*free method */ NULL, /* file delete method */ @@ -104,7 +104,6 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 21 2003 * *------------------------------------------------------------------------- @@ -146,22 +145,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_bogus_encode + * Function: H5O__bogus_encode * * Purpose: Encodes a "bogus" message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 21 2003 * *------------------------------------------------------------------------- */ static herr_t -H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void H5_ATTR_UNUSED *mesg) +H5O__bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void H5_ATTR_UNUSED *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -172,11 +170,11 @@ H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, UINT32ENCODE(p, H5O_BOGUS_VALUE); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_bogus_encode() */ +} /* end H5O__bogus_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_bogus_size + * Function: H5O__bogus_size * * Purpose: Returns the size of the raw message in bytes not * counting the message typ or size fields, but only the data @@ -188,18 +186,17 @@ H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 21 2003 * *------------------------------------------------------------------------- */ static size_t -H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *mesg) +H5O__bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(4) -} /* end H5O_bogus_size() */ +} /* end H5O__bogus_size() */ /*------------------------------------------------------------------------- @@ -210,11 +207,8 @@ H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 21 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 5a98e59..4d3c64e 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, March 1, 2007 * * Purpose: A message holding non-default v1 B-tree 'K' value @@ -27,11 +27,11 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_btreek_decode(H5F_t *f, H5O_t *open_oh, +static void *H5O__btreek_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_btreek_copy(const void *_mesg, void *_dest); -static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__btreek_copy(const void *_mesg, void *_dest); +static size_t H5O__btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__btreek_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -40,11 +40,11 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ H5O_BTREEK_ID, /*message id number */ "v1 B-tree 'K' values", /*message name for debugging */ sizeof(H5O_btreek_t), /*native message size */ - 0, /* messages are sharable? */ - H5O_btreek_decode, /*decode message */ - H5O_btreek_encode, /*encode message */ - H5O_btreek_copy, /*copy the native value */ - H5O_btreek_size, /*raw message size */ + 0, /* messages are sharable? */ + H5O__btreek_decode, /*decode message */ + H5O__btreek_encode, /*encode message */ + H5O__btreek_copy, /*copy the native value */ + H5O__btreek_size, /*raw message size */ NULL, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ @@ -56,7 +56,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O__btreek_debug /*debug the message */ + H5O__btreek_debug /*debug the message */ }}; /* Current version of v1 B-tree 'K' value information */ @@ -64,7 +64,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ /*------------------------------------------------------------------------- - * Function: H5O_btreek_decode + * Function: H5O__btreek_decode * * Purpose: Decode a shared message table message and return a pointer * to a newly allocated H5O_btreek_t struct. @@ -78,14 +78,14 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_btreek_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -109,11 +109,11 @@ H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_btreek_decode() */ +} /* end H5O__btreek_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_btreek_encode + * Function: H5O__btreek_encode * * Purpose: Encode a v1 B-tree 'K' value message. * @@ -125,11 +125,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -143,11 +143,11 @@ H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared UINT16ENCODE(p, mesg->sym_leaf_k); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_btreek_encode() */ +} /* end H5O__btreek_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_btreek_copy + * Function: H5O__btreek_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -161,13 +161,13 @@ H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared *------------------------------------------------------------------------- */ static void * -H5O_btreek_copy(const void *_mesg, void *_dest) +H5O__btreek_copy(const void *_mesg, void *_dest) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; H5O_btreek_t *dest = (H5O_btreek_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mesg); @@ -183,11 +183,11 @@ H5O_btreek_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_btreek_copy() */ +} /* end H5O__btreek_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_btreek_size + * Function: H5O__btreek_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. @@ -201,11 +201,11 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) +H5O__btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -216,7 +216,7 @@ H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh 2; /* Symbol table node leaf 'K' value */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_btreek_size() */ +} /* end H5O__btreek_size() */ /*------------------------------------------------------------------------- diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 45c55fd..58db827 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -15,7 +15,7 @@ * * Created: H5Ocache.c * Sep 28 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header metadata cache virtual functions. * @@ -84,8 +84,7 @@ static herr_t H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing); static herr_t H5O__cache_chk_free_icr(void *thing); /* Prefix routines */ -static herr_t H5O__prefix_deserialize(const uint8_t *image, - H5O_cache_ud_t *udata); +static herr_t H5O__prefix_deserialize(const uint8_t *image, H5O_cache_ud_t *udata); /* Chunk routines */ static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, @@ -294,7 +293,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) * * Note that the object header is read with with a speculative read. * If the initial read is too small, make note of this fact and return - * without error. H5C_load_entry() will note the size discrepency + * without error. H5C__load_entry() will note the size discrepency * and retry the deserialize operation with the correct size read. * * Return: Success: Pointer to in core representation @@ -1081,7 +1080,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 12, 2008 * *------------------------------------------------------------------------- @@ -1300,7 +1298,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 12, 2008 * *------------------------------------------------------------------------- @@ -1644,7 +1641,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 12, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index 6ac04c8..ac51aff 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -294,39 +294,8 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) * from the VFD layer at the end of file. As this was the * last file space allocation before shutdown, the cache image * should still be the last item in the file. - * - * If the hack to work around the self referential free space - * manager issue is in use, file space for the non-empty self - * referential free space managers was also allocated from VFD - * layer at the end of file. Since these allocations directly - * preceeded the cache image allocation they should be directly - * adjacent to the cache image block at the end of file. - * - * In this case, just call H5MF_tidy_self_referential_fsm_hack(). - * - * That routine will float the self referential free space - * managers, and reduce the eoa to its value just prior to - * allocation of space for same. Since the cache image appears - * just after the self referential free space managers, this - * will release the file space for the cache image as well. - * - * Note that in this case, there must not have been any file - * space allocations / deallocations prior to the free of the - * cache image. Verify this to the extent possible. - * - * If the hack to work around the persistent self referential - * free space manager issue is NOT in use, just call H5MF_xfree() - * to release the cache iamge. In principle, we should be able - * to just reduce the EOA to the base address of the cache - * image block, as there shouldn't be any file space allocation - * before the first metadata cache access. However, given - * time constraints, I don't want to go there now. */ - - - if(f->shared->closing) { - /* Get the eoa, and verify that it has the expected value */ if(HADDR_UNDEF == (final_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to get file size") @@ -335,11 +304,10 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) if(H5FD_free(f->shared->lf, H5FD_MEM_SUPER, f, mesg->addr, mesg->size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't free MDC image") - } else { + } + else if(H5MF_xfree(f, H5FD_MEM_SUPER, mesg->addr, mesg->size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free file space for cache image block") - } - } /* end if */ done: diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 469a9e0..6718501 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -256,7 +256,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy + * Function: H5O__copy * * Purpose: Private version of H5Ocopy * @@ -268,7 +268,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, +H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) { H5G_loc_t src_loc; /* Source object group location */ @@ -279,7 +279,7 @@ H5O_copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, hbool_t obj_open = FALSE; /* Entry at 'name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -319,7 +319,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy() */ +} /* end H5O__copy() */ /*------------------------------------------------------------------------- @@ -1307,10 +1307,10 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy_search_comm_dt_attr_cb + * Function: H5O__copy_search_comm_dt_attr_cb * * Purpose: Callback for H5O_attr_iterate_real from - * H5O_copy_search_comm_dt_check. Checks if the attribute's + * H5O__copy_search_comm_dt_check. Checks if the attribute's * datatype is committed. If it is, adds it to the merge * committed dt skiplist present in udata if it does not match * any already present. @@ -1323,7 +1323,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) +H5O__copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) { H5O_copy_search_comm_dt_ud_t *udata = (H5O_copy_search_comm_dt_ud_t *)_udata; H5T_t *dt = NULL; /* Datatype */ @@ -1332,7 +1332,7 @@ H5O_copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) hbool_t obj_inserted = FALSE; /* Object inserted into skip list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(attr); @@ -1385,11 +1385,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_search_comm_dt_attr_cb */ +} /* end H5O__copy_search_comm_dt_attr_cb */ /*------------------------------------------------------------------------- - * Function: H5O_copy_search_comm_dt_check + * Function: H5O__copy_search_comm_dt_check * * Purpose: Check if the object at obj_oloc is or contains a reference * to a committed datatype. If it does, adds it to the merge @@ -1404,7 +1404,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, +H5O__copy_search_comm_dt_check(H5O_loc_t *obj_oloc, H5O_copy_search_comm_dt_ud_t *udata) { H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ @@ -1414,7 +1414,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, const H5O_obj_class_t *obj_class = NULL; /* Type of object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(obj_oloc); @@ -1483,7 +1483,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, /* Search within attributes */ attr_op.op_type = H5A_ATTR_OP_LIB; - attr_op.u.lib_op = H5O_copy_search_comm_dt_attr_cb; + attr_op.u.lib_op = H5O__copy_search_comm_dt_attr_cb; udata->obj_oloc.file = obj_oloc->file; udata->obj_oloc.addr = obj_oloc->addr; if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, udata) < 0) @@ -1504,7 +1504,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_search_comm_dt_check */ +} /* end H5O__copy_search_comm_dt_check */ /*------------------------------------------------------------------------- @@ -1512,7 +1512,7 @@ done: * * Purpose: H5G_visit callback to add committed datatypes to the merge * committed dt skiplist. Mostly a wrapper for - * H5O_copy_search_comm_dt_check. + * H5O__copy_search_comm_dt_check. * * Return: Non-negative on success/Negative on failure * @@ -1554,7 +1554,7 @@ H5O__copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, obj_found = TRUE; /* Check object and add to skip list if appropriate */ - if(H5O_copy_search_comm_dt_check(&obj_oloc, udata) < 0) + if(H5O__copy_search_comm_dt_check(&obj_oloc, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "can't check object") } /* end if */ @@ -1653,7 +1653,7 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5E_clear_stack(NULL); else /* Check object and add to skip list if appropriate */ - if(H5O_copy_search_comm_dt_check(&obj_oloc, &udata) < 0) { + if(H5O__copy_search_comm_dt_check(&obj_oloc, &udata) < 0) { if(H5G_loc_free(&obj_loc) < 0) HERROR(H5E_OHDR, H5E_CANTRELEASE, "can't free location"); HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't check object") diff --git a/src/H5Ocopy_ref.c b/src/H5Ocopy_ref.c index 0de661f..e03bb69 100644 --- a/src/H5Ocopy_ref.c +++ b/src/H5Ocopy_ref.c @@ -178,30 +178,29 @@ H5O__copy_expand_ref_object1(H5O_loc_t *src_oloc, const void *buf_src, H5O_token_t tmp_token = { 0 }; /* If data is not initialized, copy zeros and skip */ - if(0 == HDmemcmp(src_buf, zeros, buf_size)) { + if(0 == HDmemcmp(src_buf, zeros, buf_size)) HDmemset(dst_buf, 0, buf_size); - continue; - } - - /* Set up for the object copy for the reference */ - if(H5R__decode_token_obj_compat(src_buf, &buf_size, &tmp_token, token_size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode src object address") - if(H5VL_native_token_to_addr(src_oloc->file, H5I_FILE, tmp_token, &src_oloc->addr) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize object token into address") - - if(!H5F_addr_defined(src_oloc->addr) || src_oloc->addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer") - dst_oloc->addr = HADDR_UNDEF; - - /* Attempt to copy object from source to destination file */ - if(H5O__copy_obj_by_ref(src_oloc, dst_oloc, dst_root_loc, cpy_info) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") - - /* Set the object reference info for the destination file */ - if(H5VL_native_addr_to_token(dst_oloc->file, H5I_FILE, dst_oloc->addr, &tmp_token) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "can't serialize address into object token") - if(H5R__encode_token_obj_compat((const H5O_token_t *)&tmp_token, token_size, dst_buf, &buf_size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to encode dst object address") + else { + /* Set up for the object copy for the reference */ + if(H5R__decode_token_obj_compat(src_buf, &buf_size, &tmp_token, token_size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode src object address") + if(H5VL_native_token_to_addr(src_oloc->file, H5I_FILE, tmp_token, &src_oloc->addr) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize object token into address") + + if(!H5F_addr_defined(src_oloc->addr) || src_oloc->addr == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer") + dst_oloc->addr = HADDR_UNDEF; + + /* Attempt to copy object from source to destination file */ + if(H5O__copy_obj_by_ref(src_oloc, dst_oloc, dst_root_loc, cpy_info) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + + /* Set the object reference info for the destination file */ + if(H5VL_native_addr_to_token(dst_oloc->file, H5I_FILE, dst_oloc->addr, &tmp_token) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "can't serialize address into object token") + if(H5R__encode_token_obj_compat((const H5O_token_t *)&tmp_token, token_size, dst_buf, &buf_size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to encode dst object address") + } /* end else */ } /* end for */ done: @@ -242,42 +241,41 @@ H5O__copy_expand_ref_region1(H5O_loc_t *src_oloc, const void *buf_src, uint8_t *q; /* If data is not initialized, copy zeros and skip */ - if(0 == HDmemcmp(src_buf, zeros, buf_size)) { + if(0 == HDmemcmp(src_buf, zeros, buf_size)) HDmemset(dst_buf, 0, buf_size); - continue; - } - - /* Read from heap */ - if(H5R__decode_heap(src_oloc->file, src_buf, &buf_size, &data, &data_size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode dataset region information") - - /* Get object address */ - p = (const uint8_t *)data; - H5F_addr_decode(src_oloc->file, &p, &src_oloc->addr); - if(!H5F_addr_defined(src_oloc->addr) || src_oloc->addr == 0) { - H5MM_free(data); - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer") - } - dst_oloc->addr = HADDR_UNDEF; - - /* Attempt to copy object from source to destination file */ - if(H5O__copy_obj_by_ref(src_oloc, dst_oloc, dst_root_loc, cpy_info) < 0) { + else { + /* Read from heap */ + if(H5R__decode_heap(src_oloc->file, src_buf, &buf_size, &data, &data_size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode dataset region information") + + /* Get object address */ + p = (const uint8_t *)data; + H5F_addr_decode(src_oloc->file, &p, &src_oloc->addr); + if(!H5F_addr_defined(src_oloc->addr) || src_oloc->addr == 0) { + H5MM_free(data); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer") + } + dst_oloc->addr = HADDR_UNDEF; + + /* Attempt to copy object from source to destination file */ + if(H5O__copy_obj_by_ref(src_oloc, dst_oloc, dst_root_loc, cpy_info) < 0) { + H5MM_free(data); + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + } /* end if */ + + /* Serialize object addr */ + q = (uint8_t *)data; + H5F_addr_encode(dst_oloc->file, &q, dst_oloc->addr); + + /* Write to heap */ + if(H5R__encode_heap(dst_oloc->file, dst_buf, &buf_size, data, (size_t)data_size) < 0) { + H5MM_free(data); + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode dataset region information") + } + + /* Free the buffer allocated in H5R__decode_heap() */ H5MM_free(data); - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") - } /* end if */ - - /* Serialize object addr */ - q = (uint8_t *)data; - H5F_addr_encode(dst_oloc->file, &q, dst_oloc->addr); - - /* Write to heap */ - if(H5R__encode_heap(dst_oloc->file, dst_buf, &buf_size, data, (size_t)data_size) < 0) { - H5MM_free(data); - HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode dataset region information") - } - - /* Free the buffer allocated in H5R__decode_heap() */ - H5MM_free(data); + } /* end else */ } /* end for */ done: diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 3c91cae..b476b17 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -15,7 +15,7 @@ * * Created: H5Odbg.c * Nov 17 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header debugging routines. * @@ -84,7 +84,6 @@ * Return: SUCCEED (Doesn't fail, just crashes) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 17 2006 * *------------------------------------------------------------------------- @@ -236,7 +235,6 @@ H5O__assert(const H5O_t *oh) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 13 2003 * *------------------------------------------------------------------------- @@ -277,7 +275,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -544,7 +541,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index eb678e4..dffacfd 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, March 1, 2007 * * Purpose: A message holding driver info settings @@ -27,11 +27,11 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_drvinfo_copy(const void *_mesg, void *_dest); -static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__drvinfo_copy(const void *_mesg, void *_dest); +static size_t H5O__drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__drvinfo_reset(void *_mesg); static herr_t H5O__drvinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -41,23 +41,23 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ H5O_DRVINFO_ID, /*message id number */ "driver info", /*message name for debugging */ sizeof(H5O_drvinfo_t), /*native message size */ - 0, /* messages are sharable? */ - H5O_drvinfo_decode, /*decode message */ - H5O_drvinfo_encode, /*encode message */ - H5O_drvinfo_copy, /*copy the native value */ - H5O_drvinfo_size, /*raw message size */ + 0, /* messages are sharable? */ + H5O__drvinfo_decode, /*decode message */ + H5O__drvinfo_encode, /*encode message */ + H5O__drvinfo_copy, /*copy the native value */ + H5O__drvinfo_size, /*raw message size */ H5O__drvinfo_reset, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ NULL, /* link method */ - NULL, /*set share method */ + NULL, /*set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ NULL, /* copy native value to file */ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O__drvinfo_debug /*debug the message */ + H5O__drvinfo_debug /*debug the message */ }}; /* Current version of driver info information */ @@ -65,7 +65,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_decode + * Function: H5O__drvinfo_decode * * Purpose: Decode a shared message table message and return a pointer * to a newly allocated H5O_drvinfo_t struct. @@ -79,14 +79,14 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_drvinfo_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -123,11 +123,11 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_drvinfo_decode() */ +} /* end H5O__drvinfo_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_encode + * Function: H5O__drvinfo_encode * * Purpose: Encode a v1 B-tree 'K' value message. * @@ -139,11 +139,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -159,11 +159,11 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share H5MM_memcpy(p, mesg->buf, mesg->len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_drvinfo_encode() */ +} /* end H5O__drvinfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_copy + * Function: H5O__drvinfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -177,13 +177,13 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share *------------------------------------------------------------------------- */ static void * -H5O_drvinfo_copy(const void *_mesg, void *_dest) +H5O__drvinfo_copy(const void *_mesg, void *_dest) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; H5O_drvinfo_t *dest = (H5O_drvinfo_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mesg); @@ -207,11 +207,11 @@ H5O_drvinfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_drvinfo_copy() */ +} /* end H5O__drvinfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_size + * Function: H5O__drvinfo_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. @@ -225,12 +225,12 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -242,7 +242,7 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s mesg->len; /* Buffer */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_drvinfo_size() */ +} /* end H5O__drvinfo_size() */ /*------------------------------------------------------------------------- @@ -254,7 +254,6 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 1 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 6eaaae9..c7d6c1b 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -28,16 +28,16 @@ /* PRIVATE PROTOTYPES */ -static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static herr_t H5O__dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); +static void *H5O__dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static void *H5O_dtype_copy(const void *_mesg, void *_dest); -static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); +static void *H5O__dtype_copy(const void *_mesg, void *_dest); +static size_t H5O__dtype_size(const H5F_t *f, const void *_mesg); static herr_t H5O__dtype_reset(void *_mesg); static herr_t H5O__dtype_free(void *_mesg); -static herr_t H5O_dtype_set_share(void *_mesg, const H5O_shared_t *sh); -static htri_t H5O_dtype_can_share(const void *_mesg); -static herr_t H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__dtype_set_share(void *_mesg, const H5O_shared_t *sh); +static htri_t H5O__dtype_can_share(const void *_mesg); +static herr_t H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); static void *H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, @@ -50,22 +50,22 @@ static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE * stream, /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_DTYPE -#define H5O_SHARED_DECODE H5O_dtype_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_dtype_decode -#define H5O_SHARED_ENCODE H5O_dtype_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_dtype_encode -#define H5O_SHARED_SIZE H5O_dtype_shared_size -#define H5O_SHARED_SIZE_REAL H5O_dtype_size +#define H5O_SHARED_DECODE H5O__dtype_shared_decode +#define H5O_SHARED_DECODE_REAL H5O__dtype_decode +#define H5O_SHARED_ENCODE H5O__dtype_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__dtype_encode +#define H5O_SHARED_SIZE H5O__dtype_shared_size +#define H5O_SHARED_SIZE_REAL H5O__dtype_size #define H5O_SHARED_DELETE H5O__dtype_shared_delete #undef H5O_SHARED_DELETE_REAL #define H5O_SHARED_LINK H5O__dtype_shared_link #undef H5O_SHARED_LINK_REAL #define H5O_SHARED_COPY_FILE H5O__dtype_shared_copy_file #define H5O_SHARED_COPY_FILE_REAL H5O__dtype_copy_file -#define H5O_SHARED_POST_COPY_FILE H5O_dtype_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__dtype_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE_UPD H5O__dtype_shared_post_copy_upd -#define H5O_SHARED_DEBUG H5O_dtype_shared_debug +#define H5O_SHARED_DEBUG H5O__dtype_shared_debug #define H5O_SHARED_DEBUG_REAL H5O__dtype_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -94,27 +94,27 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ "datatype", /* message name for debugging */ sizeof(H5T_t), /* native message size */ H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_dtype_shared_decode, /* decode message */ - H5O_dtype_shared_encode, /* encode message */ - H5O_dtype_copy, /* copy the native value */ - H5O_dtype_shared_size, /* size of raw message */ + H5O__dtype_shared_decode, /* decode message */ + H5O__dtype_shared_encode, /* encode message */ + H5O__dtype_copy, /* copy the native value */ + H5O__dtype_shared_size, /* size of raw message */ H5O__dtype_reset, /* reset method */ H5O__dtype_free, /* free method */ H5O__dtype_shared_delete, /* file delete method */ H5O__dtype_shared_link, /* link method */ - H5O_dtype_set_share, /* set share method */ - H5O_dtype_can_share, /* can share method */ - H5O_dtype_pre_copy_file, /* pre copy native value to file */ + H5O__dtype_set_share, /* set share method */ + H5O__dtype_can_share, /* can share method */ + H5O__dtype_pre_copy_file, /* pre copy native value to file */ H5O__dtype_shared_copy_file, /* copy native value to file */ - H5O_dtype_shared_post_copy_file, /* post copy native value to file */ + H5O__dtype_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_dtype_shared_debug /* debug the message */ + H5O__dtype_shared_debug /* debug the message */ }}; /*------------------------------------------------------------------------- - * Function: H5O_dtype_decode_helper + * Function: H5O__dtype_decode_helper * * Purpose: Decodes a datatype * @@ -129,14 +129,14 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t *dt) +H5O__dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t *dt) { unsigned flags, version; unsigned i; size_t z; htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(pp && *pp); @@ -264,7 +264,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * unsigned j; /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -331,7 +331,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Decode the field's datatype information */ - if((can_upgrade = H5O_dtype_decode_helper(ioflags, pp, temp_type)) < 0) { + if((can_upgrade = H5O__dtype_decode_helper(ioflags, pp, temp_type)) < 0) { for(j = 0; j <= i; j++) H5MM_xfree(dt->shared->u.compnd.memb[j].name); H5MM_xfree(dt->shared->u.compnd.memb); @@ -469,7 +469,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * dt->shared->u.enumer.nmembs = dt->shared->u.enumer.nalloc = flags & 0xffff; if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - if(H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) + if(H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode parent datatype") /* Check if the parent of this enum has a version greater than the @@ -511,7 +511,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * /* Decode base type of VL information */ if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed") - if(H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) + if(H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode VL parent type") /* Check if the parent of this vlen has a version greater than the @@ -552,7 +552,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * /* Decode base type of array */ if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed") - if(H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) + if(H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode array parent type") /* Check if the parent of this array has a version greater than the @@ -579,20 +579,19 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * } /* end switch */ done: - if(ret_value < 0) { + if(ret_value < 0) if(dt != NULL) { if(dt->shared != NULL) dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); dt = H5FL_FREE(H5T_t, dt); } /* end if */ - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_decode_helper() */ +} /* end H5O__dtype_decode_helper() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_encode_helper + * Function: H5O__dtype_encode_helper * * Purpose: Encodes a datatype. * @@ -608,7 +607,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) +H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) { unsigned flags = 0; uint8_t *hdr = (uint8_t *)*pp; @@ -616,7 +615,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) size_t n, z; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(pp && *pp); @@ -906,7 +905,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -968,7 +967,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) } /* end if */ /* Subtype */ - if(H5O_dtype_encode_helper(pp, dt->shared->u.compnd.memb[i].type) < 0) + if(H5O__dtype_encode_helper(pp, dt->shared->u.compnd.memb[i].type) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode member type") } /* end for */ } @@ -990,7 +989,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) flags = dt->shared->u.enumer.nmembs & 0xffff; /* Parent type */ - if(H5O_dtype_encode_helper(pp, dt->shared->parent) < 0) + if(H5O__dtype_encode_helper(pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode parent datatype") /* Names, each a multiple of eight bytes */ @@ -1026,7 +1025,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) } /* end if */ /* Encode base type of VL information */ - if(H5O_dtype_encode_helper(pp, dt->shared->parent) < 0) + if(H5O__dtype_encode_helper(pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode VL parent type") break; @@ -1064,7 +1063,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) } /* end if */ /* Encode base type of array's information */ - if(H5O_dtype_encode_helper(pp, dt->shared->parent) < 0) + if(H5O__dtype_encode_helper(pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode VL parent type") break; @@ -1083,17 +1082,17 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_encode_helper() */ +} /* end H5O__dtype_encode_helper() */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_decode + H5O__dtype_decode PURPOSE Decode a message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_dtype_decode(f, mesg_flags, p) + void *H5O__dtype_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct unsigned mesg_flags; IN: Message flags to influence decoding const uint8 *p; IN: the raw information buffer @@ -1105,13 +1104,13 @@ done: function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, +H5O__dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags/*in,out*/, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(p); @@ -1121,7 +1120,7 @@ H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigne HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Perform actual decode of message */ - if(H5O_dtype_decode_helper(ioflags, &p, dt) < 0) + if(H5O__dtype_decode_helper(ioflags, &p, dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode type") /* Set return value */ @@ -1129,16 +1128,16 @@ H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigne done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_decode() */ +} /* end H5O__dtype_decode() */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_encode + H5O__dtype_encode PURPOSE Encode a simple datatype message USAGE - herr_t H5O_dtype_encode(f, raw_size, p, mesg) + herr_t H5O__dtype_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct size_t raw_size; IN: size of the raw information buffer const uint8 *p; IN: the raw information buffer @@ -1150,12 +1149,12 @@ done: message in the "raw" disk form. --------------------------------------------------------------------------*/ static herr_t -H5O_dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg) +H5O__dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg) { const H5T_t *dt = (const H5T_t *) mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -1163,21 +1162,21 @@ H5O_dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg) HDassert(dt); /* encode */ - if(H5O_dtype_encode_helper(&p, dt) < 0) + if(H5O__dtype_encode_helper(&p, dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode type") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_encode() */ +} /* end H5O__dtype_encode() */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_copy + H5O__dtype_copy PURPOSE Copies a message from MESG to DEST, allocating DEST if necessary. USAGE - void *H5O_dtype_copy(mesg, dest) + void *H5O__dtype_copy(mesg, dest) const void *mesg; IN: Pointer to the source simple datatype struct const void *dest; IN: Pointer to the destination simple @@ -1189,13 +1188,13 @@ done: allocating the destination structure if necessary. --------------------------------------------------------------------------*/ static void * -H5O_dtype_copy(const void *_src, void *_dst) +H5O__dtype_copy(const void *_src, void *_dst) { const H5T_t *src = (const H5T_t *) _src; H5T_t *dst; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(src); @@ -1216,16 +1215,16 @@ H5O_dtype_copy(const void *_src, void *_dst) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_copy() */ +} /* end H5O__dtype_copy() */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_size + H5O__dtype_size PURPOSE Return the raw message size in bytes USAGE - void *H5O_dtype_size(f, mesg) + void *H5O__dtype_size(f, mesg) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source simple datatype struct RETURNS @@ -1236,13 +1235,13 @@ done: portion of the message). It doesn't take into account alignment. --------------------------------------------------------------------------*/ static size_t -H5O_dtype_size(const H5F_t *f, const void *_mesg) +H5O__dtype_size(const H5F_t *f, const void *_mesg) { const H5T_t *dt = (const H5T_t *)_mesg; unsigned u; /* Local index variable */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(dt); @@ -1278,7 +1277,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); /* Compute the total size needed to encode compound datatype */ for(u = 0; u < dt->shared->u.compnd.nmembs; u++) { @@ -1306,13 +1305,13 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) 4 + /*permutation*/ 4 + /*reserved*/ 16; /*dimensions*/ - ret_value += H5O_dtype_size(f, dt->shared->u.compnd.memb[u].type); + ret_value += H5O__dtype_size(f, dt->shared->u.compnd.memb[u].type); } /* end for */ } break; case H5T_ENUM: - ret_value += H5O_dtype_size(f, dt->shared->parent); + ret_value += H5O__dtype_size(f, dt->shared->parent); for(u = 0; u < dt->shared->u.enumer.nmembs; u++) { size_t name_len; /* Length of field's name */ @@ -1329,7 +1328,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) break; case H5T_VLEN: - ret_value += H5O_dtype_size(f, dt->shared->parent); + ret_value += H5O__dtype_size(f, dt->shared->parent); break; case H5T_ARRAY: @@ -1339,7 +1338,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) ret_value += 4 * dt->shared->u.array.ndims; /* dimensions */ if(dt->shared->version < H5O_DTYPE_VERSION_3) ret_value += 4 * dt->shared->u.array.ndims; /* dimension permutations */ - ret_value += H5O_dtype_size(f, dt->shared->parent); + ret_value += H5O__dtype_size(f, dt->shared->parent); break; case H5T_NO_CLASS: @@ -1352,7 +1351,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) } /* end switch */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_dtype_size() */ +} /* H5O__dtype_size() */ /*------------------------------------------------------------------------- @@ -1414,7 +1413,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_dtype_set_share + * Function: H5O__dtype_set_share * * Purpose: Copies sharing information from SH into the message. * @@ -1426,12 +1425,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh) +H5O__dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh) { H5T_t *dt = (H5T_t *)_mesg; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(dt); HDassert(sh); @@ -1462,11 +1461,11 @@ H5O_dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_set_share() */ +} /* end H5O__dtype_set_share() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_can_share + * Function: H5O__dtype_can_share * * Purpose: Determines if this datatype is allowed to be shared or * not. Immutable datatypes or datatypes that are already @@ -1482,13 +1481,13 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_dtype_can_share(const void *_mesg) +H5O__dtype_can_share(const void *_mesg) { const H5T_t *mesg = (const H5T_t *)_mesg; htri_t tri_ret; htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(mesg); @@ -1506,11 +1505,11 @@ H5O_dtype_can_share(const void *_mesg) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_can_share() */ +} /* end H5O__dtype_can_share() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_pre_copy_file + * Function: H5O__dtype_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files @@ -1525,7 +1524,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, +H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) { @@ -1533,7 +1532,7 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(file_src); @@ -1565,7 +1564,7 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_pre_copy_file() */ +} /* end H5O__dtype_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -1592,7 +1591,7 @@ H5O__dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg FUNC_ENTER_STATIC /* Perform a normal copy of the object header message */ - if(NULL == (dst_mesg = (H5T_t *)H5O_dtype_copy(native_src, NULL))) + if(NULL == (dst_mesg = (H5T_t *)H5O__dtype_copy(native_src, NULL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy") /* The datatype will be in the new file; set its location. */ @@ -1639,9 +1638,8 @@ H5O__dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, dt_dst->oloc.file = dt_dst->sh_loc.file; dt_dst->oloc.addr = dt_dst->sh_loc.u.loc.oh_addr; } /* end if */ - else { + else HDassert(!H5T_is_named(dt_dst)); - } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oefl.c b/src/H5Oefl.c index b18d819..83bab09 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 25, 1997 */ @@ -27,11 +27,11 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_efl_copy(const void *_mesg, void *_dest); -static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__efl_copy(const void *_mesg, void *_dest); +static size_t H5O__efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__efl_reset(void *_mesg); static void *H5O__efl_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, @@ -45,10 +45,10 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ "external file list", /*message name for debugging */ sizeof(H5O_efl_t), /*native message size */ 0, /* messages are sharable? */ - H5O_efl_decode, /*decode message */ - H5O_efl_encode, /*encode message */ - H5O_efl_copy, /*copy native value */ - H5O_efl_size, /*size of message on disk */ + H5O__efl_decode, /*decode message */ + H5O__efl_encode, /*encode message */ + H5O__efl_copy, /*copy native value */ + H5O__efl_size, /*size of message on disk */ H5O__efl_reset, /*reset method */ NULL, /* free method */ NULL, /* file delete method */ @@ -67,7 +67,7 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ /*------------------------------------------------------------------------- - * Function: H5O_efl_decode + * Function: H5O__efl_decode * * Purpose: Decode an external file list message and return a pointer to * the message (and some other data). @@ -87,7 +87,7 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { @@ -98,7 +98,7 @@ H5O_efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, size_t u; /* Local index variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(f); @@ -177,11 +177,11 @@ done: H5MM_xfree(mesg); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_efl_decode() */ +} /* end H5O__efl_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_efl_encode + * Function: H5O__efl_encode * * Purpose: Encodes a message. * @@ -193,12 +193,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg; size_t u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -236,11 +236,11 @@ H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, cons } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_efl_encode() */ +} /* end H5O__efl_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_efl_copy + * Function: H5O__efl_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -255,7 +255,7 @@ H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, cons *------------------------------------------------------------------------- */ static void * -H5O_efl_copy(const void *_mesg, void *_dest) +H5O__efl_copy(const void *_mesg, void *_dest) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; H5O_efl_t *dest = (H5O_efl_t *) _dest; @@ -263,7 +263,7 @@ H5O_efl_copy(const void *_mesg, void *_dest) hbool_t slot_allocated = FALSE; /* Flag to indicate that dynamic allocation has begun */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); @@ -303,11 +303,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_efl_copy() */ +} /* end H5O__efl_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_efl_size + * Function: H5O__efl_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This @@ -324,27 +324,27 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; size_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); HDassert(mesg); ret_value = (size_t)H5F_SIZEOF_ADDR(f) + /*heap address */ - 2 + /*slots allocated*/ - 2 + /*num slots used*/ - 4 + /*reserved */ + 2 + /*slots allocated*/ + 2 + /*num slots used*/ + 4 + /*reserved */ mesg->nused * ((size_t)H5F_SIZEOF_SIZE(f) + /*name offset */ (size_t)H5F_SIZEOF_SIZE(f) + /*file offset */ (size_t)H5F_SIZEOF_SIZE(f)); /*file size */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_efl_size() */ +} /* end H5O__efl_size() */ /*------------------------------------------------------------------------- @@ -402,11 +402,11 @@ H5O__efl_reset(void *_mesg) *------------------------------------------------------------------------- */ hsize_t -H5O_efl_total_size (H5O_efl_t *efl) +H5O_efl_total_size(H5O_efl_t *efl) { hsize_t ret_value = 0, tmp; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(0) if(efl->nused > 0 && H5O_EFL_UNLIMITED == efl->slot[efl->nused - 1].size) ret_value = H5O_EFL_UNLIMITED; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index cb75bc3..b9422fb 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, September 30, 1998 * * Purpose: The fill message indicates a bit pattern to use for @@ -32,15 +32,15 @@ #include "H5Sprivate.h" /* Dataspaces */ -static void *H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); -static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg); -static void *H5O_fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static herr_t H5O__fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); +static size_t H5O__fill_old_size(const H5F_t *f, const void *_mesg); +static void *H5O__fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); -static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg); -static void *H5O_fill_copy(const void *_mesg, void *_dest); +static herr_t H5O__fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); +static size_t H5O__fill_new_size(const H5F_t *f, const void *_mesg); +static void *H5O__fill_copy(const void *_mesg, void *_dest); static herr_t H5O__fill_reset(void *_mesg); static herr_t H5O__fill_free(void *_mesg); static herr_t H5O__fill_pre_copy_file(H5F_t *file_src, const void *mesg_src, @@ -49,59 +49,59 @@ static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ -#define H5O_SHARED_TYPE H5O_MSG_FILL -#define H5O_SHARED_DECODE H5O_fill_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_fill_old_decode -#define H5O_SHARED_ENCODE H5O_fill_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode -#define H5O_SHARED_SIZE H5O_fill_shared_size -#define H5O_SHARED_SIZE_REAL H5O_fill_old_size -#define H5O_SHARED_DELETE H5O__fill_shared_delete +#define H5O_SHARED_TYPE H5O_MSG_FILL +#define H5O_SHARED_DECODE H5O__fill_shared_decode +#define H5O_SHARED_DECODE_REAL H5O__fill_old_decode +#define H5O_SHARED_ENCODE H5O__fill_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__fill_old_encode +#define H5O_SHARED_SIZE H5O__fill_shared_size +#define H5O_SHARED_SIZE_REAL H5O__fill_old_size +#define H5O_SHARED_DELETE H5O__fill_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O__fill_shared_link +#define H5O_SHARED_LINK H5O__fill_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__fill_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_fill_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O__fill_debug -#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ +#define H5O_SHARED_DEBUG H5O__fill_shared_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* Set up & include shared message "interface" info */ /* (Kludgy 'undef's in order to re-include the H5Oshared.h header) */ #undef H5O_SHARED_TYPE -#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW +#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW #undef H5O_SHARED_DECODE -#define H5O_SHARED_DECODE H5O_fill_new_shared_decode +#define H5O_SHARED_DECODE H5O__fill_new_shared_decode #undef H5O_SHARED_DECODE_REAL -#define H5O_SHARED_DECODE_REAL H5O_fill_new_decode +#define H5O_SHARED_DECODE_REAL H5O__fill_new_decode #undef H5O_SHARED_ENCODE -#define H5O_SHARED_ENCODE H5O_fill_new_shared_encode +#define H5O_SHARED_ENCODE H5O__fill_new_shared_encode #undef H5O_SHARED_ENCODE_REAL -#define H5O_SHARED_ENCODE_REAL H5O_fill_new_encode +#define H5O_SHARED_ENCODE_REAL H5O__fill_new_encode #undef H5O_SHARED_SIZE -#define H5O_SHARED_SIZE H5O_fill_new_shared_size +#define H5O_SHARED_SIZE H5O__fill_new_shared_size #undef H5O_SHARED_SIZE_REAL -#define H5O_SHARED_SIZE_REAL H5O_fill_new_size +#define H5O_SHARED_SIZE_REAL H5O__fill_new_size #undef H5O_SHARED_DELETE -#define H5O_SHARED_DELETE H5O__fill_new_shared_delete +#define H5O_SHARED_DELETE H5O__fill_new_shared_delete #undef H5O_SHARED_DELETE_REAL #undef H5O_SHARED_LINK -#define H5O_SHARED_LINK H5O__fill_new_shared_link +#define H5O_SHARED_LINK H5O__fill_new_shared_link #undef H5O_SHARED_LINK_REAL #undef H5O_SHARED_COPY_FILE -#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE -#define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__fill_new_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #undef H5O_SHARED_DEBUG -#define H5O_SHARED_DEBUG H5O_fill_new_shared_debug +#define H5O_SHARED_DEBUG H5O__fill_new_shared_debug #undef H5O_SHARED_DEBUG_REAL -#define H5O_SHARED_DEBUG_REAL H5O__fill_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug #undef H5Oshared_H #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -110,11 +110,11 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ H5O_FILL_ID, /*message id number */ "fill", /*message name for debugging */ sizeof(H5O_fill_t), /*native message size */ - H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_fill_shared_decode, /*decode message */ - H5O_fill_shared_encode, /*encode message */ - H5O_fill_copy, /*copy the native value */ - H5O_fill_shared_size, /*raw message size */ + H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ + H5O__fill_shared_decode, /*decode message */ + H5O__fill_shared_encode, /*encode message */ + H5O__fill_copy, /*copy the native value */ + H5O__fill_shared_size, /*raw message size */ H5O__fill_reset, /*free internal memory */ H5O__fill_free, /* free method */ H5O__fill_shared_delete, /* file delete method */ @@ -123,10 +123,10 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ NULL, /*can share method */ H5O__fill_pre_copy_file, /* pre copy native value to file */ H5O__fill_shared_copy_file, /* copy native value to file */ - H5O_fill_shared_post_copy_file, /* post copy native value to file */ + H5O__fill_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_fill_shared_debug /*debug the message */ + H5O__fill_shared_debug /*debug the message */ }}; /* This message derives from H5O message class, for new fill value after version 1.4 */ @@ -134,11 +134,11 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ H5O_FILL_NEW_ID, /*message id number */ "fill_new", /*message name for debugging */ sizeof(H5O_fill_t), /*native message size */ - H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_fill_new_shared_decode, /*decode message */ - H5O_fill_new_shared_encode, /*encode message */ - H5O_fill_copy, /*copy the native value */ - H5O_fill_new_shared_size, /*raw message size */ + H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ + H5O__fill_new_shared_decode, /*decode message */ + H5O__fill_new_shared_encode, /*encode message */ + H5O__fill_copy, /*copy the native value */ + H5O__fill_new_shared_size, /*raw message size */ H5O__fill_reset, /*free internal memory */ H5O__fill_free, /* free method */ H5O__fill_new_shared_delete, /* file delete method */ @@ -146,11 +146,11 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ NULL, /* set share method */ NULL, /*can share method */ H5O__fill_pre_copy_file, /* pre copy native value to file */ - H5O__fill_new_shared_copy_file, /* copy native value to file */ - H5O_fill_new_shared_post_copy_file, /* post copy native value to file */ + H5O__fill_new_shared_copy_file, /* copy native value to file */ + H5O__fill_new_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_fill_new_shared_debug /*debug the message */ + H5O__fill_new_shared_debug /*debug the message */ }}; /* Format version bounds for fill value */ @@ -179,7 +179,7 @@ H5FL_BLK_EXTERN(type_conv); /*------------------------------------------------------------------------- - * Function: H5O_fill_new_decode + * Function: H5O__fill_new_decode * * Purpose: Decode a new fill value message. The new fill value * message is fill value plus space allocation time and @@ -194,14 +194,14 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ static void * -H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { H5O_fill_t *fill = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(f); HDassert(p); @@ -277,10 +277,9 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Set the "defined" flag */ fill->fill_defined = TRUE; } /* end else */ - else { + else /* Set the "defined" flag */ fill->fill_defined = TRUE; - } /* end else */ } /* end else */ /* Set return value */ @@ -294,11 +293,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fill_new_decode() */ +} /* end H5O__fill_new_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_old_decode + * Function: H5O__fill_old_decode * * Purpose: Decode an old fill value message. * @@ -311,7 +310,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, +H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { @@ -320,7 +319,7 @@ H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(f); HDassert(p); @@ -375,11 +374,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fill_old_decode() */ +} /* end H5O__fill_old_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_new_encode + * Function: H5O__fill_new_encode * * Purpose: Encode a new fill value message. The new fill value * message is fill value plus space allocation time and @@ -393,11 +392,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) +H5O__fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(p); @@ -473,11 +472,11 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_new_encode() */ +} /* end H5O__fill_new_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_old_encode + * Function: H5O__fill_old_encode * * Purpose: Encode an old fill value message. * @@ -489,11 +488,11 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) +H5O__fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(p); @@ -504,11 +503,11 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) H5MM_memcpy(p, fill->buf, (size_t)fill->size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_old_encode() */ +} /* end H5O__fill_old_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_copy + * Function: H5O__fill_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. The new fill value message is fill value plus @@ -524,13 +523,13 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) *------------------------------------------------------------------------- */ static void * -H5O_fill_copy(const void *_src, void *_dst) +H5O__fill_copy(const void *_src, void *_dst) { const H5O_fill_t *src = (const H5O_fill_t *)_src; H5O_fill_t *dst = (H5O_fill_t *)_dst; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(src); @@ -621,11 +620,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fill_copy() */ +} /* end H5O__fill_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_new_size + * Function: H5O__fill_new_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This @@ -642,40 +641,40 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) +H5O__fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(fill); /* Determine size for different versions */ if(fill->version < H5O_FILL_VERSION_3) { - ret_value = 1 + /* Version number */ - 1 + /* Space allocation time */ - 1 + /* Fill value write time */ - 1; /* Fill value defined */ + ret_value = 1 + /* Version number */ + 1 + /* Space allocation time */ + 1 + /* Fill value write time */ + 1; /* Fill value defined */ if(fill->fill_defined) - ret_value += 4 + /* Fill value size */ + ret_value += 4 + /* Fill value size */ (fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */ } /* end if */ else { - ret_value = 1 + /* Version number */ - 1; /* Status flags */ + ret_value = 1 + /* Version number */ + 1; /* Status flags */ if(fill->size > 0) - ret_value += 4 + /* Fill value size */ - (size_t)fill->size; /* Size of fill value */ + ret_value += 4 + /* Fill value size */ + (size_t)fill->size; /* Size of fill value */ } /* end else */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fill_new_size() */ +} /* end H5O__fill_new_size() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_old_size + * Function: H5O__fill_old_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This @@ -690,16 +689,16 @@ H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) *------------------------------------------------------------------------- */ static size_t -H5O_fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) +H5O__fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fill); FUNC_LEAVE_NOAPI(4 + (size_t)fill->size) -} /* end H5O_fill_old_size() */ +} /* end H5O__fill_old_size() */ /*------------------------------------------------------------------------- @@ -987,7 +986,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(FAIL) HDassert(fill); HDassert(dset_type); diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 898184b..8d6f0b1 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -15,7 +15,7 @@ * * Created: H5Oflush.c * Aug 19, 2010 - * Mike McGreevy + * Mike McGreevy * * Purpose: Object flush/refresh routines. * diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index e2fa4e5..d0f447c 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -15,7 +15,7 @@ * * Created: H5Ofsinfo.c * Feb 2009 - * Vailin Choi + * Vailin Choi * * Purpose: File space info message. * @@ -25,44 +25,44 @@ #include "H5Omodule.h" /* This source code file is part of the H5O module */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5Opkg.h" /* Object headers */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_fsinfo_copy(const void *_mesg, void *_dest); -static size_t H5O_fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__fsinfo_copy(const void *_mesg, void *_dest); +static size_t H5O__fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__fsinfo_free(void *mesg); static herr_t H5O__fsinfo_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{ - H5O_FSINFO_ID, /* message id number */ - "fsinfo", /* message name for debugging */ - sizeof(H5O_fsinfo_t), /* native message size */ - 0, /* messages are sharable? */ - H5O_fsinfo_decode, /* decode message */ - H5O_fsinfo_encode, /* encode message */ - H5O_fsinfo_copy, /* copy the native value */ - H5O_fsinfo_size, /* size of free-space manager info message */ - NULL, /* default reset method */ - H5O__fsinfo_free, /* free method */ - NULL, /* file delete method */ - NULL, /* link method */ - NULL, /* set share method */ - NULL, /* can share method */ - NULL, /* pre copy native value to file */ - NULL, /* copy native value to file */ - NULL, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O__fsinfo_debug /* debug the message */ + H5O_FSINFO_ID, /* message id number */ + "fsinfo", /* message name for debugging */ + sizeof(H5O_fsinfo_t), /* native message size */ + 0, /* messages are sharable? */ + H5O__fsinfo_decode, /* decode message */ + H5O__fsinfo_encode, /* encode message */ + H5O__fsinfo_copy, /* copy the native value */ + H5O__fsinfo_size, /* size of free-space manager info message */ + NULL, /* default reset method */ + H5O__fsinfo_free, /* free method */ + NULL, /* file delete method */ + NULL, /* link method */ + NULL, /* set share method */ + NULL, /* can share method */ + NULL, /* pre copy native value to file */ + NULL, /* copy native value to file */ + NULL, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__fsinfo_debug /* debug the message */ }}; /* Format version bounds for fsinfo message */ @@ -81,7 +81,7 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_decode + * Function: H5O__fsinfo_decode * * Purpose: Decode a message and return a pointer to a newly allocated one. * @@ -93,7 +93,7 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { @@ -102,7 +102,7 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned vers; /* message version */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -134,7 +134,6 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Map version 0 (deprecated) to version 1 message */ switch(strategy) { - case H5F_FILE_SPACE_ALL_PERSIST: fsinfo->strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; fsinfo->persist = TRUE; @@ -166,8 +165,8 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, fsinfo->version = H5O_FSINFO_VERSION_1; fsinfo->mapped = TRUE; - - } else { + } + else { HDassert(vers >= H5O_FSINFO_VERSION_1); fsinfo->version = vers; @@ -180,10 +179,9 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, H5F_addr_decode(f, &p, &(fsinfo->eoa_pre_fsm_fsalloc)); /* EOA before free-space header and section info */ /* Decode addresses of free space managers, if persisting */ - if(fsinfo->persist) { + if(fsinfo->persist) for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) H5F_addr_decode(f, &p, &(fsinfo->fs_addr[ptype - 1])); - } /* end if */ fsinfo->mapped = FALSE; } @@ -196,11 +194,11 @@ done: fsinfo = H5FL_FREE(H5O_fsinfo_t, fsinfo); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fsinfo_decode() */ +} /* end H5O__fsinfo_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_encode + * Function: H5O__fsinfo_encode * * Purpose: Encodes a message. * @@ -211,12 +209,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; H5F_mem_page_t ptype; /* Memory type for iteration */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -233,18 +231,17 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c H5F_addr_encode(f, &p, fsinfo->eoa_pre_fsm_fsalloc); /* EOA before free-space header and section info */ /* Store addresses of free-space managers, if persisting */ - if(fsinfo->persist) { + if(fsinfo->persist) /* Addresses of free-space managers */ for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) H5F_addr_encode(f, &p, fsinfo->fs_addr[ptype - 1]); - } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fsinfo_encode() */ +} /* end H5O__fsinfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_copy + * Function: H5O__fsinfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -257,13 +254,13 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_copy(const void *_mesg, void *_dest) +H5O__fsinfo_copy(const void *_mesg, void *_dest) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; H5O_fsinfo_t *dest = (H5O_fsinfo_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(fsinfo); @@ -278,11 +275,11 @@ H5O_fsinfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fsinfo_copy() */ +} /* end H5O__fsinfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_size + * Function: H5O__fsinfo_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -296,12 +293,12 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR ret_value = 3 /* Version, strategy & persist */ + (size_t)H5F_SIZEOF_SIZE(f) /* Free-space section threshold */ @@ -314,7 +311,7 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi ret_value += (H5F_MEM_PAGE_NTYPES - 1) * (size_t)H5F_SIZEOF_ADDR(f); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fsinfo_size() */ +} /* end H5O__fsinfo_size() */ /*------------------------------------------------------------------------- @@ -342,6 +339,79 @@ H5O__fsinfo_free(void *mesg) /*------------------------------------------------------------------------- + * Function: H5O__fsinfo_debug + * + * Purpose: Prints debugging info for a message. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; Feb 2009 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) +{ + const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg; + H5F_mem_page_t ptype; /* Free-space types for iteration */ + + FUNC_ENTER_STATIC_NOERR + + /* check args */ + HDassert(f); + HDassert(fsinfo); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); + + HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "File space strategy:"); + switch(fsinfo->strategy) { + case H5F_FSPACE_STRATEGY_FSM_AGGR: + HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_FSM_AGGR"); + break; + + case H5F_FSPACE_STRATEGY_PAGE: + HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_PAGE"); + break; + + case H5F_FSPACE_STRATEGY_AGGR: + HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_AGGR"); + break; + + case H5F_FSPACE_STRATEGY_NONE: + HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_NONE"); + break; + + case H5F_FSPACE_STRATEGY_NTYPES: + default: + HDfprintf(stream, "%s\n", "unknown"); + } /* end switch */ + + HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, + "Free-space persist:", fsinfo->persist); + + HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + "Free-space section threshold:", fsinfo->threshold); + + HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + "File space page size:", fsinfo->page_size); + + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + "Page end metadata threshold:", fsinfo->pgend_meta_thres); + + HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + "eoa_pre_fsm_fsalloc:", fsinfo->eoa_pre_fsm_fsalloc); + + if(fsinfo->persist) + for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) + HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + "Free space manager address:", fsinfo->fs_addr[ptype-1]); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O__fsinfo_debug() */ + +/*------------------------------------------------------------------------- * Function: H5O_fsinfo_set_version * * Purpose: Set the version to encode the fsinfo message with. @@ -414,77 +484,3 @@ done: } /* end H5O_fsinfo_check_version() */ -/*------------------------------------------------------------------------- - * Function: H5O__fsinfo_debug - * - * Purpose: Prints debugging info for a message. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi; Feb 2009 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, - int indent, int fwidth) -{ - const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg; - H5F_mem_page_t ptype; /* Free-space types for iteration */ - - FUNC_ENTER_STATIC_NOERR - - /* check args */ - HDassert(f); - HDassert(fsinfo); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - - HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "File space strategy:"); - switch(fsinfo->strategy) { - case H5F_FSPACE_STRATEGY_FSM_AGGR: - HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_FSM_AGGR"); - break; - - case H5F_FSPACE_STRATEGY_PAGE: - HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_PAGE"); - break; - - case H5F_FSPACE_STRATEGY_AGGR: - HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_AGGR"); - break; - - case H5F_FSPACE_STRATEGY_NONE: - HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_NONE"); - break; - - case H5F_FSPACE_STRATEGY_NTYPES: - default: - HDfprintf(stream, "%s\n", "unknown"); - } /* end switch */ - - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, - "Free-space persist:", fsinfo->persist); - - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, - "Free-space section threshold:", fsinfo->threshold); - - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, - "File space page size:", fsinfo->page_size); - - HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Page end metadata threshold:", fsinfo->pgend_meta_thres); - - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "eoa_pre_fsm_fsalloc:", fsinfo->eoa_pre_fsm_fsalloc); - - if(fsinfo->persist) { - for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Free space manager address:", fsinfo->fs_addr[ptype-1]); - } /* end if */ - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O__fsinfo_debug() */ - diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index d6190c6..75016e5 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -15,7 +15,7 @@ * * Created: H5Oginfo.c * Aug 23 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Group Information messages. * @@ -32,11 +32,11 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_ginfo_copy(const void *_mesg, void *_dest); -static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__ginfo_copy(const void *_mesg, void *_dest); +static size_t H5O__ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__ginfo_free(void *_mesg); static herr_t H5O__ginfo_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -47,10 +47,10 @@ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{ "ginfo", /*message name for debugging */ sizeof(H5O_ginfo_t), /*native message size */ 0, /* messages are sharable? */ - H5O_ginfo_decode, /*decode message */ - H5O_ginfo_encode, /*encode message */ - H5O_ginfo_copy, /*copy the native value */ - H5O_ginfo_size, /*size of symbol table entry */ + H5O__ginfo_decode, /*decode message */ + H5O__ginfo_encode, /*encode message */ + H5O__ginfo_copy, /*copy the native value */ + H5O__ginfo_size, /*size of symbol table entry */ NULL, /*default reset method */ H5O__ginfo_free, /* free method */ NULL, /* file delete method */ @@ -78,7 +78,7 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); /*------------------------------------------------------------------------- - * Function: H5O_ginfo_decode + * Function: H5O__ginfo_decode * * Purpose: Decode a message and return a pointer to * a newly allocated one. @@ -88,13 +88,12 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static void * -H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { @@ -102,7 +101,7 @@ H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned char flags; /* Flags for encoding group info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(p); @@ -151,29 +150,28 @@ done: ginfo = H5FL_FREE(H5O_ginfo_t, ginfo); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ginfo_decode() */ +} /* end H5O__ginfo_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_ginfo_encode + * Function: H5O__ginfo_encode * * Purpose: Encodes a message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; unsigned char flags = 0; /* Flags for encoding group info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(p); @@ -200,11 +198,11 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ginfo_encode() */ +} /* end H5O__ginfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_ginfo_copy + * Function: H5O__ginfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -214,19 +212,18 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static void * -H5O_ginfo_copy(const void *_mesg, void *_dest) +H5O__ginfo_copy(const void *_mesg, void *_dest) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; H5O_ginfo_t *dest = (H5O_ginfo_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(ginfo); @@ -241,11 +238,11 @@ H5O_ginfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ginfo_copy() */ +} /* end H5O__ginfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_ginfo_size + * Function: H5O__ginfo_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -256,33 +253,32 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static size_t -H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = 1 + /* Version */ 1 + /* Flags */ (ginfo->store_link_phase_change ? ( - (size_t)(2 + /* "Max compact" links */ - 2) /* "Min dense" links */ + (size_t)(2 + /* "Max compact" links */ + 2) /* "Min dense" links */ ) : 0) + /* "Min dense" links */ (ginfo->store_est_entry_info ? ( - (size_t)(2 + /* Estimated # of entries in group */ - 2) /* Estimated length of name of entry in group */ + (size_t)(2 + /* Estimated # of entries in group */ + 2) /* Estimated length of name of entry in group */ ) : 0); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ginfo_size() */ +} /* end H5O__ginfo_size() */ /*------------------------------------------------------------------------- @@ -300,7 +296,7 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha static herr_t H5O__ginfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); @@ -318,7 +314,6 @@ H5O__ginfo_free(void *mesg) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- diff --git a/src/H5Oint.c b/src/H5Oint.c index 04220af..09db25a 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -99,36 +99,36 @@ hbool_t H5_PKG_INIT_VAR = FALSE; * message. */ const H5O_msg_class_t *const H5O_msg_class_g[] = { - H5O_MSG_NULL, /*0x0000 Null */ - H5O_MSG_SDSPACE, /*0x0001 Dataspace */ - H5O_MSG_LINFO, /*0x0002 Link information */ - H5O_MSG_DTYPE, /*0x0003 Datatype */ - H5O_MSG_FILL, /*0x0004 Old data storage -- fill value */ - H5O_MSG_FILL_NEW, /*0x0005 New data storage -- fill value */ - H5O_MSG_LINK, /*0x0006 Link */ - H5O_MSG_EFL, /*0x0007 Data storage -- external data files */ - H5O_MSG_LAYOUT, /*0x0008 Data Layout */ + H5O_MSG_NULL, /*0x0000 Null */ + H5O_MSG_SDSPACE, /*0x0001 Dataspace */ + H5O_MSG_LINFO, /*0x0002 Link information */ + H5O_MSG_DTYPE, /*0x0003 Datatype */ + H5O_MSG_FILL, /*0x0004 Old data storage -- fill value */ + H5O_MSG_FILL_NEW, /*0x0005 New data storage -- fill value */ + H5O_MSG_LINK, /*0x0006 Link */ + H5O_MSG_EFL, /*0x0007 Data storage -- external data files */ + H5O_MSG_LAYOUT, /*0x0008 Data Layout */ #ifdef H5O_ENABLE_BOGUS - H5O_MSG_BOGUS_VALID, /*0x0009 "Bogus valid" (for testing) */ + H5O_MSG_BOGUS_VALID, /*0x0009 "Bogus valid" (for testing) */ #else /* H5O_ENABLE_BOGUS */ - NULL, /*0x0009 "Bogus valid" (for testing) */ + NULL, /*0x0009 "Bogus valid" (for testing) */ #endif /* H5O_ENABLE_BOGUS */ - H5O_MSG_GINFO, /*0x000A Group information */ - H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ - H5O_MSG_ATTR, /*0x000C Attribute */ - H5O_MSG_NAME, /*0x000D Object name */ - H5O_MSG_MTIME, /*0x000E Object modification date and time */ - H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ - H5O_MSG_CONT, /*0x0010 Object header continuation */ - H5O_MSG_STAB, /*0x0011 Symbol table */ - H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ - H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ - H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ - H5O_MSG_AINFO, /*0x0015 Attribute information */ - H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ - H5O_MSG_FSINFO, /*0x0017 Free-space manager info */ - H5O_MSG_MDCI, /*0x0018 Metadata cache image */ - H5O_MSG_UNKNOWN /*0x0019 Placeholder for unknown message */ + H5O_MSG_GINFO, /*0x000A Group information */ + H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ + H5O_MSG_ATTR, /*0x000C Attribute */ + H5O_MSG_NAME, /*0x000D Object name */ + H5O_MSG_MTIME, /*0x000E Object modification date and time */ + H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ + H5O_MSG_CONT, /*0x0010 Object header continuation */ + H5O_MSG_STAB, /*0x0011 Symbol table */ + H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ + H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ + H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ + H5O_MSG_AINFO, /*0x0015 Attribute information */ + H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ + H5O_MSG_FSINFO, /*0x0017 Free-space manager info */ + H5O_MSG_MDCI, /*0x0018 Metadata cache image */ + H5O_MSG_UNKNOWN /*0x0019 Placeholder for unknown message */ }; /* Format version bounds for object header */ @@ -219,7 +219,7 @@ H5O__init_package(void) /*------------------------------------------------------------------------- - * Function: H5O_set_version + * Function: H5O__set_version * * Purpose: Sets the correct version to encode the object header. * Chooses the oldest version possible, unless the file's @@ -233,12 +233,12 @@ H5O__init_package(void) *------------------------------------------------------------------------- */ static herr_t -H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) +H5O__set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) { uint8_t version; /* Message version */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* check arguments */ HDassert(f); @@ -262,7 +262,7 @@ H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_set_version() */ +} /* end H5O__set_version() */ /*------------------------------------------------------------------------- @@ -280,17 +280,8 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 5 1997 * - * Changes: 2018 August 17 - * Jacob Smith - * Refactor out the operations into two separate steps -- - * preparation and application -- to facilitate overriding the - * library-default size allocated for the object header. This - * function is retained as a wrapper, to minimize changes to - * unaffected calling functions. - * *------------------------------------------------------------------------- */ herr_t @@ -308,13 +299,13 @@ H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc /* create object header in freelist * header version is set internally */ - oh = H5O__create_ohdr(f, ocpl_id); + oh = H5O_create_ohdr(f, ocpl_id); if(NULL == oh) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "Can't instantiate object header") /* apply object header information to file */ - if(H5O__apply_ohdr(f, oh, ocpl_id, size_hint, initial_rc, loc) < 0) + if(H5O_apply_ohdr(f, oh, ocpl_id, size_hint, initial_rc, loc) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "Can't apply object header to file") done: @@ -326,7 +317,7 @@ done: /*----------------------------------------------------------------------------- - * Function: H5O__create_ohdr + * Function: H5O_create_ohdr * * Purpose: Create the object header, set version and flags. * @@ -339,7 +330,7 @@ done: *----------------------------------------------------------------------------- */ H5O_t * -H5O__create_ohdr(H5F_t *f, hid_t ocpl_id) +H5O_create_ohdr(H5F_t *f, hid_t ocpl_id) { H5P_genplist_t *oc_plist; H5O_t *oh = NULL; /* Object header in Freelist */ @@ -364,20 +355,18 @@ H5O__create_ohdr(H5F_t *f, hid_t ocpl_id) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "not a property list") /* Get any object header status flags set by properties */ - if(H5P_DATASET_CREATE_DEFAULT == ocpl_id) - { + if(H5P_DATASET_CREATE_DEFAULT == ocpl_id) { /* If the OCPL is the default DCPL, we can get the header flags from the * API context. Otherwise we have to call H5P_get */ if(H5CX_get_ohdr_flags(&oh_flags) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags") } - else - { + else { if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags") } - if(H5O_set_version(f, oh, oh_flags, H5F_STORE_MSG_CRT_IDX(f)) < 0) + if(H5O__set_version(f, oh, oh_flags, H5F_STORE_MSG_CRT_IDX(f)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set version of object header") oh->flags = oh_flags; @@ -389,11 +378,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, NULL, "can't delete object header") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O__create_ohdr() */ +} /* H5O_create_ohdr() */ /*----------------------------------------------------------------------------- - * Function: H5O__apply_ohdr + * Function: H5O_apply_ohdr * * Purpose: Initialize and set the object header in the file. * Record some information at `loc_out`. @@ -407,7 +396,7 @@ done: *----------------------------------------------------------------------------- */ herr_t -H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t initial_rc, H5O_loc_t *loc_out) +H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t initial_rc, H5O_loc_t *loc_out) { haddr_t oh_addr; size_t oh_size; @@ -564,7 +553,7 @@ H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t ini done: FUNC_LEAVE_NOAPI(ret_value); -} /* H5O__apply_ohdr() */ +} /* H5O_apply_ohdr() */ /*------------------------------------------------------------------------- @@ -664,7 +653,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_open_by_idx + * Function: H5O__open_by_idx * * Purpose: Internal routine to open an object by index within group * @@ -677,7 +666,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, +H5O__open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5I_type_t *opened_type) { H5G_loc_t obj_loc; /* Location used to open group */ @@ -686,7 +675,7 @@ H5O_open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, hbool_t loc_found = FALSE; /* Entry at 'name' found */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -712,11 +701,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open_by_idx() */ +} /* end H5O__open_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5O_open_by_addr + * Function: H5O__open_by_addr * * Purpose: Internal routine to open an object by its address * @@ -729,14 +718,14 @@ done: *------------------------------------------------------------------------- */ void * -H5O_open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type) +H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -755,7 +744,7 @@ H5O_open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open_by_addr() */ +} /* end H5O__open_by_addr() */ /*------------------------------------------------------------------------- @@ -869,7 +858,6 @@ done: * Failure: -1 * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 5 1997 * *------------------------------------------------------------------------- @@ -984,7 +972,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 5 1997 * *------------------------------------------------------------------------- @@ -1033,7 +1020,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Dec 31 2002 * *------------------------------------------------------------------------- @@ -1219,7 +1205,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -1266,7 +1251,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -1302,7 +1286,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Dec 31 2002 * *------------------------------------------------------------------------- @@ -1498,7 +1481,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * * Tuesday, January 21, 2003 * *------------------------------------------------------------------------- @@ -1570,7 +1552,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 19 2003 * *------------------------------------------------------------------------- @@ -1633,7 +1614,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 19 2003 * *------------------------------------------------------------------------- @@ -1696,7 +1676,7 @@ H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type) done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_obj_type() */ @@ -1734,10 +1714,9 @@ H5O__obj_type_real(const H5O_t *oh, H5O_type_t *obj_type) /* Set type to "unknown" */ *obj_type = H5O_TYPE_UNKNOWN; } - else { + else /* Set object type */ *obj_type = obj_class->type; - } FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__obj_type_real() */ @@ -1923,7 +1902,6 @@ H5O_loc_reset(H5O_loc_t *loc) * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Monday, September 19, 2005 * *------------------------------------------------------------------------- @@ -2131,7 +2109,7 @@ H5O_get_hdr_info(const H5O_loc_t *loc, H5O_hdr_info_t *hdr) done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") + HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_get_hdr_info() */ @@ -2942,7 +2920,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -2978,7 +2955,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -3015,7 +2991,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 08 2010 * *------------------------------------------------------------------------- @@ -3081,7 +3056,6 @@ H5O_get_proxy(const H5O_t *oh) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 15 2003 * *------------------------------------------------------------------------- diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 8e6e204..671afeb 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 8, 1997 * * Purpose: Messages related to data layout. @@ -967,7 +967,7 @@ H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, const H5O_layout_t *layout_src = (const H5O_layout_t *)mesg_src; /* Source layout */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(cpy_info); diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index a2f88d9..ebb34dc 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -15,7 +15,7 @@ * * Created: H5Olinfo.c * Aug 23 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Link Information messages. * @@ -38,9 +38,9 @@ /* PRIVATE PROTOTYPES */ static void *H5O__linfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_linfo_copy(const void *_mesg, void *_dest); -static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__linfo_copy(const void *_mesg, void *_dest); +static size_t H5O__linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__linfo_free(void *_mesg); static herr_t H5O__linfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); static void *H5O__linfo_copy_file(H5F_t *file_src, void *native_src, @@ -59,9 +59,9 @@ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{ sizeof(H5O_linfo_t), /*native message size */ 0, /* messages are sharable? */ H5O__linfo_decode, /*decode message */ - H5O_linfo_encode, /*encode message */ - H5O_linfo_copy, /*copy the native value */ - H5O_linfo_size, /*size of symbol table entry */ + H5O__linfo_encode, /*encode message */ + H5O__linfo_copy, /*copy the native value */ + H5O__linfo_size, /*size of symbol table entry */ NULL, /*default reset method */ H5O__linfo_free, /* free method */ H5O__linfo_delete, /* file delete method */ @@ -105,7 +105,6 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- @@ -174,25 +173,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_linfo_encode + * Function: H5O__linfo_encode * * Purpose: Encodes a message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; unsigned char index_flags; /* Flags for encoding link index info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -224,11 +222,11 @@ H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co HDassert(!H5F_addr_defined(linfo->corder_bt2_addr)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_linfo_encode() */ +} /* end H5O__linfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_copy + * Function: H5O__linfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -237,19 +235,18 @@ H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- */ static void * -H5O_linfo_copy(const void *_mesg, void *_dest) +H5O__linfo_copy(const void *_mesg, void *_dest) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; H5O_linfo_t *dest = (H5O_linfo_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(linfo); @@ -264,11 +261,11 @@ H5O_linfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_copy() */ +} /* end H5O__linfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_size + * Function: H5O__linfo_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -278,18 +275,17 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- */ static size_t -H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = 1 /* Version */ @@ -300,7 +296,7 @@ H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void + (linfo->index_corder ? (size_t)H5F_SIZEOF_ADDR(f) : 0); /* Address of v2 B-tree for indexing creation order values of links */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_size() */ +} /* end H5O__linfo_size() */ /*------------------------------------------------------------------------- @@ -393,7 +389,7 @@ H5O__linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *fi HDassert(cpy_info); /* Copy the source message */ - if(NULL == (linfo_dst = (H5O_linfo_t *)H5O_linfo_copy(linfo_src, NULL))) + if(NULL == (linfo_dst = (H5O_linfo_t *)H5O__linfo_copy(linfo_src, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "memory allocation failed") /* If we are performing a 'shallow hierarchy' copy, and the links in this @@ -441,7 +437,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 26 2006 * *------------------------------------------------------------------------- @@ -548,7 +543,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- diff --git a/src/H5Olink.c b/src/H5Olink.c index c27b51f..70b654f 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -15,7 +15,7 @@ * * Created: H5Olink.c * Aug 29 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Link messages. * @@ -40,12 +40,12 @@ /* PRIVATE PROTOTYPES */ static void *H5O__link_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_link_copy(const void *_mesg, void *_dest); -static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__link_copy(const void *_mesg, void *_dest); +static size_t H5O__link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__link_reset(void *_mesg); static herr_t H5O__link_free(void *_mesg); -static herr_t H5O_link_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__link_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O__link_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, @@ -63,16 +63,16 @@ const H5O_msg_class_t H5O_MSG_LINK[1] = {{ sizeof(H5O_link_t), /*native message size */ 0, /* messages are sharable? */ H5O__link_decode, /*decode message */ - H5O_link_encode, /*encode message */ - H5O_link_copy, /*copy the native value */ - H5O_link_size, /*size of symbol table entry */ + H5O__link_encode, /*encode message */ + H5O__link_copy, /*copy the native value */ + H5O__link_size, /*size of symbol table entry */ H5O__link_reset, /* reset method */ H5O__link_free, /* free method */ H5O_link_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ - H5O_link_pre_copy_file, /* pre copy native value to file */ + H5O__link_pre_copy_file, /* pre copy native value to file */ H5O__link_copy_file, /* copy native value to file */ H5O__link_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ @@ -111,7 +111,6 @@ H5FL_DEFINE_STATIC(H5O_link_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- @@ -284,26 +283,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_link_encode + * Function: H5O__link_encode * * Purpose: Encodes a link message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- */ static herr_t -H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; uint64_t len; /* Length of a string in the message */ unsigned char link_flags; /* Flags for encoding link info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -404,11 +402,11 @@ H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con } /* end switch */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_link_encode() */ +} /* end H5O__link_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_link_copy + * Function: H5O__link_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -418,19 +416,18 @@ H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- */ static void * -H5O_link_copy(const void *_mesg, void *_dest) +H5O__link_copy(const void *_mesg, void *_dest) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; H5O_link_t *dest = (H5O_link_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(lnk); @@ -471,11 +468,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_copy() */ +} /* end H5O__link_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_link_size + * Function: H5O__link_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -486,20 +483,19 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- */ static size_t -H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; uint64_t name_len; /* Length of name */ size_t name_size; /* Size of encoded name length */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDcompile_assert(sizeof(uint64_t) >= sizeof(size_t)); @@ -548,7 +544,7 @@ H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void } /* end switch */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_size() */ +} /* end H5O__link_size() */ /*------------------------------------------------------------------------- @@ -683,7 +679,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_link_pre_copy_file + * Function: H5O__link_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files for link messages. @@ -698,10 +694,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, +H5O__link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(deleted); @@ -716,7 +712,7 @@ H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *deleted = TRUE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_link_pre_copy_file() */ +} /* end H5O__link_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -811,7 +807,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- @@ -823,7 +818,7 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, const H5O_link_t *lnk = (const H5O_link_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); diff --git a/src/H5Omessage.c b/src/H5Omessage.c index d66ea69..283d913 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -15,7 +15,7 @@ * * Created: H5Omessage.c * Dec 3 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header message routines. * @@ -105,7 +105,6 @@ static herr_t H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 1 2006 * *------------------------------------------------------------------------- @@ -153,7 +152,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Dec 31 2002 * *------------------------------------------------------------------------- @@ -196,7 +194,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 8 2006 * *------------------------------------------------------------------------- @@ -248,7 +245,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -304,7 +300,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 6 2007 * *------------------------------------------------------------------------- @@ -352,7 +347,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -453,7 +447,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -506,7 +499,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -563,7 +555,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * *------------------------------------------------------------------------- @@ -600,7 +591,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * *------------------------------------------------------------------------- @@ -951,7 +941,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 28 1997 * *------------------------------------------------------------------------- @@ -1002,7 +991,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -1052,7 +1040,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -1118,7 +1105,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 28 1997 * *------------------------------------------------------------------------- @@ -1175,7 +1161,6 @@ done: * object headers were processed. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Nov 19 2004 * * Description: @@ -1241,7 +1226,6 @@ done: * object headers were processed. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * * Description: @@ -1316,7 +1300,7 @@ done: */ if(oh_modified & H5O_MODIFY_CONDENSE) if(H5O__condense_header(f, oh) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") + HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") /* Mark object header as changed */ if(H5O_touch_oh(f, oh, FALSE) < 0) @@ -1340,7 +1324,6 @@ done: * Return: Size of message on success, 0 on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 13 2003 * *------------------------------------------------------------------------- @@ -1383,7 +1366,6 @@ done: * Return: Size of message on success, 0 on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -1447,7 +1429,6 @@ done: * Return: Size of message on success, 0 on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 7 2007 * *------------------------------------------------------------------------- @@ -1584,7 +1565,6 @@ H5O_msg_can_share_in_ohdr(unsigned type_id) * Object is not shared: FALSE * * Programmer: James Laird - * jlaird@ncsa.uiuc.edu * April 5 2006 * *------------------------------------------------------------------------- @@ -1629,7 +1609,6 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg) * Failure: Negative * * Programmer: James Laird - * jlaird@hdfgroup.org * November 1 2006 * *------------------------------------------------------------------------- @@ -1680,7 +1659,6 @@ done: * Failure: Negative * * Programmer: James Laird - * jlaird@hdfgroup.org * Oct 17 2006 * *------------------------------------------------------------------------- @@ -1756,7 +1734,6 @@ done: * Failure: Negative * * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu * July 13, 2004 * *------------------------------------------------------------------------- @@ -1796,14 +1773,8 @@ done: * Failure: NULL * * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu * July 14, 2004 * - * Modifications: Neil Fortner - * Feb 4 2009 - * Added open_oh parameter. This parameter is optional and - * contains this message's protected object header - * *------------------------------------------------------------------------- */ void * @@ -2067,7 +2038,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * September 26 2003 * *------------------------------------------------------------------------- @@ -2107,7 +2077,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 14 2007 * *------------------------------------------------------------------------- @@ -2208,7 +2177,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Nov 21 2005 * *------------------------------------------------------------------------- diff --git a/src/H5Omodule.h b/src/H5Omodule.h index df3ab56..6f00fcc 100644 --- a/src/H5Omodule.h +++ b/src/H5Omodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Omtime.c b/src/H5Omtime.c index fbf7613..846bbf3 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, July 24, 1998 * * Purpose: The object modification time message. @@ -29,14 +29,14 @@ static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static size_t H5O__mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static void *H5O__mtime_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_mtime_copy(const void *_mesg, void *_dest); -static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__mtime_copy(const void *_mesg, void *_dest); +static size_t H5O__mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__mtime_free(void *_mesg); static herr_t H5O__mtime_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -48,9 +48,9 @@ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ sizeof(time_t), /*native message size */ 0, /* messages are sharable? */ H5O__mtime_decode, /*decode message */ - H5O_mtime_encode, /*encode message */ - H5O_mtime_copy, /*copy the native value */ - H5O_mtime_size, /*raw message size */ + H5O__mtime_encode, /*encode message */ + H5O__mtime_copy, /*copy the native value */ + H5O__mtime_size, /*raw message size */ NULL, /* reset method */ H5O__mtime_free, /* free method */ NULL, /* file delete method */ @@ -73,9 +73,9 @@ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ sizeof(time_t), /*native message size */ 0, /* messages are sharable? */ H5O__mtime_new_decode, /*decode message */ - H5O_mtime_new_encode, /*encode message */ - H5O_mtime_copy, /*copy the native value */ - H5O_mtime_new_size, /*raw message size */ + H5O__mtime_new_encode, /*encode message */ + H5O__mtime_copy, /*copy the native value */ + H5O__mtime_new_size, /*raw message size */ NULL, /* reset method */ H5O__mtime_free, /* free method */ NULL, /* file delete method */ @@ -111,7 +111,6 @@ H5FL_DEFINE(time_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 3 2002 * *------------------------------------------------------------------------- @@ -168,7 +167,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 24 1998 * *------------------------------------------------------------------------- @@ -220,24 +218,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_mtime_new_encode + * Function: H5O__mtime_new_encode * * Purpose: Encodes a new modification time message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 3 2002 * *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -256,31 +253,28 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha UINT32ENCODE(p, *mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_mtime_new_encode() */ +} /* end H5O__mtime_new_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_encode + * Function: H5O__mtime_encode * * Purpose: Encodes a modification time message. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 24 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; struct tm *tm; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -290,15 +284,15 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, /* encode */ tm = HDgmtime(mesg); HDsprintf((char*)p, "%04d%02d%02d%02d%02d%02d", - 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec); + 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__mtime_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_copy + * Function: H5O__mtime_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -308,25 +302,22 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 24 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_mtime_copy(const void *_mesg, void *_dest) +H5O__mtime_copy(const void *_mesg, void *_dest) { const time_t *mesg = (const time_t *) _mesg; time_t *dest = (time_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); - if (!dest && NULL==(dest = H5FL_MALLOC(time_t))) + if(!dest && NULL == (dest = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* copy */ @@ -337,11 +328,11 @@ H5O_mtime_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5O__mtime_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_new_size + * Function: H5O__mtime_new_size * * Purpose: Returns the size of the raw message in bytes not * counting the message type or size fields, but only the data @@ -353,28 +344,25 @@ done: * Failure: 0 * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 3 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) +H5O__mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); HDassert(mesg); FUNC_LEAVE_NOAPI(8) -} /* end H5O_mtime_new_size() */ +} /* end H5O__mtime_new_size() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_size + * Function: H5O__mtime_size * * Purpose: Returns the size of the raw message in bytes not * counting the message type or size fields, but only the data @@ -386,24 +374,21 @@ H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disabl * Failure: 0 * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 14 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5O_mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) +H5O__mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); HDassert(mesg); FUNC_LEAVE_NOAPI(16) -} +} /* end H5O__mtime_size() */ /*------------------------------------------------------------------------- @@ -439,7 +424,6 @@ H5O__mtime_free(void *mesg) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 24 1998 * *------------------------------------------------------------------------- diff --git a/src/H5Oname.c b/src/H5Oname.c index 1f20f10..41cd01e 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -15,7 +15,7 @@ * * Created: H5Oname.c * Aug 12 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Object name message. * @@ -34,9 +34,9 @@ /* PRIVATE PROTOTYPES */ static void *H5O__name_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_name_copy(const void *_mesg, void *_dest); -static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__name_copy(const void *_mesg, void *_dest); +static size_t H5O__name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__name_reset(void *_mesg); static herr_t H5O__name_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -48,9 +48,9 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ sizeof(H5O_name_t), /*native message size */ 0, /* messages are sharable? */ H5O__name_decode, /*decode message */ - H5O_name_encode, /*encode message */ - H5O_name_copy, /*copy the native value */ - H5O_name_size, /*raw message size */ + H5O__name_encode, /*encode message */ + H5O__name_copy, /*copy the native value */ + H5O__name_size, /*raw message size */ H5O__name_reset, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ @@ -77,7 +77,6 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * *------------------------------------------------------------------------- @@ -115,26 +114,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_name_encode + * Function: H5O__name_encode * * Purpose: Encodes a name message. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -145,11 +141,11 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, HDstrcpy((char*)p, mesg->s); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__name_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_name_copy + * Function: H5O__name_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -159,21 +155,18 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_name_copy(const void *_mesg, void *_dest) +H5O__name_copy(const void *_mesg, void *_dest) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; H5O_name_t *dest = (H5O_name_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); @@ -195,11 +188,11 @@ done: dest = (H5O_name_t *)H5MM_xfree(dest); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_name_copy() */ +} /* end H5O__name_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_name_size + * Function: H5O__name_size * * Purpose: Returns the size of the raw message in bytes not * counting the message typ or size fields, but only the data @@ -211,20 +204,17 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -233,7 +223,7 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar ret_value = mesg->s ? HDstrlen(mesg->s) + 1 : 0; FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5O__name_size() */ /*------------------------------------------------------------------------- @@ -245,7 +235,6 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * *------------------------------------------------------------------------- @@ -275,11 +264,8 @@ H5O__name_reset(void *_mesg) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -288,7 +274,7 @@ H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, { const H5O_name_t *mesg = (const H5O_name_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); diff --git a/src/H5Onull.c b/src/H5Onull.c index 5697455..43c555f 100644 --- a/src/H5Onull.c +++ b/src/H5Onull.c @@ -15,7 +15,6 @@ * * Created: H5Onull.c * Aug 6 1997 - * Robb Matzke * * Purpose: The null message. * diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 16ea8e5..07e0e8e 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -554,7 +554,12 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATASET[1]; H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]; /* Package-local function prototypes */ +H5_DLL void *H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type/*out*/); +H5_DLL void *H5O__open_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5I_type_t *opened_type/*out*/); H5_DLL const H5O_obj_class_t *H5O__obj_class(const H5O_loc_t *loc); +H5_DLL herr_t H5O__copy(const H5G_loc_t *src_loc, const char *src_name, + H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); H5_DLL int H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted); H5_DLL herr_t H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2_t op, void *op_data, unsigned fields); diff --git a/src/H5Opline.c b/src/H5Opline.c index a956725..35efed3 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -12,81 +12,81 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Wednesday, April 15, 1998 + * Programmer: Robb Matzke + * Wednesday, April 15, 1998 * - * Purpose: Data filter pipeline message. + * Purpose: Data filter pipeline message. */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ -#define H5Z_FRIEND /*suppress error about including H5Zpkg */ +#define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ -#include "H5Zpkg.h" /* Data filters */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ +#include "H5Zpkg.h" /* Data filters */ /* PRIVATE PROTOTYPES */ -static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg); +static herr_t H5O__pline_encode(H5F_t *f, uint8_t *p, const void *mesg); static void *H5O__pline_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static void *H5O_pline_copy(const void *_mesg, void *_dest); -static size_t H5O_pline_size(const H5F_t *f, const void *_mesg); +static void *H5O__pline_copy(const void *_mesg, void *_dest); +static size_t H5O__pline_size(const H5F_t *f, const void *_mesg); static herr_t H5O__pline_reset(void *_mesg); static herr_t H5O__pline_free(void *_mesg); -static herr_t H5O_pline_pre_copy_file(H5F_t *file_src, +static herr_t H5O__pline_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); static herr_t H5O__pline_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ -#define H5O_SHARED_TYPE H5O_MSG_PLINE -#define H5O_SHARED_DECODE H5O_pline_shared_decode -#define H5O_SHARED_DECODE_REAL H5O__pline_decode -#define H5O_SHARED_ENCODE H5O_pline_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_pline_encode -#define H5O_SHARED_SIZE H5O_pline_shared_size -#define H5O_SHARED_SIZE_REAL H5O_pline_size -#define H5O_SHARED_DELETE H5O__pline_shared_delete +#define H5O_SHARED_TYPE H5O_MSG_PLINE +#define H5O_SHARED_DECODE H5O__pline_shared_decode +#define H5O_SHARED_DECODE_REAL H5O__pline_decode +#define H5O_SHARED_ENCODE H5O__pline_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__pline_encode +#define H5O_SHARED_SIZE H5O__pline_shared_size +#define H5O_SHARED_SIZE_REAL H5O__pline_size +#define H5O_SHARED_DELETE H5O__pline_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O__pline_shared_link +#define H5O_SHARED_LINK H5O__pline_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE H5O_pline_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__pline_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_pline_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O__pline_debug -#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ +#define H5O_SHARED_DEBUG H5O__pline_shared_debug +#define H5O_SHARED_DEBUG_REAL H5O__pline_debug +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ - H5O_PLINE_ID, /* message id number */ - "filter pipeline", /* message name for debugging */ - sizeof(H5O_pline_t), /* native message size */ - H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_pline_shared_decode, /* decode message */ - H5O_pline_shared_encode, /* encode message */ - H5O_pline_copy, /* copy the native value */ - H5O_pline_shared_size, /* size of raw message */ - H5O__pline_reset, /* reset method */ - H5O__pline_free, /* free method */ - H5O__pline_shared_delete, /* file delete method */ - H5O__pline_shared_link, /* link method */ - NULL, /* set share method */ - NULL, /*can share method */ - H5O_pline_pre_copy_file, /* pre copy native value to file */ - H5O__pline_shared_copy_file, /* copy native value to file */ - H5O_pline_shared_post_copy_file, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O_pline_shared_debug /* debug the message */ + H5O_PLINE_ID, /* message id number */ + "filter pipeline", /* message name for debugging */ + sizeof(H5O_pline_t), /* native message size */ + H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ + H5O__pline_shared_decode, /* decode message */ + H5O__pline_shared_encode, /* encode message */ + H5O__pline_copy, /* copy the native value */ + H5O__pline_shared_size, /* size of raw message */ + H5O__pline_reset, /* reset method */ + H5O__pline_free, /* free method */ + H5O__pline_shared_delete, /* file delete method */ + H5O__pline_shared_link, /* link method */ + NULL, /* set share method */ + NULL, /*can share method */ + H5O__pline_pre_copy_file, /* pre copy native value to file */ + H5O__pline_shared_copy_file,/* copy native value to file */ + H5O__pline_shared_post_copy_file, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__pline_shared_debug /* debug the message */ }}; /* Format version bounds for filter pipleline */ @@ -105,12 +105,12 @@ H5FL_DEFINE(H5O_pline_t); /*------------------------------------------------------------------------- * Function: H5O__pline_decode * - * Purpose: Decodes a filter pipeline message. + * Purpose: Decodes a filter pipeline message. * - * Return: Success: Ptr to the native message. - * Failure: NULL + * Return: Success: Ptr to the native message. + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 15, 1998 * *------------------------------------------------------------------------- @@ -223,7 +223,7 @@ H5O__pline_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, if (p + 4 - 1 <= p_end) UINT32DECODE(p, filter->cd_values[j]) else - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p", p, p_size, p_end) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p", (const void *)p, p_size, (const void *)p_end) } if(pline->version == H5O_PLINE_VERSION_1) @@ -246,7 +246,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_pline_encode + * Function: H5O__pline_encode * * Purpose: Encodes message MESG into buffer P. * @@ -258,13 +258,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) +H5O__pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) { const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message to encode */ const H5Z_filter_info_t *filter; /* Filter to encode */ size_t i, j; /* Local index variables */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(p); @@ -288,7 +288,7 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) size_t name_length; /* Length of filter name */ /* Filter ID */ - UINT16ENCODE(p, filter->id); + UINT16ENCODE(p, filter->id); /* Skip writing the name length & name if the filter is an internal filter */ if(pline->version > H5O_PLINE_VERSION_1 && filter->id < H5Z_FILTER_RESERVED) { @@ -312,26 +312,26 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) } /* end else */ /* Filter flags */ - UINT16ENCODE(p, filter->flags); + UINT16ENCODE(p, filter->flags); /* # of filter parameters */ - UINT16ENCODE(p, filter->cd_nelmts); + UINT16ENCODE(p, filter->cd_nelmts); /* Encode name, if there is one to encode */ - if(name_length > 0) { + if(name_length > 0) { /* Store name, with null terminator */ - H5MM_memcpy(p, name, name_length); - p += name_length; + H5MM_memcpy(p, name, name_length); + p += name_length; /* Pad out name to alignment, in older versions */ if(pline->version == H5O_PLINE_VERSION_1) while(name_length++ % 8) *p++ = 0; - } /* end if */ + } /* end if */ /* Filter parameters */ - for(j = 0; j < filter->cd_nelmts; j++) - UINT32ENCODE(p, filter->cd_values[j]); + for(j = 0; j < filter->cd_nelmts; j++) + UINT32ENCODE(p, filter->cd_values[j]); /* Align the parameters for older versions of the format */ if(pline->version == H5O_PLINE_VERSION_1) @@ -340,11 +340,11 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_encode() */ +} /* end H5O__pline_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_pline_copy + * Function: H5O__pline_copy * * Purpose: Copies a filter pipeline message from SRC to DST allocating * DST if necessary. If DST is already allocated then we assume @@ -360,18 +360,18 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) *------------------------------------------------------------------------- */ static void * -H5O_pline_copy(const void *_src, void *_dst/*out*/) +H5O__pline_copy(const void *_src, void *_dst/*out*/) { const H5O_pline_t *src = (const H5O_pline_t *)_src; /* Source pipeline message */ H5O_pline_t *dst = (H5O_pline_t *)_dst; /* Destination pipeline message */ size_t i; /* Local index variable */ H5O_pline_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate pipeline message, if not provided */ if(!dst && NULL == (dst = H5FL_MALLOC(H5O_pline_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Shallow copy basic fields */ *dst = *src; @@ -428,16 +428,16 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/) done: if(!ret_value && dst) { H5O__pline_reset(dst); - if(!_dst) + if(!_dst) H5O__pline_free(dst); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pline_copy() */ +} /* end H5O__pline_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_pline_size + * Function: H5O__pline_size * * Purpose: Determines the size of a raw filter pipeline message. * @@ -451,18 +451,18 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) +H5O__pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) { const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message */ size_t i; /* Local index variable */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Message header */ ret_value = (size_t)(1 + /*version */ - 1 + /*number of filters */ - (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0)); /*reserved */ + 1 + /*number of filters */ + (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0)); /*reserved */ /* Calculate size of each filter in pipeline */ for(i = 0; i < pline->nused; i++) { @@ -475,26 +475,26 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) else { H5Z_class2_t *cls; /* Filter class */ - /* Get the name of the filter, same as done with H5O_pline_encode() */ + /* Get the name of the filter, same as done with H5O__pline_encode() */ if(NULL == (name = pline->filter[i].name) && (cls = H5Z_find(pline->filter[i].id))) name = cls->name; name_len = name ? HDstrlen(name) + 1 : 0; } /* end else */ - ret_value += 2 + /*filter identification number */ - (size_t)((pline->version == H5O_PLINE_VERSION_1 || pline->filter[i].id >= H5Z_FILTER_RESERVED) ? 2 : 0) + /*name length */ - 2 + /*flags */ - 2 + /*number of client data values */ - (pline->version == H5O_PLINE_VERSION_1 ? (size_t)H5O_ALIGN_OLD(name_len) : name_len); /*length of the filter name */ + ret_value += 2 + /*filter identification number */ + (size_t)((pline->version == H5O_PLINE_VERSION_1 || pline->filter[i].id >= H5Z_FILTER_RESERVED) ? 2 : 0) + /*name length */ + 2 + /*flags */ + 2 + /*number of client data values */ + (pline->version == H5O_PLINE_VERSION_1 ? (size_t)H5O_ALIGN_OLD(name_len) : name_len); /*length of the filter name */ - ret_value += pline->filter[i].cd_nelmts * 4; + ret_value += pline->filter[i].cd_nelmts * 4; if(pline->version == H5O_PLINE_VERSION_1) if(pline->filter[i].cd_nelmts % 2) ret_value += 4; } /* end for */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pline_size() */ +} /* end H5O__pline_size() */ /*------------------------------------------------------------------------- @@ -525,8 +525,7 @@ H5O__pline_reset(void *mesg) HDassert(pline); /* Free the filter information and array */ - if (pline->filter) { - + if(pline->filter) { /* Free information for each filter */ for(i = 0; i < pline->nused; i++) { if(pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name) @@ -579,7 +578,7 @@ H5O__pline_free(void *mesg) /*------------------------------------------------------------------------- - * Function: H5O_pline_pre_copy_file + * Function: H5O__pline_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files @@ -594,14 +593,14 @@ H5O__pline_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, +H5O__pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) { const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source pline */ H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(pline_src); @@ -618,12 +617,12 @@ H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, * the object copying process. */ if(udata) - if(NULL == (udata->src_pline = (H5O_pline_t *)H5O_pline_copy(pline_src, NULL))) + if(NULL == (udata->src_pline = (H5O_pline_t *)H5O__pline_copy(pline_src, NULL))) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to copy") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pline_pre_copy_file() */ +} /* end H5O__pline_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -663,36 +662,36 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, /* Loop over all the filters */ for(i = 0; i < pline->nused; i++) { - char name[32]; - - HDsnprintf(name, sizeof(name), "Filter at position %u", (unsigned)i); - HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, name); - HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), - "Filter identification:", - (unsigned)(pline->filter[i].id)); - if(pline->filter[i].name) - HDfprintf(stream, "%*s%-*s \"%s\"\n", indent + 3, "", MAX(0, fwidth - 3), - "Filter name:", - pline->filter[i].name); - else - HDfprintf(stream, "%*s%-*s NONE\n", indent + 3, "", MAX(0, fwidth - 3), - "Filter name:"); - HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), - "Flags:", - pline->filter[i].flags); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), - "Num CD values:", - pline->filter[i].cd_nelmts); + char name[32]; + + HDsnprintf(name, sizeof(name), "Filter at position %u", (unsigned)i); + HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, name); + HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), + "Filter identification:", + (unsigned)(pline->filter[i].id)); + if(pline->filter[i].name) + HDfprintf(stream, "%*s%-*s \"%s\"\n", indent + 3, "", MAX(0, fwidth - 3), + "Filter name:", + pline->filter[i].name); + else + HDfprintf(stream, "%*s%-*s NONE\n", indent + 3, "", MAX(0, fwidth - 3), + "Filter name:"); + HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), + "Flags:", + pline->filter[i].flags); + HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), + "Num CD values:", + pline->filter[i].cd_nelmts); - /* Filter parameters */ - for(j = 0; j < pline->filter[i].cd_nelmts; j++) { - char field_name[32]; + /* Filter parameters */ + for(j = 0; j < pline->filter[i].cd_nelmts; j++) { + char field_name[32]; - HDsnprintf(field_name, sizeof(field_name), "CD value %lu", (unsigned long)j); - HDfprintf(stream, "%*s%-*s %u\n", indent + 6, "", MAX(0, fwidth - 6), - field_name, - pline->filter[i].cd_values[j]); - } /* end for */ + HDsnprintf(field_name, sizeof(field_name), "CD value %lu", (unsigned long)j); + HDfprintf(stream, "%*s%-*s %u\n", indent + 6, "", MAX(0, fwidth - 6), + field_name, + pline->filter[i].cd_values[j]); + } /* end for */ } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 0be6d89..fdbc368 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -15,7 +15,7 @@ * * Created: H5Oprivate.h * Aug 5 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Object header private include file. * @@ -885,13 +885,10 @@ struct H5P_genplist_t; H5_DLL herr_t H5O_init(void); H5_DLL herr_t H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc_t *loc/*out*/); -H5_DLL H5O_t *H5O__create_ohdr(H5F_t *f, hid_t ocpl_id); -H5_DLL herr_t H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, +H5_DLL H5O_t *H5O_create_ohdr(H5F_t *f, hid_t ocpl_id); +H5_DLL herr_t H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t initial_rc, H5O_loc_t *loc_out); H5_DLL herr_t H5O_open(H5O_loc_t *loc); -H5_DLL void *H5O_open_by_idx(const H5G_loc_t *loc, const char *name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5I_type_t *opened_type/*out*/); -H5_DLL void *H5O_open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type/*out*/); H5_DLL void *H5O_open_by_loc(const H5G_loc_t *obj_loc, H5I_type_t *opened_type/*out*/); H5_DLL herr_t H5O_close(H5O_loc_t *loc, hbool_t *file_closed/*out*/); H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust); @@ -986,8 +983,6 @@ H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, H5T_t *dt_src, void *buf_src, size_t nbytes_src, H5F_t *file_dst, void *buf_dst, H5O_copy_t *cpy_info); -H5_DLL herr_t H5O_copy(const H5G_loc_t *src_loc, const char *src_name, - H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); /* Debugging routines */ H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, const void *mesg, FILE *stream, int indent, int fwidth); diff --git a/src/H5Opublic.h b/src/H5Opublic.h index d0f8ab3..23a6cba 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -15,7 +15,7 @@ * * Created: H5Opublic.h * Aug 5 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5O (object header) * package. diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index 66b79bb..1ef8486 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -15,7 +15,7 @@ * * Created: H5Orefcount.c * Mar 10 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object ref. count messages. * @@ -34,11 +34,11 @@ /* PRIVATE PROTOTYPES */ static void *H5O__refcount_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_refcount_copy(const void *_mesg, void *_dest); -static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__refcount_copy(const void *_mesg, void *_dest); +static size_t H5O__refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__refcount_free(void *_mesg); -static herr_t H5O_refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static herr_t H5O__refcount_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -50,16 +50,16 @@ const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{ sizeof(H5O_refcount_t), /*native message size */ 0, /* messages are sharable? */ H5O__refcount_decode, /*decode message */ - H5O_refcount_encode, /*encode message */ - H5O_refcount_copy, /*copy the native value */ - H5O_refcount_size, /*size of symbol table entry */ + H5O__refcount_encode, /*encode message */ + H5O__refcount_copy, /*copy the native value */ + H5O__refcount_size, /*size of symbol table entry */ NULL, /*default reset method */ H5O__refcount_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ - H5O_refcount_pre_copy_file, /* pre copy native value to file */ + H5O__refcount_pre_copy_file,/* pre copy native value to file */ NULL, /* copy native value to file */ NULL, /* post copy native value to file */ NULL, /* get creation index */ @@ -83,7 +83,6 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 10 2007 * *------------------------------------------------------------------------- @@ -125,24 +124,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_refcount_encode + * Function: H5O__refcount_encode * * Purpose: Encodes a message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 10 2007 * *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -156,11 +154,11 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar UINT32ENCODE(p, *refcount); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_refcount_encode() */ +} /* end H5O__refcount_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_refcount_copy + * Function: H5O__refcount_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -169,19 +167,18 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 10 2007 * *------------------------------------------------------------------------- */ static void * -H5O_refcount_copy(const void *_mesg, void *_dest) +H5O__refcount_copy(const void *_mesg, void *_dest) { const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; H5O_refcount_t *dest = (H5O_refcount_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(refcount); @@ -196,11 +193,11 @@ H5O_refcount_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_refcount_copy() */ +} /* end H5O__refcount_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_refcount_size + * Function: H5O__refcount_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -210,25 +207,24 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 10 2007 * *------------------------------------------------------------------------- */ static size_t -H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = 1 /* Version */ + 4; /* Ref. count */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_refcount_size() */ +} /* end H5O__refcount_size() */ /*------------------------------------------------------------------------- @@ -257,7 +253,7 @@ H5O__refcount_free(void *mesg) /*------------------------------------------------------------------------- - * Function: H5O_refcount_pre_copy_file + * Function: H5O__refcount_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files. @@ -271,10 +267,10 @@ H5O__refcount_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, +H5O__refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, hbool_t *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(deleted); @@ -286,7 +282,7 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN *deleted = TRUE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_refcount_pre_copy_file() */ +} /* end H5O__refcount_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -297,7 +293,6 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 33310dc..54ac71f 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -27,34 +27,34 @@ /* PRIVATE PROTOTYPES */ static void *H5O__sdspace_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); -static void *H5O_sdspace_copy(const void *_mesg, void *_dest); -static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); +static herr_t H5O__sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); +static void *H5O__sdspace_copy(const void *_mesg, void *_dest); +static size_t H5O__sdspace_size(const H5F_t *f, const void *_mesg); static herr_t H5O__sdspace_reset(void *_mesg); static herr_t H5O__sdspace_free(void *_mesg); -static herr_t H5O_sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); static herr_t H5O__sdspace_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_SDSPACE -#define H5O_SHARED_DECODE H5O_sdspace_shared_decode +#define H5O_SHARED_DECODE H5O__sdspace_shared_decode #define H5O_SHARED_DECODE_REAL H5O__sdspace_decode -#define H5O_SHARED_ENCODE H5O_sdspace_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_sdspace_encode -#define H5O_SHARED_SIZE H5O_sdspace_shared_size -#define H5O_SHARED_SIZE_REAL H5O_sdspace_size +#define H5O_SHARED_ENCODE H5O__sdspace_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__sdspace_encode +#define H5O_SHARED_SIZE H5O__sdspace_shared_size +#define H5O_SHARED_SIZE_REAL H5O__sdspace_size #define H5O_SHARED_DELETE H5O__sdspace_shared_delete #undef H5O_SHARED_DELETE_REAL #define H5O_SHARED_LINK H5O__sdspace_shared_link #undef H5O_SHARED_LINK_REAL #define H5O_SHARED_COPY_FILE H5O__sdspace_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE H5O_sdspace_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__sdspace_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_sdspace_shared_debug +#define H5O_SHARED_DEBUG H5O__sdspace_shared_debug #define H5O_SHARED_DEBUG_REAL H5O__sdspace_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -63,23 +63,23 @@ const H5O_msg_class_t H5O_MSG_SDSPACE[1] = {{ H5O_SDSPACE_ID, /* message id number */ "dataspace", /* message name for debugging */ sizeof(H5S_extent_t), /* native message size */ - H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_sdspace_shared_decode, /* decode message */ - H5O_sdspace_shared_encode, /* encode message */ - H5O_sdspace_copy, /* copy the native value */ - H5O_sdspace_shared_size, /* size of symbol table entry */ + H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ + H5O__sdspace_shared_decode, /* decode message */ + H5O__sdspace_shared_encode, /* encode message */ + H5O__sdspace_copy, /* copy the native value */ + H5O__sdspace_shared_size, /* size of symbol table entry */ H5O__sdspace_reset, /* default reset method */ H5O__sdspace_free, /* free method */ - H5O__sdspace_shared_delete, /* file delete method */ - H5O__sdspace_shared_link, /* link method */ - NULL, /* set share method */ - NULL, /*can share method */ - H5O_sdspace_pre_copy_file, /* pre copy native value to file */ - H5O__sdspace_shared_copy_file,/* copy native value to file */ - H5O_sdspace_shared_post_copy_file,/* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O_sdspace_shared_debug /* debug the message */ + H5O__sdspace_shared_delete, /* file delete method */ + H5O__sdspace_shared_link, /* link method */ + NULL, /* set share method */ + NULL, /*can share method */ + H5O__sdspace_pre_copy_file, /* pre copy native value to file */ + H5O__sdspace_shared_copy_file,/* copy native value to file */ + H5O__sdspace_shared_post_copy_file,/* post copy native value to file*/ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__sdspace_shared_debug /* debug the message */ }}; /* Declare external the free list for H5S_extent_t's */ @@ -199,11 +199,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5O_sdspace_encode + H5O__sdspace_encode PURPOSE Encode a simple dimensionality message USAGE - herr_t H5O_sdspace_encode(f, raw_size, p, mesg) + herr_t H5O__sdspace_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct size_t raw_size; IN: size of the raw information buffer const uint8 *p; IN: the raw information buffer @@ -214,28 +214,15 @@ done: This function encodes the native memory form of the simple dimensionality message in the "raw" disk form. - MODIFICATIONS - Robb Matzke, 1998-04-09 - The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes - instead of just four bytes. - - Robb Matzke, 1998-07-20 - Added a version number and reformatted the message for aligment. - - Raymond Lu - April 8, 2004 - Added the type of dataspace into this header message using a reserved - byte. - --------------------------------------------------------------------------*/ static herr_t -H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) +H5O__sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) { const H5S_extent_t *sdim = (const H5S_extent_t *)_mesg; unsigned flags = 0; unsigned u; /* Local counting variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -277,16 +264,16 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_sdspace_encode() */ +} /* end H5O__sdspace_encode() */ /*-------------------------------------------------------------------------- NAME - H5O_sdspace_copy + H5O__sdspace_copy PURPOSE Copies a message from MESG to DEST, allocating DEST if necessary. USAGE - void *H5O_sdspace_copy(_mesg, _dest) + void *H5O__sdspace_copy(_mesg, _dest) const void *_mesg; IN: Pointer to the source extent dimensionality struct const void *_dest; IN: Pointer to the destination extent dimensionality struct RETURNS @@ -296,13 +283,13 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) allocating the destination structure if necessary. --------------------------------------------------------------------------*/ static void * -H5O_sdspace_copy(const void *_mesg, void *_dest) +H5O__sdspace_copy(const void *_mesg, void *_dest) { const H5S_extent_t *mesg = (const H5S_extent_t *)_mesg; H5S_extent_t *dest = (H5S_extent_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); @@ -322,16 +309,16 @@ done: dest = H5FL_FREE(H5S_extent_t, dest); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_sdspace_copy() */ +} /* end H5O__sdspace_copy() */ /*-------------------------------------------------------------------------- NAME - H5O_sdspace_size + H5O__sdspace_size PURPOSE Return the raw message size in bytes USAGE - void *H5O_sdspace_size(f, mesg) + void *H5O__sdspace_size(f, mesg) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source extent dimensionality struct RETURNS @@ -341,18 +328,14 @@ done: success. (Not counting the message type or size fields, only the data portion of the message). It doesn't take into account alignment. - MODIFICATIONS - Robb Matzke, 1998-04-09 - The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes - instead of just four bytes. --------------------------------------------------------------------------*/ static size_t -H5O_sdspace_size(const H5F_t *f, const void *_mesg) +H5O__sdspace_size(const H5F_t *f, const void *_mesg) { const H5S_extent_t *space = (const H5S_extent_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Basic information for all dataspace messages */ ret_value = (size_t)(1 + /* Version */ @@ -368,7 +351,7 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg) ret_value += space->max ? (space->rank * H5F_SIZEOF_SIZE(f)) : 0; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_sdspace_size() */ +} /* end H5O__sdspace_size() */ /*------------------------------------------------------------------------- @@ -423,7 +406,7 @@ H5O__sdspace_free(void *mesg) /*------------------------------------------------------------------------- - * Function: H5O_sdspace_pre_copy_file + * Function: H5O__sdspace_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files @@ -438,14 +421,14 @@ H5O__sdspace_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, +H5O__sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) { const H5S_extent_t *src_space_extent = (const H5S_extent_t *)mesg_src; /* Source dataspace extent */ H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(file_src); diff --git a/src/H5Oshared.c b/src/H5Oshared.c index b49e501..ca6c873 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 1, 1998 * * Purpose: Functions that operate on a shared message. The shared @@ -103,7 +103,6 @@ static herr_t H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 24 2003 * *------------------------------------------------------------------------- @@ -217,7 +216,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 26 2003 * *------------------------------------------------------------------------- @@ -443,7 +441,6 @@ H5O__shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_m * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 26 2003 * *------------------------------------------------------------------------- @@ -654,7 +651,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Peter Cao - * xcao@hdfgroup.org * May 24 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Oshared.h b/src/H5Oshared.h index e4ad980..6dbf927 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 19, 2007 * * Purpose: This file contains inline definitions for "generic" routines diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 136268a..10181ad 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: James Laird +/* Programmer: James Laird * Monday, January 29, 2007 * * Purpose: A message holding "implicitly shared object header message" @@ -29,9 +29,9 @@ static void *H5O__shmesg_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_shmesg_copy(const void *_mesg, void *_dest); -static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__shmesg_copy(const void *_mesg, void *_dest); +static size_t H5O__shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__shmesg_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -42,9 +42,9 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ sizeof(H5O_shmesg_table_t), /*native message size */ 0, /* messages are sharable? */ H5O__shmesg_decode, /*decode message */ - H5O_shmesg_encode, /*encode message */ - H5O_shmesg_copy, /*copy the native value */ - H5O_shmesg_size, /*raw message size */ + H5O__shmesg_encode, /*encode message */ + H5O__shmesg_copy, /*copy the native value */ + H5O__shmesg_size, /*raw message size */ NULL, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ @@ -105,7 +105,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_shmesg_encode + * Function: H5O__shmesg_encode * * Purpose: Encode a shared message table message. * @@ -117,11 +117,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -134,11 +134,11 @@ H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c *p++ = (uint8_t)mesg->nindexes; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_shmesg_encode() */ +} /* end H5O__shmesg_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_shmesg_copy + * Function: H5O__shmesg_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -152,13 +152,13 @@ H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c *------------------------------------------------------------------------- */ static void * -H5O_shmesg_copy(const void *_mesg, void *_dest) +H5O__shmesg_copy(const void *_mesg, void *_dest) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; H5O_shmesg_table_t *dest = (H5O_shmesg_table_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mesg); @@ -174,11 +174,11 @@ H5O_shmesg_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shmesg_copy() */ +} /* end H5O__shmesg_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_shmesg_size + * Function: H5O__shmesg_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. @@ -192,11 +192,11 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) +H5O__shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -206,7 +206,7 @@ H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi 1); /* Number of indexes */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shmesg_size() */ +} /* end H5O__shmesg_size() */ /*------------------------------------------------------------------------- diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 0f14a4b..10501a0 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -15,7 +15,7 @@ * * Created: H5Ostab.c * Aug 6 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Symbol table messages. * @@ -90,7 +90,6 @@ H5FL_DEFINE_STATIC(H5O_stab_t); * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -103,7 +102,7 @@ H5O__stab_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, H5O_stab_t *stab = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -119,10 +118,9 @@ H5O__stab_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, ret_value = stab; done: - if(ret_value == NULL) { + if(ret_value == NULL) if(stab != NULL) stab = H5FL_FREE(H5O_stab_t, stab); - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__stab_decode() */ @@ -136,7 +134,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -172,7 +169,6 @@ H5O__stab_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -214,7 +210,6 @@ done: * Failure: zero * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -415,11 +410,8 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Otest.c b/src/H5Otest.c index df08ff7..5d242f3 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, December 4, 2006 * * Purpose: Object header testing functions. @@ -789,5 +789,5 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O__msg_get_chunkno_test() */ +} /* H5O__msg_move_to_new_chunk_test() */ diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index 89c00ad..a7116c8 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -15,7 +15,7 @@ * * Created: H5Ounknown.c * Apr 19 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Handle unknown message classes in a minimal way. * diff --git a/src/H5P.c b/src/H5P.c index 9bc293b..d490e7b 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * * Purpose: Generic Property Functions */ diff --git a/src/H5PBmodule.h b/src/H5PBmodule.h index c8aabb6..571d2be 100644 --- a/src/H5PBmodule.h +++ b/src/H5PBmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 5ce12b4..7429443 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -15,7 +15,7 @@ * * Created: H5Pdapl.c * October 27, 2008 - * Neil Fortner + * Neil Fortner * * Purpose: Dataset access property list class routines * @@ -322,7 +322,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) uint64_t enc_value; unsigned enc_size; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -331,7 +331,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(vds_file_pref); enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -374,7 +374,7 @@ H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) unsigned enc_size; /* Size of encoded property */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pp); HDassert(*pp); @@ -418,7 +418,7 @@ static herr_t H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -439,7 +439,7 @@ H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU static herr_t H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -466,7 +466,7 @@ H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_AT const char *pref2 = *(const char * const *)value2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(NULL == pref1 && NULL != pref2) HGOTO_DONE(1); @@ -491,7 +491,7 @@ done: static herr_t H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -570,7 +570,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) uint64_t enc_value; unsigned enc_size; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -579,7 +579,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(efile_pref); enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -622,7 +622,7 @@ H5P__dapl_efile_pref_dec(const void **_pp, void *_value) unsigned enc_size; /* Size of encoded property */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pp); HDassert(*pp); @@ -666,7 +666,7 @@ static herr_t H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -687,7 +687,7 @@ H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED static herr_t H5P__dapl_efile_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -714,7 +714,7 @@ H5P__dapl_efile_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_ const char *pref2 = *(const char * const *)value2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(NULL == pref1 && NULL != pref2) HGOTO_DONE(1); @@ -739,7 +739,7 @@ done: static herr_t H5P__dapl_efile_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -885,7 +885,7 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) uint8_t **pp = (uint8_t **)_pp; unsigned enc_size; /* Size of encoded property */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -899,7 +899,7 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ @@ -941,7 +941,7 @@ H5P__decode_chunk_cache_nslots(const void **_pp, void *_value) uint64_t enc_value; /* Decoded property value */ unsigned enc_size; /* Size of encoded property */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -987,7 +987,7 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) uint8_t **pp = (uint8_t **)_pp; unsigned enc_size; /* Size of encoded property */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -1001,7 +1001,7 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ @@ -1043,7 +1043,7 @@ H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value) uint64_t enc_value; /* Decoded property value */ unsigned enc_size; /* Size of encoded property */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 064a9b8..d8b0218 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1029,7 +1029,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) /* Encode the size of a size_t */ enc_value = (uint64_t)dt_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); /* Encode the size */ @@ -1058,7 +1058,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) if(H5T_encode(fill->type, NULL, &dt_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") enc_value = (uint64_t)dt_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); } *size += (1 + enc_size); *size += dt_size; @@ -1414,7 +1414,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) if(NULL != *pp) { /* Encode number of slots used */ enc_value = (uint64_t)efl->nused; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1424,7 +1424,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Calculate length of slot name and encode it */ len = HDstrlen(efl->slot[u].name) + 1; enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1435,14 +1435,14 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Encode offset */ enc_value = (uint64_t)efl->slot[u].offset; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode size */ enc_value = (uint64_t)efl->slot[u].size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1450,13 +1450,13 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Calculate size needed for encoding */ - *size += (1 + H5VM_limit_enc_size((uint64_t)efl->nused)); + *size += (1 + H5VM__limit_enc_size((uint64_t)efl->nused)); for(u = 0; u < efl->nused; u++) { len = HDstrlen(efl->slot[u].name) + 1; - *size += (1 + H5VM_limit_enc_size((uint64_t)len)); + *size += (1 + H5VM__limit_enc_size((uint64_t)len)); *size += len; - *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].offset)); - *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].size)); + *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].offset)); + *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].size)); } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -1847,13 +1847,6 @@ H5P__init_def_layout(void) * Programmer: Robb Matzke * Tuesday, January 6, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -1928,13 +1921,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for - * generic property list. - * *------------------------------------------------------------------------- */ H5D_layout_t @@ -1978,13 +1964,6 @@ done: * Programmer: Robb Matzke * Tuesday, January 6, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -2060,13 +2039,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * *------------------------------------------------------------------------- */ int @@ -2828,13 +2800,6 @@ done: * Programmer: Robb Matzke * Tuesday, March 3, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * *------------------------------------------------------------------------- */ int @@ -2885,13 +2850,6 @@ done: * Programmer: Robb Matzke * Tuesday, March 3, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for - * generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -3013,8 +2971,6 @@ done: * Programmer: Kent Yang * Wednesday, November 13, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3058,9 +3014,6 @@ done: * Programmer: Xiaowen Wu * Wednesday, December 22, 2004 * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -3120,9 +3073,6 @@ done: * Programmer: Xiaowen Wu * Thursday, April 14, 2005 * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -3526,9 +3476,6 @@ done: * Programmer: Raymond Lu * Wednesday, January 16, 2002 * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -3709,9 +3656,6 @@ done: * Programmer: Raymond Lu * Wednesday, January 16, 2002 * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -3760,8 +3704,6 @@ done: * Programmer: Jacob Smith * 2018 August 14 * - * Modifications: None. - * *----------------------------------------------------------------------------- */ herr_t @@ -3807,8 +3749,6 @@ done: * Programmer: Jacob Smith * 2018 August 14 * - * Modifications: None. - * *----------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index b9efaee..88ebec1 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Pdeprec.c * October 11 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5P interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 3f5754e..f416eff 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -15,7 +15,7 @@ * * Created: H5Pdxpl.c * March 16 1998 - * Robb Matzke + * Robb Matzke * * Purpose: Data transfer property list class routines * @@ -685,7 +685,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) /* encode the length of the prefix */ enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -702,7 +702,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Size of encoded data transform */ - *size += (1 + H5VM_limit_enc_size((uint64_t)len)); + *size += (1 + H5VM__limit_enc_size((uint64_t)len)); if(NULL != pexp) *size += len; @@ -770,7 +770,7 @@ done: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Leon Arber larber@uiuc.edu + * Programmer: Leon Arber * * Date: April 9, 2004 * @@ -801,7 +801,7 @@ done: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Leon Arber larber@uiuc.edu + * Programmer: Leon Arber * * Date: April 9, 2004 * @@ -887,7 +887,7 @@ done: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Leon Arber larber@uiuc.edu + * Programmer: Leon Arber * * Date: April 9, 2004 * @@ -1297,8 +1297,6 @@ done: * Programmer: Raymond Lu * Jan 14, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1339,8 +1337,6 @@ done: * Programmer: Raymond Lu * April 15, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1381,8 +1377,6 @@ done: * Programmer: Raymond Lu * April 15, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index d4b6b5f..32824b7 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * * Purpose: Generic Property Functions */ @@ -94,7 +94,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; - unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ FUNC_ENTER_PACKAGE_NOERR @@ -135,7 +135,7 @@ herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */ - unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ uint8_t **pp = (uint8_t **)_pp; FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 30b590f..baad470 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -204,12 +204,12 @@ /* Definition for 'mdc log location' flag */ #define H5F_ACS_MDC_LOG_LOCATION_SIZE sizeof(char *) #define H5F_ACS_MDC_LOG_LOCATION_DEF NULL /* default is no log location */ -#define H5F_ACS_MDC_LOG_LOCATION_ENC H5P_facc_mdc_log_location_enc -#define H5F_ACS_MDC_LOG_LOCATION_DEC H5P_facc_mdc_log_location_dec -#define H5F_ACS_MDC_LOG_LOCATION_DEL H5P_facc_mdc_log_location_del -#define H5F_ACS_MDC_LOG_LOCATION_COPY H5P_facc_mdc_log_location_copy -#define H5F_ACS_MDC_LOG_LOCATION_CMP H5P_facc_mdc_log_location_cmp -#define H5F_ACS_MDC_LOG_LOCATION_CLOSE H5P_facc_mdc_log_location_close +#define H5F_ACS_MDC_LOG_LOCATION_ENC H5P__facc_mdc_log_location_enc +#define H5F_ACS_MDC_LOG_LOCATION_DEC H5P__facc_mdc_log_location_dec +#define H5F_ACS_MDC_LOG_LOCATION_DEL H5P__facc_mdc_log_location_del +#define H5F_ACS_MDC_LOG_LOCATION_COPY H5P__facc_mdc_log_location_copy +#define H5F_ACS_MDC_LOG_LOCATION_CMP H5P__facc_mdc_log_location_cmp +#define H5F_ACS_MDC_LOG_LOCATION_CLOSE H5P__facc_mdc_log_location_close /* Definition for 'start metadata cache logging on access' flag */ #define H5F_ACS_START_MDC_LOG_ON_ACCESS_SIZE sizeof(hbool_t) #define H5F_ACS_START_MDC_LOG_ON_ACCESS_DEF FALSE @@ -331,12 +331,12 @@ static herr_t H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *s static herr_t H5P__facc_libver_type_dec(const void **_pp, void *value); /* Metadata cache log location property callbacks */ -static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); -static herr_t H5P_facc_mdc_log_location_dec(const void **_pp, void *value); -static herr_t H5P_facc_mdc_log_location_del(hid_t prop_id, const char *name, size_t size, void *value); -static herr_t H5P_facc_mdc_log_location_copy(const char *name, size_t size, void *value); -static int H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t size); -static herr_t H5P_facc_mdc_log_location_close(const char *name, size_t size, void *value); +static herr_t H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__facc_mdc_log_location_dec(const void **_pp, void *value); +static herr_t H5P__facc_mdc_log_location_del(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__facc_mdc_log_location_copy(const char *name, size_t size, void *value); +static int H5P__facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t size); +static herr_t H5P__facc_mdc_log_location_close(const char *name, size_t size, void *value); /* Metadata cache image property callbacks */ static int H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size); @@ -732,12 +732,6 @@ done: * Programmer: Robb Matzke * Tuesday, June 9, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new - * generic property list. *------------------------------------------------------------------------- */ herr_t @@ -1894,13 +1888,6 @@ done: * Programmer: Quincey Koziol * June, 1999 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -1936,13 +1923,6 @@ done: * Programmer: Quincey Koziol * June, 1999 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -1978,8 +1958,6 @@ done: * Programmer: Raymond Lu * November, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2014,8 +1992,6 @@ done: * Programmer: Raymond Lu * November, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2059,13 +2035,6 @@ done: * Programmer: Quincey Koziol * Friday, August 25, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2101,13 +2070,6 @@ done: * Programmer: Quincey Koziol * Friday, August 29, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2154,13 +2116,6 @@ done: * Programmer: Quincey Koziol * Thursday, September 21, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2196,13 +2151,6 @@ done: * Programmer: Quincey Koziol * Thursday, September 21, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2248,8 +2196,6 @@ done: * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2285,8 +2231,6 @@ done: * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3531,7 +3475,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->set_initial_size); enc_value = (uint64_t)config->initial_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3539,13 +3483,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_DOUBLE(*pp, config->min_clean_fraction); enc_value = (uint64_t)config->max_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); enc_value = (uint64_t)config->min_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3563,7 +3507,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_increment); enc_value = (uint64_t)config->max_increment; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3585,7 +3529,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_decrement); enc_value = (uint64_t)config->max_decrement; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3606,15 +3550,15 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) /* Compute encoded size of variably-encoded values */ enc_value = (uint64_t)config->initial_size; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); enc_value = (uint64_t)config->max_size; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); enc_value = (uint64_t)config->min_size; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); enc_value = (uint64_t)config->max_increment; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); enc_value = (uint64_t)config->max_decrement; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); /* Compute encoded size of fixed-size values */ *size += (5 + (sizeof(unsigned) * 8) + (sizeof(double) * 8) + @@ -4047,13 +3991,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the # of read attempts set */ + /* Get the # of read attempts set */ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") - /* If not set, return the default value */ - if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_METADATA_READ_ATTEMPTS; + /* If not set, return the default value */ + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } /* end if */ done: @@ -4137,9 +4081,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) /* Assign return value */ if(func) - *func = flush_info.func; + *func = flush_info.func; if(udata) - *udata = flush_info.udata; + *udata = flush_info.udata; done: FUNC_LEAVE_API(ret_value) @@ -4254,7 +4198,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_enc + * Function: H5P__facc_mdc_log_location_enc * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file access property @@ -4266,7 +4210,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) +H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) { const char *log_location = *(const char * const *)value; uint8_t **pp = (uint8_t **)_pp; @@ -4274,7 +4218,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) uint64_t enc_value; unsigned enc_size; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -4283,7 +4227,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(log_location); enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -4303,11 +4247,11 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) *size += len; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_enc() */ +} /* end H5P__facc_mdc_log_location_enc() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_dec + * Function: H5P__facc_mdc_log_location_dec * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file access property @@ -4319,7 +4263,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) +H5P__facc_mdc_log_location_dec(const void **_pp, void *_value) { char **log_location = (char **)_value; const uint8_t **pp = (const uint8_t **)_pp; @@ -4328,7 +4272,7 @@ H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) unsigned enc_size; /* Size of encoded property */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pp); HDassert(*pp); @@ -4357,11 +4301,11 @@ H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_facc_mdc_log_location_dec() */ +} /* end H5P__facc_mdc_log_location_dec() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_del + * Function: H5P__facc_mdc_log_location_del * * Purpose: Frees memory used to store the metadata cache log location. * @@ -4370,21 +4314,21 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, +H5P__facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); H5MM_xfree(*(void **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_del() */ +} /* end H5P__facc_mdc_log_location_del() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_copy + * Function: H5P__facc_mdc_log_location_copy * * Purpose: Creates a copy of the metadata cache log location string. * @@ -4393,20 +4337,20 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +H5P__facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); *(char **)value = H5MM_xstrdup(*(const char **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_copy() */ +} /* end H5P__facc_mdc_log_location_copy() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_cmp + * Function: H5P__facc_mdc_log_location_cmp * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file creation property @@ -4416,14 +4360,14 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U * *------------------------------------------------------------------------- */ -static int -H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) +static H5_ATTR_PURE int +H5P__facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) { const char *pref1 = *(const char * const *)value1; const char *pref2 = *(const char * const *)value2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(NULL == pref1 && NULL != pref2) HGOTO_DONE(1); @@ -4434,11 +4378,11 @@ H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_facc_mdc_log_location_cmp() */ +} /* end H5P__facc_mdc_log_location_cmp() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_close + * Function: H5P__facc_mdc_log_location_close * * Purpose: Frees memory used to store the metadata cache log location * string @@ -4448,16 +4392,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +H5P__facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); H5MM_xfree(*(void **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_close() */ +} /* end H5P__facc_mdc_log_location_close() */ /*------------------------------------------------------------------------- diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 3b0ce66..db80f19 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -15,7 +15,7 @@ * * Created: H5Pfcpl.c * January 6 1998 - * Robb Matzke + * Robb Matzke * * Purpose: File creation property list class routines * @@ -128,7 +128,7 @@ /********************/ /* Property class callbacks */ -static herr_t H5P_fcrt_reg_prop(H5P_genclass_t *pclass); +static herr_t H5P__fcrt_reg_prop(H5P_genclass_t *pclass); /* property callbacks */ static herr_t H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size); @@ -154,7 +154,7 @@ const H5P_libclass_t H5P_CLS_FCRT[1] = {{ &H5P_CLS_FILE_CREATE_g, /* Pointer to class */ &H5P_CLS_FILE_CREATE_ID_g, /* Pointer to class ID */ &H5P_LST_FILE_CREATE_ID_g, /* Pointer to default property list ID */ - H5P_fcrt_reg_prop, /* Default property registration routine */ + H5P__fcrt_reg_prop, /* Default property registration routine */ NULL, /* Class creation callback */ NULL, /* Class creation callback info */ @@ -194,7 +194,7 @@ static const hsize_t H5F_def_file_space_page_size_g = H5F_CRT_FILE_SPACE_PAGE_SI /*------------------------------------------------------------------------- - * Function: H5P_fcrt_reg_prop + * Function: H5P__fcrt_reg_prop * * Purpose: Register the file creation property list class's properties * @@ -205,11 +205,11 @@ static const hsize_t H5F_def_file_space_page_size_g = H5F_CRT_FILE_SPACE_PAGE_SI *------------------------------------------------------------------------- */ static herr_t -H5P_fcrt_reg_prop(H5P_genclass_t *pclass) +H5P__fcrt_reg_prop(H5P_genclass_t *pclass) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Register the user block size */ if(H5P__register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &H5F_def_userblock_size_g, @@ -297,7 +297,7 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_fcrt_reg_prop() */ +} /* end H5P__fcrt_reg_prop() */ /*------------------------------------------------------------------------- @@ -359,11 +359,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -517,11 +512,6 @@ done: * Programmer: Robb Matzke * Tuesday, January 6, 1998 * - * Modifications: - * - * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -571,11 +561,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -619,11 +604,6 @@ done: * Programmer: Robb Matzke * Tuesday, January 6, 1998 * - * Modifications: - * - * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -673,11 +653,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index 41ad078..a0a6d35 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -15,7 +15,7 @@ * * Created: H5Pmtpl.c * November 1 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: File mount property list class routines * @@ -64,7 +64,7 @@ /********************/ /* Property class callbacks */ -static herr_t H5P_fmnt_reg_prop(H5P_genclass_t *pclass); +static herr_t H5P__fmnt_reg_prop(H5P_genclass_t *pclass); /*********************/ @@ -80,7 +80,7 @@ const H5P_libclass_t H5P_CLS_FMNT[1] = {{ &H5P_CLS_FILE_MOUNT_g, /* Pointer to class */ &H5P_CLS_FILE_MOUNT_ID_g, /* Pointer to class ID */ &H5P_LST_FILE_MOUNT_ID_g, /* Pointer to default property list ID */ - H5P_fmnt_reg_prop, /* Default property registration routine */ + H5P__fmnt_reg_prop, /* Default property registration routine */ NULL, /* Class creation callback */ NULL, /* Class creation callback info */ @@ -106,7 +106,7 @@ static const hbool_t H5F_def_local_g = H5F_MNT_SYM_LOCAL_DEF; /* Whether sy /*------------------------------------------------------------------------- - * Function: H5P_fmnt_reg_prop + * Function: H5P__fmnt_reg_prop * * Purpose: Register the file mount property list class's properties * @@ -117,11 +117,11 @@ static const hbool_t H5F_def_local_g = H5F_MNT_SYM_LOCAL_DEF; /* Whether sy *------------------------------------------------------------------------- */ static herr_t -H5P_fmnt_reg_prop(H5P_genclass_t *pclass) +H5P__fmnt_reg_prop(H5P_genclass_t *pclass) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Register property of whether symlinks is local to file */ if(H5P__register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, @@ -130,5 +130,5 @@ H5P_fmnt_reg_prop(H5P_genclass_t *pclass) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_fmnt_reg_prop() */ +} /* end H5P__fmnt_reg_prop() */ diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index 03874c8..107ca15 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -15,7 +15,7 @@ * * Created: H5Pgcpl.c * August 29 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Group creation property list class routines * diff --git a/src/H5Pint.c b/src/H5Pint.c index 2e463b2..4d73083 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * * Purpose: Generic Property Functions */ @@ -5604,7 +5604,7 @@ done: * Return: Success: Non-negative ID of property list. * Failure: H5I_INVALID_HID * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 22, 2014 * *------------------------------------------------------------------------- @@ -5632,7 +5632,7 @@ H5P_get_plist_id(const H5P_genplist_t *plist) * Return: Success: Non-NULL class of property list. * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 22, 2014 * *------------------------------------------------------------------------- diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 8fdcc8b..72c60b4 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -15,7 +15,7 @@ * * Created: H5Plapl.c * July 14 2006 - * James Laird + * James Laird * * Purpose: Link access property list class routines * @@ -373,7 +373,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* encode the length of the plist */ enc_value = (uint64_t)fapl_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -384,7 +384,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) *pp += fapl_size; } - fapl_size += (1 + H5VM_limit_enc_size((uint64_t)fapl_size)); + fapl_size += (1 + H5VM__limit_enc_size((uint64_t)fapl_size)); } /* end if */ *size += (1 + fapl_size); /* Non-default flag, plus encoded property list size */ @@ -705,7 +705,7 @@ H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(elink_pref); enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index 9c32552..2c8e364 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -64,7 +64,7 @@ /********************/ /* Property class callbacks */ -static herr_t H5P_lcrt_reg_prop(H5P_genclass_t *pclass); +static herr_t H5P__lcrt_reg_prop(H5P_genclass_t *pclass); /*********************/ @@ -80,7 +80,7 @@ const H5P_libclass_t H5P_CLS_LCRT[1] = {{ &H5P_CLS_LINK_CREATE_g, /* Pointer to class */ &H5P_CLS_LINK_CREATE_ID_g, /* Pointer to class ID */ &H5P_LST_LINK_CREATE_ID_g, /* Pointer to default property list ID */ - H5P_lcrt_reg_prop, /* Default property registration routine */ + H5P__lcrt_reg_prop, /* Default property registration routine */ NULL, /* Class creation callback */ NULL, /* Class creation callback info */ @@ -106,7 +106,7 @@ static const unsigned H5L_def_intmd_group_g = H5L_CRT_INTERMEDIATE_GROUP_DEF; /*------------------------------------------------------------------------- - * Function: H5P_lcrt_reg_prop + * Function: H5P__lcrt_reg_prop * * Purpose: Register the dataset creation property list class's properties * @@ -116,12 +116,12 @@ static const unsigned H5L_def_intmd_group_g = H5L_CRT_INTERMEDIATE_GROUP_DEF; * October 31, 2006 *------------------------------------------------------------------------- */ -herr_t -H5P_lcrt_reg_prop(H5P_genclass_t *pclass) +static herr_t +H5P__lcrt_reg_prop(H5P_genclass_t *pclass) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Register create intermediate groups property */ if(H5P__register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &H5L_def_intmd_group_g, @@ -131,7 +131,7 @@ H5P_lcrt_reg_prop(H5P_genclass_t *pclass) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_lcrt_reg_prop() */ +} /* end H5P__lcrt_reg_prop() */ /*------------------------------------------------------------------------- diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h index d5c471a..11df06d 100644 --- a/src/H5Pmodule.h +++ b/src/H5Pmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index a60c593..b053895 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -15,7 +15,7 @@ * * Created: H5Pocpl.c * Nov 28 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object creation property list class routines * @@ -581,13 +581,6 @@ done: * Programmer: Quincey Koziol * Friday, April 5, 2003 * - * Modifications: - * - * Neil Fortner - * Thursday, March 26, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -652,18 +645,6 @@ done: * Programmer: Robb Matzke * Wednesday, April 15, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * - * Neil Fortner - * Wednesday, May 20, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -781,13 +762,6 @@ done: * Programmer: Robb Matzke * Tuesday, August 4, 1998 * - * Modifications: - * - * Neil Fortner - * Wednesday, May 20, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ int @@ -838,13 +812,6 @@ done: * Programmer: Robb Matzke * Wednesday, April 15, 1998 * - * Modifications: - * - * Neil Fortner - * Wednesday, May 20, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ H5Z_filter_t @@ -980,13 +947,6 @@ done: * Programmer: Quincey Koziol * Friday, April 5, 2003 * - * Modifications: - * - * Neil Fortner - * Thursday, May 21, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -1049,13 +1009,6 @@ done: * Programmer: Quincey Koziol * Tuesday, April 8, 2003 * - * Modifications: - * - * Neil Fortner - * Thursday, May 21, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ htri_t @@ -1132,13 +1085,6 @@ done: * Programmer: Pedro Vicente * January 26, 2004 * - * Modifications: - * - * Neil Fortner - * Thursday, May 21, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -1191,18 +1137,6 @@ done: * Programmer: Robb Matzke * Wednesday, April 15, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * - * Neil Fortner - * Thursday, March 26, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -1251,13 +1185,6 @@ done: * Programmer: Raymond Lu * Dec 19, 2002 * - * Modifications: - * - * Neil Fortner - * Wednesday, May 6, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -1480,7 +1407,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode nused value */ enc_value = (uint64_t)pline->nused; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1510,7 +1437,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode cd_nelmts */ enc_value = (uint64_t)pline->filter[u].cd_nelmts; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1523,12 +1450,12 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* calculate size required for encoding */ *size += 1; - *size += (1 + H5VM_limit_enc_size((uint64_t)pline->nused)); + *size += (1 + H5VM__limit_enc_size((uint64_t)pline->nused)); for(u = 0; u < pline->nused; u++) { *size += (sizeof(int32_t) + sizeof(unsigned) + 1); if(NULL != pline->filter[u].name) *size += H5Z_COMMON_NAME_LEN; - *size += (1 + H5VM_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); + *size += (1 + H5VM__limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); *size += pline->filter[u].cd_nelmts * sizeof(unsigned); } /* end for */ diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 7390cae..d23585c 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -15,7 +15,7 @@ * * Created: H5Pocpypl.c * Mar 13 2006 - * Peter Cao + * Peter Cao * * Purpose: Object copying property list class routines * diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index c8e5e98..2a52cc5 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, November 16, 2001 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 97d6119..6371862 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -15,7 +15,7 @@ * * Created: H5Pstrcpl.c * October 26 2005 - * James Laird + * James Laird * * Purpose: String creation property list class routines * diff --git a/src/H5Ptest.c b/src/H5Ptest.c index 303fbf7..6bec415 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Saturday May 31, 2003 * * Purpose: Generic Property Testing Functions diff --git a/src/H5RS.c b/src/H5RS.c index ae500c5..6459f0d 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -39,11 +39,11 @@ H5FL_BLK_DEFINE(str_buf); /*-------------------------------------------------------------------------- NAME - H5RS_xstrdup + H5RS__xstrdup PURPOSE Duplicate the string being reference counted USAGE - char *H5RS_xstrdup(s) + char *H5RS__xstrdup(s) const char *s; IN: String to duplicate RETURNS @@ -57,11 +57,11 @@ H5FL_BLK_DEFINE(str_buf); REVISION LOG --------------------------------------------------------------------------*/ static char * -H5RS_xstrdup(const char *s) +H5RS__xstrdup(const char *s) { char *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(s) { size_t len = HDstrlen(s) + 1; @@ -74,7 +74,7 @@ H5RS_xstrdup(const char *s) ret_value = NULL; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5RS_xstrdup() */ +} /* end H5RS__xstrdup() */ /*-------------------------------------------------------------------------- @@ -108,7 +108,7 @@ H5RS_create(const char *s) HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s = H5RS_xstrdup(s); + ret_value->s = H5RS__xstrdup(s); ret_value->wrapped = 0; ret_value->n = 1; @@ -270,7 +270,7 @@ H5RS_incr(H5RS_str_t *rs) * scope appropriately. */ if(rs->wrapped) { - rs->s = H5RS_xstrdup(rs->s); + rs->s = H5RS__xstrdup(rs->s); rs->wrapped = 0; } /* end if */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 4e44683..f48af51 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -66,6 +66,8 @@ /********************/ /* Local Prototypes */ /********************/ +static herr_t H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, size_t token_size, H5S_t *space, unsigned char *buf, size_t *nalloc); +static herr_t H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref_type, const unsigned char *buf, H5O_token_t *obj_token); /*********************/ @@ -82,9 +84,157 @@ /* Local Variables */ /*******************/ -#ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- + * Function: H5R__decode_token_compat + * + * Purpose: Decode an object token. (native only) + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref_type, + const unsigned char *buf, H5O_token_t *obj_token) +{ + hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */ + H5VL_object_t *vol_obj_file = NULL; + H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0}; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + +#ifndef NDEBUG + { + hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + + /* Check if using native VOL connector */ + if(H5VL_object_is_native(vol_obj, &is_native) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") + + /* Must use native VOL connector for this operation */ + HDassert(is_native); + } +#endif /* NDEBUG */ + + /* Get the file for the object */ + if((file_id = H5F_get_file_id(vol_obj, type, FALSE)) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + + /* Retrieve VOL object */ + if(NULL == (vol_obj_file = H5VL_vol_object(file_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + + /* Get container info */ + if(H5VL_file_get((const H5VL_object_t *)vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &cont_info) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info") + + if(ref_type == H5R_OBJECT1) { + size_t buf_size = H5R_OBJ_REF_BUF_SIZE; + + /* Get object address */ + if(H5R__decode_token_obj_compat(buf, &buf_size, obj_token, cont_info.token_size) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "unable to get object token") + } /* end if */ + else { + size_t buf_size = H5R_DSET_REG_REF_BUF_SIZE; + H5F_t *f = NULL; + + /* Retrieve file from VOL object */ + if(NULL == (f = (H5F_t *)H5VL_object_data((const H5VL_object_t *)vol_obj_file))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid VOL object") + + /* Get object address */ + if(H5R__decode_token_region_compat(f, buf, &buf_size, obj_token, cont_info.token_size, NULL) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "unable to get object address") + } /* end else */ + +done: + if(file_id != H5I_INVALID_HID && H5I_dec_ref(file_id) < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "unable to decrement refcount on file") + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5R__decode_token_compat() */ + + +/*------------------------------------------------------------------------- + * Function: H5R__encode_token_region_compat + * + * Purpose: Encode dataset selection and insert data into heap + * (native only). + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, + size_t token_size, H5S_t *space, unsigned char *buf, size_t *nalloc) +{ + size_t buf_size; + unsigned char *data = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(f); + HDassert(obj_token); + HDassert(token_size); + HDassert(space); + HDassert(nalloc); + + /* Get required buffer size */ + if(H5R__encode_heap(f, NULL, &buf_size, NULL, (size_t)0) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + + if(buf && *nalloc >= buf_size) { + ssize_t data_size; + uint8_t *p; + + /* Pass the correct encoding version for the selection depending on the + * file libver bounds, this is later retrieved in H5S hyper encode */ + H5CX_set_libver_bounds(f); + + /* Zero the heap ID out, may leak heap space if user is re-using + * reference and doesn't have garbage collection turned on + */ + HDmemset(buf, 0, buf_size); + + /* Get the amount of space required to serialize the selection */ + if((data_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "Invalid amount of space for serializing selection") + + /* Increase buffer size to allow for the dataset token */ + data_size += (hssize_t)token_size; + + /* Allocate the space to store the serialized information */ + H5_CHECK_OVERFLOW(data_size, hssize_t, size_t); + if(NULL == (data = (uint8_t *)H5MM_malloc((size_t)data_size))) + HGOTO_ERROR(H5E_REFERENCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Serialize information for dataset OID into heap buffer */ + p = (uint8_t *)data; + H5MM_memcpy(p, obj_token, token_size); + p += token_size; + + /* Serialize the selection into heap buffer */ + if(H5S_SELECT_SERIALIZE(space, &p) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection") + + /* Write to heap */ + if(H5R__encode_heap(f, buf, nalloc, data, (size_t)data_size) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + } + *nalloc = buf_size; + +done: + H5MM_free(data); + FUNC_LEAVE_NOAPI(ret_value) +} /* H5R__encode_token_region_compat() */ + + +#ifndef H5_NO_DEPRECATED_SYMBOLS +/*------------------------------------------------------------------------- * Function: H5Rget_obj_type1 * * Purpose: Retrieves the type of the object that a reference points to. diff --git a/src/H5Rint.c b/src/H5Rint.c index 0acc887..83177d6 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -1499,123 +1499,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5R__free_heap - * - * Purpose: Remove data previously inserted into heap (native only). - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5R__free_heap(H5F_t *f, const unsigned char *buf, size_t nbytes) -{ - H5HG_t hobjid; - const uint8_t *p = (const uint8_t *)buf; - size_t buf_size; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_PACKAGE - - HDassert(f); - HDassert(buf); - - buf_size = H5HG_HEAP_ID_SIZE(f); - /* Don't decode if buffer size isn't big enough */ - if(nbytes < buf_size) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") - - /* Get the heap information */ - H5F_addr_decode(f, &p, &(hobjid.addr)); - if(!H5F_addr_defined(hobjid.addr) || hobjid.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") - UINT32DECODE(p, hobjid.idx); - - /* Free heap object */ - if(hobjid.addr > 0) { - /* Free heap object */ - if(H5HG_remove(f, &hobjid) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R__free_heap() */ - - -/*------------------------------------------------------------------------- - * Function: H5R__decode_token_compat - * - * Purpose: Decode an object token. (native only) - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref_type, - const unsigned char *buf, H5O_token_t *obj_token) -{ - hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */ - H5VL_object_t *vol_obj_file = NULL; - H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0}; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_PACKAGE - -#ifndef NDEBUG - { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ - - /* Check if using native VOL connector */ - if(H5VL_object_is_native(vol_obj, &is_native) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") - - /* Must use native VOL connector for this operation */ - HDassert(is_native); - } -#endif /* NDEBUG */ - - /* Get the file for the object */ - if((file_id = H5F_get_file_id(vol_obj, type, FALSE)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - - /* Retrieve VOL object */ - if(NULL == (vol_obj_file = H5VL_vol_object(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - - /* Get container info */ - if(H5VL_file_get((const H5VL_object_t *)vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &cont_info) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info") - - if(ref_type == H5R_OBJECT1) { - size_t buf_size = H5R_OBJ_REF_BUF_SIZE; - - /* Get object address */ - if(H5R__decode_token_obj_compat(buf, &buf_size, obj_token, cont_info.token_size) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "unable to get object token") - } /* end if */ - else { - size_t buf_size = H5R_DSET_REG_REF_BUF_SIZE; - H5F_t *f = NULL; - - /* Retrieve file from VOL object */ - if(NULL == (f = (H5F_t *)H5VL_object_data((const H5VL_object_t *)vol_obj_file))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid VOL object") - - /* Get object address */ - if(H5R__decode_token_region_compat(f, buf, &buf_size, obj_token, cont_info.token_size, NULL) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "unable to get object address") - } /* end else */ - -done: - if(file_id != H5I_INVALID_HID && H5I_dec_ref(file_id) < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "unable to decrement refcount on file") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R__decode_token_compat() */ - - -/*------------------------------------------------------------------------- * Function: H5R__encode_token_obj_compat * * Purpose: Encode an object token. (native only) @@ -1682,82 +1565,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5R__encode_token_region_compat - * - * Purpose: Encode dataset selection and insert data into heap - * (native only). - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, - size_t token_size, H5S_t *space, unsigned char *buf, size_t *nalloc) -{ - size_t buf_size; - unsigned char *data = NULL; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_PACKAGE - - HDassert(f); - HDassert(obj_token); - HDassert(token_size); - HDassert(space); - HDassert(nalloc); - - /* Get required buffer size */ - if(H5R__encode_heap(f, NULL, &buf_size, NULL, (size_t)0) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - - if(buf && *nalloc >= buf_size) { - ssize_t data_size; - uint8_t *p; - - /* Pass the correct encoding version for the selection depending on the - * file libver bounds, this is later retrieved in H5S hyper encode */ - H5CX_set_libver_bounds(f); - - /* Zero the heap ID out, may leak heap space if user is re-using - * reference and doesn't have garbage collection turned on - */ - HDmemset(buf, 0, buf_size); - - /* Get the amount of space required to serialize the selection */ - if((data_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "Invalid amount of space for serializing selection") - - /* Increase buffer size to allow for the dataset token */ - data_size += (hssize_t)token_size; - - /* Allocate the space to store the serialized information */ - H5_CHECK_OVERFLOW(data_size, hssize_t, size_t); - if(NULL == (data = (uint8_t *)H5MM_malloc((size_t)data_size))) - HGOTO_ERROR(H5E_REFERENCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Serialize information for dataset OID into heap buffer */ - p = (uint8_t *)data; - H5MM_memcpy(p, obj_token, token_size); - p += token_size; - - /* Serialize the selection into heap buffer */ - if(H5S_SELECT_SERIALIZE(space, &p) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection") - - /* Write to heap */ - if(H5R__encode_heap(f, buf, nalloc, data, (size_t)data_size) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - } - *nalloc = buf_size; - -done: - H5MM_free(data); - FUNC_LEAVE_NOAPI(ret_value) -} /* H5R__encode_token_region_compat() */ - - -/*------------------------------------------------------------------------- * Function: H5R__decode_token_region_compat * * Purpose: Decode dataset selection from data inserted into heap diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index 36cf805..c475951 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -116,14 +116,10 @@ H5_DLL herr_t H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_pr /* Native HDF5 specific routines */ H5_DLL herr_t H5R__encode_heap(H5F_t *f, unsigned char *buf, size_t *nalloc, const unsigned char *data, size_t data_size); H5_DLL herr_t H5R__decode_heap(H5F_t *f, const unsigned char *buf, size_t *nbytes, unsigned char **data_ptr, size_t *data_size); -H5_DLL herr_t H5R__free_heap(H5F_t *f, const unsigned char *buf, size_t nbytes); - -H5_DLL herr_t H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref_type, const unsigned char *buf, H5O_token_t *obj_token); H5_DLL herr_t H5R__encode_token_obj_compat(const H5O_token_t *obj_token, size_t token_size, unsigned char *buf, size_t *nalloc); H5_DLL herr_t H5R__decode_token_obj_compat(const unsigned char *buf, size_t *nbytes, H5O_token_t *obj_token, size_t token_size); -H5_DLL herr_t H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, size_t token_size, H5S_t *space, unsigned char *buf, size_t *nalloc); H5_DLL herr_t H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf, size_t *nbytes, H5O_token_t *obj_token, size_t token_size, H5S_t **space_ptr); #endif /* _H5Rpkg_H */ diff --git a/src/H5SL.c b/src/H5SL.c index ff8edb8..4716dc4 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -568,10 +568,10 @@ struct H5SL_t { }; /* Static functions */ -static H5SL_node_t * H5SL_new_node(void *item, const void *key, uint32_t hashval); -static H5SL_node_t *H5SL_insert_common(H5SL_t *slist, void *item, const void *key); -static herr_t H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); -static herr_t H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); +static H5SL_node_t *H5SL__new_node(void *item, const void *key, uint32_t hashval); +static H5SL_node_t *H5SL__insert_common(H5SL_t *slist, void *item, const void *key); +static herr_t H5SL__release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); +static herr_t H5SL__close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); /* Package initialization variable */ hbool_t H5_PKG_INIT_VAR = FALSE; @@ -642,7 +642,8 @@ H5SL__init_package(void) EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -int H5SL_term_package(void) +int +H5SL_term_package(void) { int n = 0; @@ -682,11 +683,11 @@ int H5SL_term_package(void) /*-------------------------------------------------------------------------- NAME - H5SL_new_node + H5SL__new_node PURPOSE Create a new skip list node of level 0 USAGE - H5SL_node_t *H5SL_new_node(item,key,hasval) + H5SL_node_t *H5SL__new_node(item,key,hasval) void *item; IN: Pointer to item info for node void *key; IN: Pointer to key info for node uint32_t hashval; IN: Hash value for node @@ -703,11 +704,11 @@ int H5SL_term_package(void) REVISION LOG --------------------------------------------------------------------------*/ static H5SL_node_t * -H5SL_new_node(void *item, const void *key, uint32_t hashval) +H5SL__new_node(void *item, const void *key, uint32_t hashval) { H5SL_node_t *ret_value = NULL; /* New skip list node */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate the node */ if(NULL == (ret_value = (H5SL_node_t *)H5FL_MALLOC(H5SL_node_t))) @@ -727,16 +728,16 @@ H5SL_new_node(void *item, const void *key, uint32_t hashval) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_new_node() */ +} /* end H5SL__new_node() */ /*-------------------------------------------------------------------------- NAME - H5SL_insert_common + H5SL__insert_common PURPOSE Common code for inserting an object into a skip list USAGE - H5SL_node_t *H5SL_insert_common(slist,item,key) + H5SL_node_t *H5SL__insert_common(slist,item,key) H5SL_t *slist; IN/OUT: Pointer to skip list void *item; IN: Item to insert void *key; IN: Key for item to insert @@ -752,14 +753,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5SL_node_t * -H5SL_insert_common(H5SL_t *slist, void *item, const void *key) +H5SL__insert_common(H5SL_t *slist, void *item, const void *key) { H5SL_node_t *x; /* Current node to examine */ H5SL_node_t *prev; /* Node before the new node */ uint32_t hashval = 0; /* Hash value for key */ H5SL_node_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -822,7 +823,7 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) slist->curr_level = 0; /* Create new node of level 0 */ - if(NULL == (x = H5SL_new_node(item, key, hashval))) + if(NULL == (x = H5SL__new_node(item, key, hashval))) HGOTO_ERROR(H5E_SLIST ,H5E_NOSPACE, NULL, "can't create new skip list node") /* Update the links */ @@ -844,16 +845,16 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_insert_common() */ +} /* end H5SL__insert_common() */ /*-------------------------------------------------------------------------- NAME - H5SL_release_common + H5SL__release_common PURPOSE Release all nodes from a skip list, optionally calling a 'free' operator USAGE - herr_t H5SL_release_common(slist,op,opdata) + herr_t H5SL__release_common(slist,op,opdata) H5SL_t *slist; IN/OUT: Pointer to skip list to release nodes H5SL_operator_t op; IN: Callback function to free item & key void *op_data; IN/OUT: Pointer to application data for callback @@ -872,12 +873,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) +H5SL__release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { H5SL_node_t *node, *next_node; /* Pointers to skip list nodes */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -917,16 +918,16 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_release_common() */ +} /* end H5SL__release_common() */ /*-------------------------------------------------------------------------- NAME - H5SL_close_common + H5SL__close_common PURPOSE Close a skip list, deallocating it and potentially freeing all its nodes. USAGE - herr_t H5SL_close_common(slist,op,opdata) + herr_t H5SL__close_common(slist,op,opdata) H5SL_t *slist; IN/OUT: Pointer to skip list to close H5SL_operator_t op; IN: Callback function to free item & key void *op_data; IN/OUT: Pointer to application data for callback @@ -944,11 +945,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) +H5SL__close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -957,7 +958,7 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Free skip list nodes */ - if(H5SL_release_common(slist, op, op_data) < 0) + if(H5SL__release_common(slist, op, op_data) < 0) HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") /* Release header node */ @@ -969,7 +970,7 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_close_common() */ +} /* end H5SL__close_common() */ /*-------------------------------------------------------------------------- @@ -1016,7 +1017,7 @@ H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp) new_slist->safe_iterating = FALSE; /* Allocate the header node */ - if(NULL == (header = H5SL_new_node(NULL, NULL, (uint32_t)ULONG_MAX))) + if(NULL == (header = H5SL__new_node(NULL, NULL, (uint32_t)ULONG_MAX))) HGOTO_ERROR(H5E_SLIST ,H5E_NOSPACE, NULL, "can't create new skip list node") /* Initialize header node's forward pointer */ @@ -1118,8 +1119,8 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key) /* (Pre-condition) */ /* Insert item into skip list */ - if(H5SL_insert_common(slist,item,key)==NULL) - HGOTO_ERROR(H5E_SLIST,H5E_CANTINSERT,FAIL,"can't create new skip list node") + if(NULL == H5SL__insert_common(slist, item, key)) + HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, FAIL, "can't create new skip list node") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1168,8 +1169,8 @@ H5SL_add(H5SL_t *slist, void *item, const void *key) /* (Pre-condition) */ /* Insert item into skip list */ - if((ret_value=H5SL_insert_common(slist,item,key))==NULL) - HGOTO_ERROR(H5E_SLIST,H5E_CANTINSERT,NULL,"can't create new skip list node") + if(NULL == (ret_value = H5SL__insert_common(slist, item, key))) + HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, NULL, "can't create new skip list node") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2241,7 +2242,9 @@ H5SL_iterate(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_release(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(slist); @@ -2253,8 +2256,10 @@ H5SL_release(H5SL_t *slist) /* (Pre-condition) */ /* Free skip list nodes */ - H5SL_release_common(slist,NULL,NULL); /* always succeeds */ + if(H5SL__release_common(slist, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") +done: FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SL_release() */ @@ -2290,7 +2295,9 @@ H5SL_release(H5SL_t *slist) herr_t H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(slist); @@ -2302,9 +2309,11 @@ H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Free skip list nodes */ - H5SL_release_common(slist,op,op_data); /* always succeeds */ + if(H5SL__release_common(slist, op, op_data) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_free() */ @@ -2516,9 +2525,9 @@ done: herr_t H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -2527,8 +2536,10 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Close skip list */ - (void)H5SL_close_common(slist,op,op_data); /* always succeeds */ + if(H5SL__close_common(slist, op, op_data) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list") +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_destroy() */ @@ -2555,7 +2566,9 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_close(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -2564,8 +2577,10 @@ H5SL_close(H5SL_t *slist) /* (Pre-condition) */ /* Close skip list */ - (void)H5SL_close_common(slist,NULL,NULL); /* always succeeds */ + if(H5SL__close_common(slist, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list") - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_close() */ diff --git a/src/H5SLmodule.h b/src/H5SLmodule.h index 34f08a1..335e35b 100644 --- a/src/H5SLmodule.h +++ b/src/H5SLmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5SM.c b/src/H5SM.c index 6eea80d..420f5df 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -61,6 +61,7 @@ static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t size_t *empty_pos, size_t *list_pos); static herr_t H5SM__convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header, H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh); +static herr_t H5SM__bt2_convert_to_list_op(const void * record, void *op_data); static herr_t H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header); static herr_t H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed); static herr_t H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, @@ -294,7 +295,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5SM_get_index + * Function: H5SM__get_index * * Purpose: Get the index number for a given message type. * @@ -310,13 +311,13 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id) +H5SM__get_index(const H5SM_master_table_t *table, unsigned type_id) { size_t x; unsigned type_flag; ssize_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Translate the H5O type_id into an H5SM type flag */ if(H5SM__type_to_flag(type_id, &type_flag) < 0) @@ -334,7 +335,7 @@ H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id) */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_get_index() */ +} /* end H5SM__get_index() */ /*------------------------------------------------------------------------- @@ -428,7 +429,7 @@ H5SM_get_fheap_addr(H5F_t *f, unsigned type_id, haddr_t *fheap_addr) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Look up index for message type */ - if((index_num = H5SM_get_index(table, type_id)) < 0) + if((index_num = H5SM__get_index(table, type_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to find correct SOHM index") /* Retrieve heap address for index */ @@ -801,6 +802,48 @@ done: /*------------------------------------------------------------------------- + * Function: H5SM__bt2_convert_to_list_op + * + * Purpose: An H5B2_remove_t callback function to convert a SOHM + * B-tree index to a list. + * + * Inserts this record into the list passed through op_data. + * + * Return: Non-negative on success + * Negative on failure + * + * Programmer: James Laird + * Monday, November 6, 2006 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5SM__bt2_convert_to_list_op(const void * record, void *op_data) +{ + const H5SM_sohm_t *message = (const H5SM_sohm_t *)record; + const H5SM_list_t *list = (const H5SM_list_t *)op_data; + size_t mesg_idx; /* Index of message to modify */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(record); + HDassert(op_data); + + /* Get the message index, and increment the # of messages in list */ + mesg_idx = list->header->num_messages++; + HDassert(list->header->num_messages <= list->header->list_max); + + /* Insert this message at the end of the list */ + HDassert(list->messages[mesg_idx].location == H5SM_NO_LOC); + HDassert(message->location != H5SM_NO_LOC); + H5MM_memcpy(&(list->messages[mesg_idx]), message, sizeof(H5SM_sohm_t)); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM__bt2_convert_to_list_op() */ + + +/*------------------------------------------------------------------------- * Function: H5SM__convert_btree_to_list * * Purpose: Given a B-tree index, turns it into a list index. This is @@ -847,7 +890,7 @@ H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header) /* Delete the B-tree and have messages copy themselves to the * list as they're deleted */ - if(H5B2_delete(f, btree_addr, f, H5SM_bt2_convert_to_list_op, list) < 0) + if(H5B2_delete(f, btree_addr, f, H5SM__bt2_convert_to_list_op, list) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete B-tree") done: @@ -860,7 +903,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5SM_can_share_common + * Function: H5SM__can_share_common * * Purpose: "trivial" checks for determining if a message can be shared. * @@ -878,11 +921,11 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5SM_can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) +H5SM__can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) { htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check whether this message ought to be shared or not */ /* If sharing is disabled in this file, don't share the message */ @@ -901,7 +944,7 @@ H5SM_can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_can_share_common() */ +} /* end H5SM__can_share_common() */ /*------------------------------------------------------------------------- @@ -934,7 +977,7 @@ H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* "trivial" sharing checks */ - if((tri_ret = H5SM_can_share_common(f, type_id, mesg)) < 0) + if((tri_ret = H5SM__can_share_common(f, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'trivial' sharing checks returned error") if(tri_ret == FALSE) HGOTO_DONE(FALSE) @@ -956,7 +999,7 @@ H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, /* Find the right index for this message type. If there is no such index * then this type of message isn't shareable */ - if((index_num = H5SM_get_index(my_table, type_id)) < 0) { + if((index_num = H5SM__get_index(my_table, type_id)) < 0) { H5E_clear_stack(NULL); /*ignore error*/ HGOTO_DONE(FALSE) } /* end if */ @@ -1072,7 +1115,7 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, /* "trivial" sharing checks */ if(mesg_flags && (*mesg_flags & H5O_MSG_FLAG_DONTSHARE)) HGOTO_DONE(FALSE) - if((tri_ret = H5SM_can_share_common(f, type_id, mesg)) < 0) + if((tri_ret = H5SM__can_share_common(f, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'trivial' sharing checks returned error") if(tri_ret == FALSE) HGOTO_DONE(FALSE) @@ -1561,7 +1604,7 @@ H5SM_delete(H5F_t *f, H5O_t *open_oh, H5O_shared_t *sh_mesg) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and try to delete from it */ - if((index_num = H5SM_get_index(table, type_id)) < 0) + if((index_num = H5SM__get_index(table, type_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to find correct SOHM index") /* If mesg_buf is not NULL, the message's reference count has reached @@ -1675,34 +1718,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5SM_get_hash_fh_cb - * - * Purpose: Callback for fractal heap operator, to make copy of link when - * when lookup up a link by index - * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 7 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata) -{ - H5SM_fh_ud_gh_t *udata = (H5SM_fh_ud_gh_t *)_udata; /* User data for fractal heap 'op' callback */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Compute hash value on raw message */ - udata->hash = H5_checksum_lookup3(obj, obj_len, udata->type_id); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_get_hash_fh_cb() */ - - -/*------------------------------------------------------------------------- * Function: H5SM__decr_ref * * Purpose: Decrement the reference count for a SOHM message. Doesn't @@ -2108,7 +2123,7 @@ H5SM_reconstitute(H5O_shared_t *sh_mesg, H5F_t *f, unsigned msg_type_id, /*------------------------------------------------------------------------- - * Function: H5SM_get_refcount_bt2_cb + * Function: H5SM__get_refcount_bt2_cb * * Purpose: v2 B-tree 'find' callback to retrieve the record for a message * @@ -2120,12 +2135,12 @@ H5SM_reconstitute(H5O_shared_t *sh_mesg, H5F_t *f, unsigned msg_type_id, *------------------------------------------------------------------------- */ static herr_t -H5SM_get_refcount_bt2_cb(const void *_record, void *_op_data) +H5SM__get_refcount_bt2_cb(const void *_record, void *_op_data) { const H5SM_sohm_t *record = (const H5SM_sohm_t *)_record; /* v2 B-tree record for message */ H5SM_sohm_t *op_data = (H5SM_sohm_t *)_op_data; /* "op data" from v2 B-tree find */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -2137,7 +2152,7 @@ H5SM_get_refcount_bt2_cb(const void *_record, void *_op_data) *op_data = *record; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_get_refcount_bt2_cb() */ +} /* end H5SM__get_refcount_bt2_cb() */ /*------------------------------------------------------------------------- @@ -2184,7 +2199,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and find the message in it */ - if((index_num = H5SM_get_index(table, type_id)) < 0) + if((index_num = H5SM__get_index(table, type_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to find correct SOHM index") header = &(table->indexes[index_num]); @@ -2241,7 +2256,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") /* Look up the message in the v2 B-tree */ - if((msg_exists = H5B2_find(bt2, &key, H5SM_get_refcount_bt2_cb, &message)) < 0) + if((msg_exists = H5B2_find(bt2, &key, H5SM__get_refcount_bt2_cb, &message)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "error finding message in index") if(!msg_exists) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index") @@ -2466,7 +2481,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5SM_table_free + * Function: H5SM__table_free * * Purpose: Frees memory used by the SOHM table. * @@ -2478,9 +2493,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_table_free(H5SM_master_table_t *table) +H5SM__table_free(H5SM_master_table_t *table) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(table); @@ -2491,11 +2506,11 @@ H5SM_table_free(H5SM_master_table_t *table) table = H5FL_FREE(H5SM_master_table_t, table); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_table_free() */ +} /* end H5SM__table_free() */ /*------------------------------------------------------------------------- - * Function: H5SM_list_free + * Function: H5SM__list_free * * Purpose: Frees all memory used by the list. * @@ -2507,9 +2522,9 @@ H5SM_table_free(H5SM_master_table_t *table) *------------------------------------------------------------------------- */ herr_t -H5SM_list_free(H5SM_list_t *list) +H5SM__list_free(H5SM_list_t *list) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(list); HDassert(list->messages); @@ -2519,7 +2534,7 @@ H5SM_list_free(H5SM_list_t *list) list = H5FL_FREE(H5SM_list_t, list); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_list_free() */ +} /* end H5SM__list_free() */ /*------------------------------------------------------------------------- diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 7f6c804..644f3dc 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -212,45 +212,3 @@ H5SM__bt2_debug(FILE *stream, int indent, int fwidth, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SM__bt2_debug */ - -/*------------------------------------------------------------------------- - * Function: H5SM_bt2_convert_to_list_op - * - * Purpose: An H5B2_remove_t callback function to convert a SOHM - * B-tree index to a list. - * - * Inserts this record into the list passed through op_data. - * - * Return: Non-negative on success - * Negative on failure - * - * Programmer: James Laird - * Monday, November 6, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5SM_bt2_convert_to_list_op(const void * record, void *op_data) -{ - const H5SM_sohm_t *message = (const H5SM_sohm_t *)record; - const H5SM_list_t *list = (const H5SM_list_t *)op_data; - size_t mesg_idx; /* Index of message to modify */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Sanity checks */ - HDassert(record); - HDassert(op_data); - - /* Get the message index, and increment the # of messages in list */ - mesg_idx = list->header->num_messages++; - HDassert(list->header->num_messages <= list->header->list_max); - - /* Insert this message at the end of the list */ - HDassert(list->messages[mesg_idx].location == H5SM_NO_LOC); - HDassert(message->location != H5SM_NO_LOC); - H5MM_memcpy(&(list->messages[mesg_idx]), message, sizeof(H5SM_sohm_t)); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_bt2_convert_to_list_op() */ - diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 7f243a6..e7cd29e 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -15,7 +15,7 @@ * * Created: H5SMcache.c * Nov 13 2006 - * James Laird + * James Laird * * Purpose: Implement shared message metadata cache methods. * @@ -308,7 +308,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l done: if(!ret_value && table) - if(H5SM_table_free(table) < 0) + if(H5SM__table_free(table) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTFREE, NULL, "unable to destroy sohm table") FUNC_LEAVE_NOAPI(ret_value) @@ -467,7 +467,7 @@ H5SM__cache_table_free_icr(void *_thing) HDassert(table->cache_info.type == H5AC_SOHM_TABLE); /* Destroy Shared Object Header Message table */ - if(H5SM_table_free(table) < 0) + if(H5SM__table_free(table) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message table") done: @@ -778,7 +778,7 @@ H5SM__cache_list_free_icr(void *_thing) HDassert(list->cache_info.type == H5AC_SOHM_LIST); /* Destroy Shared Object Header Message list */ - if(H5SM_list_free(list) < 0) + if(H5SM__list_free(list) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message list") done: diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index e085204..1787fbe 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -38,7 +38,7 @@ /* Local Typedefs */ /******************/ -/* Udata struct for calls to H5SM_compare_cb and H5SM_compare_iter_op*/ +/* Udata struct for calls to H5SM__compare_cb and H5SM__compare_iter_op*/ typedef struct H5SM_compare_udata_t { const H5SM_mesg_key_t *key; /* Key; compare this against stored message */ H5O_msg_crt_idx_t idx; /* Index of the message in the OH, if applicable */ @@ -49,8 +49,8 @@ typedef struct H5SM_compare_udata_t { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5SM_compare_cb(const void *obj, size_t obj_len, void *udata); -static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, +static herr_t H5SM__compare_cb(const void *obj, size_t obj_len, void *udata); +static herr_t H5SM__compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, unsigned *oh_modified, void *udata); @@ -71,7 +71,7 @@ static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequenc /*------------------------------------------------------------------------- - * Function: H5SM_compare_cb + * Function: H5SM__compare_cb * * Purpose: Callback for H5HF_op, used in H5SM__message_compare below. * Determines whether the search key passed in in _UDATA is @@ -87,11 +87,11 @@ static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequenc *------------------------------------------------------------------------- */ static herr_t -H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) +H5SM__compare_cb(const void *obj, size_t obj_len, void *_udata) { H5SM_compare_udata_t *udata = (H5SM_compare_udata_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* If the encoding sizes are different, it's not the same object */ if(udata->key->encoding_size > obj_len) @@ -103,11 +103,11 @@ H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) udata->ret = HDmemcmp(udata->key->encoding, obj, obj_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_compare_cb() */ +} /* end H5SM__compare_cb() */ /*------------------------------------------------------------------------- - * Function: H5SM_compare_iter_op + * Function: H5SM__compare_iter_op * * Purpose: OH iteration callback to compare a key against a message in * an OH @@ -123,13 +123,13 @@ H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, +H5SM__compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5SM_compare_udata_t *udata = (H5SM_compare_udata_t *) _udata; herr_t ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -165,7 +165,7 @@ H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_compare_iter_op() */ +} /* end H5SM__compare_iter_op() */ /*------------------------------------------------------------------------- @@ -237,7 +237,7 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) */ if(mesg->location == H5SM_IN_HEAP) { /* Call heap op routine with comparison callback */ - if(H5HF_op(key->fheap, &(mesg->u.heap_loc.fheap_id), H5SM_compare_cb, &udata) < 0) + if(H5HF_op(key->fheap, &(mesg->u.heap_loc.fheap_id), H5SM__compare_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ else { @@ -261,7 +261,7 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) /* Locate the right message and compare with it */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5SM_compare_iter_op; + op.u.lib_op = H5SM__compare_iter_op; if(H5O_msg_iterate(&oloc, mesg->msg_type_id, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") } /* end else */ diff --git a/src/H5SMmodule.h b/src/H5SMmodule.h index 656c7dd..ccd7b9f 100644 --- a/src/H5SMmodule.h +++ b/src/H5SMmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index bb458a7..59be8b7 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Thursday, March 30, 2006 * * Purpose: This file contains declarations which are visible only within @@ -259,22 +259,16 @@ H5_DLLVAR const H5B2_class_t H5SM_INDEX[1]; /****************************/ /* General routines */ -H5_DLL ssize_t H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id); +H5_DLL ssize_t H5SM__get_index(const H5SM_master_table_t *table, unsigned type_id); /* Encode and decode routines, used for B-tree and cache encoding/decoding */ H5_DLL herr_t H5SM__message_compare(const void *rec1, const void *rec2, int *result); H5_DLL herr_t H5SM__message_encode(uint8_t *raw, const void *native, void *ctx); H5_DLL herr_t H5SM__message_decode(const uint8_t *raw, void *native, void *ctx); -/* H5B2_remove_t callback to add messages to a list index */ -H5_DLL herr_t H5SM_bt2_convert_to_list_op(const void * record, void *op_data); - -/* Fractal heap 'op' callback to compute hash value for message "in place" */ -H5_DLL herr_t H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata); - /* Routines to release data structures */ -herr_t H5SM_table_free(H5SM_master_table_t *table); -herr_t H5SM_list_free(H5SM_list_t *list); +H5_DLL herr_t H5SM__table_free(H5SM_master_table_t *table); +H5_DLL herr_t H5SM__list_free(H5SM_list_t *list); /* Testing functions */ #ifdef H5SM_TESTING diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index e6776f3..80d3692 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Thursday, March 2, 2006 * * Purpose: This file contains private declarations for the H5SM diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 0a6149d..a4a43e6 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -99,7 +99,7 @@ H5SM__get_mesg_count_test(H5F_t *f, unsigned type_id, size_t *mesg_count) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index for this message type */ - if((index_num = H5SM_get_index(table, type_id)) < 0) + if((index_num = H5SM__get_index(table, type_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to find correct SOHM index") header = &(table->indexes[index_num]); diff --git a/src/H5ST.c b/src/H5ST.c index 3a1020b..2570f72 100644 --- a/src/H5ST.c +++ b/src/H5ST.c @@ -70,7 +70,7 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_close_internal + H5ST__close_internal PURPOSE Close a TST, deallocating it. USAGE @@ -87,21 +87,21 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5ST_close_internal(H5ST_ptr_t p) +H5ST__close_internal(H5ST_ptr_t p) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Recursively free TST */ if(p) { - H5ST_close_internal(p->lokid); + H5ST__close_internal(p->lokid); if(p->splitchar) - H5ST_close_internal(p->eqkid); - H5ST_close_internal(p->hikid); + H5ST__close_internal(p->eqkid); + H5ST__close_internal(p->hikid); p = H5FL_FREE(H5ST_node_t, p); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5ST_close_internal() */ +} /* end H5ST__close_internal() */ /*-------------------------------------------------------------------------- @@ -134,7 +134,7 @@ H5ST_close(H5ST_tree_t *tree) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid TST") /* Free the TST itself */ - if(H5ST_close_internal(tree->root) < 0) + if(H5ST__close_internal(tree->root) < 0) HGOTO_ERROR(H5E_TST, H5E_CANTFREE, FAIL, "can't free TST") /* Free root node itself */ @@ -270,7 +270,7 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_find_internal + H5ST__find_internal PURPOSE Find the node matching a particular key string USAGE @@ -289,11 +289,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5ST_ptr_t -H5ST_find_internal(H5ST_ptr_t p, const char *s) +H5ST__find_internal(H5ST_ptr_t p, const char *s) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR while (p) { if (*s < p->splitchar) @@ -308,7 +308,7 @@ H5ST_find_internal(H5ST_ptr_t p, const char *s) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5ST_find_internal() */ +} /* end H5ST__find_internal() */ /*-------------------------------------------------------------------------- @@ -338,7 +338,7 @@ H5ST_find(H5ST_tree_t *tree, const char *s) FUNC_ENTER_NOAPI(NULL) - if(NULL == (ret_value = H5ST_find_internal(tree->root, s))) + if(NULL == (ret_value = H5ST__find_internal(tree->root, s))) HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") done: @@ -374,7 +374,7 @@ H5ST_locate(H5ST_tree_t *tree, const char *s) FUNC_ENTER_NOAPI(NULL) /* Locate the node to remove */ - if(NULL == (node = H5ST_find_internal(tree->root, s))) + if(NULL == (node = H5ST__find_internal(tree->root, s))) HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") /* Get the pointer to the object to return */ @@ -387,11 +387,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_findfirst_internal + H5ST__findfirst_internal PURPOSE Find the first node in a TST USAGE - H5ST_ptr_t H5ST_findfirst_internal(p) + H5ST_ptr_t H5ST__findfirst_internal(p) H5ST_ptr_t p; IN: TST to locate first node within RETURNS Success: Non-NULL @@ -404,11 +404,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5ST_ptr_t -H5ST_findfirst_internal(H5ST_ptr_t p) +H5ST__findfirst_internal(H5ST_ptr_t p) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR while(p) { /* Find least node in current tree */ @@ -428,7 +428,7 @@ H5ST_findfirst_internal(H5ST_ptr_t p) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5ST_findfirst_internal() */ +} /* end H5ST__findfirst_internal() */ /*-------------------------------------------------------------------------- @@ -456,7 +456,7 @@ H5ST_findfirst(H5ST_tree_t *tree) FUNC_ENTER_NOAPI(NULL) - if(NULL == (ret_value = H5ST_findfirst_internal(tree->root))) + if(NULL == (ret_value = H5ST__findfirst_internal(tree->root))) HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"no nodes in TST"); done: @@ -466,11 +466,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_getnext + H5ST__getnext PURPOSE Internal routine to find the next node in a given level of a TST USAGE - H5ST_ptr_t H5ST_getnext(p) + H5ST_ptr_t H5ST__getnext(p) H5ST_ptr_t *p; IN: Pointer to node to find next node from RETURNS Success: Non-NULL @@ -483,11 +483,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5ST_ptr_t -H5ST_getnext(H5ST_ptr_t p) +H5ST__getnext(H5ST_ptr_t p) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* If the node to continue from has higher-valued nodes attached */ if(p->hikid) { @@ -519,7 +519,7 @@ H5ST_getnext(H5ST_ptr_t p) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5ST_getnext() */ +} /* end H5ST__getnext() */ /*-------------------------------------------------------------------------- @@ -550,9 +550,9 @@ H5ST_findnext(H5ST_ptr_t p) /* Find the next node at the current level, or go back up the tree */ do { - q = H5ST_getnext(p); + q = H5ST__getnext(p); if(q) { - HGOTO_DONE(H5ST_findfirst_internal(q->eqkid)); + HGOTO_DONE(H5ST__findfirst_internal(q->eqkid)); } /* end if */ else p = p->up; @@ -565,11 +565,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_delete_internal + H5ST__delete_internal PURPOSE Delete a node from a TST USAGE - herr_t H5ST_delete_internal(root,p) + herr_t H5ST__delete_internal(root,p) H5ST_ptr_t *root; IN/OUT: Root of TST to delete node from H5ST_ptr_t p; IN: Node to delete RETURNS @@ -584,12 +584,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) +H5ST__delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) { H5ST_ptr_t q, /* Temporary pointer to TST node */ newp; /* Pointer to node which will replace deleted node in tree */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Find node to replace one being deleted */ if(p->lokid) { @@ -628,7 +628,7 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) /* If we deleted the last node in the TST, delete the upper node also */ if(NULL == newp) - H5ST_delete_internal(root, p->up); + H5ST__delete_internal(root, p->up); } /* end if */ else /* Deleted last node at top level of tree */ *root = newp; @@ -637,7 +637,7 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) p = H5FL_FREE(H5ST_node_t, p); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5ST_delete_internal() */ +} /* end H5ST__delete_internal() */ /*-------------------------------------------------------------------------- @@ -667,7 +667,7 @@ H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p) FUNC_ENTER_NOAPI(FAIL) - if(H5ST_delete_internal(&tree->root, p) < 0) + if(H5ST__delete_internal(&tree->root, p) < 0) HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, FAIL, "can't delete node from TST") done: @@ -703,14 +703,14 @@ H5ST_remove(H5ST_tree_t *tree, const char *s) FUNC_ENTER_NOAPI(NULL) /* Locate the node to remove */ - if(NULL == (node = H5ST_find_internal(tree->root, s))) + if(NULL == (node = H5ST__find_internal(tree->root, s))) HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") /* Get the pointer to the object to return */ ret_value = node->eqkid; /* Remove the node from the TST */ - if(H5ST_delete_internal(&tree->root, node) < 0) + if(H5ST__delete_internal(&tree->root, node) < 0) HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, NULL, "can't delete node from TST") done: diff --git a/src/H5Sall.c b/src/H5Sall.c index 9026e7c..f342279 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * * Purpose: "All" selection dataspace I/O functions. diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index 32f5295..a870c92 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -16,7 +16,6 @@ * Created: H5Sdbg.c * Quincey Koziol * Jul 24 2007 - * * * Purpose: Dump debugging information about a dataspace * diff --git a/src/H5Sdeprec.c b/src/H5Sdeprec.c index e4ec1b0..e37694c 100644 --- a/src/H5Sdeprec.c +++ b/src/H5Sdeprec.c @@ -87,7 +87,6 @@ * Failure: negative * * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu * July 14, 2004 * *------------------------------------------------------------------------- diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 9f75785..95bce29 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -5405,7 +5405,7 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, { hbool_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(span_info1); @@ -7017,9 +7017,8 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) { hbool_t non_zero_offset = FALSE; /* Whether any offset is non-zero */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(space); @@ -7062,8 +7061,7 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) } /* end if */ } -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_adjust_s() */ @@ -9613,7 +9611,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(space); diff --git a/src/H5Smodule.h b/src/H5Smodule.h index 962f0a2..67ac785 100644 --- a/src/H5Smodule.h +++ b/src/H5Smodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Snone.c b/src/H5Snone.c index 672302d..67c07d0 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 10, 1998 * * Purpose: "None" selection dataspace I/O functions. diff --git a/src/H5Spkg.h b/src/H5Spkg.h index e08fedf..b1a46f2 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 28, 2000 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Sselect.c b/src/H5Sselect.c index c9d7fc0..eb5cf1c 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Friday, May 29, 1998 * * Purpose: Dataspace selection functions. @@ -56,9 +56,9 @@ /********************/ #ifdef LATER -static herr_t H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); -static htri_t H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter); -static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter); +static herr_t H5S__select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); +static htri_t H5S__select_iter_has_next_block(const H5S_sel_iter_t *iter); +static herr_t H5S__select_iter_next_block(H5S_sel_iter_t *iter); #endif /* LATER */ @@ -1233,11 +1233,11 @@ H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) /*-------------------------------------------------------------------------- NAME - H5S_select_iter_block + H5S__select_iter_block PURPOSE Get the block of the current iterator position USAGE - herr_t H5S_select_iter_block(sel_iter,start,end) + herr_t H5S__select_iter_block(sel_iter,start,end) const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query hsize_t *start; OUT: Array to place iterator start block coordinates hsize_t *end; OUT: Array to place iterator end block coordinates @@ -1255,11 +1255,11 @@ H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) +H5S__select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(iter); @@ -1270,7 +1270,7 @@ H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) ret_value = (*iter->type->iter_block)(iter, start, end); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_select_iter_block() */ +} /* end H5S__select_iter_block() */ #endif /* LATER */ @@ -1314,11 +1314,11 @@ H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) /*-------------------------------------------------------------------------- NAME - H5S_select_iter_has_next_block + H5S__select_iter_has_next_block PURPOSE Check if there is another block available in the selection iterator USAGE - htri_t H5S_select_iter_has_next_block(sel_iter) + htri_t H5S__select_iter_has_next_block(sel_iter) const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query RETURNS Non-negative on success, negative on failure. @@ -1334,11 +1334,11 @@ H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter) +H5S__select_iter_has_next_block(const H5S_sel_iter_t *iter) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(iter); @@ -1347,7 +1347,7 @@ H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter) ret_value = (*iter->type->iter_has_next_block)(iter); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_select_iter_has_next_block() */ +} /* end H5S__select_iter_has_next_block() */ #endif /* LATER */ @@ -1397,11 +1397,11 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) /*-------------------------------------------------------------------------- NAME - H5S_select_iter_next_block + H5S__select_iter_next_block PURPOSE Advance selection iterator to next block USAGE - herr_t H5S_select_iter_next_block(iter) + herr_t H5S__select_iter_next_block(iter) H5S_sel_iter_t *iter; IN/OUT: Selection iterator to change RETURNS Non-negative on success, negative on failure. @@ -1419,11 +1419,11 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_select_iter_next_block(H5S_sel_iter_t *iter) +H5S__select_iter_next_block(H5S_sel_iter_t *iter) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(iter); @@ -1432,7 +1432,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter) ret_value = (*iter->type->iter_next_block)(iter); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_select_iter_next_block() */ +} /* end H5S__select_iter_next_block() */ #endif /* LATER */ diff --git a/src/H5Stest.c b/src/H5Stest.c index b61b6bf..1bc5b9f 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Saturday, May 31, 2003 * * Purpose: Dataspace selection testing functions. diff --git a/src/H5T.c b/src/H5T.c index 991095d..d59aaff 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1912,12 +1912,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * - * Robb Matzke, 1 Jun 1998 - * It is illegal to lock a named datatype since we must allow named - * types to be closed (to release file resources) but locking a type - * prevents that. *------------------------------------------------------------------------- */ herr_t @@ -1990,9 +1984,6 @@ done: * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * Broke out from H5Tget_class - QAK - 6/4/99 - * *------------------------------------------------------------------------- */ H5T_class_t @@ -3029,10 +3020,6 @@ done: * Programmer: Raymond Lu * July 14, 2004 * - * Modification:Raymond Lu - * 17 February 2011 - * I changed the value for the APP_REF parameter of H5I_register - * from FALSE to TRUE. *------------------------------------------------------------------------- */ hid_t @@ -3195,10 +3182,6 @@ done: * Programmer: Robb Matzke * Friday, December 5, 1997 * - * Modifications: - * Raymond Lu - * 19 May 2011 - * We support fixed size or variable-length string now. *------------------------------------------------------------------------- */ H5T_t * @@ -5173,11 +5156,6 @@ H5T_path_noop(const H5T_path_t *p) * Programmer: Raymond Lu * 8 June 2007 * - * Modifications: Neil Fortner - * 19 September 2008 - * Changed return value to H5T_subset_info_t - * (to allow it to return copy_size) - * *------------------------------------------------------------------------- */ H5T_subset_info_t * @@ -5905,7 +5883,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_upgrade_version_cb + * Function: H5T__upgrade_version_cb * * Purpose: H5T__visit callback to Upgrade the version of a datatype * (if there's any benefit to doing so) @@ -5922,9 +5900,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_upgrade_version_cb(H5T_t *dt, void *op_value) +H5T__upgrade_version_cb(H5T_t *dt, void *op_value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(dt); @@ -5959,7 +5937,7 @@ H5T_upgrade_version_cb(H5T_t *dt, void *op_value) } /* end switch */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5T_upgrade_version_cb() */ +} /* end H5T__upgrade_version_cb() */ /*------------------------------------------------------------------------- @@ -5987,7 +5965,7 @@ H5T__upgrade_version(H5T_t *dt, unsigned new_version) HDassert(dt); /* Iterate over entire datatype, upgrading the version of components, if it's useful */ - if(H5T__visit(dt, (H5T_VISIT_SIMPLE | H5T_VISIT_COMPLEX_LAST), H5T_upgrade_version_cb, &new_version) < 0) + if(H5T__visit(dt, (H5T_VISIT_SIMPLE | H5T_VISIT_COMPLEX_LAST), H5T__upgrade_version_cb, &new_version) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "iteration to upgrade datatype encoding version failed") done: diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index 887f001..effda55 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -19,8 +19,6 @@ * * Purpose: Private non-prototype header. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef H5TSprivate_H_ diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index f4a9e04..caf81cb 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -93,8 +93,6 @@ static H5T_t *H5T__reopen_member_type(const H5T_t *dt, unsigned membno); * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ size_t @@ -163,8 +161,6 @@ H5T_get_member_offset(const H5T_t *dt, unsigned membno) * Programmer: Quincey Koziol * Thursday, November 9, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_class_t @@ -361,8 +357,6 @@ H5T__get_member_size(const H5T_t *dt, unsigned membno) * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -407,8 +401,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -616,8 +608,6 @@ done: * Programmer: Quincey Koziol * Thursday, September 11, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t @@ -654,8 +644,6 @@ H5T__is_packed(const H5T_t *dt) * Programmer: Neil Fortner * Monday, October 19, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 15658cc..5d4829e 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -990,7 +990,7 @@ typedef struct H5T_conv_hw_t { /* Local Prototypes */ /********************/ -static herr_t H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order); +static herr_t H5T__reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order); /*********************/ @@ -1725,7 +1725,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(src->shared->u.atomic.prec > dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } /* end if */ @@ -1824,7 +1824,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_conv_struct_free + * Function: H5T__conv_struct_free * * Purpose: Free the private data structure used by the compound * conversion functions. @@ -1837,14 +1837,14 @@ done: *------------------------------------------------------------------------- */ static H5T_conv_struct_t * -H5T_conv_struct_free(H5T_conv_struct_t *priv) +H5T__conv_struct_free(H5T_conv_struct_t *priv) { int *src2dst = priv->src2dst; hid_t *src_memb_id = priv->src_memb_id, *dst_memb_id = priv->dst_memb_id; unsigned i; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR for(i = 0; i < priv->src_nmembs; i++) if(src2dst[i] >= 0) { @@ -1862,11 +1862,11 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) H5MM_xfree(priv->memb_path); FUNC_LEAVE_NOAPI((H5T_conv_struct_t *)H5MM_xfree(priv)) -} /* end H5T_conv_struct_free() */ +} /* end H5T__conv_struct_free() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_struct_init + * Function: H5T__conv_struct_init * * Purpose: Initialize the `priv' field of `cdata' with conversion * information that is relatively constant. If `priv' is @@ -1912,7 +1912,7 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) *------------------------------------------------------------------------- */ static herr_t -H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) +H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) { H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv); int *src2dst = NULL; @@ -1920,7 +1920,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) unsigned i, j; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC src_nmembs = src->shared->u.compnd.nmembs; dst_nmembs = dst->shared->u.compnd.nmembs; @@ -2000,7 +2000,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) H5T_path_t *tpath = H5T_path_find(src->shared->u.compnd.memb[i].type, dst->shared->u.compnd.memb[src2dst[i]].type); if(NULL == (priv->memb_path[i] = tpath)) { - cdata->priv = H5T_conv_struct_free(priv); + cdata->priv = H5T__conv_struct_free(priv); HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert member datatype") } /* end if */ } /* end if */ @@ -2053,7 +2053,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_struct_init() */ +} /* end H5T__conv_struct_init() */ /*------------------------------------------------------------------------- @@ -2160,7 +2160,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") - if(H5T_conv_struct_init(src, dst, cdata) < 0) + if(H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") break; @@ -2168,7 +2168,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Free the private conversion data. */ - cdata->priv = H5T_conv_struct_free(priv); + cdata->priv = H5T__conv_struct_free(priv); break; case H5T_CONV_CONV: @@ -2180,7 +2180,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDassert(priv); HDassert(bkg && cdata->need_bkg); - if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata) < 0) + if(cdata->recalc && H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") /* @@ -2389,7 +2389,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") /* Initialize data which is relatively constant */ - if(H5T_conv_struct_init(src, dst, cdata) < 0) + if(H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); src2dst = priv->src2dst; @@ -2422,7 +2422,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, if(dst_memb->size > src_memb->size) { offset -= src_memb->size; if(dst_memb->size > src->shared->size-offset) { - cdata->priv = H5T_conv_struct_free(priv); + cdata->priv = H5T__conv_struct_free(priv); HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion is unsupported by this function") } /* end if */ } /* end if */ @@ -2434,7 +2434,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /* * Free the private conversion data. */ - cdata->priv = H5T_conv_struct_free((H5T_conv_struct_t *)(cdata->priv)); + cdata->priv = H5T__conv_struct_free((H5T_conv_struct_t *)(cdata->priv)); break; case H5T_CONV_CONV: @@ -2445,7 +2445,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Update cached data if necessary */ - if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata) < 0) + if(cdata->recalc && H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); HDassert(priv); @@ -2579,7 +2579,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_conv_enum_init + * Function: H5T__conv_enum_init * * Purpose: Initialize information for H5T__conv_enum(). * @@ -2593,7 +2593,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) +H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) { H5T_enum_struct_t *priv = NULL; /*private conversion data */ int n; /*src value cast as native int */ @@ -2603,7 +2603,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) unsigned i, j; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC cdata->need_bkg = H5T_BKG_NO; if(NULL == (priv = (H5T_enum_struct_t *)(cdata->priv = H5MM_calloc(sizeof(*priv))))) @@ -2766,7 +2766,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_ENUM != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") - if(H5T_conv_enum_init(src, dst, cdata) < 0) + if(H5T__conv_enum_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize private data") break; @@ -2794,7 +2794,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") /* priv->src2dst map was computed for certain sort keys. Make sure those same - * sort keys are used here during conversion. See H5T_conv_enum_init(). But + * sort keys are used here during conversion. See H5T__conv_enum_init(). But * we actually don't care about the source type's order when doing the O(1) * conversion algorithm, which is turned on by non-zero priv->length */ H5T__sort_name(dst, NULL); @@ -2831,7 +2831,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* (The casting won't work when the byte orders are different. i.g. if the source value * is big-endian 0x0000000f, the direct casting "n = *((int*)s);" will make it a big * number 0x0f000000 on little-endian machine. But we won't fix it because it's an - * optimization code. Please also see the comment in the H5T_conv_enum_init() function. + * optimization code. Please also see the comment in the H5T__conv_enum_init() function. * SLU - 2011/5/24) */ if(1 == src->shared->size) @@ -3869,7 +3869,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (first>=dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -3898,7 +3898,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (first+1 == src->shared->u.atomic.prec) { /*overflow - source is negative*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -3918,7 +3918,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (first>=dst->shared->u.atomic.prec) { /*overflow - source is positive*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -3945,7 +3945,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (first+1 >= dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -3982,7 +3982,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (sfz>=0 && fz+1>=dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -4012,7 +4012,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (first+1>=dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -4293,7 +4293,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* +Inf or -Inf */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); if(sign) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); @@ -4332,7 +4332,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* +Inf or -Inf */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); if(sign) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); @@ -4371,7 +4371,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* NaN */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NAN, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -4490,7 +4490,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -4583,7 +4583,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8696,7 +8696,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(sign) { /* -Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8713,7 +8713,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { /* +Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8742,7 +8742,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(sign) { /* -Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8759,7 +8759,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { /* +Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8782,7 +8782,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* NaN */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NAN, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8878,7 +8878,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(sign) { /*source is negative*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); if(except_ret == H5T_CONV_ABORT) @@ -8894,7 +8894,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8910,7 +8910,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (first shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8931,7 +8931,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(first < dst.prec-1) { if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8957,7 +8957,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8977,7 +8977,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8994,7 +8994,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if(first < dst.prec-1) { if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -9316,7 +9316,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * precision loss. Let user's handler deal with the case if it's present */ if(cb_struct.func) { - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -9384,7 +9384,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); @@ -9486,7 +9486,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_reverse_order + * Function: H5T__reverse_order * * Purpose: Internal assisting function to reverse the order of * a sequence of byte when it's big endian or VAX order. @@ -9502,11 +9502,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) +H5T__reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) { size_t i; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(s); HDassert(size); @@ -9595,7 +9595,7 @@ H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned H5_ATTR_UNUSED ndim, HDassert(dt); if(dt->shared->type == H5T_REFERENCE) { - if(H5T_ref_reclaim(elem, dt) < 0) + if(H5T__ref_reclaim(elem, dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim ref elements") } else { HDassert(op_data); diff --git a/src/H5Tcset.c b/src/H5Tcset.c index 186e598..5ac2a62 100644 --- a/src/H5Tcset.c +++ b/src/H5Tcset.c @@ -39,10 +39,6 @@ * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived data types. - * *------------------------------------------------------------------------- */ H5T_cset_t @@ -85,10 +81,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 2c98dc0..3823e47 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Tdeprec.c * April 5 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5T interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 6daa497..ffdab5b 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -26,9 +26,9 @@ #include "H5Tpkg.h" /*data-type functions */ /* Static local functions */ -static char *H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, +static char *H5T__enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t size); -static herr_t H5T_enum_valueof(const H5T_t *dt, const char *name, +static herr_t H5T__enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/); @@ -89,8 +89,6 @@ done: * Programmer: Raymond Lu * October 9, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_t * @@ -132,8 +130,6 @@ done: * Programmer: Robb Matzke * Wednesday, December 23, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -179,8 +175,6 @@ done: * Programmer: Robb Matzke * Wednesday, December 23, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -243,8 +237,6 @@ done: * Programmer: Robb Matzke * Wednesday, December 23, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -286,8 +278,6 @@ done: * Programmer: Raymond Lu * October 9, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -323,8 +313,6 @@ H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -346,7 +334,7 @@ H5Tenum_nameof(hid_t type, const void *value, char *name/*out*/, size_t size) if (!name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name buffer supplied") - if (NULL==H5T_enum_nameof(dt, value, name, size)) + if (NULL==H5T__enum_nameof(dt, value, name, size)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "nameof query failed") done: @@ -355,7 +343,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_enum_nameof + * Function: H5T__enum_nameof * * Purpose: Finds the symbol name that corresponds the the specified * VALUE of an enumeration data type DT. At most SIZE characters @@ -375,15 +363,10 @@ done: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * Raymond Lu - * Wednesday, Febuary 9, 2005 - * Made a copy of original datatype and do sorting and search - * on that copy, to protect the original order of members. *------------------------------------------------------------------------- */ static char * -H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t size) +H5T__enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t size) { H5T_t *copied_dt = NULL; /* Do sorting in copied datatype */ unsigned lt, md = 0, rt; /* Indices for binary search */ @@ -391,7 +374,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si hbool_t alloc_name = FALSE; /* Whether name has been allocated */ char *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dt && H5T_ENUM == dt->shared->type); @@ -451,7 +434,7 @@ done: H5MM_free(name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_enum_nameof() */ +} /* end H5T__enum_nameof() */ /*------------------------------------------------------------------------- @@ -469,11 +452,6 @@ done: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * Raymond Lu - * Wednesday, Febuary 9, 2005 - * Made a copy of original datatype and do sorting and search - * on that copy, to protect the original order of members. *------------------------------------------------------------------------- */ herr_t @@ -495,7 +473,7 @@ H5Tenum_valueof(hid_t type, const char *name, void *value/*out*/) if(!value) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no value buffer") - if(H5T_enum_valueof(dt, name, value) < 0) + if(H5T__enum_valueof(dt, name, value) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "valueof query failed") done: @@ -504,7 +482,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_enum_valueof + * Function: H5T__enum_valueof * * Purpose: Finds the value that corresponds the the specified symbol * NAME of an enumeration data type DT and copy it to the VALUE @@ -518,22 +496,17 @@ done: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * Raymond Lu - * Wednesday, Febuary 9, 2005 - * Made a copy of original datatype and do sorting and search - * on that copy, to protect the original order of members. *------------------------------------------------------------------------- */ static herr_t -H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) +H5T__enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) { unsigned lt, md=0, rt; /*indices for binary search */ int cmp=(-1); /*comparison result */ H5T_t *copied_dt = NULL; /*do sorting in copied datatype */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dt && H5T_ENUM==dt->shared->type); diff --git a/src/H5Tfields.c b/src/H5Tfields.c index be0b5f2..8f5e202 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -41,9 +41,6 @@ * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with enumeration datatypes. *------------------------------------------------------------------------- */ int @@ -83,8 +80,6 @@ done: * Programmer: Raymond Lu * October 8, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -124,9 +119,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with enumeration datatypes. *------------------------------------------------------------------------- */ char * @@ -166,7 +158,6 @@ done: * Programmer: Raymond Lu * October 9, 2002 * - * Modifications: *------------------------------------------------------------------------- */ char * @@ -225,8 +216,6 @@ done: * Programmer: Raymond Lu * Thursday, April 4, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -394,8 +383,6 @@ H5T__sort_value(const H5T_t *dt, int *map) * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index bc1d84d..5270a9a 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -37,9 +37,6 @@ * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived datatypes. *------------------------------------------------------------------------- */ H5T_sign_t @@ -75,8 +72,6 @@ done: * Programmer: Raymond Lu * October 8, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_sign_t @@ -115,10 +110,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived datatypes. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index 85e8f30..0d224db 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -194,10 +194,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived datatypes. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index d2ab08c..f8f57ac 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Toffset.c b/src/H5Toffset.c index c0e94fc..38c7e53 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -25,7 +25,7 @@ #include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ -static herr_t H5T_set_offset(const H5T_t *dt, size_t offset); +static herr_t H5T__set_offset(const H5T_t *dt, size_t offset); @@ -163,10 +163,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Moved real work to a private function. - * *------------------------------------------------------------------------- */ herr_t @@ -191,7 +187,7 @@ H5Tset_offset(hid_t type_id, size_t offset) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for this datatype") /* Do the real work */ - if (H5T_set_offset(dt, offset)<0) + if (H5T__set_offset(dt, offset)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset") done: @@ -200,7 +196,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_offset + * Function: H5T__set_offset * * Purpose: Sets the bit offset of the first significant bit. The * significant bits of an atomic datum can be offset from the @@ -232,18 +228,14 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived data types. - * *------------------------------------------------------------------------- */ static herr_t -H5T_set_offset(const H5T_t *dt, size_t offset) +H5T__set_offset(const H5T_t *dt, size_t offset) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(dt); @@ -254,7 +246,7 @@ H5T_set_offset(const H5T_t *dt, size_t offset) HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { - if (H5T_set_offset(dt->shared->parent, offset)<0) + if (H5T__set_offset(dt->shared->parent, offset)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset for base type") /* Adjust size of datatype appropriately */ diff --git a/src/H5Topaque.c b/src/H5Topaque.c index 4e8f1d4..f7ce977 100644 --- a/src/H5Topaque.c +++ b/src/H5Topaque.c @@ -37,8 +37,6 @@ * Programmer: Robb Matzke * Thursday, May 20, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -84,8 +82,6 @@ done: * Programmer: Robb Matzke * Thursday, May 20, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ char * diff --git a/src/H5Torder.c b/src/H5Torder.c index b4babfa..7784c1d 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -50,7 +50,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5T_set_order(H5T_t *dtype, H5T_order_t order); +static herr_t H5T__set_order(H5T_t *dtype, H5T_order_t order); /*********************/ @@ -216,7 +216,7 @@ H5Tset_order(hid_t type_id, H5T_order_t order) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype is read-only") /* Call internal routine to set the order */ - if(H5T_set_order(dt, order) < 0) + if(H5T__set_order(dt, order) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "can't set order") done: @@ -225,7 +225,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_order + * Function: H5T__set_order * * Purpose: Private function to set the byte order for a datatype. * @@ -237,11 +237,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_set_order(H5T_t *dtype, H5T_order_t order) +H5T__set_order(H5T_t *dtype, H5T_order_t order) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC if(H5T_ENUM == dtype->shared->type && dtype->shared->u.enumer.nmembs > 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after enum members are defined") @@ -274,12 +274,12 @@ H5T_set_order(H5T_t *dtype, H5T_order_t order) /* Loop through all fields of compound type, setting the order */ for(i = 0; i < nmemb; i++) - if(H5T_set_order(dtype->shared->u.compnd.memb[i].type, order) < 0) + if(H5T__set_order(dtype->shared->u.compnd.memb[i].type, order) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set order for compound member") } /* end if */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_set_order() */ +} /* end H5T__set_order() */ diff --git a/src/H5Tpad.c b/src/H5Tpad.c index c96f42a..450c567 100644 --- a/src/H5Tpad.c +++ b/src/H5Tpad.c @@ -38,10 +38,6 @@ * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. - * *------------------------------------------------------------------------- */ herr_t @@ -82,10 +78,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 3eaec8c..28521a6 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, December 8, 1997 * * Purpose: This file contains declarations which are visible only within @@ -1187,6 +1187,7 @@ H5_DLL int H5T__get_array_ndims(const H5T_t *dt); H5_DLL int H5T__get_array_dims(const H5T_t *dt, hsize_t dims[]); /* Reference functions */ +H5_DLL herr_t H5T__ref_reclaim(void *elem, const H5T_t *dt); H5_DLL htri_t H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc); /* Compound functions */ diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index bd28fc2..9366332 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -25,7 +25,7 @@ #include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ -static herr_t H5T_set_precision(const H5T_t *dt, size_t prec); +static herr_t H5T__set_precision(const H5T_t *dt, size_t prec); @@ -45,10 +45,6 @@ static herr_t H5T_set_precision(const H5T_t *dt, size_t prec); * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived datatypes. - * *------------------------------------------------------------------------- */ size_t @@ -134,10 +130,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Moved real work to a private function. - * *------------------------------------------------------------------------- */ herr_t @@ -166,7 +158,7 @@ H5Tset_precision(hid_t type_id, size_t prec) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified datatype") /* Do the work */ - if (H5T_set_precision(dt, prec)<0) + if (H5T__set_precision(dt, prec)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision") done: @@ -175,7 +167,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_precision + * Function: H5T__set_precision * * Purpose: Sets the precision of a datatype. The precision is * the number of significant bits which, unless padding is @@ -197,19 +189,15 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived datatypes. - * *------------------------------------------------------------------------- */ static herr_t -H5T_set_precision(const H5T_t *dt, size_t prec) +H5T__set_precision(const H5T_t *dt, size_t prec) { size_t offset, size; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(dt); @@ -220,7 +208,7 @@ H5T_set_precision(const H5T_t *dt, size_t prec) HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { - if (H5T_set_precision(dt->shared->parent, prec)<0) + if (H5T__set_precision(dt->shared->parent, prec)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision for base type") /* Adjust size of datatype appropriately */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index e05bb4e..f7ca281 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -135,7 +135,6 @@ H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T_reclaim(hid_t type_id, struct H5S_t *space, void *buf); H5_DLL herr_t H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned ndim, const hsize_t *point, void *op_data); -H5_DLL herr_t H5T_ref_reclaim(void *elem, const H5T_t *dt); H5_DLL herr_t H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info); H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt); H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc); diff --git a/src/H5Tref.c b/src/H5Tref.c index 42e3da2..44f61c0 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -1237,7 +1237,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_ref_reclaim + * Function: H5T__ref_reclaim * * Purpose: Internal routine to free reference datatypes * @@ -1246,11 +1246,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_ref_reclaim(void *elem, const H5T_t *dt) +H5T__ref_reclaim(void *elem, const H5T_t *dt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); /* Sanity checks */ @@ -1262,5 +1262,5 @@ H5T_ref_reclaim(void *elem, const H5T_t *dt) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_ref_reclaim() */ +} /* end H5T__ref_reclaim() */ diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c index fa084f1..35de30b 100644 --- a/src/H5Tstrpad.c +++ b/src/H5Tstrpad.c @@ -41,10 +41,6 @@ * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived datatypes. - * *------------------------------------------------------------------------- */ H5T_str_t @@ -98,10 +94,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived datatypes. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index c706dee..00c7d8f 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -22,7 +22,7 @@ * * Created: H5Tvisit.c * Jul 19 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Visit all the components of a datatype * diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c index ceb8d61..48bd2d8 100644 --- a/src/H5VLnative_link.c +++ b/src/H5VLnative_link.c @@ -75,7 +75,7 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") /* Create the link */ - if((ret_value = H5L_create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, + if((ret_value = H5L__create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, link_loc_p, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") } /* end if */ @@ -96,7 +96,7 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Create the link */ - if((ret_value = H5L_create_soft(target_name, &link_loc, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) + if((ret_value = H5L__create_soft(target_name, &link_loc, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") break; } @@ -161,7 +161,7 @@ H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, dst_loc_p = src_loc_p; /* Copy the link */ - if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, + if(H5L__move(src_loc_p, loc_params1->loc_data.loc_by_name.name, dst_loc_p, loc_params2->loc_data.loc_by_name.name, TRUE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link") @@ -206,7 +206,7 @@ H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, dst_loc_p = src_loc_p; /* Move the link */ - if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, + if(H5L__move(src_loc_p, loc_params1->loc_data.loc_by_name.name, dst_loc_p, loc_params2->loc_data.loc_by_name.name, FALSE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") @@ -249,7 +249,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") } /* end if */ else if(loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Lget_info_by_idx */ - if(H5L_get_info_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if(H5L__get_info_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, linfo2) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") } /* end else-if */ @@ -267,7 +267,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ ssize_t *ret = HDva_arg(arguments, ssize_t *); /* Get the link name */ - if((*ret = H5L_get_name_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if((*ret = H5L__get_name_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, name, size)) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") @@ -282,12 +282,12 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ /* Get the link information */ if(loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Lget_val */ - if(H5L_get_val(&loc, loc_params->loc_data.loc_by_name.name, buf, size) < 0) + if(H5L__get_val(&loc, loc_params->loc_data.loc_by_name.name, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link value") } else if(loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Lget_val_by_idx */ - if(H5L_get_val_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if(H5L__get_val_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") } @@ -333,7 +333,7 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Check for the existence of the link */ - if((*ret = H5L_exists(&loc, loc_params->loc_data.loc_by_name.name)) < 0) + if((*ret = H5L__exists(&loc, loc_params->loc_data.loc_by_name.name)) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to specific link info") break; } @@ -392,11 +392,11 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ /* Unlink */ if(loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Ldelete */ - if(H5L_delete(&loc, loc_params->loc_data.loc_by_name.name) < 0) + if(H5L__delete(&loc, loc_params->loc_data.loc_by_name.name) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") } /* end if */ else if(loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Ldelete_by_idx */ - if(H5L_delete_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if(H5L__delete_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") } /* end else-if */ diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c index 8f60ac4..bfbbee0 100644 --- a/src/H5VLnative_object.c +++ b/src/H5VLnative_object.c @@ -64,7 +64,7 @@ H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_typ case H5VL_OBJECT_BY_IDX: { /* Open the object */ - if(NULL == (ret_value = H5O_open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if(NULL == (ret_value = H5O__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, opened_type))) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object by index") break; @@ -80,7 +80,7 @@ H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_typ HGOTO_ERROR(H5E_OHDR, H5E_CANTUNSERIALIZE, NULL, "can't deserialize object token into address") /* Open the object */ - if(NULL == (ret_value = H5O_open_by_addr(&loc, addr, opened_type))) + if(NULL == (ret_value = H5O__open_by_addr(&loc, addr, opened_type))) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object by address") break; } @@ -122,8 +122,8 @@ H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, co HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Copy the object */ - if((ret_value = H5O_copy(&src_loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object") + if((ret_value = H5O__copy(&src_loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5VM.c b/src/H5VM.c index d12bea6..403cc45 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 10, 1997 */ @@ -34,21 +34,21 @@ typedef struct H5VM_memcpy_ud_t { /* Local prototypes */ static void -H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM__stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1); static void -H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM__stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1, hsize_t *stride2); #ifdef LATER static void -H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, +H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size, const ssize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size, const ssize_t *src_stride, const void *_src); #endif /* LATER */ /*------------------------------------------------------------------------- - * Function: H5VM_stride_optimize1 + * Function: H5VM__stride_optimize1 * * Purpose: Given a stride vector which references elements of the * specified size, optimize the dimensionality, the stride @@ -63,21 +63,19 @@ H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, * Programmer: Robb Matzke * Saturday, October 11, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static void -H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM__stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM_vector_reduce_product(0, NULL)); + HDassert(1 == H5VM__vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -94,7 +92,7 @@ H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, /*------------------------------------------------------------------------- - * Function: H5VM_stride_optimize2 + * Function: H5VM__stride_optimize2 * * Purpose: Given two stride vectors which reference elements of the * specified size, optimize the dimensionality, the stride @@ -109,24 +107,19 @@ H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * Programmer: Robb Matzke * Saturday, October 11, 1997 * - * Modifications: - * Unrolled loops for common cases - * Quincey Koziol - * ?, ? ?, 2001? - * *------------------------------------------------------------------------- */ static void -H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM__stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1, hsize_t *stride2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM_vector_reduce_product(0, NULL)); + HDassert(1 == H5VM__vector_reduce_product(0, NULL)); HDassert(*elmt_size>0); /* @@ -247,11 +240,6 @@ H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * Programmer: Robb Matzke * Saturday, October 11, 1997 * - * Modifications: - * Unrolled loops for common cases - * Quincey Koziol - * ?, ? ?, 2001? - * *------------------------------------------------------------------------- */ hsize_t @@ -350,8 +338,6 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, * Programmer: Robb Matzke * Friday, October 17, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t @@ -401,8 +387,6 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -439,7 +423,7 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, /* Compute an optimal destination stride vector */ dst_start = H5VM_hyper_stride(n, size, total_size, offset, dst_stride); - H5VM_stride_optimize1(&n, &elmt_size, size, dst_stride); + H5VM__stride_optimize1(&n, &elmt_size, size, dst_stride); /* Copy */ ret_value = H5VM_stride_fill(n, elmt_size, size, dst_stride, dst+dst_start, @@ -476,11 +460,6 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * Unrolled loops for common cases - * Quincey Koziol - * ?, ? ?, 2001? - * *------------------------------------------------------------------------- */ herr_t @@ -624,7 +603,7 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, #endif /* NO_INLINED_CODE */ /* Optimize the strides as a pair */ - H5VM_stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride); + H5VM__stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride); /* Perform the copy in terms of stride */ ret_value = H5VM_stride_copy(n, elmt_size, size, @@ -645,8 +624,6 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, * Programmer: Robb Matzke * Saturday, October 11, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -665,7 +642,7 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, HDassert(elmt_size < SIZET_MAX); H5VM_vector_cpy(n, idx, size); - nelmts = H5VM_vector_reduce_product(n, size); + nelmts = H5VM__vector_reduce_product(n, size); for (i=0; i0); @@ -918,8 +889,6 @@ H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, * Programmer: Quincey Koziol * Thursday, June 18, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -975,8 +944,6 @@ H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count) * Programmer: Quincey Koziol * Monday, April 28, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1056,8 +1023,6 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) * Programmer: Quincey Koziol * Tuesday, June 22, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ hsize_t @@ -1140,8 +1105,6 @@ H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, * Programmer: Quincey Koziol * Wednesday, April 16, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 26f59e2..eaa9657 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 10, 1997 */ #ifndef H5VMprivate_H @@ -28,16 +28,16 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len, void *udata); /* Vector comparison functions like Fortran66 comparison operators */ -#define H5VM_vector_eq_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)==0) -#define H5VM_vector_lt_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)<0) -#define H5VM_vector_gt_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)>0) -#define H5VM_vector_le_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)<=0) -#define H5VM_vector_ge_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)>=0) -#define H5VM_vector_eq_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)==0) -#define H5VM_vector_lt_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)<0) -#define H5VM_vector_gt_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)>0) -#define H5VM_vector_le_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)<=0) -#define H5VM_vector_ge_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)>=0) +#define H5VM_vector_eq_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) == 0) +#define H5VM_vector_lt_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) < 0) +#define H5VM_vector_gt_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) > 0) +#define H5VM_vector_le_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) <= 0) +#define H5VM_vector_ge_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) >= 0) +#define H5VM_vector_eq_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) == 0) +#define H5VM_vector_lt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) < 0) +#define H5VM_vector_gt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) > 0) +#define H5VM_vector_le_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) <= 0) +#define H5VM_vector_ge_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) >= 0) /* Other functions */ #define H5VM_vector_cpy(N,DST,SRC) { \ @@ -139,7 +139,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, /*------------------------------------------------------------------------- - * Function: H5VM_vector_reduce_product + * Function: H5VM__vector_reduce_product * * Purpose: Product reduction of a vector. Vector elements and return * value are size_t because we usually want the number of @@ -153,17 +153,15 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE hsize_t H5_ATTR_UNUSED -H5VM_vector_reduce_product(unsigned n, const hsize_t *v) +H5VM__vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (n && !v) HGOTO_DONE(0) while (n--) ret_value *= *v++; @@ -173,7 +171,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM_vector_zerop_u + * Function: H5VM__vector_zerop_u * * Purpose: Determines if all elements of a vector are zero. * @@ -185,17 +183,15 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE htri_t H5_ATTR_UNUSED -H5VM_vector_zerop_u(int n, const hsize_t *v) +H5VM__vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (!v) HGOTO_DONE(TRUE) @@ -220,8 +216,6 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE htri_t H5_ATTR_UNUSED @@ -229,8 +223,8 @@ H5VM_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (!v) HGOTO_DONE(TRUE) @@ -243,7 +237,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM_vector_cmp_u + * Function: H5VM__vector_cmp_u * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. @@ -257,17 +251,15 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2) +H5VM__vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) @@ -285,7 +277,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM_vector_cmp_s + * Function: H5VM__vector_cmp_s * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. @@ -299,17 +291,15 @@ done: * Programmer: Robb Matzke * Wednesday, April 8, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2) +H5VM__vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) @@ -327,7 +317,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM_vector_inc + * Function: H5VM__vector_inc * * Purpose: Increments V1 by V2 * @@ -336,12 +326,10 @@ done: * Programmer: Robb Matzke * Monday, October 13, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) +H5VM__vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) *v1++ += *v2++; } @@ -369,7 +357,7 @@ static const unsigned char LogTable256[] = /*------------------------------------------------------------------------- - * Function: H5VM_log2_gen + * Function: H5VM__log2_gen * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -388,7 +376,7 @@ static const unsigned char LogTable256[] = *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM_log2_gen(uint64_t n) +H5VM__log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ register unsigned int t, tt, ttt; /* temporaries */ @@ -406,7 +394,7 @@ H5VM_log2_gen(uint64_t n) r = (t = (unsigned)(n >> 8)) ? 8 + (unsigned)LogTable256[t] : (unsigned)LogTable256[(uint8_t)n]; return(r); -} /* H5VM_log2_gen() */ +} /* H5VM__log2_gen() */ /* Lookup table for specialized log2(n) of power of two routine */ @@ -418,7 +406,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = /*------------------------------------------------------------------------- - * Function: H5VM_log2_of2 + * Function: H5VM__log2_of2 * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -436,17 +424,17 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_PURE unsigned -H5VM_log2_of2(uint32_t n) +H5VM__log2_of2(uint32_t n) { #ifndef NDEBUG HDassert(POWER_OF_TWO(n)); #endif /* NDEBUG */ return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); -} /* H5VM_log2_of2() */ +} /* H5VM__log2_of2() */ /*------------------------------------------------------------------------- - * Function: H5VM_power2up + * Function: H5VM__power2up * * Purpose: Round up a number to the next power of 2 * @@ -457,7 +445,7 @@ H5VM_log2_of2(uint32_t n) *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_CONST hsize_t -H5VM_power2up(hsize_t n) +H5VM__power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ @@ -469,11 +457,11 @@ H5VM_power2up(hsize_t n) ret_value <<= 1; return(ret_value); -} /* H5VM_power2up */ +} /* H5VM__power2up */ /*------------------------------------------------------------------------- - * Function: H5VM_limit_enc_size + * Function: H5VM__limit_enc_size * * Purpose: Determine the # of bytes needed to encode values within a * range from 0 to a given limit @@ -486,17 +474,17 @@ H5VM_power2up(hsize_t n) *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM_limit_enc_size(uint64_t limit) +H5VM__limit_enc_size(uint64_t limit) { - return (H5VM_log2_gen(limit) / 8) + 1; -} /* end H5VM_limit_enc_size() */ + return (H5VM__log2_gen(limit) / 8) + 1; +} /* end H5VM__limit_enc_size() */ static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; /*------------------------------------------------------------------------- - * Function: H5VM_bit_get + * Function: H5VM__bit_get * * Purpose: Determine the value of the n'th bit in a buffer. * @@ -515,15 +503,15 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, *------------------------------------------------------------------------- */ static H5_INLINE hbool_t H5_ATTR_UNUSED -H5VM_bit_get(const unsigned char *buf, size_t offset) +H5VM__bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE); -} /* end H5VM_bit_get() */ +} /* end H5VM__bit_get() */ /*------------------------------------------------------------------------- - * Function: H5VM_bit_set + * Function: H5VM__bit_set * * Purpose: Set/reset the n'th bit in a buffer. * @@ -542,14 +530,14 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) +H5VM__bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ if(val) buf[offset / 8] |= H5VM_bit_set_g[offset % 8]; else buf[offset / 8] &= H5VM_bit_clear_g[offset % 8]; -} /* end H5VM_bit_set() */ +} /* end H5VM__bit_set() */ #endif /* H5VMprivate_H */ diff --git a/src/H5WB.c b/src/H5WB.c index 8a85a3a..abeaf63 100644 --- a/src/H5WB.c +++ b/src/H5WB.c @@ -15,7 +15,7 @@ * * Created: H5WB.c * Jun 26 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements the "wrapped buffer" code for wrapping * an existing [staticly sized] buffer, in order to @@ -97,7 +97,6 @@ H5FL_BLK_DEFINE_STATIC(extra_buf); * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 26 2007 * *------------------------------------------------------------------------- @@ -151,7 +150,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 26 2007 * *------------------------------------------------------------------------- @@ -219,7 +217,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 26 2007 * *------------------------------------------------------------------------- @@ -257,7 +254,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 26 2007 * *------------------------------------------------------------------------- diff --git a/src/H5WBprivate.h b/src/H5WBprivate.h index 4460808..3ec9261 100644 --- a/src/H5WBprivate.h +++ b/src/H5WBprivate.h @@ -15,7 +15,7 @@ * * Created: H5WBprivate.h * Jun 26 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible wrapped buffer routines. * diff --git a/src/H5Z.c b/src/H5Z.c index 3bd4bcb..616db1f 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -68,7 +68,7 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL; #endif /* H5Z_DEBUG */ /* Local functions */ -static int H5Z_find_idx(H5Z_filter_t id); +static int H5Z__find_idx(H5Z_filter_t id); static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key); static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key); static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); @@ -713,7 +713,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_prelude_callback + * Function: H5Z__prelude_callback * * Purpose: Makes a dataset creation "prelude" callback for the "can_apply" * or "set_local" routines. @@ -726,14 +726,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, +H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hid_t space_id, H5Z_prelude_type_t prelude_type) { H5Z_class2_t *fclass; /* Individual filter information */ size_t u; /* Local index variable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pline->nused > 0); @@ -791,11 +791,11 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_prelude_callback() */ +} /* end H5Z__prelude_callback() */ /*------------------------------------------------------------------------- - * Function: H5Z_prepare_prelude_callback_dcpl + * Function: H5Z__prepare_prelude_callback_dcpl * * Purpose: Prepares to make a dataset creation "prelude" callback * for the "can_apply" or "set_local" routines. @@ -808,13 +808,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) +H5Z__prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { hid_t space_id = -1; /* ID for dataspace describing chunk */ H5O_layout_t *dcpl_layout = NULL; /* Dataset's layout information */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); HDassert(H5I_DATATYPE == H5I_get_type(type_id)); @@ -862,7 +862,7 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type } /* Make the callbacks */ - if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) + if (H5Z__prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") } } @@ -876,7 +876,7 @@ done: dcpl_layout = (H5O_layout_t *)H5MM_xfree(dcpl_layout); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_prepare_prelude_callback_dcpl() */ +} /* end H5Z__prepare_prelude_callback_dcpl() */ /*------------------------------------------------------------------------- @@ -902,7 +902,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "can apply" callbacks for filters in pipeline */ - if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) + if (H5Z__prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: @@ -933,7 +933,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "set local" callbacks for filters in pipeline */ - if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) + if (H5Z__prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: @@ -962,7 +962,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) + if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: @@ -995,7 +995,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) + if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: @@ -1168,7 +1168,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_find_idx + * Function: H5Z__find_idx * * Purpose: Given a filter ID return the offset in the global array * that holds all the registered filters. @@ -1178,20 +1178,20 @@ done: *------------------------------------------------------------------------- */ static int -H5Z_find_idx(H5Z_filter_t id) +H5Z__find_idx(H5Z_filter_t id) { size_t i; /* Local index variable */ int ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - for (i = 0; i < H5Z_table_used_g; i++) - if (H5Z_table_g[i].id == id) + for(i = 0; i < H5Z_table_used_g; i++) + if(H5Z_table_g[i].id == id) HGOTO_DONE((int)i) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_find_idx() */ +} /* end H5Z__find_idx() */ /*------------------------------------------------------------------------- @@ -1213,7 +1213,7 @@ H5Z_find(H5Z_filter_t id) FUNC_ENTER_NOAPI(NULL) /* Get the index in the global table */ - if ((idx = H5Z_find_idx(id)) < 0) + if ((idx = H5Z__find_idx(id)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) /* Set return value */ @@ -1290,7 +1290,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), * try to load it dynamically and register it. Otherwise, return failure */ - if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { H5PL_key_t key; const H5Z_class2_t *filter_info; hbool_t issue_error = FALSE; @@ -1303,7 +1303,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + if((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; } else @@ -1365,7 +1365,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, failed |= (unsigned)1 << idx; continue; /* filter excluded */ } - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + if((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { /* Check if filter is optional -- If it isn't, then error */ if((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 6d7b87e..09cca14 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, August 27, 1999 */ @@ -34,26 +34,26 @@ #endif /* Local function prototypes */ -static size_t H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, +static size_t H5Z__filter_deflate (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_DEFLATE[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_DEFLATE, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ "deflate", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - H5Z_filter_deflate, /* The actual filter function */ + H5Z__filter_deflate, /* The actual filter function */ }}; #define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * (double)1.001f) + 12) /*------------------------------------------------------------------------- - * Function: H5Z_filter_deflate + * Function: H5Z__filter_deflate * * Purpose: Implement an I/O filter around the 'deflate' algorithm in * libz @@ -64,12 +64,10 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{ * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, +H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { @@ -77,7 +75,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, int status; /* Status from zlib operation */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(*buf_size > 0); diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index c40e9b4..07e2f79 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -26,26 +26,26 @@ #include "H5Zpkg.h" /* Data filters */ /* Local function prototypes */ -static size_t H5Z_filter_fletcher32 (unsigned flags, size_t cd_nelmts, +static size_t H5Z__filter_fletcher32(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_FLETCHER32[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_FLETCHER32, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ "fletcher32", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - H5Z_filter_fletcher32, /* The actual filter function */ + H5Z__filter_fletcher32, /* The actual filter function */ }}; #define FLETCHER_LEN 4 /*------------------------------------------------------------------------- - * Function: H5Z_filter_fletcher32 + * Function: H5Z__filter_fletcher32 * * Purpose: Implement an I/O filter of Fletcher32 Checksum * @@ -55,21 +55,10 @@ const H5Z_class2_t H5Z_FLETCHER32[1] = {{ * Programmer: Raymond Lu * Jan 3, 2003 * - * Modifications: - * Raymond Lu - * July 8, 2005 - * 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. We'll check both - * the correct checksum and the wrong checksum to be consistent - * with Release 1.6.2 and before. *------------------------------------------------------------------------- */ static size_t -H5Z_filter_fletcher32 (unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, const unsigned H5_ATTR_UNUSED cd_values[], +H5Z__filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, const unsigned H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *outbuf = NULL; /* Pointer to new buffer */ @@ -80,7 +69,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, const un uint8_t tmp; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC HDassert(sizeof(uint32_t)>=4); diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h index 97e158c..e4fd90c 100644 --- a/src/H5Zmodule.h +++ b/src/H5Zmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 8c0e876..d29343b 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -34,34 +34,34 @@ typedef struct { } parms_atomic; /* Local function prototypes */ -static htri_t H5Z_can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static herr_t H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +static htri_t H5Z__can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static herr_t H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); -static void H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms); -static void H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms); -static herr_t H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms); -static herr_t H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms); +static void H5Z__calc_parms_nooptype(size_t *cd_values_actual_nparms); +static void H5Z__calc_parms_atomic(size_t *cd_values_actual_nparms); +static herr_t H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms); +static herr_t H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms); -static herr_t H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, +static herr_t H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]); -static herr_t H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, +static herr_t H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress); -static herr_t H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, +static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress); -static herr_t H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, +static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress); -static void H5Z_nbit_next_byte(size_t *j, size_t *buf_len); -static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, +static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len); +static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len); -static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, +static void H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len); -static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size); -static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p); static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], @@ -71,29 +71,27 @@ static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data unsigned *parms_index); static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, const unsigned parms[]); -static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size); -static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p); -static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, +static void H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index); -static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, +static void H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index); -static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +static void H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size, const unsigned parms[]); /* This message derives from H5Z */ H5Z_class2_t H5Z_NBIT[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_NBIT, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "nbit", /* Filter name for debugging */ - H5Z_can_apply_nbit, /* The "can apply" callback */ - H5Z_set_local_nbit, /* The "set local" callback */ - H5Z_filter_nbit, /* The actual filter function */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "nbit", /* Filter name for debugging */ + H5Z__can_apply_nbit, /* The "can apply" callback */ + H5Z__set_local_nbit, /* The "set local" callback */ + H5Z__filter_nbit, /* The actual filter function */ }}; /* Local macros */ @@ -109,7 +107,7 @@ H5Z_class2_t H5Z_NBIT[1] = {{ /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_nbit + * Function: H5Z__can_apply_nbit * * Purpose: Check the parameters for nbit compression for validity and * whether they fit a particular dataset. @@ -120,17 +118,15 @@ H5Z_class2_t H5Z_NBIT[1] = {{ * Programmer: Xiaowen Wu * Tuesday, December 21, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -146,11 +142,11 @@ H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_nbit() */ +} /* end H5Z__can_apply_nbit() */ /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_nooptype + * Function: H5Z__calc_parms_nooptype * * Purpose: Calculate the number of parameters of array cd_values[] * of datatype that is not integer, nor floating-point, nor @@ -159,12 +155,10 @@ done: * Programmer: Xiaowen Wu * Thursday, March 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static void -H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) +H5Z__calc_parms_nooptype(size_t *cd_values_actual_nparms) { /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -175,7 +169,7 @@ H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_atomic + * Function: H5Z__calc_parms_atomic * * Purpose: Calculate the number of parameters of array cd_values[] * of atomic datatype whose datatype class is integer @@ -184,12 +178,10 @@ H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) * Programmer: Xiaowen Wu * Saturday, January 29, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static void -H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) +H5Z__calc_parms_atomic(size_t *cd_values_actual_nparms) { /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -209,7 +201,7 @@ H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_array + * Function: H5Z__calc_parms_array * * Purpose: Calculate the number of parameters of array cd_values[] * for a given datatype identifier type_id @@ -221,18 +213,16 @@ H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) * Programmer: Xiaowen Wu * Wednesday, January 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) +H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) { H5T_t *dtype_base = NULL; /* Array datatype's base datatype */ H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -252,16 +242,16 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) switch(dtype_base_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(cd_values_actual_nparms); + H5Z__calc_parms_atomic(cd_values_actual_nparms); break; case H5T_ARRAY: - if(H5Z_calc_parms_array(dtype_base, cd_values_actual_nparms) == FAIL) + if(H5Z__calc_parms_array(dtype_base, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_calc_parms_compound(dtype_base, cd_values_actual_nparms) == FAIL) + if(H5Z__calc_parms_compound(dtype_base, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -273,7 +263,7 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) case H5T_ENUM: case H5T_VLEN: /* Other datatype classes: nbit does no compression */ - H5Z_calc_parms_nooptype(cd_values_actual_nparms); + H5Z__calc_parms_nooptype(cd_values_actual_nparms); break; case H5T_NO_CLASS: @@ -290,11 +280,11 @@ done: HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_calc_parms_array() */ +} /* end H5Z__calc_parms_array() */ /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_compound + * Function: H5Z__calc_parms_compound * * Purpose: Calculate the number of parameters of array cd_values[] * for a given datatype identifier type_id @@ -306,19 +296,17 @@ done: * Programmer: Xiaowen Wu * Wednesday, January 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) +H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) { int nmembers; /* Compound datatype's number of members */ H5T_t *dtype_member = NULL; /* Compound datatype's member datatype */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Store compound datatype class code */ *cd_values_actual_nparms += 1; @@ -352,16 +340,16 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) switch(dtype_member_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(cd_values_actual_nparms); + H5Z__calc_parms_atomic(cd_values_actual_nparms); break; case H5T_ARRAY: - if(H5Z_calc_parms_array(dtype_member, cd_values_actual_nparms) == FAIL) + if(H5Z__calc_parms_array(dtype_member, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_calc_parms_compound(dtype_member, cd_values_actual_nparms) == FAIL) + if(H5Z__calc_parms_compound(dtype_member, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -373,7 +361,7 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) case H5T_ENUM: case H5T_VLEN: /* Other datatype classes: nbit does no compression */ - H5Z_calc_parms_nooptype(cd_values_actual_nparms); + H5Z__calc_parms_nooptype(cd_values_actual_nparms); break; case H5T_NO_CLASS: @@ -400,7 +388,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_nooptype + * Function: H5Z__set_parms_nooptype * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is not integer, nor @@ -413,17 +401,15 @@ done: * Programmer: Xiaowen Wu * Tuesday, April 5, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]) +H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]) { size_t dtype_size; /* No-op datatype's size (in bytes) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_NOOPTYPE; @@ -438,11 +424,11 @@ H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_nooptype() */ +} /* end H5Z__set_parms_nooptype() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_atomic + * Function: H5Z__set_parms_atomic * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is integer or floating point @@ -453,12 +439,10 @@ done: * Programmer: Xiaowen Wu * Tuesday, January 11, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, +H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress) { H5T_order_t dtype_order; /* Atomic datatype's endianness order */ @@ -468,7 +452,7 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned dtype_offset; /* Atomic datatype's offset (in bits) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_ATOMIC; @@ -532,11 +516,11 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, *need_not_compress = FALSE; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_atomic() */ +} /* end H5Z__set_parms_atomic() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_array + * Function: H5Z__set_parms_array * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is array datatype @@ -547,12 +531,10 @@ done: * Programmer: Xiaowen Wu * Tuesday, April 5, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, +H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress) { H5T_t *dtype_base = NULL; /* Array datatype's base datatype */ @@ -561,7 +543,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, htri_t is_vlstring; /* flag indicating if datatype is variable-length string */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_ARRAY; @@ -586,17 +568,17 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, switch(dtype_base_class) { case H5T_INTEGER: case H5T_FLOAT: - if(H5Z_set_parms_atomic(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_atomic(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if(H5Z_set_parms_array(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_array(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_set_parms_compound(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_compound(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -609,7 +591,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, if(dtype_base_class == H5T_VLEN || is_vlstring) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "datatype not supported by nbit") - if(H5Z_set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) + if(H5Z__set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -619,7 +601,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, case H5T_OPAQUE: case H5T_REFERENCE: case H5T_ENUM: - if(H5Z_set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) + if(H5Z__set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -637,11 +619,11 @@ done: HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_array() */ +} /* end H5Z__set_parms_array() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_compound + * Function: H5Z__set_parms_compound * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is compound datatype @@ -652,12 +634,10 @@ done: * Programmer: Xiaowen Wu * Tuesday, April 5, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, +H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress) { int snmembers; /* Compound datatype's number of members */ @@ -671,7 +651,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set "local" parameter for compound datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_COMPOUND; @@ -713,17 +693,17 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, switch(dtype_member_class) { case H5T_INTEGER: case H5T_FLOAT: - if(H5Z_set_parms_atomic(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_atomic(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if(H5Z_set_parms_array(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_array(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_set_parms_compound(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_compound(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -761,7 +741,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, case H5T_REFERENCE: case H5T_ENUM: /* other datatype that nbit does no compression */ - if(H5Z_set_parms_nooptype(dtype_member, cd_values_index, cd_values) < 0) + if(H5Z__set_parms_nooptype(dtype_member, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -789,7 +769,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_set_local_nbit + * Function: H5Z__set_local_nbit * * Purpose: Set the "local" dataset parameters for nbit compression. * @@ -799,12 +779,10 @@ done: * Programmer: Xiaowen Wu * Tuesday, January 11, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t *type; /* Datatype */ @@ -819,7 +797,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) hbool_t need_not_compress; /* Flag if TRUE indicating no need to do nbit compression */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -839,16 +817,16 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) switch(dtype_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(&cd_values_actual_nparms); + H5Z__calc_parms_atomic(&cd_values_actual_nparms); break; case H5T_ARRAY: - if(H5Z_calc_parms_array(type, &cd_values_actual_nparms) < 0) + if(H5Z__calc_parms_array(type, &cd_values_actual_nparms) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_calc_parms_compound(type, &cd_values_actual_nparms) < 0) + if(H5Z__calc_parms_compound(type, &cd_values_actual_nparms) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -909,17 +887,17 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) switch(dtype_class) { case H5T_INTEGER: case H5T_FLOAT: - if(H5Z_set_parms_atomic(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if(H5Z__set_parms_atomic(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if(H5Z_set_parms_array(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if(H5Z__set_parms_array(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_set_parms_compound(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if(H5Z__set_parms_compound(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -958,11 +936,11 @@ done: H5MM_xfree(cd_values); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_nbit() */ +} /* end H5Z__set_local_nbit() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_nbit + * Function: H5Z__filter_nbit * * Purpose: Implement an I/O filter for storing packed nbit data * @@ -975,7 +953,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { unsigned char *outbuf; /* pointer to new output buffer */ @@ -983,7 +961,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], unsigned d_nelmts = 0; /* number of elements in the chunk */ size_t ret_value = 0; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments * cd_values[0] stores actual number of parameters in cd_values[] @@ -1023,7 +1001,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit compression") /* compress the buffer, size_out will be changed */ - H5Z_nbit_compress((unsigned char *)*buf, d_nelmts, outbuf, &size_out, cd_values); + H5Z__nbit_compress((unsigned char *)*buf, d_nelmts, outbuf, &size_out, cd_values); } /* end else */ /* free the input buffer */ @@ -1036,7 +1014,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_filter_nbit() */ +} /* end H5Z__filter_nbit() */ /* ======== Nbit Algorithm =============================================== * assume one byte has 8 bit @@ -1047,14 +1025,14 @@ done: */ static void -H5Z_nbit_next_byte(size_t *j, size_t *buf_len) +H5Z__nbit_next_byte(size_t *j, size_t *buf_len) { ++(*j); *buf_len = 8 * sizeof(unsigned char); } static void -H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, +H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len) { @@ -1088,7 +1066,7 @@ H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k data[data_offset + k] = (unsigned char)( ((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len)) << dat_offset); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if(dat_len == 0) return; @@ -1100,7 +1078,7 @@ H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k } static void -H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, +H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size) { unsigned i; /* index */ @@ -1114,7 +1092,7 @@ H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, data[data_offset + i] = (unsigned char)(((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len))); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if(dat_len == 0) continue; @@ -1125,7 +1103,7 @@ H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, } static void -H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, +H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p) { /* begin_i: the index of byte having first significant bit @@ -1145,7 +1123,7 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, end_i = p->offset / 8; for(k = (int)begin_i; k >= (int)end_i; k--) - H5Z_nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, + H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } else { /* big endian */ @@ -1160,7 +1138,7 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, end_i = ((unsigned)datatype_len - p->offset) / 8 - 1; for(k = (int)begin_i; k <= (int)end_i; k++) - H5Z_nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, + H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } } @@ -1192,7 +1170,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, n = total_size / p.size; for(i = 0; i < n; i++) - H5Z_nbit_decompress_one_atomic(data, data_offset + i * p.size, + H5Z__nbit_decompress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p); break; @@ -1222,7 +1200,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, case H5Z_NBIT_NOOPTYPE: (*parms_index)++; /* skip size of no-op type */ - H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z__nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; default: @@ -1269,7 +1247,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, if(p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") - H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, + H5Z__nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p); break; @@ -1288,7 +1266,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, case H5Z_NBIT_NOOPTYPE: /* Advance past member size */ (*parms_index)++; - H5Z_nbit_decompress_one_nooptype(data, data_offset+member_offset, + H5Z__nbit_decompress_one_nooptype(data, data_offset+member_offset, buffer, j, buf_len, member_size); break; @@ -1335,7 +1313,7 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") for(i = 0; i < d_nelmts; i++) - H5Z_nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, &p); + H5Z__nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, &p); break; case H5Z_NBIT_ARRAY: @@ -1367,7 +1345,7 @@ done: } static void -H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, +H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len) { @@ -1396,7 +1374,7 @@ H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, } else { buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if(dat_len == 0) return; @@ -1406,7 +1384,7 @@ H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, } static void -H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, +H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size) { unsigned i; /* index */ @@ -1420,7 +1398,7 @@ H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if(dat_len == 0) continue; @@ -1430,7 +1408,7 @@ H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, } static void -H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, +H5Z__nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p) { /* begin_i: the index of byte having first significant bit @@ -1450,7 +1428,7 @@ H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, end_i = p->offset / 8; for(k = (int)begin_i; k >= (int)end_i; k--) - H5Z_nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, + H5Z__nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } else { /* big endian */ @@ -1465,13 +1443,13 @@ H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, end_i = ((unsigned)datatype_len - p->offset) / 8 - 1; for(k = (int)begin_i; k <= (int)end_i; k++) - H5Z_nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, + H5Z__nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } } static void -H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, +H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index) { @@ -1489,7 +1467,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, p.offset = parms[(*parms_index)++]; n = total_size / p.size; for(i = 0; i < n; i++) - H5Z_nbit_compress_one_atomic(data, data_offset + i * p.size, + H5Z__nbit_compress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p); break; @@ -1498,7 +1476,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, n = total_size / base_size; /* number of base_type elements inside the array datatype */ begin_index = *parms_index; for(i = 0; i < n; i++) { - H5Z_nbit_compress_one_array(data, data_offset + i * base_size, + H5Z__nbit_compress_one_array(data, data_offset + i * base_size, buffer, j, buf_len, parms, parms_index); *parms_index = begin_index; } @@ -1509,7 +1487,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, n = total_size / base_size; /* number of base_type elements inside the array datatype */ begin_index = *parms_index; for(i = 0; i < n; i++) { - H5Z_nbit_compress_one_compound(data, data_offset + i * base_size, + H5Z__nbit_compress_one_compound(data, data_offset + i * base_size, buffer, j, buf_len, parms, parms_index); *parms_index = begin_index; } @@ -1517,7 +1495,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, case H5Z_NBIT_NOOPTYPE: (*parms_index)++; /* skip size of no-op type */ - H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z__nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; default: @@ -1526,7 +1504,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, } static void -H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, +H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index) { @@ -1546,23 +1524,23 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, p.order = parms[(*parms_index)++]; p.precision = parms[(*parms_index)++]; p.offset = parms[(*parms_index)++]; - H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, + H5Z__nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p); break; case H5Z_NBIT_ARRAY: - H5Z_nbit_compress_one_array(data, data_offset + member_offset, + H5Z__nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms, parms_index); break; case H5Z_NBIT_COMPOUND: - H5Z_nbit_compress_one_compound(data, data_offset+member_offset, + H5Z__nbit_compress_one_compound(data, data_offset+member_offset, buffer, j, buf_len, parms, parms_index); break; case H5Z_NBIT_NOOPTYPE: size = parms[(*parms_index)++]; - H5Z_nbit_compress_one_nooptype(data, data_offset+member_offset, + H5Z__nbit_compress_one_nooptype(data, data_offset+member_offset, buffer, j, buf_len, size); break; @@ -1573,7 +1551,7 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, } static void -H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size, const unsigned parms[]) { /* i: index of data, new_size: index of buffer, @@ -1599,14 +1577,14 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, p.offset = parms[7]; for(i = 0; i < d_nelmts; i++) - H5Z_nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, &p); + H5Z__nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, &p); break; case H5Z_NBIT_ARRAY: size = parms[4]; parms_index = 4; for(i = 0; i < d_nelmts; i++) { - H5Z_nbit_compress_one_array(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); + H5Z__nbit_compress_one_array(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); parms_index = 4; } break; @@ -1615,7 +1593,7 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size = parms[4]; parms_index = 4; for(i = 0; i < d_nelmts; i++) { - H5Z_nbit_compress_one_compound(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); + H5Z__nbit_compress_one_compound(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); parms_index = 4; } break; diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index fbc6fc4..6868da6 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Thursday, April 16, 1998 */ diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index a2a44fa..b37dcf3 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Thursday, April 16, 1998 */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 7bdc283..83f170e 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -36,55 +36,55 @@ enum H5Z_scaleoffset_t {t_bad=0, t_uchar=1, t_ushort, t_uint, t_ulong, t_ulong_l t_float, t_double}; /* Local function prototypes */ -static htri_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class, +static htri_t H5Z__can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static enum H5Z_scaleoffset_t H5Z__scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign); -static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, +static herr_t H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, unsigned cd_values[], int need_convert); -static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, +static herr_t H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); -static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size); -static H5_ATTR_CONST unsigned H5Z_scaleoffset_log2(unsigned long long num); -static void H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, +static void H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size); +static H5_ATTR_CONST unsigned H5Z__scaleoffset_log2(unsigned long long num); +static void H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval); -static void H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, +static void H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t minbits, unsigned long long minval); -static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, +static herr_t H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval, double D_val); -static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, +static herr_t H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t minbits, unsigned long long minval, double D_val); -static void H5Z_scaleoffset_next_byte(size_t *j, unsigned *buf_len); -static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, +static void H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len); +static void H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len); -static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, +static void H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len); -static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p); -static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p); -static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, +static void H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p); -static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +static void H5Z__scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size, parms_atomic p); /* This message derives from H5Z */ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_SCALEOFFSET, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "scaleoffset", /* Filter name for debugging */ - H5Z_can_apply_scaleoffset, /* The "can apply" callback */ - H5Z_set_local_scaleoffset, /* The "set local" callback */ - H5Z_filter_scaleoffset, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_SCALEOFFSET, /* Filter id number */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "scaleoffset", /* Filter name for debugging */ + H5Z__can_apply_scaleoffset, /* The "can apply" callback */ + H5Z__set_local_scaleoffset, /* The "set local" callback */ + H5Z__filter_scaleoffset, /* The actual filter function */ }}; /* Local macros */ @@ -192,7 +192,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \ } @@ -207,7 +207,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(unsigned type, cd_values, fill_val) \ } @@ -235,7 +235,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \ } @@ -422,7 +422,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \ H5Z_scaleoffset_check_1(type, max, min, minbits) \ span = (type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)(span+1)); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span+1)); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ @@ -433,7 +433,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_1(type, max, min, minbits) \ span = (type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ @@ -455,7 +455,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \ H5Z_scaleoffset_check_2(type, max, min, minbits) \ span = (unsigned type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)(span + 1)); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1)); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) \ if(*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ @@ -466,7 +466,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_2(type, max, min, minbits) \ span = (unsigned type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) \ if(*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ @@ -553,14 +553,14 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \ H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) \ span = (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) + 1); \ - *minbits = H5Z_scaleoffset_log2(span + 1); \ + *minbits = H5Z__scaleoffset_log2(span + 1); \ if(*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ H5Z_scaleoffset_modify_1(i, type, pow_fun, abs_fun, lround_fun, llround_fun, buf, d_nelmts, filval, minbits, min, D_val) \ } else { /* fill value undefined */ \ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) \ span = (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) + 1); \ - *minbits = H5Z_scaleoffset_log2(span); \ + *minbits = H5Z__scaleoffset_log2(span); \ if(*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ H5Z_scaleoffset_modify_2(i, type, pow_fun, lround_fun, llround_fun, buf, d_nelmts, min, D_val) \ } \ @@ -667,7 +667,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_scaleoffset + * Function: H5Z__can_apply_scaleoffset * * Purpose: Check the parameters for scaleoffset compression for * validity and whether they fit a particular dataset. @@ -678,19 +678,17 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ * Programmer: Xiaowen Wu * Friday, February 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ H5T_class_t dtype_class; /* Datatype's class */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -717,11 +715,11 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_scaleoffset() */ +} /* end H5Z__can_apply_scaleoffset() */ /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_get_type + * Function: H5Z__scaleoffset_get_type * * Purpose: Get the specific integer type based on datatype size and sign * or floating-point type based on size @@ -732,17 +730,15 @@ done: * Programmer: Xiaowen Wu * Wednesday, April 13, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static enum H5Z_scaleoffset_t -H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) +H5Z__scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) { enum H5Z_scaleoffset_t type = t_bad; /* integer type */ enum H5Z_scaleoffset_t ret_value = t_bad; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) { if(dtype_sign==H5Z_SCALEOFFSET_SGN_NONE) { /* unsigned integer */ @@ -786,7 +782,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_set_parms_fillval + * Function: H5Z__scaleoffset_set_parms_fillval * * Purpose: Get the fill value of the dataset and store in cd_values[] * @@ -799,13 +795,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, +H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, unsigned cd_values[], int need_convert) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(scale_type == t_uchar) H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert) @@ -834,11 +830,11 @@ H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_scaleoffset_set_parms_fillval() */ +} /* end H5Z__scaleoffset_set_parms_fillval() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_scaleoffset + * Function: H5Z__set_local_scaleoffset * * Purpose: Set the "local" dataset parameters for scaleoffset * compression. @@ -849,12 +845,10 @@ done: * Programmer: Xiaowen Wu * Friday, February 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ H5T_t *type; /* Datatype */ @@ -871,7 +865,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) H5D_fill_value_t status; /* Status of fill value in property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -997,12 +991,12 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) need_convert = TRUE; /* Before getting fill value, get its type */ - if((scale_type = H5Z_scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS], + if((scale_type = H5Z__scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS], cd_values[H5Z_SCALEOFFSET_PARM_SIZE], cd_values[H5Z_SCALEOFFSET_PARM_SIGN])) == 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot use C integer datatype for cast") /* Get dataset fill value and store in cd_values[] */ - if(H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0) + if(H5Z__scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "unable to set fill value") } /* end else */ @@ -1012,11 +1006,11 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_scaleoffset() */ +} /* end H5Z__set_local_scaleoffset() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_scaleoffset + * Function: H5Z__filter_scaleoffset * * Purpose: Implement an I/O filter for storing packed integer * data using scale and offset method. @@ -1027,12 +1021,10 @@ done: * Programmer: Xiaowen Wu * Monday, February 7, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* return value */ @@ -1053,7 +1045,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value unsigned i; /* index */ parms_atomic p; /* parameters needed for compress/decompress functions */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) @@ -1179,7 +1171,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* convert to dataset datatype endianness order if needed */ if(need_convert) - H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); + H5Z__scaleoffset_convert(outbuf, d_nelmts, p.size); *buf = outbuf; outbuf = NULL; @@ -1190,31 +1182,31 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* decompress the buffer if minbits not equal to zero */ if(minbits != 0) - H5Z_scaleoffset_decompress(outbuf, d_nelmts, (unsigned char*)(*buf)+buf_offset, p); + H5Z__scaleoffset_decompress(outbuf, d_nelmts, (unsigned char*)(*buf)+buf_offset, p); else { /* fill value is not defined and all data elements have the same value */ for(i = 0; i < size_out; i++) outbuf[i] = 0; } /* before postprocess, get memory type */ - if((type = H5Z_scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0) + if((type = H5Z__scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot use C integer datatype for cast") /* postprocess after decompression */ if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, + H5Z__scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, cd_values, minbits, minval); if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) if(scale_type==0) { /* variable-minimum-bits method */ - if(H5Z_scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, + if(H5Z__scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, cd_values, minbits, minval, D_val)==FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "post-decompression failed") } /* after postprocess, convert to dataset datatype endianness order if needed */ if(need_convert) - H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); + H5Z__scaleoffset_convert(outbuf, d_nelmts, p.size); } /* output; compress */ else { @@ -1222,20 +1214,20 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* before preprocess, convert to memory endianness order if needed */ if(need_convert) - H5Z_scaleoffset_convert(*buf, d_nelmts, p.size); + H5Z__scaleoffset_convert(*buf, d_nelmts, p.size); /* before preprocess, get memory type */ - if((type = H5Z_scaleoffset_get_type(dtype_class, p.size, dtype_sign))==0) + if((type = H5Z__scaleoffset_get_type(dtype_class, p.size, dtype_sign))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot use C integer datatype for cast") /* preprocess before compression */ if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, + H5Z__scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, cd_values, &minbits, &minval); if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) if(scale_type==0) { /* variable-minimum-bits method */ - if(H5Z_scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, + if(H5Z__scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, cd_values, &minbits, &minval, D_val)==FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed") } @@ -1289,7 +1281,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value * all data elements have the same value */ if(minbits != 0) - H5Z_scaleoffset_compress((unsigned char *)*buf, d_nelmts, outbuf + buf_offset, size_out - buf_offset, p); + H5Z__scaleoffset_compress((unsigned char *)*buf, d_nelmts, outbuf + buf_offset, size_out - buf_offset, p); } /* free the input buffer */ @@ -1320,7 +1312,7 @@ done: * or from big-endian to little-endian 2/21/2005 */ static void -H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) +H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) { if(dtype_size > 1) { size_t i, j; @@ -1335,13 +1327,13 @@ H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) buffer[i + dtype_size - 1 - j] = temp; } /* end for */ } /* end if */ -} /* end H5Z_scaleoffset_convert() */ +} /* end H5Z__scaleoffset_convert() */ /* return ceiling of floating-point log2 function * receive unsigned integer as argument 3/10/2005 */ static unsigned -H5Z_scaleoffset_log2(unsigned long long num) +H5Z__scaleoffset_log2(unsigned long long num) { unsigned v = 0; unsigned long long lower_bound = 1; /* is power of 2, largest value <= num */ @@ -1360,7 +1352,7 @@ H5Z_scaleoffset_log2(unsigned long long num) /* precompress for integer type */ static void -H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval) { if(type == t_uchar) @@ -1392,7 +1384,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse return; } span = (unsigned char)(max - min + 1); - *minbits = H5Z_scaleoffset_log2((unsigned long long)(span+1)); + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span+1)); } else /* minbits already set, only calculate min */ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ @@ -1407,7 +1399,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse return; } span = (unsigned char)(max - min + 1); - *minbits = H5Z_scaleoffset_log2((unsigned long long)span); + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); } else /* minbits already set, only calculate min */ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) if(*minbits != sizeof(signed char) * 8) /* change values if minbits != full precision */ @@ -1432,7 +1424,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse /* postdecompress for integer type */ static void -H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t minbits, unsigned long long minval) { long long sminval = *(long long*)&minval; /* for signed integer types */ @@ -1481,13 +1473,13 @@ H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleof /* precompress for floating-point type, variable-minimum-bits method success: non-negative, failure: negative 4/15/05 */ static herr_t -H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval, double D_val) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(type == t_float) H5Z_scaleoffset_precompress_3(float, HDpowf, HDfabsf, HDroundf, HDlroundf, HDllroundf, data, d_nelmts, @@ -1503,14 +1495,14 @@ done: /* postdecompress for floating-point type, variable-minimum-bits method success: non-negative, failure: negative 4/15/05 */ static herr_t -H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t minbits, unsigned long long minval, double D_val) { long long sminval = (long long)minval; /* for signed integer types */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(type == t_float) H5Z_scaleoffset_postdecompress_3(float, HDpowf, data, d_nelmts, filavail, @@ -1524,14 +1516,14 @@ done: } static void -H5Z_scaleoffset_next_byte(size_t *j, unsigned *buf_len) +H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len) { ++(*j); *buf_len = 8 * sizeof(unsigned char); } static void -H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, +H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len) { @@ -1552,7 +1544,7 @@ H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, else { data[data_offset + k] = (unsigned char)((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len)); dat_len -= *buf_len; - H5Z_scaleoffset_next_byte(j, buf_len); + H5Z__scaleoffset_next_byte(j, buf_len); if(dat_len == 0) return; @@ -1563,7 +1555,7 @@ H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, } static void -H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, +H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ @@ -1579,7 +1571,7 @@ H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; for(k = (int)begin_i; k >= 0; k--) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, + H5Z__scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, dtype_len); } else { /* big endian */ @@ -1588,13 +1580,13 @@ H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, begin_i = (dtype_len - p.minbits) / 8; for(k = (int)begin_i; k <= (int)(p.size - 1); k++) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, + H5Z__scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, dtype_len); } } static void -H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, +H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p) { /* i: index of data, j: index of buffer, @@ -1612,11 +1604,11 @@ H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, /* decompress */ for(i = 0; i < d_nelmts; i++) - H5Z_scaleoffset_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); + H5Z__scaleoffset_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); } static void -H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, +H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len) { @@ -1636,7 +1628,7 @@ H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, } else { buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_scaleoffset_next_byte(j, buf_len); + H5Z__scaleoffset_next_byte(j, buf_len); if(dat_len == 0) return; @@ -1646,7 +1638,7 @@ H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, } static void -H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, +H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ @@ -1662,7 +1654,7 @@ H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; for(k = (int)begin_i; k >= 0; k--) - H5Z_scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, + H5Z__scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, dtype_len); } else { /* big endian */ @@ -1670,13 +1662,13 @@ H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, begin_i = (dtype_len - p.minbits) / 8; for(k = (int)begin_i; k <= (int)(p.size - 1); k++) - H5Z_scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, + H5Z__scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, dtype_len); } } static void -H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, +H5Z__scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size, parms_atomic p) { /* i: index of data, j: index of buffer, @@ -1694,6 +1686,6 @@ H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, /* compress */ for(i = 0; i < d_nelmts; i++) - H5Z_scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); + H5Z__scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); } diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index b1d0722..224c78e 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -23,20 +23,20 @@ #include "H5Zpkg.h" /* Data filters */ /* Local function prototypes */ -static herr_t H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, +static herr_t H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_SHUFFLE, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ "shuffle", /* Filter name for debugging */ NULL, /* The "can apply" callback */ - H5Z_set_local_shuffle, /* The "set local" callback */ - H5Z_filter_shuffle, /* The actual filter function */ + H5Z__set_local_shuffle, /* The "set local" callback */ + H5Z__filter_shuffle, /* The actual filter function */ }}; /* Local macros */ @@ -44,7 +44,7 @@ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_shuffle + * Function: H5Z__set_local_shuffle * * Purpose: Set the "local" dataset parameter for data shuffling to be * the size of the datatype. @@ -55,12 +55,10 @@ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ * Programmer: Quincey Koziol * Monday, April 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t *type; /* Datatype */ @@ -69,7 +67,7 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_i unsigned cd_values[H5Z_SHUFFLE_TOTAL_NPARMS]; /* Filter parameters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -93,11 +91,11 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_i done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_shuffle() */ +} /* end H5Z__set_local_shuffle() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_shuffle + * Function: H5Z__filter_shuffle * * Purpose: Implement an I/O filter which "de-interlaces" a block of data * by putting all the bytes in a byte-position for each element @@ -112,14 +110,10 @@ done: * Programmer: Kent Yang * Wednesday, November 13, 2002 * - * Modifications: - * Quincey Koziol, November 13, 2002 - * Cleaned up code. - * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *dest = NULL; /* Buffer to deposit [un]shuffled bytes into */ @@ -134,7 +128,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t leftover; /* Extra bytes at end of buffer */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Check arguments */ if (cd_nelmts!=H5Z_SHUFFLE_TOTAL_NPARMS || cd_values[H5Z_SHUFFLE_PARM_SIZE]==0) diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 8ed173e..c72c499 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -32,27 +32,27 @@ #endif /* Local function prototypes */ -static htri_t H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static herr_t H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_szip (unsigned flags, size_t cd_nelmts, +static htri_t H5Z__can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static herr_t H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ H5Z_class2_t H5Z_SZIP[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_SZIP, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "szip", /* Filter name for debugging */ - H5Z_can_apply_szip, /* The "can apply" callback */ - H5Z_set_local_szip, /* The "set local" callback */ - H5Z_filter_szip, /* The actual filter function */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "szip", /* Filter name for debugging */ + H5Z__can_apply_szip, /* The "can apply" callback */ + H5Z__set_local_szip, /* The "set local" callback */ + H5Z__filter_szip, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_szip + * Function: H5Z__can_apply_szip * * Purpose: Check the parameters for szip compression for validity and * whether they fit a particular dataset. @@ -73,14 +73,14 @@ H5Z_class2_t H5Z_SZIP[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ unsigned dtype_size; /* Datatype's size (in bits) */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -105,11 +105,11 @@ H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_szip() */ +} /* end H5Z__can_apply_szip() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_szip + * Function: H5Z__set_local_szip * * Purpose: Set the "local" dataset parameters for szip compression. * @@ -119,18 +119,10 @@ done: * Programmer: Quincey Koziol * Monday, April 7, 2003 * - * Modifications: Used new logic to set the size of the scanline parameter. - * Now SZIP compression can be applied to the chunk - * of any shape and size with only one restriction: the number - * of elements in the chunk has to be not less than number - * of elements (pixels) in the block (cd_values[H5Z_SZIP_PARM_PPB] - * parameter). - * Elena Pourmal, July 20, 2004 - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t *type; /* Datatype */ @@ -147,7 +139,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) hsize_t scanline; /* Size of dataspace's fastest changing dimension */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -253,11 +245,11 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_szip() */ +} /* end H5Z__set_local_szip() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_szip + * Function: H5Z__filter_szip * * Purpose: Implement an I/O filter around the 'rice' algorithm in * libsz @@ -271,7 +263,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* Return value */ @@ -280,7 +272,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], unsigned char *newbuf = NULL; /* Pointer to input buffer */ SZ_com_t sz_param; /* szip parameter block */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Sanity check to make certain that we haven't drifted out of date with * the mask options from the szlib.h header */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 1c8d415..6f53ae0 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -86,24 +86,20 @@ typedef struct { } H5Z_token; /* Local function prototypes */ -static H5Z_token *H5Z_get_token(H5Z_token *current); -static H5Z_node *H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); -static H5Z_node *H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); -static H5Z_node *H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); -static H5Z_node *H5Z_new_node(H5Z_token_type type); -static void H5Z_do_op(H5Z_node* tree); -static hbool_t H5Z_op_is_numbs(H5Z_node* _tree); -static hbool_t H5Z_op_is_numbs2(H5Z_node* _tree); -static hid_t H5Z_xform_find_type(const H5T_t* type); -static herr_t H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result* res); -static void H5Z_xform_destroy_parse_tree(H5Z_node *tree); -static void* H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers); -static void* H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers); -static void H5Z_xform_reduce_tree(H5Z_node* tree); -#ifdef H5Z_XFORM_DEBUG -static void H5Z_XFORM_DEBUG(H5Z_node *tree); -static void H5Z_print(H5Z_node *tree, FILE *stream); -#endif /* H5Z_XFORM_DEBUG */ +static H5Z_token *H5Z__get_token(H5Z_token *current); +static H5Z_node *H5Z__parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); +static H5Z_node *H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); +static H5Z_node *H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); +static H5Z_node *H5Z__new_node(H5Z_token_type type); +static void H5Z__do_op(H5Z_node* tree); +static hbool_t H5Z__op_is_numbs(H5Z_node* _tree); +static hbool_t H5Z__op_is_numbs2(H5Z_node* _tree); +static hid_t H5Z__xform_find_type(const H5T_t* type); +static herr_t H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result* res); +static void H5Z__xform_destroy_parse_tree(H5Z_node *tree); +static void* H5Z__xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers); +static void* H5Z__xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers); +static void H5Z__xform_reduce_tree(H5Z_node* tree); /* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before * doing the operation. So I break down the command into two lines: @@ -312,11 +308,11 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); { \ ret_value->type = (TYPE); \ if(tree->lchild) \ - ret_value->lchild = (H5Z_node*) H5Z_xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \ + ret_value->lchild = (H5Z_node*) H5Z__xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \ else \ ret_value->lchild = NULL; \ if(tree->rchild) \ - ret_value->rchild = (H5Z_node*) H5Z_xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \ + ret_value->rchild = (H5Z_node*) H5Z__xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \ else \ ret_value->rchild = NULL; \ } \ @@ -329,7 +325,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } /* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. - * The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, + * The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z__do_op, * these two macros are called in different ways. (SLU 2012/3/20) */ #define H5Z_XFORM_DO_OP6(OP) \ @@ -371,7 +367,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * 25. August 2003 */ @@ -393,20 +389,23 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); /*------------------------------------------------------------------------- - * Function: H5Z_unget_token + * Function: H5Z__unget_token + * * Purpose: Rollback the H5Z_token to the previous H5Z_token retrieved. There * should only need to be one level of rollback necessary * for our grammar. + * * Return: Always succeeds. + * * Programmer: Bill Wendling * 26. August 2003 -* + * *------------------------------------------------------------------------- */ static void -H5Z_unget_token(H5Z_token *current) +H5Z__unget_token(H5Z_token *current) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(current); @@ -420,7 +419,7 @@ H5Z_unget_token(H5Z_token *current) /*------------------------------------------------------------------------- - * Function: H5Z_get_token + * Function: H5Z__get_token * * Purpose: Determine what the next valid H5Z_token is in the expression * string. The current position within the H5Z_token string is @@ -438,11 +437,11 @@ H5Z_unget_token(H5Z_token *current) *------------------------------------------------------------------------- */ static H5Z_token * -H5Z_get_token(H5Z_token *current) +H5Z__get_token(H5Z_token *current) { H5Z_token *ret_value = current; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(current); @@ -558,7 +557,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_xform_destroy_parse_tree + * Function: H5Z__xform_destroy_parse_tree * Purpose: Recursively destroys the expression tree. * Return: Nothing * Programmer: Bill Wendling @@ -567,14 +566,13 @@ done: *------------------------------------------------------------------------- */ static void -H5Z_xform_destroy_parse_tree(H5Z_node *tree) +H5Z__xform_destroy_parse_tree(H5Z_node *tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - if (tree) - { - H5Z_xform_destroy_parse_tree(tree->lchild); - H5Z_xform_destroy_parse_tree(tree->rchild); + if(tree) { + H5Z__xform_destroy_parse_tree(tree->lchild); + H5Z__xform_destroy_parse_tree(tree->rchild); H5MM_xfree(tree); tree = NULL; } @@ -589,7 +587,7 @@ H5Z_xform_destroy_parse_tree(H5Z_node *tree) * Purpose: Entry function for parsing the expression string. * * Return: Success: Valid H5Z_node ptr to an expression tree. - * NULLure: NULL + * Failure: NULL * * Programmer: Bill Wendling * 26. August 2003 @@ -597,12 +595,12 @@ H5Z_xform_destroy_parse_tree(H5Z_node *tree) *------------------------------------------------------------------------- */ static void * -H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) +H5Z__xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) { H5Z_token tok; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC if(!expression) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "No expression provided?") @@ -610,9 +608,9 @@ H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) /* Set up the initial H5Z_token for parsing */ tok.tok_expr = tok.tok_begin = tok.tok_end = expression; - ret_value = (void*)H5Z_parse_expression(&tok, dat_val_pointers); + ret_value = (void*)H5Z__parse_expression(&tok, dat_val_pointers); - H5Z_xform_reduce_tree((H5Z_node*)ret_value); + H5Z__xform_reduce_tree((H5Z_node*)ret_value); done: FUNC_LEAVE_NOAPI(ret_value) @@ -620,48 +618,49 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_parse_expression + * Function: H5Z__parse_expression * Purpose: Beginning of the recursive descent parser to parse the * expression. An expression is: * * expr := term | term '+' term | term '-' term * * Return: Success: Valid H5Z_node ptr to expression tree - * NULLure: NULL + * Failure: NULL + * * Programmer: Bill Wendling * 26. August 2003 * *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) +H5Z__parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *expr; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - expr = H5Z_parse_term(current, dat_val_pointers); + expr = H5Z__parse_term(current, dat_val_pointers); for (;;) { H5Z_node *new_node; - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch(current->tok_type) { case H5Z_XFORM_PLUS: - new_node = H5Z_new_node(H5Z_XFORM_PLUS); + new_node = H5Z__new_node(H5Z_XFORM_PLUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = expr; - new_node->rchild = H5Z_parse_term(current, dat_val_pointers); + new_node->rchild = H5Z__parse_term(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -669,18 +668,18 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_MINUS: - new_node = H5Z_new_node(H5Z_XFORM_MINUS); + new_node = H5Z__new_node(H5Z_XFORM_MINUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = expr; - new_node->rchild = H5Z_parse_term(current, dat_val_pointers); + new_node->rchild = H5Z__parse_term(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -688,7 +687,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_RPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(expr) case H5Z_XFORM_END: @@ -702,7 +701,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) case H5Z_XFORM_DIVIDE: case H5Z_XFORM_LPAREN: default: - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } } @@ -713,47 +712,48 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_parse_term + * Function: H5Z__parse_term * Purpose: Parses a term in our expression language. A term is: * * term := factor | factor '*' factor | factor '/' factor * * Return: Success: Valid H5Z_node ptr to expression tree - * NULLure: NULL + * Failure: NULL + * * Programmer: Bill Wendling * 26. August 2003 -* + * *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) +H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *term = NULL; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - term = H5Z_parse_factor(current, dat_val_pointers); + term = H5Z__parse_factor(current, dat_val_pointers); for (;;) { H5Z_node *new_node; - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch (current->tok_type) { case H5Z_XFORM_MULT: - new_node = H5Z_new_node(H5Z_XFORM_MULT); + new_node = H5Z__new_node(H5Z_XFORM_MULT); if (!new_node) { - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = term; - new_node->rchild = H5Z_parse_factor(current, dat_val_pointers); + new_node->rchild = H5Z__parse_factor(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -761,25 +761,25 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_DIVIDE: - new_node = H5Z_new_node(H5Z_XFORM_DIVIDE); + new_node = H5Z__new_node(H5Z_XFORM_DIVIDE); if (!new_node) { - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = term; - new_node->rchild = H5Z_parse_factor(current, dat_val_pointers); + new_node->rchild = H5Z__parse_factor(current, dat_val_pointers); term = new_node; if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; case H5Z_XFORM_RPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(term) case H5Z_XFORM_END: @@ -791,12 +791,12 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) case H5Z_XFORM_PLUS: case H5Z_XFORM_MINUS: case H5Z_XFORM_LPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(term) case H5Z_XFORM_ERROR: default: - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "bad transform type passed to data transform expression") } /* end switch */ } /* end for */ @@ -807,7 +807,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_parse_factor + * Function: H5Z__parse_factor * Purpose: Parses a factor in our expression language. A factor is: * * factor := number | // C long or double @@ -817,26 +817,27 @@ done: * '(' expr ')' * * Return: Success: Valid H5Z_node ptr to expression tree - * NULLure: NULL + * Failure: NULL + * * Programmer: Bill Wendling * 26. August 2003 * *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) +H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *factor=NULL; H5Z_node *new_node; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch (current->tok_type) { case H5Z_XFORM_INTEGER: - factor = H5Z_new_node(H5Z_XFORM_INTEGER); + factor = H5Z__new_node(H5Z_XFORM_INTEGER); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -844,7 +845,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_FLOAT: - factor = H5Z_new_node(H5Z_XFORM_FLOAT); + factor = H5Z__new_node(H5Z_XFORM_FLOAT); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -852,7 +853,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_SYMBOL: - factor = H5Z_new_node(H5Z_XFORM_SYMBOL); + factor = H5Z__new_node(H5Z_XFORM_SYMBOL); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -862,76 +863,76 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_LPAREN: - factor = H5Z_parse_expression(current, dat_val_pointers); + factor = H5Z__parse_expression(current, dat_val_pointers); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") - current = H5Z_get_token(current); + current = H5Z__get_token(current); if (current->tok_type != H5Z_XFORM_RPAREN) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error in data transform expression") } break; case H5Z_XFORM_RPAREN: /* We shouldn't see a ) right now */ - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error: unexpected ')' ") case H5Z_XFORM_PLUS: /* unary + */ - new_node = H5Z_parse_factor(current, dat_val_pointers); + new_node = H5Z__parse_factor(current, dat_val_pointers); if (new_node) { if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && new_node->type != H5Z_XFORM_SYMBOL) { - H5Z_xform_destroy_parse_tree(new_node); - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } factor = new_node; - new_node = H5Z_new_node(H5Z_XFORM_PLUS); + new_node = H5Z__new_node(H5Z_XFORM_PLUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } new_node->rchild = factor; factor = new_node; } else { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; case H5Z_XFORM_MINUS: /* unary - */ - new_node = H5Z_parse_factor(current, dat_val_pointers); + new_node = H5Z__parse_factor(current, dat_val_pointers); if (new_node) { if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && new_node->type != H5Z_XFORM_SYMBOL) { - H5Z_xform_destroy_parse_tree(new_node); - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } factor = new_node; - new_node = H5Z_new_node(H5Z_XFORM_MINUS); + new_node = H5Z__new_node(H5Z_XFORM_MINUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } new_node->rchild = factor; factor = new_node; } else { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; @@ -956,21 +957,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_new_node + * Function: H5Z__new_node + * * Purpose: Create and initialize a new H5Z_node structure. + * * Return: Success: Valid H5Z_node ptr - * NULLure: NULL + * Failure: NULL + * * Programmer: Bill Wendling * 26. August 2003 * *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_new_node(H5Z_token_type type) +H5Z__new_node(H5Z_token_type type) { H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (ret_value = (H5Z_node *)H5MM_calloc(sizeof(H5Z_node)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to allocate space for nodes in the parse tree") @@ -985,7 +989,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_xform_eval * Purpose: If the transform is trivial, this function applies it. - * Otherwise, it calls H5Z_xform_eval_full to do the full + * Otherwise, it calls H5Z__xform_eval_full to do the full * transform. * Return: SUCCEED if transform applied successfully, FAIL otherwise * Programmer: Leon Arber @@ -1009,7 +1013,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size tree = data_xform_prop->parse_root; /* Get the datatype ID for the buffer's type */ - if((array_type = H5Z_xform_find_type(buf_type)) < 0) + if((array_type = H5Z__xform_find_type(buf_type)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Cannot perform data transform on this type.") /* After this point, we're assured that the type of the array is handled by the eval code, @@ -1069,7 +1073,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size } /* end for */ } /* end else */ - if(H5Z_xform_eval_full(tree, array_size, array_type, &res) < 0) + if(H5Z__xform_eval_full(tree, array_size, array_type, &res) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if(data_xform_prop->dat_val_pointers->num_ptrs > 1) @@ -1096,25 +1100,30 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_xform_eval_full + * Function: H5Z__xform_eval_full + * * Purpose: Does a full evaluation of the parse tree contained in tree * and applies this transform to array. + * + * Notes: In the case of a polynomial data transform (ie, the left and right + * subtree are both of type H5Z_XFORM_SYMBOL), the convention is + * that the left hand side will accumulate changes and, at the end, + * the new data will be copied from the lhs. + * * Return: Nothing + * * Programmer: Leon Arber * 5/1/04 * - * Notes: In the case of a polynomial data transform (ie, the left and right subtree - * are both of type H5Z_XFORM_SYMBOL), the convention is that the left hand side - * will accumulate changes and, at the end, the new data will be copied from the lhs. *------------------------------------------------------------------------- */ static herr_t -H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result *res) +H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result *res) { H5Z_result resl, resr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(tree); @@ -1139,9 +1148,9 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ res->value.dat_val = *((void**)(tree->value.dat_val)); } /* end if */ else { - if(tree->lchild && H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) + if(tree->lchild && H5Z__xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") - if(H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) + if(H5Z__xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") res->type = H5Z_XFORM_SYMBOL; @@ -1191,23 +1200,25 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_xform_eval_full() */ +} /* end H5Z__xform_eval_full() */ /*------------------------------------------------------------------------- * Function: H5Z_find_type + * * Return: Native type of datatype that is passed in + * * Programmer: Leon Arber, 4/20/04 * *------------------------------------------------------------------------- */ static hid_t -H5Z_xform_find_type(const H5T_t* type) +H5Z__xform_find_type(const H5T_t* type) { H5T_t *tmp; /* Temporary datatype */ hid_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(type); @@ -1274,25 +1285,28 @@ H5Z_xform_find_type(const H5T_t* type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_xform_find_type() */ +} /* end H5Z__xform_find_type() */ /*------------------------------------------------------------------------- - * Function: H5Z_xform_copy_tree + * Function: H5Z__xform_copy_tree + * * Purpose: Makes a copy of the parse tree passed in. + * * Return: A pointer to a root for a new parse tree which is a copy * of the one passed in. + * * Programmer: Leon Arber * April 1, 2004. * *------------------------------------------------------------------------- */ static void * -H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers) +H5Z__xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers) { H5Z_node* ret_value=NULL; - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC HDassert(tree); @@ -1351,21 +1365,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_op_is_numbs + * Function: H5Z__op_is_numbs + * * Purpose: Internal function to facilitate the condition check in - * H5Z_xform_reduce_tree to reduce the bulkiness of the code. + * H5Z__xform_reduce_tree to reduce the bulkiness of the code. + * * Return: TRUE or FALSE + * * Programmer: Raymond Lu * 15 March 2012 * *------------------------------------------------------------------------- */ static hbool_t -H5Z_op_is_numbs(H5Z_node* _tree) +H5Z__op_is_numbs(H5Z_node* _tree) { hbool_t ret_value = FALSE; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(_tree); @@ -1377,23 +1394,26 @@ H5Z_op_is_numbs(H5Z_node* _tree) /*------------------------------------------------------------------------- - * Function: H5Z_op_is_numbs2 + * Function: H5Z__op_is_numbs2 + * * Purpose: Internal function to facilitate the condition check in - * H5Z_xform_reduce_tree to reduce the bulkiness of the code. - * The difference from H5Z_op_is_numbs is that the left child + * H5Z__xform_reduce_tree to reduce the bulkiness of the code. + * The difference from H5Z__op_is_numbs is that the left child * can be empty, like -x or +x. + * * Return: TRUE or FALSE + * * Programmer: Raymond Lu * 15 March 2012 * *------------------------------------------------------------------------- */ static hbool_t -H5Z_op_is_numbs2(H5Z_node* _tree) +H5Z__op_is_numbs2(H5Z_node* _tree) { hbool_t ret_value = FALSE; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(_tree); @@ -1406,50 +1426,51 @@ H5Z_op_is_numbs2(H5Z_node* _tree) /*------------------------------------------------------------------------- - * Function: H5Z_xform_reduce_tree + * Function: H5Z__xform_reduce_tree + * * Purpose: Simplifies parse tree passed in by performing any obvious * and trivial arithemtic calculations. * * Return: None. + * * Programmer: Leon Arber * April 1, 2004. - * Modifications: * *------------------------------------------------------------------------- */ static void -H5Z_xform_reduce_tree(H5Z_node* tree) +H5Z__xform_reduce_tree(H5Z_node* tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(tree) { if((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT)) { - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + if(H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->lchild); - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->lchild); + if(H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->rchild); - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->rchild); + if(H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); } } } else if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) { - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + if(H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->lchild); - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->lchild); + if(H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->rchild); - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->rchild); + if(H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); } } } @@ -1461,22 +1482,25 @@ H5Z_xform_reduce_tree(H5Z_node* tree) /*------------------------------------------------------------------------- - * Function: H5Z_do_op + * Function: H5Z__do_op + * * Purpose: If the root of the tree passed in points to a simple * arithmetic operation and the left and right subtrees are both * integer or floating point values, this function does that * operation, free the left and right subtrees, and replaces * the root with the result of the operation. + * * Return: None. + * * Programmer: Leon Arber * April 1, 2004. * *------------------------------------------------------------------------- */ static void -H5Z_do_op(H5Z_node* tree) +H5Z__do_op(H5Z_node* tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(tree->type == H5Z_XFORM_DIVIDE) H5Z_XFORM_DO_OP3(/) @@ -1492,7 +1516,7 @@ H5Z_do_op(H5Z_node* tree) /*------------------------------------------------------------------------- - * Function: H5D_xform_create + * Function: H5Z_xform_create * * Purpose: Create a new data transform object from a string. * @@ -1546,7 +1570,7 @@ H5Z_xform_create(const char *expr) data_xform_prop->dat_val_pointers->num_ptrs = 0; /* we generate the parse tree right here and store a pointer to its root in the property. */ - if((data_xform_prop->parse_root = (H5Z_node *)H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers))==NULL) + if((data_xform_prop->parse_root = (H5Z_node *)H5Z__xform_parse(expr, data_xform_prop->dat_val_pointers))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to generate parse tree from expression") /* Sanity check @@ -1563,7 +1587,7 @@ done: if(ret_value==NULL) { if(data_xform_prop) { if(data_xform_prop->parse_root) - H5Z_xform_destroy_parse_tree(data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(data_xform_prop->parse_root); if(data_xform_prop->xform_exp) H5MM_xfree(data_xform_prop->xform_exp); if(count > 0 && data_xform_prop->dat_val_pointers->ptr_dat_val) @@ -1600,7 +1624,7 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop) if(data_xform_prop) { /* Destroy the parse tree */ - H5Z_xform_destroy_parse_tree(data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(data_xform_prop->parse_root); /* Free the expression */ H5MM_xfree(data_xform_prop->xform_exp); @@ -1674,7 +1698,7 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop) new_data_xform_prop->dat_val_pointers->num_ptrs = 0; /* Copy parse tree */ - if((new_data_xform_prop->parse_root = (H5Z_node*)H5Z_xform_copy_tree((*data_xform_prop)->parse_root, (*data_xform_prop)->dat_val_pointers, new_data_xform_prop->dat_val_pointers)) == NULL) + if((new_data_xform_prop->parse_root = (H5Z_node*)H5Z__xform_copy_tree((*data_xform_prop)->parse_root, (*data_xform_prop)->dat_val_pointers, new_data_xform_prop->dat_val_pointers)) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "error copying the parse tree") /* Sanity check @@ -1691,7 +1715,7 @@ done: if(ret_value<0) { if(new_data_xform_prop) { if(new_data_xform_prop->parse_root) - H5Z_xform_destroy_parse_tree(new_data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(new_data_xform_prop->parse_root); if(new_data_xform_prop->xform_exp) H5MM_xfree(new_data_xform_prop->xform_exp); H5MM_xfree(new_data_xform_prop); diff --git a/src/H5checksum.c b/src/H5checksum.c index 4e98976..a9d2b4e 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -15,7 +15,7 @@ * * Created: H5checksum.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal code for computing fletcher32 checksums * @@ -152,7 +152,7 @@ H5_checksum_fletcher32(const void *_data, size_t _len) /*------------------------------------------------------------------------- - * Function: H5_checksum_crc_make_table + * Function: H5__checksum_crc_make_table * * Purpose: Compute the CRC table for the CRC checksum algorithm * @@ -164,12 +164,12 @@ H5_checksum_fletcher32(const void *_data, size_t _len) *------------------------------------------------------------------------- */ static void -H5_checksum_crc_make_table(void) +H5__checksum_crc_make_table(void) { uint32_t c; /* Checksum for each byte value */ unsigned n, k; /* Local index variables */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Compute the checksum for each possible byte value */ for(n = 0; n < 256; n++) { @@ -184,11 +184,11 @@ H5_checksum_crc_make_table(void) H5_crc_table_computed = TRUE; FUNC_LEAVE_NOAPI_VOID -} /* end H5_checksum_crc_make_table() */ +} /* end H5__checksum_crc_make_table() */ /*------------------------------------------------------------------------- - * Function: H5_checksum_crc_make_table + * Function: H5__checksum_crc_update * * Purpose: Update a running CRC with the bytes buf[0..len-1]--the CRC * should be initialized to all 1's, and the transmitted value @@ -203,22 +203,22 @@ H5_checksum_crc_make_table(void) *------------------------------------------------------------------------- */ static uint32_t -H5_checksum_crc_update(uint32_t crc, const uint8_t *buf, size_t len) +H5__checksum_crc_update(uint32_t crc, const uint8_t *buf, size_t len) { size_t n; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Initialize the CRC table if necessary */ if(!H5_crc_table_computed) - H5_checksum_crc_make_table(); + H5__checksum_crc_make_table(); /* Update the CRC with the results from this buffer */ for(n = 0; n < len; n++) crc = H5_crc_table[(crc ^ buf[n]) & 0xff] ^ (crc >> 8); FUNC_LEAVE_NOAPI(crc) -} /* end H5_checksum_crc_update() */ +} /* end H5__checksum_crc_update() */ /*------------------------------------------------------------------------- @@ -247,7 +247,7 @@ H5_checksum_crc(const void *_data, size_t len) HDassert(_data); HDassert(len > 0); - FUNC_LEAVE_NOAPI(H5_checksum_crc_update((uint32_t)0xffffffffL, (const uint8_t *)_data, len) ^ 0xffffffffL) + FUNC_LEAVE_NOAPI(H5__checksum_crc_update((uint32_t)0xffffffffL, (const uint8_t *)_data, len) ^ 0xffffffffL) } /* end H5_checksum_crc() */ /* diff --git a/src/H5detect.c b/src/H5detect.c index 655b05c..138695b 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -221,25 +221,6 @@ precision (detected_t *d) * * Return: void * - * Modifications: - * - * Robb Matzke, 4 Nov 1996 - * The INFO.perm now contains `-1' for bytes that aren't used and - * are always zero. This happens on the Cray for `short' where - * sizeof(short) is 8, but only the low-order 4 bytes are ever used. - * - * Robb Matzke, 4 Nov 1996 - * Added a `padding' field to indicate how many zero bytes appear to - * the left (N) or right (-N) of the value. - * - * Robb Matzke, 5 Nov 1996 - * Removed HFILE and CFILE arguments. - * - * Neil Fortner, 6 Sep 2013 - * Split macro into DETECT_I and DETECT_BYTE macros, extracted - * common code into DETECT_I_BYTE_CORE. This was done to remove - * "will never be executed" warnings. - * *------------------------------------------------------------------------- */ #define DETECT_I_BYTE_CORE(TYPE,VAR,INFO,DETECT_TYPE) { \ @@ -1617,12 +1598,6 @@ static int verify_signal_handlers(int signum, void (*handler)(int)) * * Return: Success: EXIT_SUCCESS * - * Modifications: - * Some compilers, e.g., Intel C v7.0, took a long time to compile - * with optimization when a module routine contains many code lines. - * Divide up all those types detections macros into subroutines, both - * to avoid the compiler optimization error and cleaner codes. - * *------------------------------------------------------------------------- */ int HDF_NO_UBSAN diff --git a/src/H5private.h b/src/H5private.h index 836d7d5..f8df821 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, October 30, 1998 * * Purpose: This file is included by all HDF5 library source files to @@ -1515,6 +1515,9 @@ typedef off_t h5_stat_size_t; #ifndef HDstrtoull #define HDstrtoull(S,R,N) strtoull(S,R,N) #endif /* HDstrtoul */ +#ifndef HDstrtoumax + #define HDstrtoumax(S,R,N) strtoumax(S,R,N) +#endif /* HDstrtoul */ #ifndef HDstrxfrm #define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z) #endif /* HDstrxfrm */ diff --git a/src/H5system.c b/src/H5system.c index 24935fd..b0b2fad 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -516,8 +516,6 @@ H5_GCC_DIAG_ON(format-nonliteral) * Programmer: Robb Matzke * Thursday, April 9, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef HDstrtoll diff --git a/src/H5timer.c b/src/H5timer.c index cef7bf9..61d6f0f 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -14,7 +14,7 @@ /*------------------------------------------------------------------------- * Created: H5timer.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal, platform-independent 'timer' support routines. * diff --git a/src/H5trace.c b/src/H5trace.c index db33673..40967ee 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -15,7 +15,7 @@ * * Created: H5trace.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal code for tracing API calls * diff --git a/src/hdf5.lnt b/src/hdf5.lnt index 995e3f6..61c4a61 100644 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -1,9 +1,9 @@ // Lint options shared by both PC-Lint for Windows and Flexelint for Linux // Turn off warnings about not using the inlined H5V* functions: --esym(528, H5VM_vector_reduce_product, H5VM_vector_inc) --esym(528, H5VM_vector_cmp, H5VM_vector_cmp_s, H5VM_vector_cmp_u) --esym(528, H5VM_vector_zerop_s, H5VM_vector_zerop_u) +-esym(528, H5VM_vector_reduce_product, H5VM__vector_inc) +-esym(528, H5VM__vector_cmp_s) +-esym(528, H5VM__vector_zerop_s, H5VM__vector_zerop_u) // Suppress message about using 'goto' in a few functions -efunc(801,H5_term_library,H5_trace) diff --git a/test/accum.c b/test/accum.c index 548a04d..3947aff 100644 --- a/test/accum.c +++ b/test/accum.c @@ -1708,10 +1708,10 @@ test_random_write(H5F_t *f) /* Choose random # seed */ seed = (unsigned)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned)1155438845; */ HDfprintf(stderr, "Random # seed was: %u\n", seed); -#endif /* QAK */ +#endif HDsrandom(seed); /* Allocate space for the segment length buffer */ diff --git a/test/big.c b/test/big.c index a2f07af..5c1dcda 100644 --- a/test/big.c +++ b/test/big.c @@ -803,10 +803,10 @@ main (int ac, char **av) /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned long)1155438845; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#endif HDsrandom((unsigned)seed); /* run VFD-specific test */ diff --git a/test/btree2.c b/test/btree2.c index c4c5530..e209d22 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -2982,10 +2982,10 @@ test_insert_lots(hid_t fapl, const H5B2_create_t *cparam, /* Initialize random number seed */ curr_time=HDtime(NULL); -#ifdef QAK +#if 0 curr_time=1109170019; HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); -#endif /* QAK */ +#endif HDsrandom((unsigned)curr_time); /* @@ -4975,10 +4975,10 @@ test_update_lots(hid_t fapl, const H5B2_create_t *cparam, /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK +#if 0 curr_time = 1451342093; HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); -#endif /* QAK */ +#endif HDsrandom((unsigned)curr_time); /* @@ -8652,10 +8652,10 @@ test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cpara /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK +#if 0 curr_time = 1163537969; HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); -#endif /* QAK */ +#endif HDsrandom((unsigned)curr_time); /* diff --git a/test/dsets.c b/test/dsets.c index 4ab3efa..3547554 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -11723,9 +11723,9 @@ error: /*------------------------------------------------------------------------- * Function: test_power2up * - * Purpose: Tests that the H5VM_power2up(n) function does not result in an + * Purpose: Tests that the H5VM__power2up(n) function does not result in an * infinite loop when input n exceeds 2^63. (HDFFV-10217) - * H5VM_power2up() is used to calculate the next power of 2 for + * H5VM__power2up() is used to calculate the next power of 2 for * a dataset's scaled dimension sizes. * * Return: Success: 0 diff --git a/test/earray.c b/test/earray.c index 6597afd..a8ae9f0 100644 --- a/test/earray.c +++ b/test/earray.c @@ -232,7 +232,7 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) HDmemset(tparam, 0, sizeof(*tparam)); /* Compute general information */ - tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM_log2_of2(cparam->data_blk_min_elmts)); + tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM__log2_of2(cparam->data_blk_min_elmts)); /* Allocate information for each super block */ tparam->sblk_info = (H5EA_sblk_info_t *)HDmalloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); @@ -381,10 +381,6 @@ check_stats(const H5EA_t *ea, const earray_state_t *state) TEST_ERROR } /* end if */ #endif /* NOT_YET */ -#ifdef QAK -HDfprintf(stderr, "nelmts = %Hu, total EA size = %Hu\n", earray_stats.stored.nelmts, - (earray_stats.computed.hdr_size + earray_stats.computed.index_blk_size + earray_stats.stored.super_blk_size + earray_stats.stored.data_blk_size)); -#endif /* QAK */ /* All tests passed */ return(0); @@ -560,12 +556,6 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr) if(H5EA_close(ea) < 0) FAIL_STACK_ERROR -#ifdef QAK -HDfprintf(stderr, "ea_addr = %a\n", ea_addr); -H5Fflush(file, H5F_SCOPE_GLOBAL); -HDsystem("cp earray.h5 earray.h5.save"); -#endif /* QAK */ - /* Delete array */ if(H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR @@ -728,7 +718,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE /* Set invalid max. # of elements per data block page bits */ if(test_cparam.idx_blk_elmts > 0) { HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); - test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); + test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM__log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; @@ -1383,20 +1373,9 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); -#ifdef QAK -HDfprintf(stderr, "idx = %Hu, tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx, sblk_idx, tparam->sblk_info[sblk_idx].ndblks, tparam->sblk_info[sblk_idx].dblk_nelmts, tparam->sblk_info[sblk_idx].start_idx, tparam->sblk_info[sblk_idx].start_dblk); -#endif /* QAK */ - + sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state->nelmts = EA_NELMTS(cparam, tparam, idx, sblk_idx); -#ifdef QAK -HDfprintf(stderr, "state->nelmts = %Hu\n", state->nelmts); -#endif /* QAK */ - state->ndata_blks = EA_NDATA_BLKS(cparam, tparam, idx, sblk_idx); -#ifdef QAK -HDfprintf(stderr, "state->ndata_blks = %Hu\n", state->ndata_blks); -#endif /* QAK */ /* Check if we have any super blocks yet */ if(tparam->sblk_info[sblk_idx].ndblks >= cparam->sup_blk_min_data_ptrs) { @@ -1405,9 +1384,6 @@ HDfprintf(stderr, "state->ndata_blks = %Hu\n", state->ndata_blks); eiter->base_sblk_idx = sblk_idx; state->nsuper_blks = (sblk_idx - eiter->base_sblk_idx) + 1; -#ifdef QAK -HDfprintf(stderr, "state->nsuper_blks = %Hu\n", state->nsuper_blks); -#endif /* QAK */ } /* end if */ else state->nsuper_blks = 0; @@ -1489,10 +1465,10 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, eiter->idx = cnt - 1; eiter->max = cnt - 1; if(cnt > cparam->idx_blk_elmts) { - eiter->max_sblk_idx = H5VM_log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + eiter->max_sblk_idx = H5VM__log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); eiter->max_nelmts = EA_NELMTS(cparam, tparam, eiter->max, eiter->max_sblk_idx); eiter->max_ndata_blks = EA_NDATA_BLKS(cparam, tparam, eiter->max, eiter->max_sblk_idx); - eiter->idx_blk_nsblks = 2 * H5VM_log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); + eiter->idx_blk_nsblks = 2 * H5VM__log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); } /* end if */ else { eiter->max_sblk_idx = (hsize_t)0; @@ -1610,38 +1586,27 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, hsize_t tmp_idx; /* Temporary index in superblock */ hsize_t dblk_idx; /* Index of data block within superblock */ - idx_sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + idx_sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); tmp_idx = idx - (cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx); dblk_idx = tmp_idx / tparam->sblk_info[idx_sblk_idx].dblk_nelmts; if(dblk_idx > 0) loc_idx = idx - tparam->sblk_info[idx_sblk_idx].dblk_nelmts; else loc_idx = cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx - 1; - loc_sblk_idx = H5VM_log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + loc_sblk_idx = H5VM__log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); } /* end else */ -#ifdef QAK -HDfprintf(stderr, "idx = %Hu, loc_idx = %Hu, eiter->max_sblk_idx = %u, idx_sblk_idx = %u, loc_sblk_idx = %u\n", idx, loc_idx, eiter->max_sblk_idx, idx_sblk_idx, loc_sblk_idx); -HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx_sblk_idx, tparam->sblk_info[idx_sblk_idx].ndblks, tparam->sblk_info[idx_sblk_idx].dblk_nelmts, tparam->sblk_info[idx_sblk_idx].start_idx, tparam->sblk_info[idx_sblk_idx].start_dblk); -HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", eiter->max_sblk_idx, tparam->sblk_info[eiter->max_sblk_idx].ndblks, tparam->sblk_info[eiter->max_sblk_idx].dblk_nelmts, tparam->sblk_info[eiter->max_sblk_idx].start_idx, tparam->sblk_info[eiter->max_sblk_idx].start_dblk); -#endif /* QAK */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) idx_nelmts = (hsize_t)cparam->idx_blk_elmts; else idx_nelmts = EA_NELMTS(cparam, tparam, loc_idx, loc_sblk_idx); state->nelmts = (eiter->max_nelmts - idx_nelmts) + cparam->idx_blk_elmts; -#ifdef QAK -HDfprintf(stderr, "eiter->max_nelmts = %Hu, idx_nelmts = %Hu, state->nelmts = %Hu\n", eiter->max_nelmts, idx_nelmts, state->nelmts); -#endif /* QAK */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) idx_ndata_blks = 0; else idx_ndata_blks = EA_NDATA_BLKS(cparam, tparam, loc_idx, loc_sblk_idx); state->ndata_blks = eiter->max_ndata_blks - idx_ndata_blks; -#ifdef QAK -HDfprintf(stderr, "eiter->max_ndata_blks = %Hu, idx_ndata_blks = %Hu, state->ndata_blks = %Hu\n", eiter->max_ndata_blks, idx_ndata_blks, state->ndata_blks); -#endif /* QAK */ /* Check if we have any super blocks yet */ if(tparam->sblk_info[eiter->max_sblk_idx].ndblks >= cparam->sup_blk_min_data_ptrs) { @@ -1649,9 +1614,6 @@ HDfprintf(stderr, "eiter->max_ndata_blks = %Hu, idx_ndata_blks = %Hu, state->nda state->nsuper_blks = (eiter->max_sblk_idx - idx_sblk_idx) + 1; else state->nsuper_blks = (eiter->max_sblk_idx - eiter->idx_blk_nsblks) + 1; -#ifdef QAK -HDfprintf(stderr, "eiter->idx_blk_nsblks = %Hu, state->nsuper_blks = %Hu\n", eiter->idx_blk_nsblks, state->nsuper_blks); -#endif /* QAK */ } /* end if */ } /* end else */ @@ -2355,7 +2317,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state.nelmts = (hsize_t)cparam->idx_blk_elmts + tparam->sblk_info[sblk_idx].dblk_nelmts; state.ndata_blks = (hsize_t)1; state.nsuper_blks = (hsize_t)1; diff --git a/test/fheap.c b/test/fheap.c index b1a0db0..55af7d6 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -1592,7 +1592,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 2nd level deep indirect blocks */ - for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1710,7 +1710,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 3rd level deep indirect blocks */ - for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) /* Fill row of 3rd level indirect blocks */ if(fill_3rd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1800,7 +1800,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 4th level deep indirect blocks */ - for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) { + for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) { /* Fill row of 4th level indirect blocks */ if(fill_4th_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -3195,7 +3195,6 @@ error: return(1); } /* test_reopen_hdr() */ -#ifndef QAK2 /*------------------------------------------------------------------------- * Function: test_man_insert_weird @@ -6237,7 +6236,6 @@ error: } /* test_man_fill_all_4th_recursive_indirect() */ #endif /* ALL_INSERT_TESTS */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_start_5th_recursive_indirect @@ -6369,9 +6367,7 @@ error: } H5E_END_TRY; return(1); } /* test_man_start_5th_recursive_indirect() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_remove_bogus @@ -6448,10 +6444,10 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned long)1155438845; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#endif HDsrandom((unsigned)seed); /* Set heap ID to random (non-null) value */ @@ -7270,10 +7266,6 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Verify the file is correct size */ -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ if(file_size != empty_size) TEST_ERROR @@ -7573,10 +7565,6 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Verify the file is correct size */ -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ if(file_size != empty_size) TEST_ERROR @@ -7720,9 +7708,7 @@ error: return 1; } /* test_man_incr_insert_remove() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_remove_root_direct @@ -8323,9 +8309,7 @@ error: } H5E_END_TRY; return(1); } /* test_man_remove_3rd_indirect() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_skip_start_block @@ -9589,9 +9573,6 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9725,9 +9706,6 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9747,9 +9725,6 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object too large for initial block size in skipped indirect blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, 4); if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9760,9 +9735,6 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object to fill space in (medium) block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 4) - obj_size; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10506,9 +10478,6 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10627,9 +10596,6 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); -#ifdef QAK -HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); -#endif /* QAK */ /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, fill_size, &state, &keep_ids)) @@ -10660,9 +10626,6 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10673,9 +10636,6 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows + 1) - obj_size; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10829,9 +10789,6 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10998,9 +10955,6 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11155,9 +11109,6 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11332,9 +11283,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11544,9 +11492,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11740,9 +11685,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11972,9 +11914,6 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -12043,9 +11982,7 @@ error: } H5E_END_TRY; return(1); } /* test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_frag_simple @@ -12396,9 +12333,6 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * /* Compute # of bits used in first row */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); -#ifdef QAK -HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); -#endif /* QAK */ /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, fill_size, &state, &keep_ids)) @@ -12576,9 +12510,7 @@ error: } H5E_END_TRY; return(1); } /* test_man_frag_3rd_direct() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_huge_insert_one @@ -12699,9 +12631,6 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -12929,9 +12858,6 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -13234,9 +13160,6 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -13657,9 +13580,6 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -13879,9 +13799,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -13911,9 +13828,7 @@ error: } H5E_END_TRY; return(1); } /* test_filtered_huge() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_tiny_insert_one @@ -14034,9 +13949,6 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -14264,9 +14176,6 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -14864,9 +14773,6 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -14907,10 +14813,7 @@ error: } H5E_END_TRY; return(1); } /* test_tiny_insert_mix() */ -#endif /* QAK */ -#endif /* QAK2 */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_filtered_man_root_direct @@ -15060,9 +14963,6 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -15388,9 +15288,6 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -15413,9 +15310,7 @@ error: } H5E_END_TRY; return(1); } /* test_filtered_man_root_indirect() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_random @@ -15498,10 +15393,10 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned long)1156158635; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#endif HDsrandom((unsigned)seed); /* Loop over adding objects to the heap, until the size limit is reached */ @@ -15522,9 +15417,6 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Increment the amount of objects added */ total_obj_added += obj_size; } /* end while */ -#ifdef QAK -HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids, total_obj_added, size_limit); -#endif /* QAK */ /* Randomize the order of the IDs kept */ for(u = 0; u < keep_ids.num_ids; u++) { @@ -15583,9 +15475,6 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -15704,10 +15593,10 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned long)1155181717; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#endif HDsrandom((unsigned)seed); /* Loop over adding objects to the heap, until the size limit is reached */ @@ -15740,9 +15629,6 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Increment the amount of objects added */ total_obj_added += obj_size; } /* end while */ -#ifdef QAK -HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids, total_obj_added, size_limit); -#endif /* QAK */ /* Randomize the order of the IDs kept */ for(u = 0; u < keep_ids.num_ids; u++) { @@ -15801,10 +15687,6 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -15838,9 +15720,7 @@ error: } H5E_END_TRY; return(1); } /* test_random_pow2() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_write @@ -16124,9 +16004,7 @@ error: } H5E_END_TRY; return(1); } /* test_write() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_bug1 @@ -16301,7 +16179,6 @@ error: } H5E_END_TRY; return(1); } /* test_bug1() */ -#endif /* QAK */ /*------------------------------------------------------------------------- diff --git a/test/hdfs.c b/test/hdfs.c index ab39da6..1e4f26c 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -30,7 +30,6 @@ #ifdef H5_HAVE_LIBHDFS #define HDFS_TEST_DEBUG 0 #define HDFS_TEST_MAX_BUF_SIZE 256 -#endif /* H5_HAVE_LIBHDFS */ /***************************************************************************** * @@ -372,11 +371,8 @@ if (strcmp((actual), (expected)) != 0) { \ * OTHER MACROS AND DEFINITIONS * ********************************/ -/* copied from src/hdfs.c - */ -#ifdef H5_HAVE_LIBHDFS +/* copied from src/hdfs.c */ #define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#endif /* H5_HAVE_LIBHDFS */ #define HDFS_NAMENODE_NAME_MAX_SIZE 128 @@ -384,12 +380,10 @@ if (strcmp((actual), (expected)) != 0) { \ * FILE-LOCAL GLOBAL VARIABLES * *******************************/ -#ifdef H5_HAVE_LIBHDFS static const char filename_missing[] = "/tmp/missing.txt"; static const char filename_bard[] = "/tmp/t8.shakespeare.txt"; static const char filename_raven[] = "/tmp/Poe_Raven.txt"; static const char filename_example_h5[] = "/tmp/t.h5"; -#endif /* H5_HAVE_LIBHDFS */ static H5FD_hdfs_fapl_t default_fa = { 1, /* fa version */ @@ -399,6 +393,7 @@ static H5FD_hdfs_fapl_t default_fa = { "", /* kerberos path */ 1024, /* buffer size */ }; +#endif /* H5_HAVE_LIBHDFS */ /****************** * TEST FUNCTIONS * @@ -429,6 +424,14 @@ static H5FD_hdfs_fapl_t default_fa = { static int test_fapl_config_validation(void) { +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS fapl configuration validation"); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else /********************* * test-local macros * *********************/ @@ -604,6 +607,7 @@ error: } H5E_END_TRY; } return 1; +#endif /* H5_HAVE_LIBHDFS */ } /* end test_fapl_config_validation() */ @@ -630,6 +634,14 @@ error: static int test_hdfs_fapl(void) { +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS fapl "); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else /************************ * test-local variables * ************************/ @@ -681,6 +693,7 @@ error: } H5E_END_TRY; return 1; +#endif /* H5_HAVE_LIBHDFS */ } /* end test_hdfs_fapl() */ @@ -1723,6 +1736,7 @@ main(void) * commence tests * ******************/ +#ifdef H5_HAVE_LIBHDFS static char hdfs_namenode_name[HDFS_NAMENODE_NAME_MAX_SIZE] = ""; const char *hdfs_namenode_name_env = NULL; @@ -1736,6 +1750,7 @@ main(void) hdfs_namenode_name_env, HDFS_NAMENODE_NAME_MAX_SIZE); } +#endif /* H5_HAVE_LIBHDFS */ h5_reset(); diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 4da742f..35c3f90 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -28,6 +28,8 @@ #ifdef H5_HAVE_MIRROR_VFD +#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */ + /* For future consideration, IP address and port number might be * environment variables? */ diff --git a/test/pool.c b/test/pool.c index 1851d6e..591413d 100644 --- a/test/pool.c +++ b/test/pool.c @@ -636,10 +636,10 @@ test_allocate_random(void) /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK +#if 0 curr_time=1115412944; HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); -#endif /* QAK */ +#endif HDsrandom((unsigned)curr_time); /* Create a memory pool */ diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index 71e4929..7ad74ed 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -88,26 +88,6 @@ open_skeleton(const char *filename, unsigned verbose) if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; -#ifdef QAK - /* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - -#ifdef QAK - H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); -#endif /* QAK */ - /* Open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) return -1; diff --git a/test/swmr_generator.c b/test/swmr_generator.c index f6a4fe2..7fb08df 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -121,38 +121,10 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write, if(!HDstrcmp(index_type, "b2")) max_dims[0] = H5S_UNLIMITED; -#ifdef QAK - /* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - -#ifdef QAK - H5Pset_small_data_block_size(fapl, (hsize_t)(50 * CHUNK_SIZE * DTYPE_SIZE)); -#endif /* QAK */ - -#ifdef QAK - H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); -#endif /* QAK */ - /* Create file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) return -1; -#ifdef QAK - H5Pset_link_phase_change(fcpl, 0, 0); -#endif /* QAK */ - /* Emit informational message */ if(verbose) HDfprintf(stderr, "Creating file\n"); diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index 2bebab9..504ea8a 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -90,26 +90,6 @@ open_skeleton(const char *filename, unsigned verbose, unsigned old) return -1; } -#ifdef QAK -/* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - -#ifdef QAK - H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); -#endif /* QAK */ - /* Open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) return -1; diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index 5173c71..1892fe2 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -87,26 +87,6 @@ open_skeleton(const char *filename, unsigned verbose) if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; -#ifdef QAK - /* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr,"mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - -#ifdef QAK - H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); -#endif /* QAK */ - /* Open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) return -1; diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index fc7e7a5..0527229 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -85,16 +85,6 @@ create_file(const char *filename, hbool_t verbose, FILE *verbose_file, if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; -#ifdef QAK - if(verbose) { - char verbose_name[1024]; - - HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_start_write.log.%u", random_seed); - - H5Pset_fapl_log(fapl, verbose_name, H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); - } /* end if */ -#endif /* QAK */ - /* Create file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) return -1; diff --git a/test/swmr_writer.c b/test/swmr_writer.c index d4387aa..656a5b2 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -90,22 +90,6 @@ open_skeleton(const char *filename, hbool_t verbose, FILE *verbose_file, return -1; } -#ifdef QAK - /* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - if(use_log_vfd) { char verbose_name[1024]; diff --git a/test/tattr.c b/test/tattr.c index dab03a7..496dd6c 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -542,7 +542,7 @@ test_attr_flush(hid_t fapl) ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata); CHECK(ret, FAIL, "H5Awrite"); - if(!H5_DBL_ABS_EQUAL(rdata, 0.0)) + if(!H5_DBL_ABS_EQUAL(rdata, (double)0.0f)) TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F); ret=H5Fflush(fil, H5F_SCOPE_GLOBAL); @@ -551,7 +551,7 @@ test_attr_flush(hid_t fapl) ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata); CHECK(ret, FAIL, "H5Awrite"); - if(!H5_DBL_ABS_EQUAL(rdata, 0.0)) + if(!H5_DBL_ABS_EQUAL(rdata, (double)0.0f)) TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F); ret=H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata); @@ -6773,13 +6773,6 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, char attrname[NAME_BUF_SIZE]; /* Object name */ H5A_info_t my_info; /* Local attribute info */ -#ifdef QAK -HDfprintf(stderr, "attr_name = '%s'\n", attr_name); -if(info) - HDfprintf(stderr, "info->corder = %u\n", (unsigned)info->corder); -HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); -#endif /* QAK */ - /* Increment # of times the callback was called */ op_data->ncalled++; diff --git a/utils/mirror_vfd/mirror_remote.h b/utils/mirror_vfd/mirror_remote.h index 9132d51..67e95a5 100644 --- a/utils/mirror_vfd/mirror_remote.h +++ b/utils/mirror_vfd/mirror_remote.h @@ -20,6 +20,8 @@ #ifdef H5_HAVE_MIRROR_VFD +#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */ + #define V_NONE 0 #define V_ERR 1 #define V_WARN 2 -- cgit v0.12 From 47ad0ac7237b464e939fe54dd129a151944d9706 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 6 Aug 2020 15:09:59 -0700 Subject: Renames BEST-EFFORT to BEST_EFFORT for file locking env var --- release_docs/RELEASE.txt | 6 +++--- src/H5FDcore.c | 2 +- src/H5FDdirect.c | 2 +- src/H5FDlog.c | 2 +- src/H5FDsec2.c | 2 +- src/H5FDstdio.c | 2 +- src/H5Fint.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6013603..7ccdbe9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -556,15 +556,15 @@ New Features (DER - 2020/03/18, HDFFV-11057) - - Add BEST-EFFORT value to HDF5_USE_FILE_LOCKING environment variable + - Add BEST_EFFORT value to HDF5_USE_FILE_LOCKING environment variable - This change adds a BEST-EFFORT to the TRUE/FALSE, 1/0 settings that + This change adds a BEST_EFFORT to the TRUE/FALSE, 1/0 settings that were previously accepted. This option turns on file locking but ignores locking errors when the library detects that file locking has been disabled on a file system (useful on some HPC Lustre installations). - The capitalization of BEST-EFFORT is mandatory. + The capitalization of BEST_EFFORT is mandatory. See the configure option discussion for HDFFV-11092 (above) for more information on the file locking feature and how it's controlled. diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 7a31fdf..9a82e2b 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -423,7 +423,7 @@ H5FD__init_package(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 6494fff..9839269 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -204,7 +204,7 @@ H5FD__init_package(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 045662a..c0506e9 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -245,7 +245,7 @@ H5FD__init_package(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index eee554a..12e107f 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -201,7 +201,7 @@ H5FD__init_package(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 574cd9d..a769e86 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -242,7 +242,7 @@ H5FD_stdio_init(void) /* Check the use disabled file locks environment variable */ lock_env_var = getenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !strcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !strcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = 1; /* Override: Ignore disabled locks */ else if(lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = 0; /* Override: Don't ignore disabled locks */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 8b2d18f..7b1ea40 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -291,7 +291,7 @@ H5F__parse_file_lock_env_var(htri_t *use_locks) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && (!HDstrcmp(lock_env_var, "FALSE") || !HDstrcmp(lock_env_var, "0"))) *use_locks = FALSE; /* Override: Never use locks */ - else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "BEST-EFFORT") || !HDstrcmp(lock_env_var, "1"))) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "BEST_EFFORT") || !HDstrcmp(lock_env_var, "1"))) *use_locks = TRUE; /* Override: Always use locks */ else *use_locks = FAIL; /* Environment variable not set, or not set correctly */ -- cgit v0.12 From 8fe3cece3c671453e4c49f22fde9d7635c08f031 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 6 Aug 2020 17:46:40 -0500 Subject: Switch H5VM inline routines back to single underscope and put a comment in their header about this naming --- src/H5B2hdr.c | 4 +- src/H5B2int.c | 2 +- src/H5Dbtree.c | 2 +- src/H5Dbtree2.c | 6 +-- src/H5Dchunk.c | 10 ++--- src/H5Dearray.c | 4 +- src/H5Dfarray.c | 4 +- src/H5Dint.c | 6 +-- src/H5EA.c | 4 +- src/H5EAdblock.c | 2 +- src/H5EAhdr.c | 6 +-- src/H5EApkg.h | 2 +- src/H5FA.c | 6 +-- src/H5FAdbg.c | 2 +- src/H5FScache.c | 4 +- src/H5FSsection.c | 14 +++--- src/H5Faccum.c | 10 ++--- src/H5Fprivate.h | 2 +- src/H5HFdbg.c | 6 +-- src/H5HFdblock.c | 4 +- src/H5HFdtable.c | 12 +++--- src/H5HFhdr.c | 6 +-- src/H5HFiblock.c | 10 ++--- src/H5HFiter.c | 2 +- src/H5HFpkg.h | 2 +- src/H5MF.c | 2 +- src/H5Odtype.c | 6 +-- src/H5Pdapl.c | 8 ++-- src/H5Pdcpl.c | 20 ++++----- src/H5Pdxpl.c | 4 +- src/H5Pencdec.c | 4 +- src/H5Pfapl.c | 22 +++++----- src/H5Plapl.c | 6 +-- src/H5Pocpl.c | 8 ++-- src/H5VM.c | 10 ++--- src/H5VMprivate.h | 126 +++++++++++++++++++++++++++++++++++++----------------- src/hdf5.lnt | 6 +-- test/dsets.c | 4 +- test/earray.c | 16 +++---- test/fheap.c | 6 +-- 40 files changed, 214 insertions(+), 166 deletions(-) diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index fc5e7f8..7b8b564 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -174,7 +174,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned) HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); @@ -190,7 +190,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) * hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec; - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[u].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec))) diff --git a/src/H5B2int.c b/src/H5B2int.c index 3f9ae74..816d8f8 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -367,7 +367,7 @@ H5B2__split_root(H5B2_hdr_t *hdr) hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100; hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) * hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec; - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[hdr->depth].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index c80f90a..5b5ff4a 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -338,7 +338,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Compare the offsets but ignore the other fields */ - ret_value = H5VM__vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); + ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_cmp2() */ diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index b9cf6cd..d233ce5 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -256,7 +256,7 @@ H5D__bt2_crt_context(void *_udata) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -355,7 +355,7 @@ H5D__bt2_compare(const void *_udata, const void *_rec2, int *result) HDassert(rec2); /* Compare the offsets but ignore the other fields */ - *result = H5VM__vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); + *result = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* H5D__bt2_compare() */ @@ -773,7 +773,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 4d351dd..8962348 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -833,7 +833,7 @@ H5D__chunk_set_sizes(H5D_t *dset) unsigned enc_bytes_per_dim; /* Number of bytes required to encode this dimension */ /* Get encoded size of dim, in bytes */ - enc_bytes_per_dim = (H5VM__log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; + enc_bytes_per_dim = (H5VM_log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; /* Check if this is the largest value so far */ if(enc_bytes_per_dim > max_enc_bytes_per_dim) @@ -997,14 +997,14 @@ H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id) rdcc->scaled_dims[u] = (dset->shared->curr_dims[u] + dset->shared->layout.u.chunk.dim[u] - 1) / dset->shared->layout.u.chunk.dim[u]; - if(!(scaled_power2up = H5VM__power2up(rdcc->scaled_dims[u]))) + if(!(scaled_power2up = H5VM_power2up(rdcc->scaled_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Inital 'power2up' values for scaled dimensions */ rdcc->scaled_power2up[u] = scaled_power2up; /* Number of bits required to encode scaled dimension size */ - rdcc->scaled_encode_bits[u] = H5VM__log2_gen(rdcc->scaled_power2up[u]); + rdcc->scaled_encode_bits[u] = H5VM_log2_gen(rdcc->scaled_power2up[u]); } /* end for */ } /* end if */ @@ -6887,12 +6887,12 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - allow_chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); + allow_chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); if(allow_chunk_size_len > 8) allow_chunk_size_len = 8; /* Compute encoded size of chunk */ - new_chunk_size_len = (H5VM__log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; + new_chunk_size_len = (H5VM_log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; if(new_chunk_size_len > 8) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?") diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 56be6a7..a53489e 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -252,7 +252,7 @@ H5D__earray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -937,7 +937,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index a79471a..a9202c2 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -248,7 +248,7 @@ H5D__farray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -892,7 +892,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dint.c b/src/H5Dint.c index d662cec..079fef7 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -672,7 +672,7 @@ H5D__cache_dataspace_info(const H5D_t *dset) for(u = 0; u < dset->shared->ndims; u++) { hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ - if(!(scaled_power2up = H5VM__power2up(dset->shared->curr_dims[u]))) + if(!(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") dset->shared->curr_power2up[u] = scaled_power2up; } @@ -3088,14 +3088,14 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) dset->shared->cache.chunk.scaled_dims[dim_idx] > dset->shared->cache.chunk.nslots)) update_chunks = TRUE; - if(!(scaled_power2up = H5VM__power2up(scaled))) + if(!(scaled_power2up = H5VM_power2up(scaled))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Check if the number of bits required to encode the scaled size value changed */ if(dset->shared->cache.chunk.scaled_power2up[dim_idx] != scaled_power2up) { /* Update the 'power2up' & 'encode_bits' values for the current dimension */ dset->shared->cache.chunk.scaled_power2up[dim_idx] = scaled_power2up; - dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM__log2_gen(scaled_power2up); + dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM_log2_gen(scaled_power2up); /* Indicate that the cached chunk indices need to be updated */ update_chunks = TRUE; diff --git a/src/H5EA.c b/src/H5EA.c index a027792..bf50452 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -553,7 +553,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, (page_idx * sblock->dblk_page_size); /* Check if page has been initialized yet */ - if(!H5VM__bit_get(sblock->page_init, page_init_idx)) { + if(!H5VM_bit_get(sblock->page_init, page_init_idx)) { /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the data block page */ @@ -561,7 +561,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in super block */ - H5VM__bit_set(sblock->page_init, page_init_idx, TRUE); + H5VM_bit_set(sblock->page_init, page_init_idx, TRUE); sblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ else diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index c72dc7c..d540a3c 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -266,7 +266,7 @@ H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx)) /* Determine the superblock information for the index */ H5_CHECK_OVERFLOW(idx, /*From:*/hsize_t, /*To:*/uint64_t); - sblk_idx = H5VM__log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); /* Set return value */ ret_value = sblk_idx; diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 07330c1..8b4d5f7 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -199,7 +199,7 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata)) HDassert(hdr->cparam.sup_blk_min_data_ptrs); /* Compute general information */ - hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM__log2_of2(hdr->cparam.data_blk_min_elmts)); + hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts)); hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits; hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits); @@ -261,7 +261,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Check for needing to increase size of array of factories */ if(idx >= hdr->elmt_fac.nalloc) { @@ -327,7 +327,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Free buffer for elements in index block */ HDassert(idx < hdr->elmt_fac.nalloc); diff --git a/src/H5EApkg.h b/src/H5EApkg.h index ad1fdfc..b70231d 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -146,7 +146,7 @@ #define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) /* Compute the first super block index that will hold a certain # of data block pointers */ -#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM__log2_of2((uint32_t)m)) +#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM_log2_of2((uint32_t)m)) /****************************/ /* Package Private Typedefs */ diff --git a/src/H5FA.c b/src/H5FA.c index 871793e..ee99bb2 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -395,13 +395,13 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt)) dblk_page_nelmts = dblock->dblk_page_nelmts; /* Check if the page has been created yet */ - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Create the data block page */ if(H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in data block */ - H5VM__bit_set(dblock->dblk_page_init, page_idx, TRUE); + H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE); dblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -482,7 +482,7 @@ H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt)) page_idx = (size_t)(idx / dblock->dblk_page_nelmts); /* Check if the page is defined yet */ - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Call the class's 'fill' callback */ if((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0) H5E_THROW(H5E_CANTSET, "can't set element to class's fill value") diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index 431e6fa..b578cf2 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -229,7 +229,7 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Read and print each page's elements in the data block */ for(page_idx = 0; page_idx < dblock->npages; page_idx++) { - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth, "Page %Zu:", page_idx, "empty"); diff --git a/src/H5FScache.c b/src/H5FScache.c index ed468b4..4c75fb1 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -1027,7 +1027,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ old_tot_sect_count = fspace->tot_sect_count; @@ -1294,7 +1294,7 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, /* Set up user data for iterator */ udata.sinfo = sinfo; udata.image = ℑ - udata.sect_cnt_size = H5VM__limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); + udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); /* Iterate over all the bins */ for(bin = 0; bin < sinfo->nbins; bin++) diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 269f63c..51233a0 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -144,10 +144,10 @@ HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set non-zero values */ - sinfo->nbins = H5VM__log2_gen(fspace->max_sect_size); + sinfo->nbins = H5VM_log2_gen(fspace->max_sect_size); sinfo->sect_prefix_size = H5FS_SINFO_PREFIX_SIZE(f); sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8; - sinfo->sect_len_size = H5VM__limit_enc_size((uint64_t)fspace->max_sect_size); + sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size); #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size); HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr); @@ -527,7 +527,7 @@ H5FS__sect_serialize_size(H5FS_t *fspace) sect_buf_size = fspace->sinfo->sect_prefix_size; /* Count for each differently sized serializable section */ - sect_buf_size += fspace->sinfo->serial_size_count * H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Size for each differently sized serializable section */ sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size; @@ -777,7 +777,7 @@ H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(cls); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?") @@ -963,7 +963,7 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(sect->size); /* Determine correct bin which holds items of the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) { if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) @@ -1640,7 +1640,7 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node HDassert(node); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(request); + bin = H5VM_log2_gen(request); HDassert(bin < fspace->sinfo->nbins); alignment = fspace->alignment; if(!((alignment > 1) && (request >= fspace->align_thres))) @@ -2028,7 +2028,7 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, HDassert(fspace->sinfo->bins); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < fspace->sinfo->nbins); HDassert(fspace->sinfo->bins[bin].bin_list); diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 5ad7634..02f475d 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -153,7 +153,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(new_size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -296,7 +296,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)((size + accum->size) - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)((size + accum->size) - 1))); /* Check for accumulator getting too big */ if(new_size > H5F_ACCUM_MAX_SIZE) { @@ -609,7 +609,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -653,7 +653,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t clear_size; /* Size of memory that needs clearing */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Grow the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) @@ -701,7 +701,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 1cfd103..9deba8c 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -117,7 +117,7 @@ typedef struct H5F_t H5F_t; /* (Assumes that the high bits of the integer are zero) */ # define UINT64ENCODE_VARLEN(p, n) { \ uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM__limit_enc_size(__n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ \ *(p)++ = (uint8_t)_s; \ UINT64ENCODE_VAR(p, __n, _s); \ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index f6c7f0e..e841d78 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -702,10 +702,10 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, unsigned first_row_bits; /* Number of bits used bit addresses in first row */ unsigned num_indirect_rows; /* Number of rows of blocks in each indirect block */ - first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM__log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM_log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { - num_indirect_rows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; + num_indirect_rows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 96392c1..1e0813c 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -356,7 +356,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, if(request < hdr->man_dtable.cparam.start_block_size) min_dblock_size = hdr->man_dtable.cparam.start_block_size; else { - min_dblock_size = ((size_t)1) << (1 + H5VM__log2_gen((uint64_t)request)); + min_dblock_size = ((size_t)1) << (1 + H5VM_log2_gen((uint64_t)request)); HDassert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size); } /* end else */ @@ -559,7 +559,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting parent indirect block */ /* Compute # of rows in child indirect block */ - nrows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; + nrows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; HDassert(nrows < iblock->nrows); /* child must be smaller than parent */ /* Compute indirect block's entry */ diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index ad317c9..4fff348 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -102,10 +102,10 @@ H5HF__dtable_init(H5HF_dtable_t *dtable) HDassert(dtable); /* Compute/cache some values */ - dtable->start_bits = H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size); - dtable->first_row_bits = dtable->start_bits + H5VM__log2_of2(dtable->cparam.width); + dtable->start_bits = H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size); + dtable->first_row_bits = dtable->start_bits + H5VM_log2_of2(dtable->cparam.width); dtable->max_root_rows = (dtable->cparam.max_index - dtable->first_row_bits) + 1; - dtable->max_direct_bits = H5VM__log2_of2((uint32_t)dtable->cparam.max_direct_size); + dtable->max_direct_bits = H5VM_log2_of2((uint32_t)dtable->cparam.max_direct_size); dtable->max_direct_rows = (dtable->max_direct_bits - dtable->start_bits) + 2; dtable->num_id_first_row = dtable->cparam.start_block_size * dtable->cparam.width; dtable->max_dir_blk_off_size = H5HF_SIZEOF_OFFSET_LEN(dtable->cparam.max_direct_size); @@ -165,7 +165,7 @@ H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, uns H5_CHECKED_ASSIGN(*col, unsigned, (off / dtable->cparam.start_block_size), hsize_t); } /* end if */ else { - unsigned high_bit = H5VM__log2_gen(off); /* Determine the high bit in the offset */ + unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */ hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */ *row = (high_bit - dtable->first_row_bits) + 1; @@ -241,7 +241,7 @@ H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) if(block_size == dtable->cparam.start_block_size) row = 0; else - row = (H5VM__log2_of2((uint32_t)block_size) - H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; + row = (H5VM_log2_of2((uint32_t)block_size) - H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; FUNC_LEAVE_NOAPI(row) } /* end H5HF__dtable_size_to_row() */ @@ -271,7 +271,7 @@ H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) */ HDassert(dtable); - rows = (H5VM__log2_gen(size) - dtable->first_row_bits) + 1; + rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1; FUNC_LEAVE_NOAPI(rows) } /* end H5HF__dtable_size_to_rows() */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 4a645cd..043ab87 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -46,7 +46,7 @@ #ifndef NDEBUG /* Limit on the size of the max. direct block size */ /* (This is limited to 32-bits currently, because I think it's unlikely to - * need to be larger, the 32-bit limit for H5VM__log2_of2(n), and + * need to be larger, the 32-bit limit for H5VM_log2_of2(n), and * some offsets/sizes are encoded with a maximum of 32-bits - QAK) */ #define H5HF_MAX_DIRECT_SIZE_LIMIT ((hsize_t)2 * 1024 * 1024 * 1024) @@ -221,7 +221,7 @@ H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Set the size of heap IDs */ hdr->heap_len_size = (uint8_t)MIN(hdr->man_dtable.max_dir_blk_off_size, - H5VM__limit_enc_size((uint64_t)hdr->max_man_size)); + H5VM_limit_enc_size((uint64_t)hdr->max_man_size)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1070,7 +1070,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned child_entry; /* Entry of child indirect block */ /* Compute # of rows needed in child indirect block */ - child_rows_needed = (H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; + child_rows_needed = (H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; HDassert(child_rows_needed > child_nrows); child_entry = (next_row + (child_rows_needed - child_nrows)) * hdr->man_dtable.cparam.width; if(child_entry > (iblock->nrows * hdr->man_dtable.cparam.width)) diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 1c40d53..2714ac7 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -371,7 +371,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) nrows = hdr->man_dtable.cparam.start_root_rows; - block_row_off = H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); + block_row_off = H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); if(block_row_off > 0) block_row_off++; /* Account for the pair of initial rows of the initial block size */ rows_needed = 1 + block_row_off; @@ -689,7 +689,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; /* Compute new # of rows in root indirect block */ - new_nrows = (unsigned)1 << (1 + H5VM__log2_gen((uint64_t)max_child_row)); + new_nrows = (unsigned)1 << (1 + H5VM_log2_gen((uint64_t)max_child_row)); /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ @@ -1722,10 +1722,10 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, size_t u; /* Local index variable */ entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width; - first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM__log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM_log2_of2(hdr->man_dtable.cparam.width); num_indirect_rows = - (H5VM__log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; + (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) { size_t v; /* Local index variable */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 002ff01..43cb76a 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -210,7 +210,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, /* Compute # of rows in context indirect block */ child_size = hdr->man_dtable.row_block_size[biter->curr->up->row]; - iblock_nrows = (H5VM__log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; + iblock_nrows = (H5VM_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; } /* end else */ /* Load indirect block for this context location */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index ca05798..5324bc4 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -134,7 +134,7 @@ /* Compute the # of bytes required to store an offset into a given buffer size */ #define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) -#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM__log2_of2((unsigned)(l))) +#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM_log2_of2((unsigned)(l))) /* Heap ID bit flags */ /* Heap ID version (2 bits: 6-7) */ diff --git a/src/H5MF.c b/src/H5MF.c index 7de09cb..42ad3fb 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -419,7 +419,7 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) fs_create.client = H5FS_CLIENT_FILE_ID; fs_create.shrink_percent = H5MF_FSPACE_SHRINK; fs_create.expand_percent = H5MF_FSPACE_EXPAND; - fs_create.max_sect_addr = 1 + H5VM__log2_gen((uint64_t)f->shared->maxaddr); + fs_create.max_sect_addr = 1 + H5VM_log2_gen((uint64_t)f->shared->maxaddr); fs_create.max_sect_size = f->shared->maxaddr; /* Set up alignment and threshold to use depending on TYPE */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c7d6c1b..cbadfd0 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -264,7 +264,7 @@ H5O__dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t unsigned j; /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -905,7 +905,7 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -1277,7 +1277,7 @@ H5O__dtype_size(const H5F_t *f, const void *_mesg) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* Compute the total size needed to encode compound datatype */ for(u = 0; u < dt->shared->u.compnd.nmembs; u++) { diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 7429443..6dae5ed 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -331,7 +331,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(vds_file_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -579,7 +579,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(efile_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -899,7 +899,7 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ @@ -1001,7 +1001,7 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index d8b0218..11ab7b1 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1029,7 +1029,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) /* Encode the size of a size_t */ enc_value = (uint64_t)dt_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); /* Encode the size */ @@ -1058,7 +1058,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) if(H5T_encode(fill->type, NULL, &dt_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") enc_value = (uint64_t)dt_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); } *size += (1 + enc_size); *size += dt_size; @@ -1414,7 +1414,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) if(NULL != *pp) { /* Encode number of slots used */ enc_value = (uint64_t)efl->nused; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1424,7 +1424,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Calculate length of slot name and encode it */ len = HDstrlen(efl->slot[u].name) + 1; enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1435,14 +1435,14 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Encode offset */ enc_value = (uint64_t)efl->slot[u].offset; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode size */ enc_value = (uint64_t)efl->slot[u].size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1450,13 +1450,13 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Calculate size needed for encoding */ - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->nused)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->nused)); for(u = 0; u < efl->nused; u++) { len = HDstrlen(efl->slot[u].name) + 1; - *size += (1 + H5VM__limit_enc_size((uint64_t)len)); + *size += (1 + H5VM_limit_enc_size((uint64_t)len)); *size += len; - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].offset)); - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].size)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].offset)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].size)); } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index f416eff..e6db02f 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -685,7 +685,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) /* encode the length of the prefix */ enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -702,7 +702,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Size of encoded data transform */ - *size += (1 + H5VM__limit_enc_size((uint64_t)len)); + *size += (1 + H5VM_limit_enc_size((uint64_t)len)); if(NULL != pexp) *size += len; diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 32824b7..8b10971 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -94,7 +94,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; - unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ FUNC_ENTER_PACKAGE_NOERR @@ -135,7 +135,7 @@ herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */ - unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ uint8_t **pp = (uint8_t **)_pp; FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index baad470..7f962ef 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -3475,7 +3475,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->set_initial_size); enc_value = (uint64_t)config->initial_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3483,13 +3483,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_DOUBLE(*pp, config->min_clean_fraction); enc_value = (uint64_t)config->max_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); enc_value = (uint64_t)config->min_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3507,7 +3507,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_increment); enc_value = (uint64_t)config->max_increment; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3529,7 +3529,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_decrement); enc_value = (uint64_t)config->max_decrement; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3550,15 +3550,15 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) /* Compute encoded size of variably-encoded values */ enc_value = (uint64_t)config->initial_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->min_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_increment; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_decrement; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); /* Compute encoded size of fixed-size values */ *size += (5 + (sizeof(unsigned) * 8) + (sizeof(double) * 8) + @@ -4227,7 +4227,7 @@ H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(log_location); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 72c60b4..8a0848c 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -373,7 +373,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* encode the length of the plist */ enc_value = (uint64_t)fapl_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -384,7 +384,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) *pp += fapl_size; } - fapl_size += (1 + H5VM__limit_enc_size((uint64_t)fapl_size)); + fapl_size += (1 + H5VM_limit_enc_size((uint64_t)fapl_size)); } /* end if */ *size += (1 + fapl_size); /* Non-default flag, plus encoded property list size */ @@ -705,7 +705,7 @@ H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(elink_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index b053895..b576aec 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1407,7 +1407,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode nused value */ enc_value = (uint64_t)pline->nused; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1437,7 +1437,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode cd_nelmts */ enc_value = (uint64_t)pline->filter[u].cd_nelmts; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1450,12 +1450,12 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* calculate size required for encoding */ *size += 1; - *size += (1 + H5VM__limit_enc_size((uint64_t)pline->nused)); + *size += (1 + H5VM_limit_enc_size((uint64_t)pline->nused)); for(u = 0; u < pline->nused; u++) { *size += (sizeof(int32_t) + sizeof(unsigned) + 1); if(NULL != pline->filter[u].name) *size += H5Z_COMMON_NAME_LEN; - *size += (1 + H5VM__limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); + *size += (1 + H5VM_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); *size += pline->filter[u].cd_nelmts * sizeof(unsigned); } /* end for */ diff --git a/src/H5VM.c b/src/H5VM.c index 403cc45..7be8eab 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -75,7 +75,7 @@ H5VM__stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM__vector_reduce_product(0, NULL)); + HDassert(1 == H5VM_vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -119,7 +119,7 @@ H5VM__stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM__vector_reduce_product(0, NULL)); + HDassert(1 == H5VM_vector_reduce_product(0, NULL)); HDassert(*elmt_size>0); /* @@ -642,7 +642,7 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, HDassert(elmt_size < SIZET_MAX); H5VM_vector_cpy(n, idx, size); - nelmts = H5VM__vector_reduce_product(n, size); + nelmts = H5VM_vector_reduce_product(n, size); for (i=0; i 0) -#define H5VM_vector_le_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) <= 0) -#define H5VM_vector_ge_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) >= 0) -#define H5VM_vector_eq_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) == 0) -#define H5VM_vector_lt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) < 0) -#define H5VM_vector_gt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) > 0) -#define H5VM_vector_le_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) <= 0) -#define H5VM_vector_ge_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) >= 0) +#define H5VM_vector_eq_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) == 0) +#define H5VM_vector_lt_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) < 0) +#define H5VM_vector_gt_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) > 0) +#define H5VM_vector_le_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) <= 0) +#define H5VM_vector_ge_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) >= 0) +#define H5VM_vector_eq_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) == 0) +#define H5VM_vector_lt_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) < 0) +#define H5VM_vector_gt_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) > 0) +#define H5VM_vector_le_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) <= 0) +#define H5VM_vector_ge_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) >= 0) /* Other functions */ #define H5VM_vector_cpy(N,DST,SRC) { \ @@ -139,13 +139,17 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, /*------------------------------------------------------------------------- - * Function: H5VM__vector_reduce_product + * Function: H5VM_vector_reduce_product * * Purpose: Product reduction of a vector. Vector elements and return * value are size_t because we usually want the number of * elements in an array and array dimensions are always of type * size_t. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: Product of elements * * Failure: 1 if N is zero @@ -156,7 +160,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, *------------------------------------------------------------------------- */ static H5_INLINE hsize_t H5_ATTR_UNUSED -H5VM__vector_reduce_product(unsigned n, const hsize_t *v) +H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; @@ -171,10 +175,14 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM__vector_zerop_u + * Function: H5VM_vector_zerop_u * * Purpose: Determines if all elements of a vector are zero. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: TRUE if all elements are zero, * FALSE otherwise * @@ -186,7 +194,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE htri_t H5_ATTR_UNUSED -H5VM__vector_zerop_u(int n, const hsize_t *v) +H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ @@ -208,6 +216,10 @@ done: * * Purpose: Determines if all elements of a vector are zero. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: TRUE if all elements are zero, * FALSE otherwise * @@ -237,11 +249,15 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM__vector_cmp_u + * Function: H5VM_vector_cmp_u * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: -1 if V1 is less than V2 * 0 if they are equal * 1 if V1 is greater than V2 @@ -254,7 +270,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM__vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) +H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ @@ -277,11 +293,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM__vector_cmp_s + * Function: H5VM_vector_cmp_s * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: -1 if V1 is less than V2 * 0 if they are equal * 1 if V1 is greater than V2 @@ -294,7 +314,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM__vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) +H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ @@ -317,10 +337,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM__vector_inc + * Function: H5VM_vector_inc * * Purpose: Increments V1 by V2 * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: void * * Programmer: Robb Matzke @@ -329,7 +353,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM__vector_inc(int n, hsize_t *v1, const hsize_t *v2) +H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) *v1++ += *v2++; } @@ -357,7 +381,7 @@ static const unsigned char LogTable256[] = /*------------------------------------------------------------------------- - * Function: H5VM__log2_gen + * Function: H5VM_log2_gen * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -368,6 +392,10 @@ static const unsigned char LogTable256[] = * The version on the web-site is for 32-bit quantities and this * version has been extended for 64-bit quantities. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: log2(n) (always - no failure condition) * * Programmer: Quincey Koziol @@ -376,7 +404,7 @@ static const unsigned char LogTable256[] = *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM__log2_gen(uint64_t n) +H5VM_log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ register unsigned int t, tt, ttt; /* temporaries */ @@ -394,7 +422,7 @@ H5VM__log2_gen(uint64_t n) r = (t = (unsigned)(n >> 8)) ? 8 + (unsigned)LogTable256[t] : (unsigned)LogTable256[(uint8_t)n]; return(r); -} /* H5VM__log2_gen() */ +} /* H5VM_log2_gen() */ /* Lookup table for specialized log2(n) of power of two routine */ @@ -406,7 +434,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = /*------------------------------------------------------------------------- - * Function: H5VM__log2_of2 + * Function: H5VM_log2_of2 * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -416,6 +444,10 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = * This is from the "Bit Twiddling Hacks" at: * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: log2(n) (always - no failure condition) * * Programmer: Quincey Koziol @@ -424,20 +456,24 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_PURE unsigned -H5VM__log2_of2(uint32_t n) +H5VM_log2_of2(uint32_t n) { #ifndef NDEBUG HDassert(POWER_OF_TWO(n)); #endif /* NDEBUG */ return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); -} /* H5VM__log2_of2() */ +} /* H5VM_log2_of2() */ /*------------------------------------------------------------------------- - * Function: H5VM__power2up + * Function: H5VM_power2up * * Purpose: Round up a number to the next power of 2 * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Return the number which is a power of 2 * * Programmer: Vailin Choi; Nov 2014 @@ -445,7 +481,7 @@ H5VM__log2_of2(uint32_t n) *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_CONST hsize_t -H5VM__power2up(hsize_t n) +H5VM_power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ @@ -457,15 +493,19 @@ H5VM__power2up(hsize_t n) ret_value <<= 1; return(ret_value); -} /* H5VM__power2up */ +} /* H5VM_power2up */ /*------------------------------------------------------------------------- - * Function: H5VM__limit_enc_size + * Function: H5VM_limit_enc_size * * Purpose: Determine the # of bytes needed to encode values within a * range from 0 to a given limit * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Number of bytes needed * * Programmer: Quincey Koziol @@ -474,17 +514,17 @@ H5VM__power2up(hsize_t n) *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM__limit_enc_size(uint64_t limit) +H5VM_limit_enc_size(uint64_t limit) { - return (H5VM__log2_gen(limit) / 8) + 1; -} /* end H5VM__limit_enc_size() */ + return (H5VM_log2_gen(limit) / 8) + 1; +} /* end H5VM_limit_enc_size() */ static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; /*------------------------------------------------------------------------- - * Function: H5VM__bit_get + * Function: H5VM_bit_get * * Purpose: Determine the value of the n'th bit in a buffer. * @@ -495,6 +535,10 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: TRUE/FALSE * * Programmer: Quincey Koziol @@ -503,15 +547,15 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, *------------------------------------------------------------------------- */ static H5_INLINE hbool_t H5_ATTR_UNUSED -H5VM__bit_get(const unsigned char *buf, size_t offset) +H5VM_bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE); -} /* end H5VM__bit_get() */ +} /* end H5VM_bit_get() */ /*------------------------------------------------------------------------- - * Function: H5VM__bit_set + * Function: H5VM_bit_set * * Purpose: Set/reset the n'th bit in a buffer. * @@ -522,6 +566,10 @@ H5VM__bit_get(const unsigned char *buf, size_t offset) * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: None * * Programmer: Quincey Koziol @@ -530,14 +578,14 @@ H5VM__bit_get(const unsigned char *buf, size_t offset) *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM__bit_set(unsigned char *buf, size_t offset, hbool_t val) +H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ if(val) buf[offset / 8] |= H5VM_bit_set_g[offset % 8]; else buf[offset / 8] &= H5VM_bit_clear_g[offset % 8]; -} /* end H5VM__bit_set() */ +} /* end H5VM_bit_set() */ #endif /* H5VMprivate_H */ diff --git a/src/hdf5.lnt b/src/hdf5.lnt index 61c4a61..7b0f384 100644 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -1,9 +1,9 @@ // Lint options shared by both PC-Lint for Windows and Flexelint for Linux // Turn off warnings about not using the inlined H5V* functions: --esym(528, H5VM_vector_reduce_product, H5VM__vector_inc) --esym(528, H5VM__vector_cmp_s) --esym(528, H5VM__vector_zerop_s, H5VM__vector_zerop_u) +-esym(528, H5VM_vector_reduce_product, H5VM_vector_inc) +-esym(528, H5VM_vector_cmp_s) +-esym(528, H5VM_vector_zerop_s, H5VM_vector_zerop_u) // Suppress message about using 'goto' in a few functions -efunc(801,H5_term_library,H5_trace) diff --git a/test/dsets.c b/test/dsets.c index 3547554..4ab3efa 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -11723,9 +11723,9 @@ error: /*------------------------------------------------------------------------- * Function: test_power2up * - * Purpose: Tests that the H5VM__power2up(n) function does not result in an + * Purpose: Tests that the H5VM_power2up(n) function does not result in an * infinite loop when input n exceeds 2^63. (HDFFV-10217) - * H5VM__power2up() is used to calculate the next power of 2 for + * H5VM_power2up() is used to calculate the next power of 2 for * a dataset's scaled dimension sizes. * * Return: Success: 0 diff --git a/test/earray.c b/test/earray.c index a8ae9f0..7d91bdc 100644 --- a/test/earray.c +++ b/test/earray.c @@ -232,7 +232,7 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) HDmemset(tparam, 0, sizeof(*tparam)); /* Compute general information */ - tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM__log2_of2(cparam->data_blk_min_elmts)); + tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM_log2_of2(cparam->data_blk_min_elmts)); /* Allocate information for each super block */ tparam->sblk_info = (H5EA_sblk_info_t *)HDmalloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); @@ -718,7 +718,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE /* Set invalid max. # of elements per data block page bits */ if(test_cparam.idx_blk_elmts > 0) { HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); - test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM__log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); + test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; @@ -1373,7 +1373,7 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state->nelmts = EA_NELMTS(cparam, tparam, idx, sblk_idx); state->ndata_blks = EA_NDATA_BLKS(cparam, tparam, idx, sblk_idx); @@ -1465,10 +1465,10 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, eiter->idx = cnt - 1; eiter->max = cnt - 1; if(cnt > cparam->idx_blk_elmts) { - eiter->max_sblk_idx = H5VM__log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + eiter->max_sblk_idx = H5VM_log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); eiter->max_nelmts = EA_NELMTS(cparam, tparam, eiter->max, eiter->max_sblk_idx); eiter->max_ndata_blks = EA_NDATA_BLKS(cparam, tparam, eiter->max, eiter->max_sblk_idx); - eiter->idx_blk_nsblks = 2 * H5VM__log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); + eiter->idx_blk_nsblks = 2 * H5VM_log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); } /* end if */ else { eiter->max_sblk_idx = (hsize_t)0; @@ -1586,14 +1586,14 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, hsize_t tmp_idx; /* Temporary index in superblock */ hsize_t dblk_idx; /* Index of data block within superblock */ - idx_sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + idx_sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); tmp_idx = idx - (cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx); dblk_idx = tmp_idx / tparam->sblk_info[idx_sblk_idx].dblk_nelmts; if(dblk_idx > 0) loc_idx = idx - tparam->sblk_info[idx_sblk_idx].dblk_nelmts; else loc_idx = cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx - 1; - loc_sblk_idx = H5VM__log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + loc_sblk_idx = H5VM_log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); } /* end else */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) @@ -2317,7 +2317,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state.nelmts = (hsize_t)cparam->idx_blk_elmts + tparam->sblk_info[sblk_idx].dblk_nelmts; state.ndata_blks = (hsize_t)1; state.nsuper_blks = (hsize_t)1; diff --git a/test/fheap.c b/test/fheap.c index 55af7d6..1ce7398 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -1592,7 +1592,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 2nd level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1710,7 +1710,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 3rd level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) /* Fill row of 3rd level indirect blocks */ if(fill_3rd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1800,7 +1800,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 4th level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) { + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) { /* Fill row of 4th level indirect blocks */ if(fill_4th_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR -- cgit v0.12 From 5ce2a178043d9749d30076a2e62249d9998c40ec Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 6 Aug 2020 17:58:07 -0700 Subject: Removes staff email addresses from the repository Removes redundant C library headers from hl library --- bin/errors | 2 +- bin/h5vers | 2 +- bin/warnhist | 2 +- hl/fortran/src/H5IMcc.c | 12 +- hl/fortran/src/H5IMfc.c | 24 +- hl/fortran/src/H5IMff.F90 | 24 +- hl/fortran/src/H5LTfc.c | 24 +- hl/fortran/src/H5LTff.F90 | 40 +-- hl/fortran/src/H5TBfc.c | 18 +- hl/fortran/src/H5TBff.F90 | 18 +- hl/src/H5DS.c | 543 ++++++++++++++++-------------------- hl/src/H5IM.c | 30 +- hl/src/H5LD.c | 4 - hl/src/H5LT.c | 127 ++++----- hl/src/H5PT.c | 58 ++-- hl/src/H5TB.c | 55 ++-- hl/test/gen_test_ds.c | 2 - hl/test/h5hltest.h | 2 +- hl/test/test_ds.c | 2 - hl/test/test_dset_append.c | 4 - hl/test/test_image.c | 4 - hl/test/test_ld.c | 5 - hl/test/test_lite.c | 2 - hl/test/test_packet.c | 2 - hl/test/test_table.c | 2 - hl/tools/gif2h5/h52gifgentst.c | 2 +- test/SWMR_UseCase_UG.txt | 4 +- test/app_ref.c | 2 +- test/big.c | 4 +- test/bittests.c | 2 +- test/btree2.c | 2 +- test/cache.c | 1 - test/cmpd_dset.c | 2 +- test/cross_read.c | 2 +- test/dangle.c | 2 +- test/dsets.c | 2 +- test/dt_arith.c | 2 +- test/dtypes.c | 2 +- test/earray.c | 2 +- test/enum.c | 2 +- test/extend.c | 2 +- test/external.c | 2 +- test/external_common.c | 2 +- test/external_common.h | 2 +- test/external_fname.h | 2 +- test/fheap.c | 2 +- test/filter_fail.c | 2 +- test/flush1.c | 2 +- test/flush2.c | 2 +- test/gen_bad_compound.c | 2 +- test/gen_bad_ohdr.c | 2 +- test/gen_cross.c | 2 +- test/gen_filters.c | 2 +- test/gen_mergemsg.c | 2 +- test/gen_new_array.c | 2 +- test/gen_new_fill.c | 2 +- test/gen_new_group.c | 2 +- test/gen_new_mtime.c | 2 +- test/gen_new_super.c | 2 +- test/gen_old_array.c | 2 +- test/gen_old_group.c | 2 +- test/gen_old_layout.c | 2 +- test/gen_old_mtime.c | 2 +- test/gen_sizes_lheap.c | 2 +- test/gen_specmetaread.c | 2 +- test/gen_udlinks.c | 2 +- test/getname.c | 2 +- test/gheap.c | 2 +- test/h5test.c | 2 +- test/h5test.h | 2 +- test/hdfs.c | 2 +- test/hyperslab.c | 2 +- test/istore.c | 2 +- test/lheap.c | 2 +- test/mount.c | 2 +- test/mtime.c | 2 +- test/ntypes.c | 2 +- test/ohdr.c | 2 +- test/pool.c | 2 +- test/ros3.c | 2 +- test/s3comms.c | 2 +- test/set_extent.c | 2 +- test/space_overflow.c | 2 +- test/stab.c | 4 +- test/tchecksum.c | 2 +- test/testframe.c | 2 +- test/tfile.c | 3 - test/unlink.c | 2 +- test/vds.c | 2 +- test/vds_env.c | 2 +- test/vfd.c | 2 +- tools/lib/h5tools.h | 2 +- tools/lib/h5tools_str.h | 2 +- tools/lib/h5tools_utils.h | 2 +- tools/src/h5diff/h5diff_main.c | 2 +- tools/src/h5diff/ph5diff_main.c | 2 +- tools/src/h5ls/h5ls.c | 2 +- tools/src/h5repack/h5repack_parse.c | 2 +- tools/src/misc/h5debug.c | 3 +- tools/src/misc/h5repart.c | 2 +- tools/test/h5copy/testh5copy.sh.in | 2 +- tools/test/h5diff/h5diffgentest.c | 2 +- tools/test/h5dump/h5dumpgentest.c | 10 +- tools/test/h5repack/h5repacktst.c | 10 +- tools/test/misc/h5perf_gentest.c | 4 +- tools/test/misc/h5repart_gentest.c | 2 +- tools/test/misc/testh5mkgrp.sh.in | 2 +- tools/test/perform/iopipe.c | 2 +- tools/test/perform/overhead.c | 2 +- tools/test/perform/perf_meta.c | 2 +- 110 files changed, 546 insertions(+), 657 deletions(-) diff --git a/bin/errors b/bin/errors index 107bb9c..a5bad3a 100755 --- a/bin/errors +++ b/bin/errors @@ -17,7 +17,7 @@ use Text::Tabs; # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# Robb Matzke, matzke@llnl.gov +# Robb Matzke # 30 Aug 1997 # # Purpose: This script will read standard input which should be a diff --git a/bin/h5vers b/bin/h5vers index 659a081..6093eb0 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -17,7 +17,7 @@ use strict; # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# Robb Matzke +# Robb Matzke # 17 July 1998 ### Purpose diff --git a/bin/warnhist b/bin/warnhist index a88474b..3b2cec6 100755 --- a/bin/warnhist +++ b/bin/warnhist @@ -15,7 +15,7 @@ use warnings; # 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. # -# Quincey Koziol, koziol@hdfgroup.org +# Quincey Koziol # 9 Aug 2013 # # Purpose: Given an input file containing the output from a build of the diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index c6e4b1b..1d12f56 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -34,7 +34,7 @@ herr_t H5IM_get_palette(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -127,7 +127,7 @@ herr_t H5IMmake_image_8bitf(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -244,7 +244,7 @@ herr_t H5IMmake_image_24bitf(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -302,7 +302,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -395,7 +395,7 @@ herr_t H5IMmake_palettef(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -434,7 +434,7 @@ herr_t H5IMget_palettef(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index cafd623..638cea4 100644 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -24,7 +24,7 @@ * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -85,7 +85,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -138,7 +138,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -207,7 +207,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -292,7 +292,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -341,7 +341,7 @@ h5imis_image_c(hid_t_f *loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -396,7 +396,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -461,7 +461,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -527,7 +527,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -588,7 +588,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -655,7 +655,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -714,7 +714,7 @@ done: * * Return: true, false, fail * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * diff --git a/hl/fortran/src/H5IMff.F90 b/hl/fortran/src/H5IMff.F90 index ffa18aa..3438e7f 100644 --- a/hl/fortran/src/H5IMff.F90 +++ b/hl/fortran/src/H5IMff.F90 @@ -41,7 +41,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -95,7 +95,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -142,7 +142,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -204,7 +204,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -267,7 +267,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -313,7 +313,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -364,7 +364,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -416,7 +416,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -467,7 +467,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -516,7 +516,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -567,7 +567,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -619,7 +619,7 @@ CONTAINS ! ! Return: true, false, fail ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 3597c3a..2c4f274 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -24,7 +24,7 @@ * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -94,7 +94,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -153,7 +153,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -218,7 +218,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -274,7 +274,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -373,7 +373,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -460,7 +460,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -535,7 +535,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -595,7 +595,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -643,7 +643,7 @@ h5ltfind_dataset_c(hid_t_f *loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -722,7 +722,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -791,7 +791,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index bc8734f..5cd255c 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -164,7 +164,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 1, 2004 ! @@ -385,7 +385,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -426,7 +426,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -595,7 +595,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -770,7 +770,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -933,7 +933,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -983,7 +983,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -1092,7 +1092,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1143,7 +1143,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1193,7 +1193,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1245,7 +1245,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1350,7 +1350,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1397,7 +1397,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1443,7 +1443,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1490,7 +1490,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1551,7 +1551,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! @@ -1600,7 +1600,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1644,7 +1644,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! @@ -1703,7 +1703,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1757,7 +1757,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 285cd84..bd582e4 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -26,7 +26,7 @@ * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -301,7 +301,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -350,7 +350,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -398,7 +398,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -443,7 +443,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -487,7 +487,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 13, 2004 * @@ -534,7 +534,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 13, 2004 * @@ -580,7 +580,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -627,7 +627,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 13, 2004 * diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90 index c3db01e..e39af97 100644 --- a/hl/fortran/src/H5TBff.F90 +++ b/hl/fortran/src/H5TBff.F90 @@ -172,7 +172,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -424,7 +424,7 @@ CONTAINS ! ! Purpose: Writes one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -505,7 +505,7 @@ CONTAINS ! ! Purpose: Reads one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -586,7 +586,7 @@ CONTAINS ! ! Purpose: Writes one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -661,7 +661,7 @@ CONTAINS ! ! Purpose: Reads one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -734,7 +734,7 @@ CONTAINS ! ! Purpose: Inserts one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -807,7 +807,7 @@ CONTAINS ! ! Purpose: Inserts one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -858,7 +858,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -909,7 +909,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 82dc129..12bcc93 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include #include "H5DSprivate.h" #include "H5LTprivate.h" #include "H5IMprivate.h" @@ -25,29 +22,24 @@ static herr_t H5DS_is_reserved(hid_t did); static hid_t H5DS_get_REFLIST_type(void); /*------------------------------------------------------------------------- -* Function: H5DSset_scale -* -* Purpose: The dataset DSID is converted to a Dimension Scale dataset. -* Creates the CLASS attribute, set to the value "DIMENSION_SCALE" -* and an empty REFERENCE_LIST attribute. -* If DIMNAME is specified, then an attribute called NAME is created, -* with the value DIMNAME. -* -* Return: Success: SUCCEED, Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 04, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSset_scale(hid_t dsid, - const char *dimname) + * Function: H5DSset_scale + * + * Purpose: The dataset DSID is converted to a Dimension Scale dataset. + * Creates the CLASS attribute, set to the value "DIMENSION_SCALE" + * and an empty REFERENCE_LIST attribute. + * If DIMNAME is specified, then an attribute called NAME is created, + * with the value DIMNAME. + * + * Return: Success: SUCCEED, Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 04, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSset_scale(hid_t dsid, const char *dimname) { int has_dimlist; H5I_type_t it; @@ -95,34 +87,28 @@ herr_t H5DSset_scale(hid_t dsid, /*------------------------------------------------------------------------- -* Function: H5DSattach_scale -* -* Purpose: Define Dimension Scale DSID to be associated with dimension IDX -* of Dataset DID. Entries are created in the DIMENSION_LIST and -* REFERENCE_LIST attributes. -* -* Return: -* Success: SUCCEED -* Failure: FAIL -* -* Fails if: Bad arguments -* If DSID is not a Dimension Scale -* If DID is a Dimension Scale (A Dimension Scale cannot have scales) -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: December 20, 2004 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSattach_scale(hid_t did, - hid_t dsid, - unsigned int idx) + * Function: H5DSattach_scale + * + * Purpose: Define Dimension Scale DSID to be associated with dimension IDX + * of Dataset DID. Entries are created in the DIMENSION_LIST and + * REFERENCE_LIST attributes. + * + * Return: + * Success: SUCCEED + * Failure: FAIL + * + * Fails if: Bad arguments + * If DSID is not a Dimension Scale + * If DID is a Dimension Scale (A Dimension Scale cannot have scales) + * + * Programmer: Pedro Vicente + * + * Date: December 20, 2004 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) { int has_dimlist; int has_reflist; @@ -547,39 +533,31 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSdetach_scale -* -* Purpose: If possible, deletes association of Dimension Scale DSID with -* dimension IDX of Dataset DID. This deletes the entries in the -* DIMENSION_LIST and REFERENCE_LIST attributes. -* -* Return: -* Success: SUCCEED -* Failure: FAIL -* -* Fails if: Bad arguments -* The dataset DID or DSID do not exist. -* The DSID is not a Dimension Scale -* DSID is not attached to DID. -* Note that a scale may be associated with more than dimension of the same dataset. -* If so, the detach operation only deletes one of the associations, for DID. -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: December 20, 2004 -* -* Comments: -* -* Modifications: Function didn't delete DIMENSION_LIST attribute, when -* all dimension scales were detached from a dataset; added. -* 2010/05/13 EIP -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSdetach_scale(hid_t did, - hid_t dsid, - unsigned int idx) + * Function: H5DSdetach_scale + * + * Purpose: If possible, deletes association of Dimension Scale DSID with + * dimension IDX of Dataset DID. This deletes the entries in the + * DIMENSION_LIST and REFERENCE_LIST attributes. + * + * Return: + * Success: SUCCEED + * Failure: FAIL + * + * Fails if: Bad arguments + * The dataset DID or DSID do not exist. + * The DSID is not a Dimension Scale + * DSID is not attached to DID. + * Note that a scale may be associated with more than dimension of the same dataset. + * If so, the detach operation only deletes one of the associations, for DID. + * + * Programmer: Pedro Vicente + * + * Date: December 20, 2004 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) { int has_dimlist; int has_reflist; @@ -940,35 +918,29 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSis_attached -* -* Purpose: Report if dimension scale DSID is currently attached to -* dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST -* attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute -* -* Return: -* 1: both the DS and the dataset pointers match -* 0: one of them or both do not match -* FAIL (-1): error -* -* Fails if: Bad arguments -* If DSID is not a Dimension Scale -* If DID is a Dimension Scale (A Dimension Scale cannot have scales) -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: February 18, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -htri_t H5DSis_attached(hid_t did, - hid_t dsid, - unsigned int idx) + * Function: H5DSis_attached + * + * Purpose: Report if dimension scale DSID is currently attached to + * dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST + * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute + * + * Return: + * 1: both the DS and the dataset pointers match + * 0: one of them or both do not match + * FAIL (-1): error + * + * Fails if: Bad arguments + * If DSID is not a Dimension Scale + * If DID is a Dimension Scale (A Dimension Scale cannot have scales) + * + * Programmer: Pedro Vicente + * + * Date: February 18, 2005 + * + *------------------------------------------------------------------------- + */ +htri_t +H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx) { int has_dimlist; int has_reflist; @@ -1249,54 +1221,47 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSiterate_scales -* -* Purpose: H5DSiterate_scales iterates over the scales attached to dimension DIM -* of dataset DID. For each scale in the list, the visitor_data and some -* additional information, specified below, are passed to the visitor function. -* The iteration begins with the IDX object in the group and the next element -* to be processed by the operator is returned in IDX. If IDX is NULL, then the -* iterator starts at zero. -* -* Parameters: -* -* hid_t DID; IN: the dataset -* unsigned int DIM; IN: the dimension of the dataset -* int *DS_IDX; IN/OUT: on input the dimension scale index to start iterating, -* on output the next index to visit. If NULL, start at -* the first position. -* H5DS_iterate_t VISITOR; IN: the visitor function -* void *VISITOR_DATA; IN: arbitrary data to pass to the visitor function. -* -* Iterate over all scales of DIM, calling an application callback -* with the item, key and any operator data. -* -* The operator callback receives a pointer to the item , -* and the pointer to the operator data passed -* in to H5SL_iterate ('op_data'). The return values from an operator are: -* A. Zero causes the iterator to continue, returning zero when all -* nodes of that type have been processed. -* B. Positive causes the iterator to immediately return that positive -* value, indicating short-circuit success. -* C. Negative causes the iterator to immediately return that value, -* indicating failure. -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 31, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSiterate_scales(hid_t did, - unsigned int dim, - int *ds_idx, - H5DS_iterate_t visitor, - void *visitor_data ) + * Function: H5DSiterate_scales + * + * Purpose: H5DSiterate_scales iterates over the scales attached to dimension DIM + * of dataset DID. For each scale in the list, the visitor_data and some + * additional information, specified below, are passed to the visitor function. + * The iteration begins with the IDX object in the group and the next element + * to be processed by the operator is returned in IDX. If IDX is NULL, then the + * iterator starts at zero. + * + * Parameters: + * + * hid_t DID; IN: the dataset + * unsigned int DIM; IN: the dimension of the dataset + * int *DS_IDX; IN/OUT: on input the dimension scale index to start iterating, + * on output the next index to visit. If NULL, start at + * the first position. + * H5DS_iterate_t VISITOR; IN: the visitor function + * void *VISITOR_DATA; IN: arbitrary data to pass to the visitor function. + * + * Iterate over all scales of DIM, calling an application callback + * with the item, key and any operator data. + * + * The operator callback receives a pointer to the item , + * and the pointer to the operator data passed + * in to H5SL_iterate ('op_data'). The return values from an operator are: + * A. Zero causes the iterator to continue, returning zero when all + * nodes of that type have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. + * + * Programmer: Pedro Vicente + * + * Date: January 31, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, + H5DS_iterate_t visitor, void *visitor_data ) { hid_t scale_id; int rank; @@ -1450,20 +1415,20 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSset_label -* -* Purpose: Set label for the dimension IDX of dataset DID to the value LABEL -* -* Return: Success: SUCCEED, Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 11, 2005 -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) + * Function: H5DSset_label + * + * Purpose: Set label for the dimension IDX of dataset DID to the value LABEL + * + * Return: Success: SUCCEED, Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 11, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSset_label(hid_t did, unsigned int idx, const char *label) { int has_labels; hid_t sid = -1; /* space ID */ @@ -1655,29 +1620,24 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSget_label -* -* Purpose: Read the label LABEL for dimension IDX of dataset DID -* Up to 'size' characters are stored in 'label' followed by a '\0' string -* terminator. If the label is longer than 'size'-1, -* the string terminator is stored in the last position of the buffer to -* properly terminate the string. -* -* Return: 0 if no label found, size of label if found, Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 11, 2005 -* -* Comments: -* -* Modifications: -* JIRA HDFFV-7673: Added a check to see if the label name exists, -* if not then returns zero. July 30, 2011. MSB -* -*------------------------------------------------------------------------- -*/ -ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) + * Function: H5DSget_label + * + * Purpose: Read the label LABEL for dimension IDX of dataset DID + * Up to 'size' characters are stored in 'label' followed by a '\0' string + * terminator. If the label is longer than 'size'-1, + * the string terminator is stored in the last position of the buffer to + * properly terminate the string. + * + * Return: 0 if no label found, size of label if found, Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 11, 2005 + * + *------------------------------------------------------------------------- + */ +ssize_t +H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) { int has_labels; hid_t sid = -1; /* space ID */ @@ -1817,32 +1777,24 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSget_scale_name -* -* Purpose: Read the name of dataset scale DID into buffer NAME -* Up to 'size' characters are stored in 'name' followed by a '\0' string -* terminator. If the name is longer than 'size'-1, -* the string terminator is stored in the last position of the buffer to -* properly terminate the string. -* -* Return: size of name if found, zero if not found, Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 04, 2005 -* -* Comments: -* -* Modifications: -* The size of the name returned should not include the NULL termination -* in its value so as to be consistent with other HDF5 APIs. -* -*------------------------------------------------------------------------- -*/ - -ssize_t H5DSget_scale_name(hid_t did, - char *name, - size_t size) + * Function: H5DSget_scale_name + * + * Purpose: Read the name of dataset scale DID into buffer NAME + * Up to 'size' characters are stored in 'name' followed by a '\0' string + * terminator. If the name is longer than 'size'-1, + * the string terminator is stored in the last position of the buffer to + * properly terminate the string. + * + * Return: size of name if found, zero if not found, Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 04, 2005 + * + *------------------------------------------------------------------------- + */ +ssize_t +H5DSget_scale_name(hid_t did, char *name, size_t size) { hid_t aid; /* attribute ID */ hid_t tid = -1; /* attribute type ID */ @@ -1944,24 +1896,20 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSis_scale -* -* Purpose: check if the dataset DID is a dimension scale -* -* Return: 1, is, 0, not, FAIL, error -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 04, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -htri_t H5DSis_scale(hid_t did) + * Function: H5DSis_scale + * + * Purpose: check if the dataset DID is a dimension scale + * + * Return: 1, is, 0, not, FAIL, error + * + * Programmer: Pedro Vicente + * + * Date: January 04, 2005 + * + *------------------------------------------------------------------------- + */ +htri_t +H5DSis_scale(hid_t did) { hid_t tid = -1; /* attribute type ID */ hid_t aid = -1; /* attribute ID */ @@ -2047,27 +1995,22 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSget_num_scales -* -* Purpose: get the number of scales linked to the IDX dimension of dataset DID -* -* Return: -* Success: number of scales -* Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 13, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -int H5DSget_num_scales(hid_t did, - unsigned int idx) + * Function: H5DSget_num_scales + * + * Purpose: get the number of scales linked to the IDX dimension of dataset DID + * + * Return: + * Success: number of scales + * Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 13, 2005 + * + *------------------------------------------------------------------------- + */ +int +H5DSget_num_scales(hid_t did, unsigned int idx) { int has_dimlist; hid_t sid; /* space ID */ @@ -2170,25 +2113,20 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DS_is_reserved -* -* Purpose: Verify that a dataset's CLASS is either an image, palette or table -* -* Return: true, false, fail -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: March 19, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -static -herr_t H5DS_is_reserved(hid_t did) + * Function: H5DS_is_reserved + * + * Purpose: Verify that a dataset's CLASS is either an image, palette or table + * + * Return: true, false, fail + * + * Programmer: Pedro Vicente + * + * Date: March 19, 2005 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5DS_is_reserved(hid_t did) { int has_class; hid_t tid = -1; @@ -2261,26 +2199,21 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DS_get_REFLIST_type -* -* Purpose: This is a helper function to return a native type for -* the REFERENCE_LIST attribute. -* -* Return: Type identifier on success and negative on failure -* -* Programmer: epourmal@hdfgroup.org -* -* Date: May 22, 2010 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -static -hid_t H5DS_get_REFLIST_type(void) + * Function: H5DS_get_REFLIST_type + * + * Purpose: This is a helper function to return a native type for + * the REFERENCE_LIST attribute. + * + * Return: Type identifier on success and negative on failure + * + * Programmer: Elena Pourmal + * + * Date: May 22, 2010 + * + *------------------------------------------------------------------------- + */ +static hid_t +H5DS_get_REFLIST_type(void) { hid_t ntid_t = -1; diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 6f7414b..2b292dc 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -13,8 +13,6 @@ #include "H5IMprivate.h" #include "H5LTprivate.h" -#include -#include /*------------------------------------------------------------------------- * Function: H5IMmake_image_8bit @@ -23,7 +21,7 @@ * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -77,7 +75,7 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -162,7 +160,7 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, * * Return: * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: May 28, 2001 * @@ -204,7 +202,7 @@ static herr_t find_palette(hid_t loc_id, * * Return: Success: 1, Failure: 0 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: May 11, 2001 * @@ -230,7 +228,7 @@ herr_t H5IM_find_palette( hid_t loc_id ) * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: July 25, 2001 * @@ -412,7 +410,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -462,7 +460,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: May 01, 2001 * @@ -518,7 +516,7 @@ herr_t H5IMmake_palette( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: May 01, 2001 * @@ -695,7 +693,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: September 10, 2001 * @@ -796,7 +794,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: July 22, 2001 * @@ -887,7 +885,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: July 22, 2001 * @@ -1003,7 +1001,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * @@ -1110,7 +1108,7 @@ out: * * Return: true, false, fail * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * @@ -1214,7 +1212,7 @@ out: * * Return: true, false, fail * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c index 3106ea8..21975d1 100644 --- a/hl/src/H5LD.c +++ b/hl/src/H5LD.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include #include "H5LDprivate.h" /*------------------------------------------------------------------------- diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index a631533..939f6aa 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -11,11 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include - #include "H5LTprivate.h" /* For Lex and Yacc */ @@ -504,7 +499,7 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Quincey Koziol, koziol@hdfgroup.org +* Programmer: Quincey Koziol * * Date: October 10, 2007 * @@ -570,7 +565,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 19, 2001 * @@ -599,7 +594,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -628,7 +623,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -657,7 +652,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -688,7 +683,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -717,7 +712,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -748,7 +743,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -778,7 +773,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -970,7 +965,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Quincey Koziol, koziol@hdfgroup.org +* Programmer: Quincey Koziol * * Date: October 8, 2007 * @@ -1012,7 +1007,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: June 13, 2001 * @@ -1035,7 +1030,7 @@ herr_t H5LTread_dataset(hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1056,7 +1051,7 @@ herr_t H5LTread_dataset_char( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1077,7 +1072,7 @@ herr_t H5LTread_dataset_short( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1098,7 +1093,7 @@ herr_t H5LTread_dataset_int( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1119,7 +1114,7 @@ herr_t H5LTread_dataset_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1141,7 +1136,7 @@ herr_t H5LTread_dataset_float( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1163,7 +1158,7 @@ herr_t H5LTread_dataset_double( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -1216,7 +1211,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 4, 2001 * @@ -1272,7 +1267,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 4, 2001 * Modified: February 28, 2006: checked for NULL parameters @@ -1348,7 +1343,7 @@ out: * * Purpose: operator function used by H5LTfind_dataset * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: June 21, 2001 * @@ -1392,7 +1387,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_ * Purpose: Inquires if a dataset named dset_name exists attached * to the object loc_id. * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: July 15, 2001 * @@ -1436,7 +1431,7 @@ H5_GCC_DIAG_ON(cast-qual) * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: July 23, 2001 * @@ -1534,7 +1529,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: July 25, 2001 * @@ -1613,7 +1608,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1643,7 +1638,7 @@ herr_t H5LTset_attribute_char( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -1674,7 +1669,7 @@ herr_t H5LTset_attribute_uchar( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1705,7 +1700,7 @@ herr_t H5LTset_attribute_short( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -1736,7 +1731,7 @@ herr_t H5LTset_attribute_ushort( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1767,7 +1762,7 @@ herr_t H5LTset_attribute_int( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -1799,7 +1794,7 @@ herr_t H5LTset_attribute_uint( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1829,7 +1824,7 @@ herr_t H5LTset_attribute_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu +* Programmer: Elena Pourmal * * Date: June 17, 2005 * @@ -1861,7 +1856,7 @@ herr_t H5LTset_attribute_long_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -1893,7 +1888,7 @@ herr_t H5LTset_attribute_ulong( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: July 25, 2001 * @@ -1926,7 +1921,7 @@ herr_t H5LTset_attribute_float( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1957,7 +1952,7 @@ herr_t H5LTset_attribute_double( hid_t loc_id, * * Purpose: operator function used by H5LT_find_attribute * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: June 21, 2001 * @@ -1998,7 +1993,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, * Purpose: Inquires if an attribute named attr_name exists attached to * the object loc_id. * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: May 17, 2006 * @@ -2020,7 +2015,7 @@ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name ) * * Purpose: Inquires if an attribute named attr_name exists attached to the object loc_id. * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: June 21, 2001 * @@ -2059,7 +2054,7 @@ H5_GCC_DIAG_ON(cast-qual) * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 4, 2001 * @@ -2129,7 +2124,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 4, 2001 * @@ -2215,7 +2210,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* Programmer: Raymond Lu * * Date: October 6, 2004 * @@ -2265,7 +2260,7 @@ out: * * Return: void * -* Programmer: Raymond Lu, songyulu@hdfgroup.org +* Programmer: Raymond Lu * * Date: 29 September 2011 * @@ -2325,7 +2320,7 @@ out: * * Return: void * -* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* Programmer: Raymond Lu * * Date: December 6, 2005 * @@ -2489,7 +2484,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* Programmer: Raymond Lu * * Date: December 6, 2005 * @@ -2536,7 +2531,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* Programmer: Raymond Lu * * Date: December 20, 2005 * @@ -3101,7 +3096,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3153,7 +3148,7 @@ herr_t H5LTget_attribute_string( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3182,7 +3177,7 @@ herr_t H5LTget_attribute_char( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -3213,7 +3208,7 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3242,7 +3237,7 @@ herr_t H5LTget_attribute_short( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -3273,7 +3268,7 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3302,7 +3297,7 @@ herr_t H5LTget_attribute_int( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -3333,7 +3328,7 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3362,7 +3357,7 @@ herr_t H5LTget_attribute_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu +* Programmer: Elena Pourmal * * Date: June 17, 2005 * @@ -3392,7 +3387,7 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -3422,7 +3417,7 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3454,7 +3449,7 @@ herr_t H5LTget_attribute_float( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3486,7 +3481,7 @@ herr_t H5LTget_attribute_double( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3525,7 +3520,7 @@ herr_t H5LTget_attribute( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3589,7 +3584,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3639,7 +3634,7 @@ out: * * Return: FAIL on error, SUCCESS on success * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 04, 2005 * diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index f413bea..fa77ae1 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include - #include "H5PTprivate.h" #include "H5TBprivate.h" @@ -53,8 +51,8 @@ static herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index); * * Return: Success: table ID, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu (Author of H5PTcreate_fl) - * James Laird, jlaird@ncsa.uiuc.edu (Author of H5PTcreate_fl) + * Programmer: Nat Furrer (Author of H5PTcreate_fl) + * James Laird (Author of H5PTcreate_fl) * * Date: March 12, 2004 * @@ -182,8 +180,8 @@ error: * * Return: Success: table ID, Failure: Negative * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -301,8 +299,8 @@ error: * * Return: Success: table ID, Failure: Negative * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -426,8 +424,8 @@ H5PT_free_id(void *id) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -475,8 +473,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 21, 2004 * @@ -530,8 +528,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -583,8 +581,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -628,8 +626,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -680,8 +678,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -737,8 +735,8 @@ H5PT_get_index(htbl_t *table, hsize_t *pt_index) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 23, 2004 * @@ -795,8 +793,8 @@ herr_t H5PTget_index(hid_t table_id, hsize_t *pt_index) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -832,8 +830,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -861,8 +859,8 @@ herr_t H5PTis_valid(hid_t table_id) * * Return: True: 1, False: 0, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 14, 2004 * @@ -910,8 +908,8 @@ error: * Return: Success: SUCCEED, Failure: FAIL * -2 if memory was reclaimed but another error occurred * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 12, 2004 * diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index c54c41f..79d5cef 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include - #include "H5LTprivate.h" #include "H5TBprivate.h" @@ -55,7 +52,7 @@ static hid_t H5TB_create_type(hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * Quincey Koziol * * Date: January 17, 2001 @@ -275,7 +272,7 @@ out: * Return: Success: 0, Failure: -1 * * Programmers: -* Pedro Vicente, pvn@ncsa.uiuc.edu +* Pedro Vicente * Quincey Koziol * * Date: November 19, 2001 @@ -345,7 +342,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -442,7 +439,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 21, 2001 * @@ -605,7 +602,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 21, 2001 * @@ -778,7 +775,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 20, 2001 * @@ -853,7 +850,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -923,7 +920,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -1086,7 +1083,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -1251,7 +1248,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 26, 2001 * @@ -1413,7 +1410,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 26, 2001 * @@ -1569,7 +1566,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: December 5, 2001 * @@ -1701,7 +1698,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: December 10, 2001 * @@ -2059,7 +2056,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -2480,7 +2477,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -2934,7 +2931,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 30, 2001 * @@ -2960,7 +2957,7 @@ herr_t H5TBAget_title(hid_t loc_id, * * Return: Success: TRUE/FALSE, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -3033,7 +3030,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3120,7 +3117,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3240,7 +3237,7 @@ out: * * Return: Success: TRUE/FALSE, Failure: N/A * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3281,7 +3278,7 @@ hbool_t H5TB_find_field(const char *field, const char *field_list) * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: December 6, 2001 * @@ -3345,7 +3342,7 @@ out: * * Return: Success: the memory type ID, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 31, 2004 * @@ -3445,8 +3442,8 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu -* James Laird, jlaird@ncsa.uiuc.edu +* Programmer: Nat Furrer +* James Laird * * Date: March 8, 2004 * @@ -3512,8 +3509,8 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu -* James Laird, jlaird@ncsa.uiuc.edu +* Programmer: Nat Furrer +* James Laird * * Date: March 8, 2004 * diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index 285ab77..a43af77 100644 --- a/hl/test/gen_test_ds.c +++ b/hl/test/gen_test_ds.c @@ -23,8 +23,6 @@ * in test_ds.c will read them. */ -#include -#include #include "h5hltest.h" #include "H5DSpublic.h" #include "H5LTpublic.h" diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index 85f47bd..6cf5062 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, April 28, 2006 * * Purpose: Test support stuff. diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 79e6f45..5550dd1 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5DSpublic.h" diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index 1914a08..455c0e8 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "h5hltest.h" #include "H5DOpublic.h" diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 6d13419..06a0ff3 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index e3cde5d..7de409f 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -11,11 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5LDpublic.h" diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index e6b4668..f3e6e97 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 61aebc7..eb28e3d 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5PTpublic.h" #include "H5TBpublic.h" diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 1d6bcec..cd2e2a4 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5TBpublic.h" diff --git a/hl/tools/gif2h5/h52gifgentst.c b/hl/tools/gif2h5/h52gifgentst.c index 655563c..c0ad151 100644 --- a/hl/tools/gif2h5/h52gifgentst.c +++ b/hl/tools/gif2h5/h52gifgentst.c @@ -22,7 +22,7 @@ * * Purpose: generate files for h52gif testing * - * Programmer: Pedro Vicente, pvn@hdfgroup.org + * Programmer: Pedro Vicente * * Date: March 15, 2007 * diff --git a/test/SWMR_UseCase_UG.txt b/test/SWMR_UseCase_UG.txt index 18d4927..1e3d1e6 100644 --- a/test/SWMR_UseCase_UG.txt +++ b/test/SWMR_UseCase_UG.txt @@ -6,8 +6,8 @@ case program and explain how to run them. 2.1. Author and Dates: - Version 2: By Albert Cheng (acheng@hdfgroup.org), 2013/06/18. - Version 1: By Albert Cheng (acheng@hdfgroup.org), 2013/06/01. + Version 2: By Albert Cheng, 2013/06/18. + Version 1: By Albert Cheng, 2013/06/01. %%%%Use Case 1.7%%%% diff --git a/test/app_ref.c b/test/app_ref.c index a4853fa..c1735fa 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, August 14, 2008 * * Purpose: Tests closing the library after reference counts have been diff --git a/test/big.c b/test/big.c index a2f07af..c4f8e88 100644 --- a/test/big.c +++ b/test/big.c @@ -12,9 +12,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 8, 1998 - * Modified: Albert Cheng + * Modified: Albert Cheng * September 11, 2010 */ /* diff --git a/test/bittests.c b/test/bittests.c index 046528a..6f236d6 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 16, 1998 * * Purpose: Tests functions in H5Tbit.c diff --git a/test/btree2.c b/test/btree2.c index c4c5530..e91808d 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, February 1, 2005 */ #include "h5test.h" diff --git a/test/cache.c b/test/cache.c index bb18728..fdfba00 100644 --- a/test/cache.c +++ b/test/cache.c @@ -28146,7 +28146,6 @@ check_auto_cache_resize_aux_fcns(unsigned paged) * Return: void * * Programmer: Mike McGreevy - * * 12/16/08 * * Modifications: diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index ff3767c..c8ef1e4 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, January 23, 1998 */ diff --git a/test/cross_read.c b/test/cross_read.c index c16ddbc..dabd3ab 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, March 23, 2006 * * Purpose: Check if floating-point data created on big-endian and diff --git a/test/dangle.c b/test/dangle.c index 9f30f10..8300792 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Purpose: Test dangling IDs diff --git a/test/dsets.c b/test/dsets.c index 4ab3efa..e4cf2a4 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the dataset interface (H5D) diff --git a/test/dt_arith.c b/test/dt_arith.c index 8d04770..775f4ee 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the data type interface (H5T) diff --git a/test/dtypes.c b/test/dtypes.c index 6dfc47d..e96e826 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the datatype interface (H5T) diff --git a/test/earray.c b/test/earray.c index 6597afd..f9bb56e 100644 --- a/test/earray.c +++ b/test/earray.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, June 17, 2008 */ #include "h5test.h" diff --git a/test/enum.c b/test/enum.c index 109f7c3..1933ce1 100644 --- a/test/enum.c +++ b/test/enum.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 22, 1998 */ #include "h5test.h" diff --git a/test/extend.c b/test/extend.c index 1e2b5b5..369ad32 100644 --- a/test/extend.c +++ b/test/extend.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, January 30, 1998 * * Purpose: Tests extendible datasets. diff --git a/test/external.c b/test/external.c index d29fb6b..c98c228 100644 --- a/test/external.c +++ b/test/external.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 3, 1998 * * Purpose: Tests datasets stored in external raw files. diff --git a/test/external_common.c b/test/external_common.c index a9e600b..85fdfa0 100644 --- a/test/external_common.c +++ b/test/external_common.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * April, 2019 * * Purpose: Private function for external.c and external_env.c diff --git a/test/external_common.h b/test/external_common.h index f02652b..3633ea3 100644 --- a/test/external_common.h +++ b/test/external_common.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * April, 2019 * * Purpose: Private function for external.c and external_env.c diff --git a/test/external_fname.h b/test/external_fname.h index c5111b6..f5aca6d 100644 --- a/test/external_fname.h +++ b/test/external_fname.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * July, 2019 * * Purpose: Private declaration for external.c and external_env.c diff --git a/test/fheap.c b/test/fheap.c index b1a0db0..ef459d3 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Friday, February 24, 2006 */ #include "h5test.h" diff --git a/test/filter_fail.c b/test/filter_fail.c index e5187be..b3e5c8a 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 7 September 2010 * * Purpose: Make sure dataset, file, and library can close properly when a diff --git a/test/flush1.c b/test/flush1.c index 04f24f7..e01f4a5 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 23, 1998 * * Purpose: This is the first half of a two-part test that makes sure diff --git a/test/flush2.c b/test/flush2.c index 5fc716b..c3103d9 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 23, 1998 * * Purpose: This is the second half of a two-part test that makes sure diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c index 292659c..bd857b4 100644 --- a/test/gen_bad_compound.c +++ b/test/gen_bad_compound.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 14, 2011 * * Purpose: This program is run to generate an HDF5 data file with objects diff --git a/test/gen_bad_ohdr.c b/test/gen_bad_ohdr.c index 36ba64a..0f85cfe 100644 --- a/test/gen_bad_ohdr.c +++ b/test/gen_bad_ohdr.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Jan 5, 2008 * * Purpose: This program is run to generate an HDF5 data file with a diff --git a/test/gen_cross.c b/test/gen_cross.c index 105895d..2c1ff4d 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, March 23, 2006 * * This program writes floating-point data to the HDF5 file. It generates diff --git a/test/gen_filters.c b/test/gen_filters.c index 9764830..ace86ba 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -38,7 +38,7 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, * * Failure: -1 * - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * Thursday, March 25, 2004 * *------------------------------------------------------------------------- diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c index f158d57..6633eb0 100644 --- a/test/gen_mergemsg.c +++ b/test/gen_mergemsg.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, June 30, 2006 * * This program creates an object with fragmented object header messages diff --git a/test/gen_new_array.c b/test/gen_new_array.c index 27f162c..041b691 100644 --- a/test/gen_new_array.c +++ b/test/gen_new_array.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 09, 2000 * * Purpose: Create a two datasets, one with a compound datatypes with array diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index 5bdbf73..c012d8b 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Feb 27, 2002 * * Purpose: This program is run to generate a HDF5 data file with fill diff --git a/test/gen_new_group.c b/test/gen_new_group.c index 6924291..42a751f 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Oct 24, 2005 * * Purpose: This program is run to generate an HDF5 data file with both diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c index b44d567..90259c7 100644 --- a/test/gen_new_mtime.c +++ b/test/gen_new_mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 3, 2003 * * Purpose: Create a dataset, which should have the newer mtime information diff --git a/test/gen_new_super.c b/test/gen_new_super.c index d371f5f..36f2187 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 15, 2003 * * Purpose: Create a file which will have the newer superblock format. diff --git a/test/gen_old_array.c b/test/gen_old_array.c index 3fab657..402fd40 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 09, 2000 * * Purpose: Create a two datasets with compound datatypes, one with no array diff --git a/test/gen_old_group.c b/test/gen_old_group.c index d109329..55dbde3 100644 --- a/test/gen_old_group.c +++ b/test/gen_old_group.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Oct 24, 2005 * * Purpose: This program is run to generate an HDF5 data file with an diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index 56c3e4e..0210786 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 27, 2004 * * Purpose: Create two datasets (one for version 1 and one for version 2 of diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index cbe3bdc..e72c9b1 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 3, 2003 * * Purpose: Create a dataset, which should have the older mtime information diff --git a/test/gen_sizes_lheap.c b/test/gen_sizes_lheap.c index 81742df..0e62019 100644 --- a/test/gen_sizes_lheap.c +++ b/test/gen_sizes_lheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, July 15, 2010 * * Purpose: Creates a file with non-default sizes of lengths and addresses. diff --git a/test/gen_specmetaread.c b/test/gen_specmetaread.c index f2625a7..ca44f9a 100644 --- a/test/gen_specmetaread.c +++ b/test/gen_specmetaread.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, October 8, 2009 * * Purpose: Create a file with a dataset who's raw data immediately follows diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c index e48d0e8..456cb5c 100644 --- a/test/gen_udlinks.c +++ b/test/gen_udlinks.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Tuesday, June 6, 2006 * * This program creates HDF5 files with user-defined links. These files diff --git a/test/getname.c b/test/getname.c index a6f2f5a..ef0d5ea 100644 --- a/test/getname.c +++ b/test/getname.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * April 12, 2002 * * Purpose: Tests the "ID to name" functionality diff --git a/test/gheap.c b/test/gheap.c index 09ba1cf..077f921 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Purpose: Tests the global heap. The global heap is the set of all diff --git a/test/h5test.c b/test/h5test.c index 55141ea..255932a 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, November 19, 1998 * * Purpose: Provides support functions for most of the hdf5 tests cases. diff --git a/test/h5test.h b/test/h5test.h index 697bde6..22047e1 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, November 20, 1998 * * Purpose: Test support stuff. diff --git a/test/hdfs.c b/test/hdfs.c index ab39da6..3112dcc 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -19,7 +19,7 @@ * * Demonstrates basic use cases and fapl interaction. * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2018-04-23 */ diff --git a/test/hyperslab.c b/test/hyperslab.c index e702023..8168eed 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, October 10, 1997 * * Purpose: Hyperslab operations are rather complex, so this file diff --git a/test/istore.c b/test/istore.c index c8fe866..e80f260 100644 --- a/test/istore.c +++ b/test/istore.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 15, 1997 * * Purpose: Tests various aspects of indexed raw data storage. diff --git a/test/lheap.c b/test/lheap.c index 5f60dca..dd430a3 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * * Purpose: Test local heaps used by symbol tables (groups). diff --git a/test/mount.c b/test/mount.c index 3abe084..4cc02e4 100644 --- a/test/mount.c +++ b/test/mount.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, October 7, 1998 * * Purpose: Tests file mounting. diff --git a/test/mtime.c b/test/mtime.c index 81a20db..8294e80 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 30, 1998 * * Purpose: Determines if the modification time message is working diff --git a/test/ntypes.c b/test/ntypes.c index f1d2449..e371b93 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -2675,7 +2675,7 @@ error: * Return: Success: 0 * Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * September 3, 2004 * * Modifications: diff --git a/test/ohdr.c b/test/ohdr.c index ad76576..f00a4f8 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Tuesday, November 24, 1998 */ #include "h5test.h" diff --git a/test/pool.c b/test/pool.c index 1851d6e..648a501 100644 --- a/test/pool.c +++ b/test/pool.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, May 3, 2005 */ #include "h5test.h" diff --git a/test/ros3.c b/test/ros3.c index 73b6ac2..fb7aa2b 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -20,7 +20,7 @@ * * Demonstrates basic use cases and fapl/dxpl interaction. * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2017-10-11 */ diff --git a/test/s3comms.c b/test/s3comms.c index 9453b75..9a7d7d6 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -15,7 +15,7 @@ * * Purpose: Unit tests for the S3 Communications (s3comms) module. * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2017-10-11 */ diff --git a/test/set_extent.c b/test/set_extent.c index 171fd05..17bdb1b 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * April 12, 2002 * * Purpose: Tests the H5Dset_extent call diff --git a/test/space_overflow.c b/test/space_overflow.c index 15be9ba..82ddb3b 100644 --- a/test/space_overflow.c +++ b/test/space_overflow.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, October 26, 1998 * * Purpose: Create a dataset with a simple data space that has the diff --git a/test/stab.c b/test/stab.c index 215d748..ed4b5a0 100644 --- a/test/stab.c +++ b/test/stab.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 */ @@ -171,7 +171,7 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format) * * Failure: number of errors * - * Programmer: Robb Matzke 2002-03-28 + * Programmer: Robb Matzke 2002-03-28 * * Modifications: *------------------------------------------------------------------------- diff --git a/test/tchecksum.c b/test/tchecksum.c index 6e509fb..82dc135 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -15,7 +15,7 @@ * * Created: tchecksum.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Test internal checksum routine(s) * diff --git a/test/testframe.c b/test/testframe.c index 3c2a335..cfb62ec 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 6, 2004 * * Purpose: Provides support functions for the testing framework. diff --git a/test/tfile.c b/test/tfile.c index d6047dc..e7dfcbe 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3097,7 +3097,6 @@ test_rw_noupdate(void) ** test_userblock_alignment() test, to handle common testing ** ** Programmer: Quincey Koziol -** koziol@hdfgroup.org ** Septmber 10, 2009 ** *****************************************************************/ @@ -3159,7 +3158,6 @@ test_userblock_alignment_helper1(hid_t fcpl, hid_t fapl) ** test_userblock_alignment() test, to handle common testing ** ** Programmer: Quincey Koziol -** koziol@hdfgroup.org ** Septmber 10, 2009 ** *****************************************************************/ @@ -3229,7 +3227,6 @@ test_userblock_alignment_helper2(hid_t fapl, hbool_t open_rw) ** object [allocation] alignment size set interact properly. ** ** Programmer: Quincey Koziol -** koziol@hdfgroup.org ** Septmber 8, 2009 ** *****************************************************************/ diff --git a/test/unlink.c b/test/unlink.c index 48dd79d..f45d7d7 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 25, 1998 * * Purpose: Test unlinking operations. diff --git a/test/vds.c b/test/vds.c index c4d1391..816acf9 100644 --- a/test/vds.c +++ b/test/vds.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, February 16, 2015 * * Purpose: Tests datasets with virtual layout. diff --git a/test/vds_env.c b/test/vds_env.c index 3d5b5dd..0d0891f 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, February 16, 2015 * * Purpose: Tests datasets with virtual layout. diff --git a/test/vfd.c b/test/vfd.c index 09ef106..f1443c5 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Tuesday, Sept 24, 2002 * * Purpose: Tests the basic features of Virtual File Drivers diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 152ec1a..7d3f40a 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 23, 1998 * * Purpose: Support functions for the various tools. diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index 074e86d..65446ee 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * Monday, 19. February 2001 */ #ifndef H5TOOLS_STR_H__ diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 42144cc..07069cc 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * Tuesday, 6. March 2001 * * Purpose: Support functions for the various tools. diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 33d6570..e14447d 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -26,7 +26,7 @@ * Return: An exit status of 0 means no differences were found, 1 means some * differences were found. * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 9, 2003 * diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index c473c8b..2336378 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -31,7 +31,7 @@ static void ph5diff_worker(int ); * Return: An exit status of 0 means no differences were found, 1 means some * differences were found. * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 9, 2003 * diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index e239cbc..8cf9b3c 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, March 23, 1998 */ diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 95cacc1..50ccd7a 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -478,7 +478,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, * Example: * "AA,B,CDE:CHUNK=10X10" * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: December 30, 2003 * diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index e9a783b..7242ed3 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -15,7 +15,7 @@ * * Created: debug.c * Jul 18 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Debugs an existing HDF5 file at a low level. * @@ -237,7 +237,6 @@ get_H5FA_class(const uint8_t *sig) * Failure: exit (non-zero) * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index d516fa0..371cf2c 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, May 13, 1998 * * Purpose: Repartitions a file family. This program can be used to diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index 84e3b65..ebbcb6c 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -13,7 +13,7 @@ # # Tests for the h5copy tool # -# Pedro Vicente Nunes (pvn@hdfgroup.org), Albert Cheng (acheng@hdfgroup.org) +# Pedro Vicente Nunes, Albert Cheng # Thursday, July 20, 2006 # diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index bdc2ddc..afdf46c 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -31,7 +31,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); * * Purpose: generate files for h5diff testing * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 12, 2003 * diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 731e233..3bb6604 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -3964,7 +3964,7 @@ static void gent_char(void) * * Return: void * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 28, 2003 * @@ -4404,7 +4404,7 @@ static void write_attr_in(hid_t loc_id, * * Return: void * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 28, 2003 * @@ -4854,7 +4854,7 @@ static void write_dset_in(hid_t loc_id, * * Return: void * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 19, 2003 * @@ -4923,7 +4923,7 @@ static void gent_attr_all(void) * * Purpose: utility function to write an attribute * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 19, 2003 * @@ -4962,7 +4962,7 @@ int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, * * Return: * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 27, 2003 * diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index ab0dbb7..2666e95 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -3872,7 +3872,7 @@ out: * * Purpose: write datasets in LOC_ID * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -4736,7 +4736,7 @@ out: * * Purpose: write attributes in LOC_ID (dataset, group, named datatype) * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -5927,7 +5927,7 @@ out: * * Purpose: utility function to create and write a dataset in LOC_ID * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -5963,7 +5963,7 @@ out: * * Purpose: utility function to create and write a dataset in LOC_ID * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -6011,7 +6011,7 @@ out: * * Purpose: utility function to write an attribute in LOC_ID * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c index f50e5fb..511a9e2 100644 --- a/tools/test/misc/h5perf_gentest.c +++ b/tools/test/misc/h5perf_gentest.c @@ -14,7 +14,7 @@ creates a large number of attributes, groups, and datasets by specifying -a, -g, -d options respectively. Using "-h" option to see details. - Programmer: Peter Cao , Jan. 2013 + Programmer: Peter Cao, Jan. 2013 ****************************************************************************/ #include "hdf5.h" @@ -128,7 +128,7 @@ int main (int argc, char *argv[]) Return: Non-negative on success/Negative on failure - Programmer: Peter Cao , Jan. 2013 + Programmer: Peter Cao, Jan. 2013 ****************************************************************************/ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index bd94104..520069f 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * June 1, 2005 * * Purpose: Generate a family file of 1024 bytes for each member diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in index b08cce1..7dc8155 100644 --- a/tools/test/misc/testh5mkgrp.sh.in +++ b/tools/test/misc/testh5mkgrp.sh.in @@ -13,7 +13,7 @@ # # Tests for the h5mkgrp tool # -# Quincey Koziol (koziol@hdfgroup.org) +# Quincey Koziol # Tuesday, February 13, 2007 # diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index de56281..bb74a1b 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, March 12, 1998 */ diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 58558a5..bb3aff5 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, September 28, 1998 * * Purpose: Creates a chunked dataset and measures the storage overhead. diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index b56f074..77248cc 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, Oct 3, 2004 * * Purpose: Tests performance of metadata -- cgit v0.12 From 5f6eec0b20ce325fbd4cbc7913cd972fbd070a22 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 7 Aug 2020 11:08:19 -0500 Subject: Move H5T_vlen_reclaim to package scope --- src/H5Tconv.c | 2 +- src/H5Tpkg.h | 1 + src/H5Tprivate.h | 1 - src/H5Tvlen.c | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 5d4829e..95c83f9 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -9601,7 +9601,7 @@ H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned H5_ATTR_UNUSED ndim, HDassert(op_data); /* Allow vlen reclaim to recurse into that routine */ - if(H5T_vlen_reclaim(elem, dt, (H5T_vlen_alloc_info_t *)op_data) < 0) + if(H5T__vlen_reclaim(elem, dt, (H5T_vlen_alloc_info_t *)op_data) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim vlen elements") } diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 28521a6..1766c3f 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -1179,6 +1179,7 @@ H5_DLL void H5T__bit_neg(uint8_t *buf, size_t start, size_t size); /* VL functions */ H5_DLL H5T_t * H5T__vlen_create(const H5T_t *base); +H5_DLL herr_t H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info); H5_DLL htri_t H5T__vlen_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc); /* Array functions */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index f7ca281..490ffb5 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -135,7 +135,6 @@ H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T_reclaim(hid_t type_id, struct H5S_t *space, void *buf); H5_DLL herr_t H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned ndim, const hsize_t *point, void *op_data); -H5_DLL herr_t H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info); H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt); H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc); H5_DLL htri_t H5T_is_sensible(const H5T_t *dt); diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 9d098c6..f185c2f 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -1037,7 +1037,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_vlen_reclaim + * Function: H5T__vlen_reclaim * * Purpose: Internal recursive routine to free VL datatypes * @@ -1049,7 +1049,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info) +H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info) { unsigned u; /* Local index variable */ H5MM_free_t free_func; /* Free function */ @@ -1156,7 +1156,7 @@ H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_vlen_reclaim() */ +} /* end H5T__vlen_reclaim() */ /*------------------------------------------------------------------------- @@ -1191,7 +1191,7 @@ H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") /* Recurse on buffer to free dynamic fields */ - if(H5T_vlen_reclaim(elem, dt, &vl_alloc_info) < 0) + if(H5T__vlen_reclaim(elem, dt, &vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim vlen elements") done: -- cgit v0.12 From a975a8d0eb3244d1a08afc80133a12279d1f90e5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 7 Aug 2020 11:50:22 -0700 Subject: Removes unsuffixed float warnings These warnings can only be addressed with gnu extensions. --- config/gnu-warnings/4.8 | 3 +++ config/gnu-warnings/developer-4.8 | 1 - config/gnu-warnings/no-developer-4.8 | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/gnu-warnings/4.8 b/config/gnu-warnings/4.8 index c7e3dd1..05f4d92 100644 --- a/config/gnu-warnings/4.8 +++ b/config/gnu-warnings/4.8 @@ -9,6 +9,9 @@ # warning flag added for GCC >= 4.5 -Wstrict-overflow=5 +# This warning can only be truly addressed using the gcc extension of +# using D to indicate doubles (e.g., 1.23D). +-Wno-unsuffixed-float-constants # warning flags added for GCC >= 4.6 -Wdouble-promotion diff --git a/config/gnu-warnings/developer-4.8 b/config/gnu-warnings/developer-4.8 index fd76f6c..bfd15a1 100644 --- a/config/gnu-warnings/developer-4.8 +++ b/config/gnu-warnings/developer-4.8 @@ -5,7 +5,6 @@ # the variable is never *used* before it has been initialized? # -Wjump-misses-init --Wunsuffixed-float-constants # developer warning flag added for GCC >= 4.6 -Wsuggest-attribute=const diff --git a/config/gnu-warnings/no-developer-4.8 b/config/gnu-warnings/no-developer-4.8 index 1e29c78..09a9a96 100644 --- a/config/gnu-warnings/no-developer-4.8 +++ b/config/gnu-warnings/no-developer-4.8 @@ -1,6 +1,5 @@ # no-developer warning flag added for GCC >= 4.5 -Wno-jump-misses-init --Wno-unsuffixed-float-constants # no-developer warning flag added for GCC >= 4.6 -Wno-suggest-attribute=const -- cgit v0.12 From 0ed65346033e7fbc71634d4911f9761e2ec145b2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 7 Aug 2020 12:40:04 -0700 Subject: Fixes flock Windows failure --- test/h5test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/h5test.c b/test/h5test.c index 255932a..497a5f2 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2255,15 +2255,15 @@ done: *------------------------------------------------------------------------- */ herr_t -h5_check_if_file_locking_enabled(hbool_t *are_enabled) +h5_check_if_file_locking_enabled(hbool_t *is_enabled) { const char *filename = "locking_test_file"; - mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + int pmode = O_RDWR | O_CREAT | O_TRUNC; int fd = -1; - *are_enabled = TRUE; + *is_enabled = TRUE; - if((fd = HDcreat(filename, mode)) < 0) + if((fd = HDopen(filename, pmode, H5_POSIX_CREATE_MODE_RW)) < 0) goto error; /* Test HDflock() to see if it works */ @@ -2277,7 +2277,7 @@ h5_check_if_file_locking_enabled(hbool_t *are_enabled) * error condition. */ errno = 0; - *are_enabled = FALSE; + *is_enabled = FALSE; } else goto error; @@ -2293,7 +2293,7 @@ h5_check_if_file_locking_enabled(hbool_t *are_enabled) return SUCCEED; error: - *are_enabled = FALSE; + *is_enabled = FALSE; if (fd > -1) { HDclose(fd); HDremove(filename); -- cgit v0.12 From e1a7a1acbecea906951b9351577355cf93b192a8 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 8 Aug 2020 08:44:34 -0500 Subject: Remove redundant calls to set the metadata cache tag --- src/H5Gobj.c | 8 ++++---- src/H5Goh.c | 4 ++-- src/H5Gstab.c | 8 ++++---- src/H5HG.c | 4 ++-- src/H5MF.c | 44 ++++++++++++++++++++++---------------------- src/H5Oattribute.c | 4 ++-- src/H5SM.c | 20 ++++++++++---------- test/mf.c | 8 ++++++++ 8 files changed, 54 insertions(+), 46 deletions(-) diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 1892182..0a139f9 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -380,7 +380,7 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->oh_addr) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(lnk); @@ -391,7 +391,7 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_obj_compact_to_dense_cb() */ @@ -1040,7 +1040,7 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(grp_oloc && grp_oloc->file); @@ -1090,7 +1090,7 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, HGOTO_ERROR(H5E_SYM, H5E_CANTUPDATE, FAIL, "unable to update link info") done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_obj_remove() */ diff --git a/src/H5Goh.c b/src/H5Goh.c index f29529b..cba6e80 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -338,7 +338,7 @@ H5O__group_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(oh->cache_info.addr) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(loc); @@ -411,6 +411,6 @@ done: if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__group_bh_info() */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index e8d38b9..674d84d 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -316,7 +316,7 @@ H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -331,7 +331,7 @@ H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__stab_insert() */ @@ -526,7 +526,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, H5G_link_table_t ltable = {0, NULL}; /* Link table */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(oloc->addr) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(oloc); @@ -593,7 +593,7 @@ done: if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__stab_iterate() */ diff --git a/src/H5HG.c b/src/H5HG.c index f9d780c..8caf551 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -141,7 +141,7 @@ H5HG__create(H5F_t *f, size_t size) size_t n; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__GLOBALHEAP_TAG) + FUNC_ENTER_STATIC /* Check args */ HDassert(f); @@ -228,7 +228,7 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5HG__create() */ diff --git a/src/H5MF.c b/src/H5MF.c index fac6620..946961d 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -399,7 +399,7 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) H5AC_ring_t fsm_ring; /* Ring of FSM */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC /* * Check arguments. @@ -452,7 +452,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__create_fstype() */ @@ -476,7 +476,7 @@ H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -503,7 +503,7 @@ H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__start_fstype() */ @@ -528,7 +528,7 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) haddr_t tmp_fs_addr; /* Temporary holder for free space manager address */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -575,7 +575,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__delete_fstype() */ @@ -597,7 +597,7 @@ H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC /* * Check arguments. @@ -622,7 +622,7 @@ HDfprintf(stderr, "%s: Before closing free space manager\n", FUNC); f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_fstype() */ @@ -647,7 +647,7 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_PACKAGE HDassert(f); HDassert(fspace); @@ -680,7 +680,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__add_sect() */ @@ -706,7 +706,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, H5MF_free_section_t *node; /* Free space section pointer */ htri_t ret_value = FAIL; /* Whether an existing free list node was found */ - FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_PACKAGE HDassert(f); HDassert(fspace); @@ -765,7 +765,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__find_sect() */ @@ -905,7 +905,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) H5MF_free_section_t *node = NULL; /* Free space section pointer */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size); @@ -1013,7 +1013,7 @@ H5MF__sects_dump(f, stderr); if(H5MF__sect_free((H5FS_section_info_t *)node) < 0) HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, HADDR_UNDEF, "can't free section node") - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__alloc_pagefs() */ @@ -1590,7 +1590,7 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1625,7 +1625,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5MF__close_delete() */ @@ -1759,7 +1759,7 @@ H5MF__close_aggrfs(H5F_t *f) H5FD_mem_t type; /* Memory type for iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1901,7 +1901,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_aggrfs() */ @@ -1926,7 +1926,7 @@ H5MF__close_pagefs(H5F_t *f) H5O_fsinfo_t fsinfo; /* File space info message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -2076,7 +2076,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_pagefs() */ @@ -2105,7 +2105,7 @@ H5MF__close_shrink_eoa(H5F_t *f) H5MF_sect_ud_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -2185,7 +2185,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_shrink_eoa() */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index d498be5..75b23dd 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -1699,7 +1699,7 @@ H5O__attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(f); @@ -1732,7 +1732,7 @@ H5O__attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__attr_count_real */ diff --git a/src/H5SM.c b/src/H5SM.c index 6eea80d..066224e 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -640,7 +640,7 @@ H5SM__create_list(H5F_t *f, H5SM_index_header_t *header) haddr_t addr = HADDR_UNDEF; /* Address of the list on disk */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC HDassert(f); HDassert(header); @@ -682,7 +682,7 @@ done: H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, addr, (hsize_t)header->list_size); } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__create_list */ @@ -822,7 +822,7 @@ H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header) haddr_t btree_addr; herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC /* Remember the address of the old B-tree, but change the header over to be * a list.. @@ -855,7 +855,7 @@ done: if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to unprotect SOHM index") - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__convert_btree_to_list() */ @@ -1246,7 +1246,7 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, size_t empty_pos = UFAIL; /* Empty entry in list */ herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(header); @@ -1509,7 +1509,7 @@ done: if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__write_mesg() */ @@ -1781,7 +1781,7 @@ H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, unsigned type_id; /* Message type to operate on */ herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -1946,7 +1946,7 @@ done: *mesg_size = 0; } - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__delete_from_index() */ @@ -2387,7 +2387,7 @@ H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, H5O_t *oh = NULL; /* Object header for message in object header */ herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC HDassert(f); HDassert(mesg); @@ -2461,7 +2461,7 @@ done: if(ret_value < 0 && udata.encoding_buf) udata.encoding_buf = H5MM_xfree(udata.encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__read_mesg */ diff --git a/test/mf.c b/test/mf.c index 7cfc954..8e2f75c 100644 --- a/test/mf.c +++ b/test/mf.c @@ -7696,6 +7696,8 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) TEST_ERROR if(fs_persist) { + haddr_t prv_tag = HADDR_UNDEF; + /* Re-open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0) TEST_ERROR @@ -7704,6 +7706,9 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR + /* Set the freespace tag for the metadata cache */ + H5AC_tag(H5AC__FREESPACE_TAG, &prv_tag); \ + /* Verify that the large generic manager is there */ H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); if(!H5F_addr_defined(f->shared->fs_addr[fs_type])) @@ -7754,6 +7759,9 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if(found_addr != gaddr1) TEST_ERROR + /* Reset the previous tag */ + H5AC_tag(prv_tag, NULL); \ + /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR -- cgit v0.12 From f863d4f970c2f54298a69f95bb6a15e710e1ed75 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 9 Aug 2020 18:13:42 -0500 Subject: Addition to HDFFV-10591 Description Added missing parameter description and improved format. Platforms tested: Linux/64 (jelly) --- src/H5Oattr.c | 29 ++++++++++++++++------------- src/H5Odtype.c | 7 +++++-- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/H5Oattr.c b/src/H5Oattr.c index e38ef5c..6123949 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -108,8 +108,11 @@ H5FL_EXTERN(H5S_extent_t); with the decoded information USAGE void *H5O_attr_decode(f, mesg_flags, p) - H5F_t *f; IN: pointer to the HDF5 file struct - unsigned mesg_flags; IN: Message flags to influence decoding + H5F_t *f; IN: pointer to the HDF5 file struct + H5O_t *open_oh; IN: pointer to the object header + unsigned mesg_flags; IN: message flags to influence decoding + unsigned *ioflags; IN/OUT: flags for decoding + size_t p_size; IN: size of buffer *p const uint8_t *p; IN: the raw information buffer RETURNS Pointer to the new message in native order on success, NULL on failure @@ -120,16 +123,16 @@ H5FL_EXTERN(H5S_extent_t); --------------------------------------------------------------------------*/ static void * H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) + unsigned *ioflags, size_t p_size, const uint8_t *p) { - H5A_t *attr = NULL; - H5S_extent_t *extent; /*extent dimensionality information */ - size_t name_len; /*attribute name length */ - size_t dt_size; /* Datatype size */ - hssize_t sds_size; /* Signed Dataspace size */ - hsize_t ds_size; /* Dataspace size */ - unsigned flags = 0; /* Attribute flags */ - H5A_t *ret_value = NULL; /* Return value */ + H5A_t *attr = NULL; + H5S_extent_t *extent; /*extent dimensionality information */ + size_t name_len; /*attribute name length */ + size_t dt_size; /* Datatype size */ + hssize_t sds_size; /* Signed Dataspace size */ + hsize_t ds_size; /* Dataspace size */ + unsigned flags = 0; /* Attribute flags */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -138,7 +141,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, HDassert(p); if(NULL == (attr = H5FL_CALLOC(H5A_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (attr->shared = H5FL_CALLOC(H5A_shared_t))) HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared attr structure") @@ -146,7 +149,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, /* Version number */ attr->shared->version = *p++; if(attr->shared->version < H5O_ATTR_VERSION_1 || attr->shared->version > H5O_ATTR_VERSION_LATEST) - HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "bad version number for attribute message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "bad version number for attribute message") /* Get the flags byte if we have a later version of the attribute */ if(attr->shared->version >= H5O_ATTR_VERSION_2) { diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 6eaaae9..92a8ee3 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -1094,9 +1094,12 @@ done: with the decoded information USAGE void *H5O_dtype_decode(f, mesg_flags, p) - H5F_t *f; IN: pointer to the HDF5 file struct + H5F_t *f; IN: pointer to the HDF5 file struct + H5O_t *open_oh; IN: pointer to the object header unsigned mesg_flags; IN: Message flags to influence decoding - const uint8 *p; IN: the raw information buffer + unsigned *ioflags; IN/OUT: flags for decoding + size_t p_size; IN: size of buffer *p + const uint8_t *p; IN: the raw information buffer RETURNS Pointer to the new message in native order on success, NULL on failure DESCRIPTION -- cgit v0.12 From 79a2e34f88af7c7290401607f1dd1fed822dc414 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 10 Aug 2020 12:58:20 -0500 Subject: Correct typos w/HGOTO_DONE & HGOTO_ERROR --- src/H5FDros3.c | 40 ++++++++++++++++++++-------------------- src/H5FDs3comms.c | 30 +++++++++++++++--------------- src/H5HLcache.c | 6 +++--- src/H5I.c | 6 ++---- src/H5Odtype.c | 10 +++++----- src/H5Ostab.c | 2 +- src/H5Tenum.c | 3 +-- 7 files changed, 47 insertions(+), 50 deletions(-) diff --git a/src/H5FDros3.c b/src/H5FDros3.c index 38e34a0..c024716 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -1202,71 +1202,71 @@ H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2) /* URL: SCHEME */ if(HDstrcmp(purl1->scheme, purl2->scheme)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* URL: HOST */ if(HDstrcmp(purl1->host, purl2->host)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* URL: PORT */ if(purl1->port && purl2->port) { if(HDstrcmp(purl1->port, purl2->port)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(purl1->port) - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(purl2->port) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* URL: PATH */ if(purl1->path && purl2->path) { if(HDstrcmp(purl1->path, purl2->path)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(purl1->path && !purl2->path) - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(purl2->path && !purl1->path) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* URL: QUERY */ if(purl1->query && purl2->query) { if(HDstrcmp(purl1->query, purl2->query)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(purl1->query && !purl2->query) - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(purl2->query && !purl1->query) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* FAPL: AWS_REGION */ if(f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') { if(HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(f1->fa.aws_region[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(f2->fa.aws_region[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* FAPL: SECRET_ID */ if(f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') { if(HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(f1->fa.secret_id[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(f2->fa.secret_id[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* FAPL: SECRET_KEY */ if(f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') { if(HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(f1->fa.secret_key[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(f2->fa.secret_key[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index e79ee0d..4c762d1 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -311,7 +311,7 @@ H5FD_s3comms_hrb_node_set( if(*L == NULL) { if(value == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list") else { #if S3COMMS_DEBUG HDprintf("CREATE NEW\n"); HDfflush(stdout); @@ -414,7 +414,7 @@ HDprintf("MODIFY HEAD\n"); HDfflush(stdout); is_looking = FALSE; if(value == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head") else { #if S3COMMS_DEBUG HDprintf("PREPEND NEW HEAD\n"); HDfflush(stdout); @@ -442,7 +442,7 @@ HDprintf("PREPEND NEW HEAD\n"); HDfflush(stdout); is_looking = FALSE; if(value == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node") else { #if S3COMMS_DEBUG HDprintf("APPEND A NODE\n"); HDfflush(stdout); @@ -465,7 +465,7 @@ HDprintf("APPEND A NODE\n"); HDfflush(stdout); is_looking = FALSE; if(value == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node") else { #if S3COMMS_DEBUG HDprintf("INSERT A NODE\n"); HDfflush(stdout); @@ -944,9 +944,9 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize."); if(sds.size > CURL_MAX_HTTP_HEADER) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun") else if (sds.size == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata") #if S3COMMS_DEBUG else HDfprintf(stderr, "GETSIZE: OK\n"); @@ -2305,7 +2305,7 @@ H5FD_s3comms_parse_url( purl->scheme = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->scheme == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for SCHEME"); - (void)HDstrncpy(purl->scheme, curstr, (size_t)len); + HDstrncpy(purl->scheme, curstr, (size_t)len); purl->scheme[len] = '\0'; for(i = 0; i < len; i++ ) purl->scheme[i] = (char)HDtolower(purl->scheme[i]); @@ -2337,7 +2337,7 @@ H5FD_s3comms_parse_url( } /* end else (IPv4) */ len = tmpstr - curstr; if(len == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty") else if(len > urllen) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of HOST substring"); @@ -2345,7 +2345,7 @@ H5FD_s3comms_parse_url( purl->host = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->host == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for HOST"); - (void)HDstrncpy(purl->host, curstr, (size_t)len); + HDstrncpy(purl->host, curstr, (size_t)len); purl->host[len] = 0; /************* @@ -2359,7 +2359,7 @@ H5FD_s3comms_parse_url( tmpstr++; len = tmpstr - curstr; if(len == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty") else if(len > urllen) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PORT substring"); for(i = 0; i < len; i ++) @@ -2370,7 +2370,7 @@ H5FD_s3comms_parse_url( purl->port = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->port == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PORT"); - (void)HDstrncpy(purl->port, curstr, (size_t)len); + HDstrncpy(purl->port, curstr, (size_t)len); purl->port[len] = 0; } /* end if PORT element */ @@ -2392,8 +2392,8 @@ H5FD_s3comms_parse_url( if(len > 0) { purl->path = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->path == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH"); - (void)HDstrncpy(purl->path, curstr, (size_t)len); + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH"); + HDstrncpy(purl->path, curstr, (size_t)len); purl->path[len] = 0; } } /* end if PATH element */ @@ -2409,13 +2409,13 @@ H5FD_s3comms_parse_url( tmpstr++; len = tmpstr - curstr; if(len == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty") else if(len > urllen) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of QUERY substring"); purl->query = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->query == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for QUERY"); - (void)HDstrncpy(purl->query, curstr, (size_t)len); + HDstrncpy(purl->query, curstr, (size_t)len); purl->query[len] = 0; } /* end if QUERY exists */ diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 38cf060..006ddc0 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -486,11 +486,11 @@ done: if(!ret_value) { if(prfx) { if(FAIL == H5HL__prfx_dest(prfx)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap prefix"); + HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap prefix"); } /* end if */ else { if(heap && FAIL == H5HL__dest(heap)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap"); + HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap"); } /* end else */ } /* end if */ @@ -771,7 +771,7 @@ done: /* Release the [possibly partially initialized] local heap on errors */ if(!ret_value && dblk) if(FAIL == H5HL__dblk_dest(dblk)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block"); + HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block"); FUNC_LEAVE_NOAPI(ret_value) } /* end H5HL__cache_datablock_deserialize() */ diff --git a/src/H5I.c b/src/H5I.c index a739c4e..c1d966c 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -1124,9 +1124,8 @@ H5I_is_file_object(hid_t id) /* Return TRUE if the ID is a file object (dataset, group, map, or committed * datatype), FALSE otherwise. */ - if (H5I_DATASET == id_type || H5I_GROUP == id_type || H5I_MAP == id_type) { + if (H5I_DATASET == id_type || H5I_GROUP == id_type || H5I_MAP == id_type) ret_value = TRUE; - } else if (H5I_DATATYPE == id_type) { H5T_t *dt = NULL; @@ -1136,9 +1135,8 @@ H5I_is_file_object(hid_t id) ret_value = H5T_is_named(dt); } - else { + else ret_value = FALSE; - } done: FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Odtype.c b/src/H5Odtype.c index cbadfd0..3ad53a4 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -439,15 +439,15 @@ H5O__dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t /* Set reference type */ dt->shared->u.atomic.u.r.rtype = (H5R_type_t)(flags & 0x0f); if(dt->shared->u.atomic.u.r.rtype <= H5R_BADTYPE - || dt->shared->u.atomic.u.r.rtype >= H5R_MAXTYPE) + || dt->shared->u.atomic.u.r.rtype >= H5R_MAXTYPE) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "invalid reference type"); /* Set generic flag */ if(dt->shared->u.atomic.u.r.rtype == H5R_OBJECT2 - || dt->shared->u.atomic.u.r.rtype == H5R_DATASET_REGION2 - || dt->shared->u.atomic.u.r.rtype == H5R_ATTR) { - dt->shared->u.atomic.u.r.opaque = TRUE; - dt->shared->u.atomic.u.r.version = (unsigned)((flags >> 4) & 0x0f); + || dt->shared->u.atomic.u.r.rtype == H5R_DATASET_REGION2 + || dt->shared->u.atomic.u.r.rtype == H5R_ATTR) { + dt->shared->u.atomic.u.r.opaque = TRUE; + dt->shared->u.atomic.u.r.version = (unsigned)((flags >> 4) & 0x0f); if(dt->shared->u.atomic.u.r.version != H5R_ENCODE_VERSION) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "reference version does not match"); } else diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 10501a0..18f32b3 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -185,7 +185,7 @@ H5O__stab_copy(const void *_mesg, void *_dest) /* check args */ HDassert(stab); if(!dest && NULL == (dest = H5FL_MALLOC(H5O_stab_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* copy */ *dest = *stab; diff --git a/src/H5Tenum.c b/src/H5Tenum.c index ffdab5b..cd41a23 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -414,8 +414,7 @@ H5T__enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t s /* Save result name */ if(!name) { - if(NULL == (name = (char *)H5MM_malloc( - HDstrlen(copied_dt->shared->u.enumer.name[md]) + 1))) + if(NULL == (name = (char *)H5MM_malloc(HDstrlen(copied_dt->shared->u.enumer.name[md]) + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); alloc_name = TRUE; } /* end if */ -- cgit v0.12 From 78c6be05a84f854074a4df2e10c15a56444e4015 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 11 Aug 2020 17:46:54 -0700 Subject: Fixes the splitter VFD test on Windows. --- test/h5test.c | 10 +++++----- test/vfd.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/h5test.c b/test/h5test.c index 255932a..817e98c 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2067,13 +2067,13 @@ h5_compare_file_bytes(char *f1name, char *f2name) int ret_value = 0; /* for error handling */ /* Open files for reading */ - f1ptr = HDfopen(f1name, "r"); + f1ptr = HDfopen(f1name, "rb"); if (f1ptr == NULL) { HDfprintf(stderr, "Unable to fopen() %s\n", f1name); ret_value = -1; goto done; } - f2ptr = HDfopen(f2name, "r"); + f2ptr = HDfopen(f2name, "rb"); if (f2ptr == NULL) { HDfprintf(stderr, "Unable to fopen() %s\n", f2name); ret_value = -1; @@ -2200,7 +2200,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) max_buf = 4096 * sizeof(char); - orig_ptr = HDfopen(orig, "r"); + orig_ptr = HDfopen(orig, "rb"); if (NULL == orig_ptr) { ret_value = -1; goto done; @@ -2210,7 +2210,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) fsize = (hsize_t)HDftell(orig_ptr); HDrewind(orig_ptr); - dest_ptr = HDfopen(dest, "w"); + dest_ptr = HDfopen(dest, "wb"); if (NULL == dest_ptr) { ret_value = -1; goto done; @@ -2224,7 +2224,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) } while (read_size > 0) { - if(HDfread(dup_buf, read_size, 1, orig_ptr) != 1) { + if (HDfread(dup_buf, read_size, 1, orig_ptr) != 1) { ret_value = -1; goto done; } diff --git a/test/vfd.c b/test/vfd.c index f1443c5..d849d96 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -2453,7 +2453,7 @@ run_splitter_test(const struct splitter_dataset_def *data, SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } - /* Verify existence of logfile iff appropriate */ + /* Verify existence of logfile if appropriate */ logfile = fopen(vfd_config->log_file_path, "r"); if ( (TRUE == provide_logfile_path && NULL == logfile) || (FALSE == provide_logfile_path && NULL != logfile) ) -- cgit v0.12 From 768f8abb18a0b7d7233cfc1ea3da32efe83f56f1 Mon Sep 17 00:00:00 2001 From: Elena Date: Wed, 12 Aug 2020 08:40:11 -0500 Subject: The H5DSis_scale function was updated to return "not a dimension scale" (0) instead of failing (-1), when CLASS or DIMENSION_SCALE attributes are not written according to Dimension Scales Specification (HDFFV-10436). --- hl/src/H5DS.c | 89 ++++++++++++++++++++++++++---------------------- release_docs/RELEASE.txt | 8 +++-- 2 files changed, 55 insertions(+), 42 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 12bcc93..31cbe13 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1896,30 +1896,32 @@ out: } /*------------------------------------------------------------------------- - * Function: H5DSis_scale - * - * Purpose: check if the dataset DID is a dimension scale - * - * Return: 1, is, 0, not, FAIL, error - * - * Programmer: Pedro Vicente - * - * Date: January 04, 2005 - * - *------------------------------------------------------------------------- - */ -htri_t -H5DSis_scale(hid_t did) +* Function: H5DSis_scale +* +* Purpose: check if the dataset DID is a dimension scale +* +* Return: 1, is, 0, not, FAIL, error +* +* Programmer: pvn@ncsa.uiuc.edu +* +* Date: January 04, 2005 +* +*------------------------------------------------------------------------- +*/ + +htri_t H5DSis_scale(hid_t did) { - hid_t tid = -1; /* attribute type ID */ - hid_t aid = -1; /* attribute ID */ - herr_t has_class; /* has the "CLASS" attribute */ - htri_t is_ds; /* boolean return value */ - H5I_type_t it; /* ID type */ - char *buf; /* Name of attribute */ - hsize_t storage_size; /* Size of storage for attribute */ - - /*------------------------------------------------------------------------- + hid_t tid = -1; /* attribute type ID */ + hid_t aid = -1; /* attribute ID */ + herr_t attr_class; /* has the "CLASS" attribute */ + htri_t is_ds = 0; /* set to "not a dimension scale" */ + H5I_type_t it; /* type of identofier */ + char *buf; /* buffer to read a name of attribute */ + size_t string_size; /* Size of storage for the attribute */ + H5T_class_t type_class; + H5T_str_t strpad; + + /*------------------------------------------------------------------------ * parameter checking *------------------------------------------------------------------------- */ @@ -1931,11 +1933,11 @@ H5DSis_scale(hid_t did) return FAIL; /* try to find the attribute "CLASS" on the dataset */ - if((has_class = H5LT_find_attribute(did, "CLASS")) < 0) + if((attr_class = H5LT_find_attribute(did, "CLASS")) < 0) return FAIL; - if(has_class == 0) - is_ds = 0; + if(attr_class == 0) + return is_ds; else { @@ -1945,19 +1947,27 @@ H5DSis_scale(hid_t did) if((tid = H5Aget_type(aid)) < 0) goto out; - /* check to make sure attribute is a string */ - if(H5T_STRING != H5Tget_class(tid)) + /* check to make sure attribute is a string; + if not, then it is not dimension scale */ + if((type_class = H5Tget_class(tid)) < 0) goto out; + if(H5T_STRING != type_class) + goto out_success; - /* check to make sure string is null-terminated */ - if(H5T_STR_NULLTERM != H5Tget_strpad(tid)) + /* check to make sure string is null-terminated; + if not, then it is not dimension scale */ + if((strpad = H5Tget_strpad(tid)) < 0 ) goto out; + if(H5T_STR_NULLTERM != strpad) + goto out_success; - /* allocate buffer large enough to hold string */ - if((storage_size = H5Aget_storage_size(aid)) == 0) - goto out; + /* get string size should be 16 to hold "DIMENSION_SCALE" string */ + if((string_size = H5Tget_size(tid)) == 0) + return FAIL; + if(string_size != 16) + goto out_success; - buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1); + buf = (char*)HDmalloc((size_t)string_size * sizeof(char)); if(buf == NULL) goto out; @@ -1966,10 +1976,9 @@ H5DSis_scale(hid_t did) goto out; /* compare strings */ - if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0) + if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, + MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0) is_ds = 1; - else - is_ds = 0; HDfree(buf); @@ -1979,11 +1988,11 @@ H5DSis_scale(hid_t did) if (H5Aclose(aid) < 0) goto out; + goto out_success; } - - return is_ds; - +out_success: + return is_ds; /* error zone */ out: H5E_BEGIN_TRY { diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7ccdbe9..5720c17 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -742,7 +742,7 @@ New Features High-Level APIs: --------------- - - + - C Packet Table API ------------------ @@ -1203,7 +1203,11 @@ Bug Fixes since HDF5-1.10.3 release High-Level APIs: ------ - - + - The H5DSis_scale function was updated to return "not a dimension scale" (0) + instead of failing (-1), when CLASS or DIMENSION_SCALE attributes are + not written according to Dimension Scales Specification. + + (EIP - 2020/08/12, HDFFV-10436) Fortran High-Level APIs: ------ -- cgit v0.12 From ed51c0e302e1d422dcdd730448a8e9e06326985a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Aug 2020 09:52:10 -0700 Subject: Fixes memory leads in trefer.c --- test/trefer.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/test/trefer.c b/test/trefer.c index b90ec45..8ce75e9 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -1135,11 +1135,11 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) hsize_t *coords; /* Coordinate buffer */ hsize_t low[SPACE2_RANK]; /* Selection bounds */ hsize_t high[SPACE2_RANK]; /* Selection bounds */ - H5R_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ + H5R_ref_t *wbuf = NULL, /* buffer to write to disk */ + *rbuf = NULL; /* buffer read from disk */ H5R_ref_t nvrbuf[3]={{{{0}}},{{{101}}},{{{255}}}}; /* buffer with non-valid refs */ - uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ + uint8_t *dwbuf = NULL, /* Buffer for writing numeric data to disk */ + *drbuf = NULL; /* Buffer for reading numeric data from disk */ uint8_t *tu8; /* Temporary pointer to uint8 data */ H5O_type_t obj_type; /* Type of object */ int i, j; /* Counters */ @@ -1537,13 +1537,14 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) CHECK(ret, FAIL, "H5Rdestroy"); } - /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); - } + + /* Free memory buffers */ + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); + } /* test_reference_region() */ /**************************************************************** @@ -1576,10 +1577,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) hsize_t *coords; /* Coordinate buffer */ hsize_t low[SPACE3_RANK]; /* Selection bounds */ hsize_t high[SPACE3_RANK]; /* Selection bounds */ - H5R_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ - uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ + H5R_ref_t *wbuf = NULL, /* buffer to write to disk */ + *rbuf = NULL; /* buffer read from disk */ + uint8_t *dwbuf = NULL, /* Buffer for writing numeric data to disk */ + *drbuf = NULL; /* Buffer for reading numeric data from disk */ uint8_t *tu8; /* Temporary pointer to uint8 data */ H5O_type_t obj_type; /* Object type */ int i; /* Counter */ @@ -1876,13 +1877,14 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) CHECK(ret, FAIL, "H5Rdestroy"); } - /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); - } + + /* Free memory buffers */ + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); + } /* test_reference_region_1D() */ /**************************************************************** -- cgit v0.12 From 4f0283db788fc1a0db94e7825567210021b3b594 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Aug 2020 11:38:04 -0700 Subject: Fixes a size mismatch when copying old-style to new-style references --- src/H5Rint.c | 2 +- src/H5Tconv.c | 2 +- test/trefer.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/H5Rint.c b/src/H5Rint.c index 0acc887..ae72b47 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -822,7 +822,7 @@ H5R__set_obj_token(H5R_ref_priv_t *ref, const H5O_token_t *obj_token, HDassert(token_size); HDassert(token_size <= H5O_MAX_TOKEN_SIZE); - H5MM_memcpy(&ref->info.obj.token, obj_token, sizeof(H5O_token_t)); + H5MM_memcpy(&ref->info.obj.token, obj_token, token_size); HDassert(token_size <= 255); ref->token_size = (uint8_t)token_size; diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 15658cc..8bf36f0 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -3641,7 +3641,7 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(0 == (buf_size = src->shared->u.atomic.u.r.cls->getsize( src->shared->u.atomic.u.r.file, s, src->shared->size, dst->shared->u.atomic.u.r.file, &dst_copy))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "incorrect size") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to obtain size of reference") /* Check if conversion buffer is large enough, resize if necessary. */ if(conv_buf_size < buf_size) { diff --git a/test/trefer.c b/test/trefer.c index 8ce75e9..4bf5c17 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -2720,10 +2720,10 @@ test_reference_compat_conv(void) hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hobj_ref_t *wbuf_obj; /* Buffer to write to disk */ - H5R_ref_t *rbuf_obj; /* Buffer read from disk */ - hdset_reg_ref_t *wbuf_reg; /* Buffer to write to disk */ - H5R_ref_t *rbuf_reg; /* Buffer read from disk */ + hobj_ref_t *wbuf_obj = NULL; /* Buffer to write to disk */ + H5R_ref_t *rbuf_obj = NULL; /* Buffer read from disk */ + hdset_reg_ref_t *wbuf_reg = NULL; /* Buffer to write to disk */ + H5R_ref_t *rbuf_reg = NULL; /* Buffer read from disk */ H5O_type_t obj_type; /* Object type */ herr_t ret; /* Generic return value */ unsigned int i; /* Counter */ -- cgit v0.12 From 752411bfda95b6a143708994554a56cc8a5345c0 Mon Sep 17 00:00:00 2001 From: Elena Date: Wed, 12 Aug 2020 15:19:41 -0500 Subject: Fixed several typos in the comments found by Larry during the review. --- hl/src/H5DS.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 31cbe13..c129e43 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1915,9 +1915,9 @@ htri_t H5DSis_scale(hid_t did) hid_t aid = -1; /* attribute ID */ herr_t attr_class; /* has the "CLASS" attribute */ htri_t is_ds = 0; /* set to "not a dimension scale" */ - H5I_type_t it; /* type of identofier */ - char *buf; /* buffer to read a name of attribute */ - size_t string_size; /* Size of storage for the attribute */ + H5I_type_t it; /* type of identifier */ + char *buf; /* buffer to read name of attribute */ + size_t string_size; /* size of storage for the attribute */ H5T_class_t type_class; H5T_str_t strpad; -- cgit v0.12 From cecaed97f7987266d74dff90448d02c586d14052 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 12 Aug 2020 16:14:44 -0500 Subject: HDFFV-11127 - force RTLD_LOCAL in dlopen --- release_docs/RELEASE.txt | 15 ++++++++++++--- src/H5PLpkg.h | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7ccdbe9..2217b5a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -349,9 +349,9 @@ New Features added to the libhdf5.settings file. Autotools: - + An --enable-file-locking=(yes|no|best-effort) option has been added. - + yes: Use file locking. no: Do not use file locking. best-effort: Use file locking and ignore "disabled" errors. @@ -765,6 +765,15 @@ Bug Fixes since HDF5-1.10.3 release Library ------- + - Explicitly declared dlopen to use RTLD_LOCAL + + dlopen documentation states that f neither RTLD_GLOBAL nor + RTLD_LOCAL are specified, then the default behavior is unspecified. + The default on linux is usually RTLD_LOCAL while macos will default + to RTLD_GLOBAL. + + (ADB - 2020/08/12, HDFFV-11127) + - Fixed issues CVE-2018-13870 and CVE-2018-13869 When a buffer overflow occurred because a name length was corrupted @@ -774,7 +783,7 @@ Bug Fixes since HDF5-1.10.3 release locations to prevent the crashes and h5dump now simply fails with an error message when this error condition occurs. - (BMR - 2020/7/22, HDFFV-11120 and HDFFV-11121) + (BMR - 2020/07/22, HDFFV-11120 and HDFFV-11121) - Fixed the segmentation fault when reading attributes with multiple threads diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 8c2367f..a086a2c 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -95,7 +95,7 @@ # define H5PL_HANDLE void * /* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ -# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY) +# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY | RTLD_LOCAL) /* Get the address of a symbol in dynamic library */ # define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) -- cgit v0.12 From 037bad4f7220b88de5ff3b74c205ea1d790290d5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Aug 2020 15:07:15 -0700 Subject: Fixes Windows issues due to exposed pthread code --- test/ttsafe_attr_vlen.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/ttsafe_attr_vlen.c b/test/ttsafe_attr_vlen.c index b07e362..2b94167 100644 --- a/test/ttsafe_attr_vlen.c +++ b/test/ttsafe_attr_vlen.c @@ -54,7 +54,7 @@ void *tts_attr_vlen_thread(void *); void tts_attr_vlen(void) { - pthread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ + H5TS_thread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ hid_t fid = H5I_INVALID_HID; /* File ID */ hid_t gid = H5I_INVALID_HID; /* Group ID */ hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ @@ -106,12 +106,15 @@ tts_attr_vlen(void) CHECK(ret, H5I_INVALID_HID, "H5Tclose"); /* Start multiple threads and execute tts_attr_vlen_thread() for each thread */ - for(i = 0; i < NUM_THREADS; i++) - pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); + for(i = 0; i < NUM_THREADS; i++) { + threads[i] = H5TS_create_thread(tts_attr_vlen_thread, NULL, NULL); + } + //pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); /* Wait for the threads to end */ for(i = 0; i < NUM_THREADS; i++) - pthread_join(threads[i], NULL); + H5TS_wait_for_thread(threads[i]); + //pthread_join(threads[i], NULL); } /* end tts_attr_vlen() */ -- cgit v0.12 From 04b24163f7f08248a58d256371e088c8cc7816c8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Aug 2020 15:21:38 -0700 Subject: Cleans warnings and cruft from ttsafe_attr_vlen.c --- test/ttsafe_attr_vlen.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test/ttsafe_attr_vlen.c b/test/ttsafe_attr_vlen.c index 2b94167..43a5e9a 100644 --- a/test/ttsafe_attr_vlen.c +++ b/test/ttsafe_attr_vlen.c @@ -60,7 +60,7 @@ tts_attr_vlen(void) hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ hid_t asid = H5I_INVALID_HID; /* Dataspace ID for attribute */ hid_t aid = H5I_INVALID_HID; /* The attribute ID */ - char *string_attr = "2.0"; /* The attribute data */ + const char *string_attr = "2.0"; /* The attribute data */ int ret; /* Return value */ int i; /* Local index variable */ @@ -109,26 +109,24 @@ tts_attr_vlen(void) for(i = 0; i < NUM_THREADS; i++) { threads[i] = H5TS_create_thread(tts_attr_vlen_thread, NULL, NULL); } - //pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); /* Wait for the threads to end */ for(i = 0; i < NUM_THREADS; i++) H5TS_wait_for_thread(threads[i]); - //pthread_join(threads[i], NULL); } /* end tts_attr_vlen() */ /* Start execution for each thread */ void * -tts_attr_vlen_thread(void *client_data) +tts_attr_vlen_thread(void H5_ATTR_UNUSED *client_data) { - hid_t fid = H5I_INVALID_HID; /* File ID */ - hid_t gid = H5I_INVALID_HID; /* Group ID */ - hid_t aid = H5I_INVALID_HID; /* Attribute ID */ - hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ - char *string_attr_check; /* The attribute data being read */ - char *string_attr = "2.0"; /* The expected attribute data */ - herr_t ret; /* Return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ + char *string_attr_check; /* The attribute data being read */ + const char *string_attr = "2.0"; /* The expected attribute data */ + herr_t ret; /* Return value */ /* Open the test file */ fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); -- cgit v0.12 From 747fde00fef0280352f596c8c35e7a49fe38f83f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 13 Aug 2020 06:22:50 -0500 Subject: spelling --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 2217b5a..07c61e5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -767,7 +767,7 @@ Bug Fixes since HDF5-1.10.3 release ------- - Explicitly declared dlopen to use RTLD_LOCAL - dlopen documentation states that f neither RTLD_GLOBAL nor + dlopen documentation states that if neither RTLD_GLOBAL nor RTLD_LOCAL are specified, then the default behavior is unspecified. The default on linux is usually RTLD_LOCAL while macos will default to RTLD_GLOBAL. -- cgit v0.12 From b806f3e9acad6261438dacecbb11a87bcd644e72 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 13 Aug 2020 10:13:18 -0700 Subject: Tweak to hide unused threadsafe callback in non-threadsafe builds --- test/thread_id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/thread_id.c b/test/thread_id.c index 24aef80..0c804ed 100644 --- a/test/thread_id.c +++ b/test/thread_id.c @@ -25,6 +25,8 @@ */ #include "testhdf5.h" +#if defined(H5_HAVE_THREADSAFE) && !defined(H5_HAVE_WIN_THREADS) + static void my_errx(int, const char *, ...) H5_ATTR_FORMAT(printf, 2, 3); static void @@ -40,8 +42,6 @@ my_errx(int code, const char *fmt, ...) HDexit(code); } -#if defined(H5_HAVE_THREADSAFE) && !defined(H5_HAVE_WIN_THREADS) - #if defined(H5_HAVE_DARWIN) typedef struct _pthread_barrierattr { -- cgit v0.12 From c6248cfb6975a6ecadf0259390247ce05dc13c4b Mon Sep 17 00:00:00 2001 From: Elena Date: Thu, 13 Aug 2020 19:33:51 -0500 Subject: Addresseda Dana's comments from the pull request. --- hl/src/H5DS.c | 61 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index c129e43..bd4c196 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1914,9 +1914,9 @@ htri_t H5DSis_scale(hid_t did) hid_t tid = -1; /* attribute type ID */ hid_t aid = -1; /* attribute ID */ herr_t attr_class; /* has the "CLASS" attribute */ - htri_t is_ds = 0; /* set to "not a dimension scale" */ + htri_t is_ds = -1; /* set to "not a dimension scale" */ H5I_type_t it; /* type of identifier */ - char *buf; /* buffer to read name of attribute */ + char *buf = NULL; /* buffer to read name of attribute */ size_t string_size; /* size of storage for the attribute */ H5T_class_t type_class; H5T_str_t strpad; @@ -1927,18 +1927,19 @@ htri_t H5DSis_scale(hid_t did) */ /* get ID type */ if ((it = H5Iget_type(did)) < 0) - return FAIL; + goto out; if(H5I_DATASET != it) - return FAIL; + goto out; /* try to find the attribute "CLASS" on the dataset */ if((attr_class = H5LT_find_attribute(did, "CLASS")) < 0) - return FAIL; - - if(attr_class == 0) - return is_ds; + goto out; + if(attr_class == 0) { + is_ds = 0; + goto out; + } else { if((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0) @@ -1951,21 +1952,27 @@ htri_t H5DSis_scale(hid_t did) if not, then it is not dimension scale */ if((type_class = H5Tget_class(tid)) < 0) goto out; - if(H5T_STRING != type_class) - goto out_success; - + if(H5T_STRING != type_class) { + is_ds = 0; + goto out; + } /* check to make sure string is null-terminated; if not, then it is not dimension scale */ if((strpad = H5Tget_strpad(tid)) < 0 ) goto out; - if(H5T_STR_NULLTERM != strpad) - goto out_success; + if(H5T_STR_NULLTERM != strpad) { + is_ds = 0; + goto out; + } - /* get string size should be 16 to hold "DIMENSION_SCALE" string */ + /* According to Spec string is ASCII and its size should be 16 to hold + "DIMENSION_SCALE" string */ if((string_size = H5Tget_size(tid)) == 0) - return FAIL; - if(string_size != 16) - goto out_success; + goto out; + if(string_size != 16) { + is_ds = 0; + goto out; + } buf = (char*)HDmalloc((size_t)string_size * sizeof(char)); if(buf == NULL) @@ -1987,20 +1994,16 @@ htri_t H5DSis_scale(hid_t did) if (H5Aclose(aid) < 0) goto out; - - goto out_success; - } -out_success: - return is_ds; - /* error zone */ out: - H5E_BEGIN_TRY { - H5Aclose(aid); - H5Tclose(tid); - } H5E_END_TRY; - return FAIL; - + if(is_ds < 0) { + HDfree(buf); + H5E_BEGIN_TRY { + H5Aclose(aid); + H5Tclose(tid); + } H5E_END_TRY; + } + return is_ds; } /*------------------------------------------------------------------------- -- cgit v0.12 From 3feeb8ec20a7b08acdcd77f3e10c8c93818d890e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 14 Aug 2020 06:32:58 -0700 Subject: Fixes naming issues in H5VM inline functions --- src/H5VMprivate.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index e784847..5c975f6 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -164,8 +164,8 @@ H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (n && !v) HGOTO_DONE(0) while (n--) ret_value *= *v++; @@ -198,8 +198,8 @@ H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (!v) HGOTO_DONE(TRUE) @@ -235,8 +235,8 @@ H5VM_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (!v) HGOTO_DONE(TRUE) @@ -274,8 +274,8 @@ H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) @@ -318,8 +318,8 @@ H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) -- cgit v0.12 From 500d87fd1f5d6068feeb71119bc5d22843203fef Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 12:16:58 -0500 Subject: HDFFV-9984 Add options to merge/prune external links during repack --- MANIFEST | 19 ++ release_docs/RELEASE.txt | 11 + tools/lib/h5tools_utils.c | 2 +- tools/src/h5copy/h5copy.c | 4 +- tools/src/h5repack/h5repack.h | 38 +-- tools/src/h5repack/h5repack_copy.c | 84 +++++- tools/src/h5repack/h5repack_main.c | 53 ++-- tools/test/h5diff/h5diffgentest.c | 1 - tools/test/h5repack/CMakeTests.cmake | 113 +++++++- tools/test/h5repack/h5repack.sh.in | 300 ++++++++++++++++----- ...y_extlinks_src-merge.h5copy_extlinks_src.h5.tst | 26 ++ ...links_src-mergeprune.h5copy_extlinks_src.h5.ddl | 28 ++ ...y_extlinks_src-prune.h5copy_extlinks_src.h5.ddl | 6 + .../test/h5repack/testfiles/h5copy_extlinks_src.h5 | Bin 0 -> 2184 bytes .../test/h5repack/testfiles/h5copy_extlinks_trg.h5 | Bin 0 -> 2168 bytes tools/test/h5repack/testfiles/h5repack-help.txt | 3 + .../testfiles/textlink-merge.textlink.h5.tst | 13 + .../testfiles/textlink-mergeprune.textlink.h5.ddl | 4 + .../testfiles/textlink-prune.textlink.h5.ddl | 4 + .../testfiles/textlinkfar-merge.textlinkfar.h5.tst | 20 ++ .../textlinkfar-mergeprune.textlinkfar.h5.ddl | 152 +++++++++++ .../testfiles/textlinkfar-prune.textlinkfar.h5.ddl | 4 + .../testfiles/textlinksrc-merge.textlinksrc.h5.tst | 32 +++ .../textlinksrc-mergeprune.textlinksrc.h5.ddl | 187 +++++++++++++ .../testfiles/textlinksrc-prune.textlinksrc.h5.ddl | 4 + .../testfiles/textlinktar-merge.textlinktar.h5.tst | 44 +++ .../textlinktar-mergeprune.textlinktar.h5.ddl | 200 ++++++++++++++ .../testfiles/textlinktar-prune.textlinktar.h5.ddl | 52 ++++ .../testfiles/tsoftlinks-merge.tsoftlinks.h5.tst | 53 ++++ .../tsoftlinks-mergeprune.tsoftlinks.h5.ddl | 127 +++++++++ .../testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl | 47 ++++ 31 files changed, 1511 insertions(+), 120 deletions(-) create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 create mode 100644 tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst create mode 100644 tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst create mode 100644 tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst create mode 100644 tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst create mode 100644 tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl diff --git a/MANIFEST b/MANIFEST index 6aaf772..826c0d5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2663,6 +2663,7 @@ #test files for h5repack ./tools/test/h5repack/testfiles/README ./tools/test/h5repack/testfiles/bounds_latest_latest.h5 +./tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 ./tools/test/h5repack/testfiles/h5repack_aggr.h5 ./tools/test/h5repack/testfiles/h5repack_attr.h5 ./tools/test/h5repack/testfiles/h5repack_attr_refs.h5 @@ -2741,6 +2742,24 @@ ./tools/test/h5repack/testfiles/4_vds.h5-vds_compa-v.ddl ./tools/test/h5repack/testfiles/attrregion.tattrreg.h5.ddl ./tools/test/h5repack/testfiles/dataregion.tdatareg.h5.ddl +./tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst +./tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl +./tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl +./tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst +./tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl +./tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl +./tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst +./tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl +./tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl +./tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst +./tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl +./tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl +./tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst +./tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl +./tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl +./tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst +./tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl +./tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl # jam utility and tests ./tools/src/h5jam/Makefile.am diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9cb9d53..45dee05 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -699,6 +699,17 @@ New Features Tools: ------ + - h5repack added options to control how external links are handled. + + Currently h5repack preserves external links and cannot copy and merge + data from the external files. Two options, merge and prune, were added to + control how to merge data from an external link into the resulting file. + --merge Follow external soft link recursively and merge data. + --prune Do not follow external soft links and remove link. + --merge --prune Follow external link, merge data and remove dangling link. + + (ADB - 2020/08/05, HDFFV-9984) + - h5repack was fixed to repack the reference attributes properly. The code line that checks if the update of reference inside a compound datatype is misplaced outside the code block loop that carries out the diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 1a1c2db..6167dd9 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -901,7 +901,7 @@ tmpfile(void) * link_info->trg_path must be freed out of this function *-------------------------------------------------------------------------*/ int -H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, hbool_t get_obj_type) +H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t *link_info, hbool_t get_obj_type) { htri_t l_ret; H5O_info2_t trg_oinfo; diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 5b19ae7..a6e4d4e 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -212,8 +212,8 @@ main (int argc, const char *argv[]) unsigned flag = 0; unsigned verbose = 0; unsigned parents = 0; - hid_t ocpl_id = (-1); /* Object copy property list */ - hid_t lcpl_id = (-1); /* Link creation property list */ + hid_t ocpl_id = H5I_INVALID_HID; /* Object copy property list */ + hid_t lcpl_id = H5I_INVALID_HID; /* Link creation property list */ int opt; int li_ret; h5tool_link_info_t linkinfo; diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h index caa1166..b124fdb 100644 --- a/tools/src/h5repack/h5repack.h +++ b/tools/src/h5repack/h5repack.h @@ -101,25 +101,27 @@ typedef struct { /* all the above, ready to go to the hrepack call */ typedef struct { - pack_opttbl_t *op_tbl; /*table with all -c and -f options */ - int all_layout; /*apply the layout to all objects */ - int all_filter; /*apply the filter to all objects */ + pack_opttbl_t *op_tbl; /* table with all -c and -f options */ + int all_layout; /* apply the layout to all objects */ + int all_filter; /* apply the filter to all objects */ filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */ - int n_filter_g; /*number of global filters */ - chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ - H5D_layout_t layout_g; /*global layout information for the ALL case */ - int verbose; /*verbose mode */ - hsize_t min_comp; /*minimum size to compress, in bytes */ - int use_native; /*use a native type in write */ - hbool_t latest; /*pack file with the latest file format */ - H5F_libver_t low_bound; /* The file's low bound as in H5Fset_libver_bounds() */ - H5F_libver_t high_bound; /* The file's high bound as in H5Fset_libver_bounds() */ - hid_t fin_fapl; /* FAPL to use for opening the input file */ - hid_t fout_fapl; /* FAPL to use for opening/creating the output file */ - int grp_compact; /* Set the maximum number of links to store as header messages in the group */ - int grp_indexed; /* Set the minimum number of links to store in the indexed format */ - int msg_size[8]; /* Minimum size of shared messages: dataspace, - datatype, fill value, filter pipleline, attribute */ + int n_filter_g; /* number of global filters */ + chunk_info_t chunk_g; /* global chunk INFO for the ALL case */ + H5D_layout_t layout_g; /* global layout information for the ALL case */ + int verbose; /* verbose mode */ + hbool_t merge; /* Merge external file. */ + hbool_t prune; /* Don't follow external file. */ + hsize_t min_comp; /* minimum size to compress, in bytes */ + int use_native; /* use a native type in write */ + hbool_t latest; /* pack file with the latest file format */ + H5F_libver_t low_bound; /* The file's low bound as in H5Fset_libver_bounds() */ + H5F_libver_t high_bound; /* The file's high bound as in H5Fset_libver_bounds() */ + hid_t fin_fapl; /* FAPL to use for opening the input file */ + hid_t fout_fapl; /* FAPL to use for opening/creating the output file */ + int grp_compact; /* Set the maximum number of links to store as header messages in the group */ + int grp_indexed; /* Set the minimum number of links to store in the indexed format */ + int msg_size[8]; /* Minimum size of shared messages: dataspace, + datatype, fill value, filter pipleline, attribute */ const char *ublock_filename; /* user block file name */ hsize_t ublock_size; /* user block size */ hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index b1d6ab4..8f3496f 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -594,6 +594,8 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, hid_t f_space_id = H5I_INVALID_HID; /* file space ID */ hid_t ftype_id = H5I_INVALID_HID; /* file type ID */ hid_t wtype_id = H5I_INVALID_HID; /* read/write type ID */ + hid_t ocpl_id = H5I_INVALID_HID; /* property to pass copy options */ + hid_t lcpl_id = H5I_INVALID_HID; /* link creation property list */ named_dt_t *named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */ size_t msize; /* size of type */ hsize_t nelmts; /* number of elements in dataset */ @@ -610,6 +612,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, int req_filter; /* there was a request for a filter */ int req_obj_layout = 0; /* request layout to current object */ unsigned crt_order_flags; /* group creation order flag */ + h5tool_link_info_t linkinfo; unsigned i; unsigned u; int ifil; @@ -619,6 +622,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, hsize_t size_dset; int ret_value = 0; + /* init linkinfo struct */ + HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); + /*------------------------------------------------------------------------- * copy the supplied object list *------------------------------------------------------------------------- @@ -1137,26 +1143,25 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, *------------------------------------------------------------------------- */ else { - hid_t pid = H5I_INVALID_HID; - /* create property to pass copy options */ - if ((pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) + if ((ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed"); /* set options for object copy */ - if (H5Pset_copy_object(pid, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) + if (H5Pset_copy_object(ocpl_id, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pset_copy_object failed"); if (H5Ocopy(fidin, /* Source file or group identifier */ travt->objs[i].name, /* Name of the source object to be copied */ fidout, /* Destination file or group identifier */ travt->objs[i].name, /* Name of the destination object */ - pid, /* Properties which apply to the copy */ + ocpl_id, /* Properties which apply to the copy */ H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */ H5TOOLS_GOTO_ERROR((-1), "H5Ocopy failed"); - if (H5Pclose(pid) < 0) + if (H5Pclose(ocpl_id) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + ocpl_id = H5I_INVALID_HID; /*------------------------------------------------------------------------- * Copy attrs manually @@ -1228,11 +1233,61 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if (options->verbose) HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); - if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT) < 0) - H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + /* Check -X option. */ + if (options->merge) { + if (H5tools_get_symlink_info(fidin, travt->objs[i].name, &linkinfo, 1) == 0) { + /* dangling link */ + if (options->prune) { + HDprintf("Pruned %s.\n", travt->objs[i].name); + } + else { + if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + } + } + else { + /* valid link */ + /* create property to pass copy options */ + if ((ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pcreate create property failed"); - if (options->verbose) - HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); + /* set options for object copy */ + if (H5Pset_copy_object(ocpl_id, H5O_COPY_EXPAND_EXT_LINK_FLAG) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pset_copy_object failed"); + + /* Create link creation property list */ + if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { + H5TOOLS_GOTO_ERROR((-1), "H5Pcreate link creation property failed"); + } + + /* Set flag for intermediate group creation */ + if (H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pset_create_intermediate_group failed"); + + if (H5Ocopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, ocpl_id, lcpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Ocopy failed"); + + if (H5Pclose(lcpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + + if (H5Pclose(ocpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + } + + /* free link info path */ + if (linkinfo.trg_path) + HDfree(linkinfo.trg_path); + linkinfo.trg_path = NULL; + } /* options->merge */ + else { + if (options->prune) { + HDprintf("Pruned %s.\n", travt->objs[i].name); + } + else { + if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + } + } break; default: @@ -1249,15 +1304,22 @@ done: if (named_datatype_free(&named_dt_head, 0) < 0) H5TOOLS_ERROR((-1), "named_datatype_free failed"); } - else + else { H5E_BEGIN_TRY { named_datatype_free(&named_dt_head, 1); } H5E_END_TRY; + } + + /* free link info path */ + if (linkinfo.trg_path) + HDfree(linkinfo.trg_path); H5E_BEGIN_TRY { H5Gclose(grp_in); H5Gclose(grp_out); + H5Pclose(lcpl_id); + H5Pclose(ocpl_id); H5Pclose(dcpl_in); H5Pclose(gcpl_in); H5Pclose(gcpl_out); diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 0ad61c0..cf0c611 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -32,36 +32,38 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVvf:l:m:e:nLj:k:c:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E"; +static const char *s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:"; static struct long_options l_opts[] = { - { "help", no_arg, 'h' }, - { "version", no_arg, 'V' }, - { "verbose", no_arg, 'v' }, + { "alignment", require_arg, 'a' }, + { "block", require_arg, 'b' }, + { "compact", require_arg, 'c' }, + { "indexed", require_arg, 'd' }, + { "file", require_arg, 'e' }, { "filter", require_arg, 'f' }, + { "help", no_arg, 'h' }, + { "infile", require_arg, 'i' }, /* for backward compability */ + { "low", require_arg, 'j' }, + { "high", require_arg, 'k' }, { "layout", require_arg, 'l' }, { "minimum", require_arg, 'm' }, - { "file", require_arg, 'e' }, { "native", no_arg, 'n' }, - { "latest", no_arg, 'L' }, - { "low", require_arg, 'j' }, - { "high", require_arg, 'k' }, - { "compact", require_arg, 'c' }, - { "indexed", require_arg, 'd' }, + { "outfile", require_arg, 'o' }, /* for backward compability */ + { "sort_by", require_arg, 'q' }, { "ssize", require_arg, 's' }, + { "threshold", require_arg, 't' }, { "ublock", require_arg, 'u' }, - { "block", require_arg, 'b' }, + { "verbose", no_arg, 'v' }, + { "sort_order", require_arg, 'z' }, + { "enable-error-stack", no_arg, 'E' }, + { "fs_pagesize", require_arg, 'G' }, + { "latest", no_arg, 'L' }, { "metadata_block_size", require_arg, 'M' }, - { "threshold", require_arg, 't' }, - { "alignment", require_arg, 'a' }, - { "infile", require_arg, 'i' }, /* for backward compability */ - { "outfile", require_arg, 'o' }, /* for backward compability */ - { "fs_strategy", require_arg, 'S' }, { "fs_persist", require_arg, 'P' }, + { "fs_strategy", require_arg, 'S' }, { "fs_threshold", require_arg, 'T' }, - { "fs_pagesize", require_arg, 'G' }, - { "sort_by", require_arg, 'q' }, - { "sort_order", require_arg, 'z' }, - { "enable-error-stack", no_arg, 'E' }, + { "version", no_arg, 'V' }, + { "merge", no_arg, 'X' }, + { "prune", no_arg, 'W' }, { "src-vol-value", require_arg, '1' }, { "src-vol-name", require_arg, '2' }, { "src-vol-info", require_arg, '3' }, @@ -113,6 +115,9 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " --high=BOUND The high bound for library release versions to use\n"); PRINTVALSTREAM(rawoutstream, " when creating objects in the file\n"); PRINTVALSTREAM(rawoutstream, " (default is H5F_LIBVER_LATEST)\n"); + PRINTVALSTREAM(rawoutstream, " --merge Follow external soft link recursively and merge data\n"); + PRINTVALSTREAM(rawoutstream, " --prune Do not follow external soft links and remove link\n"); + PRINTVALSTREAM(rawoutstream, " --merge --prune Follow external link, merge data and remove dangling link\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n"); @@ -545,6 +550,14 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) options->high_bound = bound; break; + case 'X': + options->merge = TRUE; + break; + + case 'W': + options->prune = TRUE; + break; + case 'c': options->grp_compact = HDatoi( opt_arg ); if (options->grp_compact > 0) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index afdf46c..173a5ce 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -8035,7 +8035,6 @@ void test_double_epsilon(const char *fname1, const char *fname2) { hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; hsize_t dims1[2] = { 4, 7 }; - hsize_t dims2[2] = { 4, 7 }; double wdata[4][7]; int i, j; diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 4823d07..2a34438 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -72,6 +72,14 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_paged_persist.h5 # h5diff/testfile ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 + # tools/testfiles for external links + ${HDF5_TOOLS_DIR}/testfiles/tsoftlinks.h5 + ${HDF5_TOOLS_DIR}/testfiles/textlinkfar.h5 + ${HDF5_TOOLS_DIR}/testfiles/textlinksrc.h5 + ${HDF5_TOOLS_DIR}/testfiles/textlinktar.h5 + ${HDF5_TOOLS_DIR}/testfiles/textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 # tools/testfiles ${HDF5_TOOLS_DIR}/testfiles/tfamily00000.h5 ${HDF5_TOOLS_DIR}/testfiles/tfamily00001.h5 @@ -128,6 +136,13 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_version_test.h5repack_layout.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_zero.h5repack_layout.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5 + # tools/testfiles for external links + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/tsoftlinks-merge.tsoftlinks.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-merge.textlinkfar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-merge.textlinksrc.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-merge.textlinktar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlink-merge.textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5 ) set (LIST_DDL_TEST_FILES @@ -154,6 +169,19 @@ # refs ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/attrregion.tattrreg.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/dataregion.tdatareg.h5 + # tools/testfiles for external links + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-prune.textlinkfar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-prune.textlinksrc.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-prune.textlinktar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlink-prune.textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/tsoftlinks-prune.tsoftlinks.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-mergeprune.textlinkfar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-mergeprune.textlinksrc.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-mergeprune.textlinktar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlink-mergeprune.textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5 ) foreach (h5_file ${LIST_HDF5_TEST_FILES}) @@ -276,7 +304,7 @@ endif () endmacro () - macro (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) + macro (ADD_H5_FILTER_TEST testname testfilter testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -410,6 +438,48 @@ endif () endmacro () + macro (ADD_H5_DIFF_TEST testname testtype resultcode testfile) + if ("${testtype}" STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_DIFF-${testname} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" + ) + set_property(TEST H5REPACK_DIFF-${testname} PROPERTY DISABLED) + endif () + else () + add_test ( + NAME H5REPACK_DIFF-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_DIFF-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack + ) + add_test ( + NAME H5REPACK_DIFF-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_DIFF-${testname} PROPERTIES + DEPENDS H5REPACK_DIFF-${testname}-clear-objects + ) + add_test ( + NAME H5REPACK_DIFF-${testname}_DFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;--enable-error-stack;${testfile};out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=out-${testname}.${testfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${testname}.${testfile}.tst" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5REPACK_DIFF-${testname}_DFF PROPERTIES + DEPENDS H5REPACK_DIFF-${testname} + ) + endif () + endmacro () + macro (ADD_H5_STAT_TEST testname testtype resultcode statarg resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -1148,7 +1218,7 @@ if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") endif () - ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) + ADD_H5_FILTER_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### # the following tests assume the input files have filters @@ -1540,6 +1610,45 @@ ADD_H5_EXTERNAL_TEST (ext_int32le_3d "TEST" int32le_3d -l CONTI) ADD_H5_EXTERNAL_TEST (ext_uint8be "TEST" uint8be -l CONTI) ############################################################################## +### E X T E R N A L L I N K T E S T S +############################################################################## +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DMP_TEST (h5copy_extlinks_src-base "TEST" 0 h5copy_extlinks_src.h5 --enable-error-stack) +ADD_H5_DMP_TEST (tsoftlinks-base "TEST" 0 tsoftlinks.h5 --enable-error-stack) +ADD_H5_DMP_TEST (textlink-base "TEST" 0 textlink.h5 --enable-error-stack) +ADD_H5_DMP_TEST (textlinkfar-base "TEST" 0 textlinkfar.h5 --enable-error-stack) +ADD_H5_DMP_TEST (textlinksrc-base "TEST" 0 textlinksrc.h5 --enable-error-stack) +ADD_H5_DMP_TEST (textlinktar-base "TEST" 0 textlinktar.h5 --enable-error-stack) + +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DIFF_TEST (textlinksrc-merge "TEST" 1 textlinksrc.h5 --merge) +ADD_H5_DIFF_TEST (tsoftlinks-merge "TEST" 1 tsoftlinks.h5 --merge) +ADD_H5_DIFF_TEST (textlink-merge "TEST" 0 textlink.h5 --merge) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DIFF_TEST (textlinkfar-merge "TEST" 1 textlinkfar.h5 --merge) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DIFF_TEST (textlinktar-merge "TEST" 1 textlinktar.h5 --merge) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DIFF_TEST (h5copy_extlinks_src-merge "TEST" 0 h5copy_extlinks_src.h5 --merge) + +ADD_H5_DMP_TEST (h5copy_extlinks_src-prune "TEST" 0 h5copy_extlinks_src.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (tsoftlinks-prune "TEST" 0 tsoftlinks.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlink-prune "TEST" 0 textlink.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlinkfar-prune "TEST" 0 textlinkfar.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlinksrc-prune "TEST" 0 textlinksrc.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlinktar-prune "TEST" 0 textlinktar.h5 --prune --enable-error-stack) + +ADD_H5_DMP_TEST (h5copy_extlinks_src-mergeprune "TEST" 0 h5copy_extlinks_src.h5 --merge --prune --enable-error-stack) +ADD_H5_DMP_TEST (tsoftlinks-mergeprune "TEST" 0 tsoftlinks.h5 --merge --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlink-mergeprune "TEST" 0 textlink.h5 --merge --prune --enable-error-stack) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DMP_TEST (textlinkfar-mergeprune "TEST" 0 textlinkfar.h5 --merge --prune --enable-error-stack) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DMP_TEST (textlinksrc-mergeprune "TEST" 0 textlinksrc.h5 --merge --prune --enable-error-stack) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DMP_TEST (textlinktar-mergeprune "TEST" 0 textlinktar.h5 --merge --prune --enable-error-stack) + +############################################################################## ### P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index ad6fef8..3d4e0ea 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -92,10 +92,18 @@ $SRC_H5REPACK_TESTFILES/h5repack_attr_refs.h5 $SRC_H5REPACK_TESTFILES/h5repack_deflate.h5 $SRC_H5REPACK_TESTFILES/h5repack_early.h5 $SRC_H5REPACK_TESTFILES/h5repack_ext.h5 +$SRC_H5REPACK_TESTFILES/h5repack_f32le.h5 +$SRC_H5REPACK_TESTFILES/h5repack_f32le_ex.h5 $SRC_H5REPACK_TESTFILES/h5repack_fill.h5 $SRC_H5REPACK_TESTFILES/h5repack_filters.h5 $SRC_H5REPACK_TESTFILES/h5repack_fletcher.h5 $SRC_H5REPACK_TESTFILES/h5repack_hlink.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex.h5 $SRC_H5REPACK_TESTFILES/h5repack_layout.h5 $SRC_H5REPACK_TESTFILES/h5repack_layouto.h5 $SRC_H5REPACK_TESTFILES/h5repack_layout2.h5 @@ -109,23 +117,26 @@ $SRC_H5REPACK_TESTFILES/h5repack_refs.h5 $SRC_H5REPACK_TESTFILES/h5repack_shuffle.h5 $SRC_H5REPACK_TESTFILES/h5repack_soffset.h5 $SRC_H5REPACK_TESTFILES/h5repack_szip.h5 +$SRC_H5REPACK_TESTFILES/h5repack_uint8be.h5 +$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex.h5 +########fsm#files######## $SRC_H5REPACK_TESTFILES/h5repack_aggr.h5 $SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_nopersist.h5 $SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_persist.h5 $SRC_H5REPACK_TESTFILES/h5repack_none.h5 $SRC_H5REPACK_TESTFILES/h5repack_paged_nopersist.h5 $SRC_H5REPACK_TESTFILES/h5repack_paged_persist.h5 -$SRC_H5REPACK_TESTFILES/h5repack_f32le.h5 -$SRC_H5REPACK_TESTFILES/h5repack_f32le_ex.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex.h5 -$SRC_H5REPACK_TESTFILES/h5repack_uint8be.h5 -$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex.h5 +########h5diff/testfile######## $SRC_H5DIFF_TESTFILES/h5diff_attr1.h5 +########tools/testfiles#for#external#links######## +$SRC_TOOLS_TESTFILES/tsoftlinks.h5 +$SRC_TOOLS_TESTFILES/textlinkfar.h5 +$SRC_TOOLS_TESTFILES/textlinksrc.h5 +$SRC_TOOLS_TESTFILES/textlinktar.h5 +$SRC_TOOLS_TESTFILES/textlink.h5 +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src.h5 +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_trg.h5 +########tools/testfiles######## $SRC_TOOLS_TESTFILES/tfamily00000.h5 $SRC_TOOLS_TESTFILES/tfamily00001.h5 $SRC_TOOLS_TESTFILES/tfamily00002.h5 @@ -138,6 +149,8 @@ $SRC_TOOLS_TESTFILES/tfamily00008.h5 $SRC_TOOLS_TESTFILES/tfamily00009.h5 $SRC_TOOLS_TESTFILES/tfamily00010.h5 $SRC_TOOLS_TESTFILES/tordergr.h5 +########reference#conversion#files######## +########tools/testfiles/vds######## $SRC_TOOLS_TESTFILES/vds/1_a.h5 $SRC_TOOLS_TESTFILES/vds/1_b.h5 $SRC_TOOLS_TESTFILES/vds/1_c.h5 @@ -168,33 +181,61 @@ $SRC_H5REPACK_TESTFILES/h5repack-help.txt $SRC_H5REPACK_TESTFILES/h5repack_ext.bin $SRC_H5REPACK_TESTFILES/ublock.bin $SRC_H5REPACK_TESTFILES/h5repack.info -$SRC_H5REPACK_TESTFILES/crtorder.tordergr.h5.ddl -$SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl +########dat#files######## $SRC_H5REPACK_TESTFILES/h5repack_f32le_ex-0.dat $SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex-0.dat $SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex-1.dat $SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex-0.dat $SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex-0.dat -$SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl -$SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst -$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst -$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl $SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-0.dat $SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-1.dat $SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-2.dat $SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-3.dat -$SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst -$SRC_H5REPACK_TESTFILES/1_vds.h5-vds_dset_chunk20x10x5-v.ddl -$SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl -$SRC_H5REPACK_TESTFILES/3_1_vds.h5-vds_chunk2x5x8-v.ddl -$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_compa-v.ddl -$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl +############### +$SRC_H5REPACK_TESTFILES/crtorder.tordergr.h5.ddl +$SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl +$SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl +$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl +########fsm#files######## $SRC_H5REPACK_TESTFILES/SP.h5repack_fsm_aggr_nopersist.h5.ddl $SRC_H5REPACK_TESTFILES/S.h5repack_fsm_aggr_persist.h5.ddl $SRC_H5REPACK_TESTFILES/STG.h5repack_none.h5.ddl $SRC_H5REPACK_TESTFILES/GS.h5repack_paged_nopersist.h5.ddl $SRC_H5REPACK_TESTFILES/SP.h5repack_paged_persist.h5.ddl $SRC_H5REPACK_TESTFILES/SPT.h5repack_aggr.h5.ddl +########vds#files######## +$SRC_H5REPACK_TESTFILES/1_vds.h5-vds_dset_chunk20x10x5-v.ddl +$SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl +$SRC_H5REPACK_TESTFILES/3_1_vds.h5-vds_chunk2x5x8-v.ddl +$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_compa-v.ddl +$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl +########refs#files######## +$SRC_H5REPACK_TESTFILES/attrregion.tattrreg.h5.ddl +$SRC_H5REPACK_TESTFILES/dataregion.tdatareg.h5.ddl +########external#links#files######## +$SRC_H5REPACK_TESTFILES/textlinkfar-prune.textlinkfar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinksrc-prune.textlinksrc.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinktar-prune.textlinktar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlink-prune.textlink.h5.ddl +$SRC_H5REPACK_TESTFILES/tsoftlinks-prune.tsoftlinks.h5.ddl +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinkfar-mergeprune.textlinkfar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinksrc-mergeprune.textlinksrc.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinktar-mergeprune.textlinktar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlink-mergeprune.textlink.h5.ddl +$SRC_H5REPACK_TESTFILES/tsoftlinks-mergeprune.tsoftlinks.h5.ddl +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl +########tst#files######## +$SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst +$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst +$SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst +########external#links#tst#files######## +$SRC_H5REPACK_TESTFILES/tsoftlinks-merge.tsoftlinks.h5.tst +$SRC_H5REPACK_TESTFILES/textlinkfar-merge.textlinkfar.h5.tst +$SRC_H5REPACK_TESTFILES/textlinksrc-merge.textlinksrc.h5.tst +$SRC_H5REPACK_TESTFILES/textlinktar-merge.textlinktar.h5.tst +$SRC_H5REPACK_TESTFILES/textlink-merge.textlink.h5.tst +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst " # @@ -271,6 +312,12 @@ SKIP() { echo " -SKIP-" } +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + # Call the h5diff tool # DIFFTEST() @@ -619,25 +666,6 @@ VERIFY_INVALIDBOUNDS() } # end of VERIFY_INVALIDBOUNDS # ----------------------------------------------------------------------------- -# Expect h5diff to fail -# ----------------------------------------------------------------------------- -DIFFFAIL() -{ - VERIFY h5diff unequal $@ - ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN -q "$@" - ) - RET=$? - if [ $RET == 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - else - echo " PASSED" - fi -} - -# ----------------------------------------------------------------------------- # Catchall test for repacking with external files # Loops over all (internally-listed) cases and applies the given arguments # to h5repack. @@ -805,6 +833,121 @@ TOOLTESTV() rm -f $outfile } +# This is same as TOOLTESTV() with comparing display output +# with actual filename swapped +# +TOOLTESTSV() +{ + expect="$TESTDIR/$1.$2.tst" + actual="$TESTDIR/`basename $2 .ddl`.out" + actual_err="$TESTDIR/`basename $2 .ddl`.err" + + infile=$2 + outfile=out-$1.$2 + shift + shift + + # Run test. + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + VERIFY h5diff unequal $@ + ( + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN -v $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET == 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi + fi + + # display output compare + STDOUT_FILTER $actual + cat $actual_err >> $actual + + VERIFY output from $H5REPACK $@ + if cmp -s $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.tst) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' + fi + + rm -f $actual $actual_err + rm -f $outfile +} + +# This is same as TOOLTESTSV() but expects a diff fail +# +TOOLFAILSV() +{ + expect="$TESTDIR/$1.$2.tst" + actual="$TESTDIR/`basename $2 .ddl`.out" + actual_err="$TESTDIR/`basename $2 .ddl`.err" + + infile=$2 + outfile=out-$1.$2 + shift + shift + + # Run test. + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + VERIFY h5diff unequal $@ + ( + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN -v $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET == 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi + fi + + # display output compare + STDOUT_FILTER $actual + cat $actual_err >> $actual + + VERIFY output from $H5REPACK $@ + if cmp -s $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.tst) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' + fi + + rm -f $actual $actual_err + rm -f $outfile +} + # same as TOOLTESTV but filters error stack output and compares to an error file # Extract file name, line number, version and thread IDs because they may be different # ADD_H5ERR_MASK_TEST @@ -1356,44 +1499,28 @@ TOOLTEST_STAT SPT $arg # layout options (these files have no filters) ######################################################### VERIFY_LAYOUT_DSET dset2_chunk_20x10 h5repack_layout.h5 dset2 CHUNKED --layout dset2:CHUNK=20x10 - VERIFY_LAYOUT_ALL chunk_20x10 h5repack_layout.h5 CHUNKED -l CHUNK=20x10 - VERIFY_LAYOUT_DSET dset2_conti h5repack_layout.h5 dset2 CONTIGUOUS -l dset2:CONTI - VERIFY_LAYOUT_ALL conti h5repack_layout.h5 CONTIGUOUS -l CONTI - VERIFY_LAYOUT_DSET dset2_compa h5repack_layout.h5 dset2 COMPACT -l dset2:COMPA - VERIFY_LAYOUT_ALL compa h5repack_layout.h5 COMPACT -l COMPA - TOOLTESTM dset2_chunk_20x10-errstk h5repack_layout.h5 --layout=dset2:CHUNK=20x10x5 --enable-error-stack ################################################################ # layout conversions (file has no filters) ############################################################### - VERIFY_LAYOUT_DSET dset_compa_conti h5repack_layout.h5 dset_compact CONTIGUOUS -l dset_compact:CONTI - VERIFY_LAYOUT_DSET dset_compa_chunk h5repack_layout.h5 dset_compact CHUNKED -l dset_compact:CHUNK=2x5 - VERIFY_LAYOUT_DSET dset_compa_compa h5repack_layout.h5 dset_compact COMPACT -l dset_compact:COMPA - VERIFY_LAYOUT_DSET dset_conti_compa h5repack_layout.h5 dset_contiguous COMPACT -l dset_contiguous:COMPA - VERIFY_LAYOUT_DSET dset_conti_chunk h5repack_layout.h5 dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6 - VERIFY_LAYOUT_DSET dset_conti_conti h5repack_layout.h5 dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI - VERIFY_LAYOUT_DSET chunk_compa h5repack_layout.h5 dset_chunk COMPACT -l dset_chunk:COMPA - VERIFY_LAYOUT_DSET chunk_conti h5repack_layout.h5 dset_chunk CONTIGUOUS -l dset_chunk:CONTI - VERIFY_LAYOUT_DSET chunk_18x13 h5repack_layout.h5 dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13 # test convert small size dataset ( < 1k) to compact layout without -m VERIFY_LAYOUT_DSET contig_small_compa h5repack_layout2.h5 contig_small COMPACT -l contig_small:COMPA - VERIFY_LAYOUT_DSET contig_small_fixed_compa h5repack_layout2.h5 chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA #--------------------------------------------------------------------------- @@ -1421,6 +1548,7 @@ VERIFY_LAYOUT_DSET chunk2compa h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk # chunk dim is bigger than dataset dim. ( dset size < 64k ) VERIFY_LAYOUT_DSET error1 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE # chunk dim is bigger than dataset dim. ( dset size > 64k ) + VERIFY_LAYOUT_DSET error2 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE # chunk dims are smaller than dataset dims. ( dset size < 64k ) @@ -1435,7 +1563,6 @@ TOOLTEST error4 h5repack_layout3.h5 -f NONE # (dset size < 64K) and with unlimited max dims on a condition as follow. # (HDFFV-8214) #-------------------------------------------------------------------------- - # chunk dim is bigger than dataset dim. should succeed. VERIFY_LAYOUT_DSET ckdim_biger h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI # chunk dim is smaller than dataset dim. should succeed. @@ -1466,7 +1593,6 @@ else fi # several global filters - arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg @@ -1562,9 +1688,15 @@ else VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI fi -######################################################### -# Testing version bounds -######################################################### +################################################################ +# reference new api conversions +############################################################### +#TOOLTEST_DUMP attrregion tattrreg.h5 +#TOOLTEST_DUMP dataregion tdatareg.h5 + +############################################################################## +### V E R S I O N B O U N D S T E S T S +############################################################################## # -j 0 -k 2, superblock will be 0 VERIFY_SUPERBLOCK 0 2 0 h5repack_layout.h5 -j 0 -k 2 h5repack_layout.h5 # -j 1 -k 2, superblock will be 2 @@ -1574,11 +1706,49 @@ VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5 # -j 0 -k 1, file cannot be opened VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5 -######################################## -# Testing external storage -######################################## +############################################################################## +### E X T E R N A L S T O R A G E T E S T S +############################################################################## VERIFY_EXTERNAL_CONSOLIDATION -l CONTI +############################################################################## +### E X T E R N A L L I N K T E S T S +############################################################################## +### HDFFV-11128 needs fixed to enable the following test +#TOOLTEST_DUMP h5copy_extlinks_src-base h5copy_extlinks_src.h5 --enable-error-stack +TOOLTEST_DUMP tsoftlinks-base tsoftlinks.h5 --enable-error-stack +TOOLTEST_DUMP textlink-base textlink.h5 --enable-error-stack +TOOLTEST_DUMP textlinkfar-base textlinkfar.h5 --enable-error-stack +TOOLTEST_DUMP textlinksrc-base textlinksrc.h5 --enable-error-stack +TOOLTEST_DUMP textlinktar-base textlinktar.h5 --enable-error-stack + +TOOLTESTSV h5copy_extlinks_src-merge h5copy_extlinks_src.h5 --merge +TOOLFAILSV tsoftlinks-merge tsoftlinks.h5 --merge +TOOLTESTSV textlink-merge textlink.h5 --merge +### HDFFV-11128 needs fixed to enable the following test +#TOOLFAILSV textlinkfar-merge textlinkfar.h5 --merge +### HDFFV-11128 needs fixed to enable the following test +#TOOLFAILSV textlinksrc-merge textlinksrc.h5 --merge +### HDFFV-11128 needs fixed to enable the following test +#TOOLFAILSV textlinktar-merge textlinktar.h5 --merge + +TOOLTEST_DUMP h5copy_extlinks_src-prune h5copy_extlinks_src.h5 --prune --enable-error-stack +TOOLTEST_DUMP tsoftlinks-prune tsoftlinks.h5 --prune --enable-error-stack +TOOLTEST_DUMP textlink-prune textlink.h5 --prune --enable-error-stack +TOOLTEST_DUMP textlinkfar-prune textlinkfar.h5 --prune --enable-error-stack +TOOLTEST_DUMP textlinksrc-prune textlinksrc.h5 --prune --enable-error-stack +TOOLTEST_DUMP textlinktar-prune textlinktar.h5 --prune --enable-error-stack + +TOOLTEST_DUMP h5copy_extlinks_src-mergeprune h5copy_extlinks_src.h5 --merge --prune --enable-error-stack +TOOLTEST_DUMP tsoftlinks-mergeprune tsoftlinks.h5 --merge --prune --enable-error-stack +TOOLTEST_DUMP textlink-mergeprune textlink.h5 --merge --prune --enable-error-stack +### HDFFV-11128 needs fixed to enable the following test +#TOOLTEST_DUMP textlinkfar-mergeprune textlinkfar.h5 --merge --prune --enable-error-stack +### HDFFV-11128 needs fixed to enable the following test +#TOOLTEST_DUMP textlinksrc-mergeprune textlinksrc.h5 --merge --prune --enable-error-stack +### HDFFV-11128 needs fixed to enable the following test +#TOOLTEST_DUMP textlinktar-mergeprune textlinktar.h5 --merge --prune --enable-error-stack + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst b/tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst new file mode 100644 index 0000000..52f215d --- /dev/null +++ b/tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst @@ -0,0 +1,26 @@ + +file1 file2 +--------------------------------------- + x x / + x x /group_ext + x x /group_ext/extlink_datatype + x x /group_ext/extlink_dset + x x /group_ext/extlink_grp + x x /group_ext/extlink_notyet1 + x x /group_ext/extlink_notyet2 + +group : and +0 differences found +group : and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_TYPE +Not comparable: is of type H5G_UDLINK and is of type H5G_DATASET +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +external link: and +0 differences found +external link: and +0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl b/tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl new file mode 100644 index 0000000..ad8a320 --- /dev/null +++ b/tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl @@ -0,0 +1,28 @@ +HDF5 "out-h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5" { +GROUP "/" { + GROUP "group_ext" { + DATATYPE "extlink_datatype" H5T_STD_I32LE; + DATASET "extlink_dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2200 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "extlink_grp" { + } + } +} +} diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl b/tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl new file mode 100644 index 0000000..b7d7bca --- /dev/null +++ b/tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl @@ -0,0 +1,6 @@ +HDF5 "out-h5copy_extlinks_src-prune.h5copy_extlinks_src.h5" { +GROUP "/" { + GROUP "group_ext" { + } +} +} diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 b/tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 new file mode 100644 index 0000000..7b8621e Binary files /dev/null and b/tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 differ diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 b/tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 new file mode 100644 index 0000000..3a0242d Binary files /dev/null and b/tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 differ diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 00fae24..e12838d 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -29,6 +29,9 @@ usage: h5repack [OPTIONS] file1 file2 --high=BOUND The high bound for library release versions to use when creating objects in the file (default is H5F_LIBVER_LATEST) + --merge Follow external soft link recursively and merge data + --prune Do not follow external soft links and remove link + --merge --prune Follow external link, merge data and remove dangling link -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format -s S[:F], --ssize=S[:F] Shared object header message minimum size diff --git a/tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst b/tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst new file mode 100644 index 0000000..a7ff71d --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst @@ -0,0 +1,13 @@ + +file1 file2 +--------------------------------------- + x x / + x x /extlink1 + x x /extlink2 + +group : and +0 differences found +external link: and +0 differences found +external link: and +0 differences found diff --git a/tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl new file mode 100644 index 0000000..7206ae9 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl @@ -0,0 +1,4 @@ +HDF5 "out-textlink-mergeprune.textlink.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl new file mode 100644 index 0000000..83db344 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl @@ -0,0 +1,4 @@ +HDF5 "out-textlink-prune.textlink.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst b/tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst new file mode 100644 index 0000000..6673d39 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst @@ -0,0 +1,20 @@ + +file1 file2 +--------------------------------------- + x x / + x x /src_file + x /src_file/ext2soft_link1 + x /src_file/ext2softdangle_link1 + x /src_file/ext_link1 + x /src_file/ext_link2 + x /src_file/ext_link3 + x /src_file/ext_link4 + x /src_file/ext_link5 + +group : and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl new file mode 100644 index 0000000..7ba3308 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl @@ -0,0 +1,152 @@ +HDF5 "out-textlinkfar-mergeprune.textlinkfar.h5" { +GROUP "/" { + GROUP "src_file" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + HARDLINK "/dset1" + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + HARDLINK "/group" + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + HARDLINK "/dset" + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" HARDLINK "/type" + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + HARDLINK "/empty_group" + } + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl new file mode 100644 index 0000000..30f8f1b --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl @@ -0,0 +1,4 @@ +HDF5 "out-textlinkfar-prune.textlinkfar.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst b/tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst new file mode 100644 index 0000000..d5a5902 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst @@ -0,0 +1,32 @@ + +file1 file2 +--------------------------------------- + x x / + x x /ext2soft_link1 + x x /ext2softdangle_link1 + x x /ext_link1 + x /ext_link1/dset + x /ext_link1/elink_t1 + x /ext_link1/elink_t2 + x /ext_link1/subgroup + x /ext_link1/subgroup/link_to_group + x x /ext_link2 + x x /ext_link3 + x x /ext_link4 + x x /ext_link5 + +group : and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_DATASET +external link: and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +Not comparable: is of type H5G_UDLINK and is of type H5G_DATASET +Not comparable: is of type H5G_UDLINK and is of type H5G_TYPE +external link: and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl new file mode 100644 index 0000000..5b3c740 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl @@ -0,0 +1,187 @@ +HDF5 "out-textlinksrc-mergeprune.textlinksrc.h5" { +GROUP "/" { + DATASET "ext2soft_link1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "ext_link1" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/ext_link1" + } + } + } + DATASET "ext_link2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2104 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "ext_link3" H5T_STD_I32LE; + GROUP "ext_link5" { + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl new file mode 100644 index 0000000..65d35ef --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl @@ -0,0 +1,4 @@ +HDF5 "out-textlinksrc-prune.textlinksrc.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst b/tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst new file mode 100644 index 0000000..ccf4f7b --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst @@ -0,0 +1,44 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset + x x /empty_group + x x /group + x x /group/dset + x x /group/elink_t1 + x /group/elink_t1/ext2soft_link1 + x /group/elink_t1/ext2softdangle_link1 + x /group/elink_t1/ext_link1 + x /group/elink_t1/ext_link2 + x /group/elink_t1/ext_link3 + x /group/elink_t1/ext_link4 + x /group/elink_t1/ext_link5 + x x /group/elink_t2 + x x /group/subgroup + x x /group/subgroup/link_to_group + x x /type + +group : and +0 differences found +dataset: and +0 differences found +group : and +0 differences found +group : and +0 differences found +dataset: and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +external link: and +0 differences found +group : and +0 differences found +group : and +0 differences found +datatype: and +0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl new file mode 100644 index 0000000..c52e34d --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl @@ -0,0 +1,200 @@ +HDF5 "out-textlinktar-mergeprune.textlinktar.h5" { +GROUP "/" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "empty_group" { + } + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2072 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "elink_t1" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + HARDLINK "/dset1" + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + HARDLINK "/group" + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + HARDLINK "/dset" + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" HARDLINK "/type" + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + HARDLINK "/empty_group" + } + } + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + DATATYPE "type" H5T_STD_I32LE; +} +} diff --git a/tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl new file mode 100644 index 0000000..6787784 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl @@ -0,0 +1,52 @@ +HDF5 "out-textlinktar-prune.textlinktar.h5" { +GROUP "/" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "empty_group" { + } + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2072 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + DATATYPE "type" H5T_STD_I32LE; +} +} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst b/tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst new file mode 100644 index 0000000..27c33d7 --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst @@ -0,0 +1,53 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset1 + x x /dset2 + x x /dtype + x x /group1 + x x /group1/soft_dangle + x x /group1/soft_dset1 + x x /group1/soft_dset2 + x x /group1/soft_dtype + x x /group1/soft_empty_grp + x x /group_empty + x x /soft_dangle + x x /soft_dset1 + x x /soft_dtype + x x /soft_empty_grp + x x /soft_group1 + x /soft_group1/soft_dangle + x /soft_group1/soft_dset1 + x /soft_group1/soft_dset2 + x /soft_group1/soft_dtype + x /soft_group1/soft_empty_grp + +group : and +0 differences found +dataset: and +0 differences found +dataset: and +0 differences found +datatype: and +0 differences found +group : and +0 differences found +link : and +0 differences found +Not comparable: is of type H5G_LINK and is of type H5G_DATASET +Not comparable: is of type H5G_LINK and is of type H5G_DATASET +Not comparable: is of type H5G_LINK and is of type H5G_TYPE +Not comparable: is of type H5G_LINK and is of type H5G_GROUP +group : and +0 differences found +link : and +0 differences found +Not comparable: is of type H5G_LINK and is of type H5G_DATASET +Not comparable: is of type H5G_LINK and is of type H5G_TYPE +Not comparable: is of type H5G_LINK and is of type H5G_GROUP +Not comparable: is of type H5G_LINK and is of type H5G_GROUP +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl new file mode 100644 index 0000000..fa4e12d --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl @@ -0,0 +1,127 @@ +HDF5 "out-tsoftlinks-mergeprune.tsoftlinks.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "dtype" H5T_STD_I32BE; + GROUP "group1" { + DATASET "soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2112 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "soft_dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2144 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "soft_dtype" H5T_STD_I32BE; + GROUP "soft_empty_grp" { + } + } + GROUP "group_empty" { + } + DATASET "soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2176 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "soft_dtype" H5T_STD_I32BE; + GROUP "soft_empty_grp" { + } + GROUP "soft_group1" { + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dset2" { + LINKTARGET "/dset2" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + } +} +} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl new file mode 100644 index 0000000..de58ef2 --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl @@ -0,0 +1,47 @@ +HDF5 "out-tsoftlinks-prune.tsoftlinks.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "dtype" H5T_STD_I32BE; + GROUP "group1" { + } + GROUP "group_empty" { + } +} +} -- cgit v0.12 From 646872cb8e3d2f4d53ae0709067ee523bc3a8145 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 13:45:31 -0500 Subject: HDFFV-9984 - add missing ref files --- tools/test/h5repack/CMakeTests.cmake | 6 + tools/test/h5repack/h5repack.sh.in | 12 ++ .../testfiles/textlink-base-textlink.h5.ddl | 12 ++ .../testfiles/textlinkfar-base-textlinkfar.h5.ddl | 116 ++++++++++++++ .../testfiles/textlinksrc-base-textlinksrc.h5.ddl | 150 ++++++++++++++++++ .../testfiles/textlinktar-base-textlinktar.h5.ddl | 168 +++++++++++++++++++++ .../testfiles/tsoftlinks-base-tsoftlinks.h5.ddl | 77 ++++++++++ 7 files changed, 541 insertions(+) create mode 100644 tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 2a34438..1bf3fa2 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -170,6 +170,12 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/attrregion.tattrreg.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/dataregion.tdatareg.h5 # tools/testfiles for external links + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-base.textlinkfar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-base.textlinksrc.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-base.textlinktar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlink-base.textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/tsoftlinks-base.tsoftlinks.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-prune.textlinkfar.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-prune.textlinksrc.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-prune.textlinktar.h5 diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 3d4e0ea..e4ae008 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -213,6 +213,18 @@ $SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl $SRC_H5REPACK_TESTFILES/attrregion.tattrreg.h5.ddl $SRC_H5REPACK_TESTFILES/dataregion.tdatareg.h5.ddl ########external#links#files######## +$SRC_H5REPACK_TESTFILES/textlinkfar-base.textlinkfar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinksrc-base.textlinksrc.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinktar-base.textlinktar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlink-base.textlink.h5.ddl +$SRC_H5REPACK_TESTFILES/tsoftlinks-base.tsoftlinks.h5.ddl +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinkfar-merge.textlinkfar.h5.tst +$SRC_H5REPACK_TESTFILES/textlinksrc-merge.textlinksrc.h5.tst +$SRC_H5REPACK_TESTFILES/textlinktar-merge.textlinktar.h5.tst +$SRC_H5REPACK_TESTFILES/textlink-merge.textlink.h5.tst +$SRC_H5REPACK_TESTFILES/tsoftlinks-merge.tsoftlinks.h5.tst +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst $SRC_H5REPACK_TESTFILES/textlinkfar-prune.textlinkfar.h5.ddl $SRC_H5REPACK_TESTFILES/textlinksrc-prune.textlinksrc.h5.ddl $SRC_H5REPACK_TESTFILES/textlinktar-prune.textlinktar.h5.ddl diff --git a/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl new file mode 100644 index 0000000..b87a17d --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl @@ -0,0 +1,12 @@ +HDF5 "out-textlink-base.textlink.h5" { +GROUP "/" { + EXTERNAL_LINK "extlink1" { + TARGETFILE "filename" + TARGETPATH "objname" + } + EXTERNAL_LINK "extlink2" { + TARGETFILE "anotherfile" + TARGETPATH "anotherobj" + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl new file mode 100644 index 0000000..a5eb497 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl @@ -0,0 +1,116 @@ +HDF5 "out-textlinkfar-base.textlinkfar.h5" { +GROUP "/" { + EXTERNAL_LINK "src_file" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl new file mode 100644 index 0000000..9a9a9aa --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl @@ -0,0 +1,150 @@ +HDF5 "out-textlinksrc-base.textlinksrc.h5" { +GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + HARDLINK "/dset1" + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + HARDLINK "/group" + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + HARDLINK "/dset" + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" HARDLINK "/type" + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + HARDLINK "/empty_group" + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl new file mode 100644 index 0000000..3f02ff2 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl @@ -0,0 +1,168 @@ +HDF5 "out-textlinktar-base.textlinktar.h5" { +GROUP "/" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "empty_group" { + } + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2072 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + DATATYPE "type" H5T_STD_I32LE; +} +} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl new file mode 100644 index 0000000..b0cd32d --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl @@ -0,0 +1,77 @@ +HDF5 "out-tsoftlinks-base.tsoftlinks.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "dtype" H5T_STD_I32BE; + GROUP "group1" { + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dset2" { + LINKTARGET "/dset2" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + } + GROUP "group_empty" { + } + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + SOFTLINK "soft_group1" { + LINKTARGET "/group1" + } +} +} -- cgit v0.12 From a21ae8e56b0f5d693aef000088e542f5dadf10c9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 13:45:57 -0500 Subject: HDFFV-9984 add missing ref file --- ...py_extlinks_src-base.h5copy_extlinks_src.h5.ddl | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl b/tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl new file mode 100644 index 0000000..ad8a320 --- /dev/null +++ b/tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl @@ -0,0 +1,28 @@ +HDF5 "out-h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5" { +GROUP "/" { + GROUP "group_ext" { + DATATYPE "extlink_datatype" H5T_STD_I32LE; + DATASET "extlink_dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2200 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "extlink_grp" { + } + } +} +} -- cgit v0.12 From b196ddb4a89b36a3200e0ba9e7b8c2b2f4b52774 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 15:21:56 -0500 Subject: HDFFV-9984 - correct name of ref files --- .../testfiles/textlink-base-textlink.h5.ddl | 12 -- .../testfiles/textlink-base.textlink.h5.ddl | 12 ++ .../testfiles/textlinkfar-base-textlinkfar.h5.ddl | 116 -------------- .../testfiles/textlinkfar-base.textlinkfar.h5.ddl | 116 ++++++++++++++ .../testfiles/textlinksrc-base-textlinksrc.h5.ddl | 150 ------------------ .../testfiles/textlinksrc-base.textlinksrc.h5.ddl | 150 ++++++++++++++++++ .../testfiles/textlinktar-base-textlinktar.h5.ddl | 168 --------------------- .../testfiles/textlinktar-base.textlinktar.h5.ddl | 168 +++++++++++++++++++++ .../testfiles/tsoftlinks-base-tsoftlinks.h5.ddl | 77 ---------- .../testfiles/tsoftlinks-base.tsoftlinks.h5.ddl | 77 ++++++++++ 10 files changed, 523 insertions(+), 523 deletions(-) delete mode 100644 tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl delete mode 100644 tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl delete mode 100644 tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl delete mode 100644 tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl delete mode 100644 tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl diff --git a/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl deleted file mode 100644 index b87a17d..0000000 --- a/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl +++ /dev/null @@ -1,12 +0,0 @@ -HDF5 "out-textlink-base.textlink.h5" { -GROUP "/" { - EXTERNAL_LINK "extlink1" { - TARGETFILE "filename" - TARGETPATH "objname" - } - EXTERNAL_LINK "extlink2" { - TARGETFILE "anotherfile" - TARGETPATH "anotherobj" - } -} -} diff --git a/tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl new file mode 100644 index 0000000..b87a17d --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl @@ -0,0 +1,12 @@ +HDF5 "out-textlink-base.textlink.h5" { +GROUP "/" { + EXTERNAL_LINK "extlink1" { + TARGETFILE "filename" + TARGETPATH "objname" + } + EXTERNAL_LINK "extlink2" { + TARGETFILE "anotherfile" + TARGETPATH "anotherobj" + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl deleted file mode 100644 index a5eb497..0000000 --- a/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl +++ /dev/null @@ -1,116 +0,0 @@ -HDF5 "out-textlinkfar-base.textlinkfar.h5" { -GROUP "/" { - EXTERNAL_LINK "src_file" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - EXTERNAL_LINK "ext2soft_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dset1" - DATASET "/soft_dset1" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2848 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext2softdangle_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dangle" - } - EXTERNAL_LINK "ext_link1" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group" - GROUP "group" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3136 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - EXTERNAL_LINK "elink_t1" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - HARDLINK "/" - } - } - EXTERNAL_LINK "elink_t2" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/ext_link4" - } - GROUP "subgroup" { - GROUP "link_to_group" { - HARDLINK "/group" - } - } - } - } - EXTERNAL_LINK "ext_link2" { - TARGETFILE "textlinktar.h5" - TARGETPATH "dset" - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3160 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext_link3" { - TARGETFILE "textlinktar.h5" - TARGETPATH "type" - DATATYPE "type" H5T_STD_I32LE; - } - EXTERNAL_LINK "ext_link4" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group/elink_t2" - } - EXTERNAL_LINK "ext_link5" { - TARGETFILE "textlinktar.h5" - TARGETPATH "empty_group" - GROUP "empty_group" { - } - } - } - } -} -} diff --git a/tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl new file mode 100644 index 0000000..a5eb497 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl @@ -0,0 +1,116 @@ +HDF5 "out-textlinkfar-base.textlinkfar.h5" { +GROUP "/" { + EXTERNAL_LINK "src_file" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl deleted file mode 100644 index 9a9a9aa..0000000 --- a/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl +++ /dev/null @@ -1,150 +0,0 @@ -HDF5 "out-textlinksrc-base.textlinksrc.h5" { -GROUP "/" { - EXTERNAL_LINK "ext2soft_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dset1" - DATASET "/soft_dset1" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2848 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext2softdangle_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dangle" - } - EXTERNAL_LINK "ext_link1" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group" - GROUP "group" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3136 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - EXTERNAL_LINK "elink_t1" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - EXTERNAL_LINK "ext2soft_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dset1" - DATASET "/soft_dset1" { - HARDLINK "/dset1" - } - } - EXTERNAL_LINK "ext2softdangle_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dangle" - } - EXTERNAL_LINK "ext_link1" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group" - GROUP "group" { - HARDLINK "/group" - } - } - EXTERNAL_LINK "ext_link2" { - TARGETFILE "textlinktar.h5" - TARGETPATH "dset" - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3160 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext_link3" { - TARGETFILE "textlinktar.h5" - TARGETPATH "type" - DATATYPE "type" H5T_STD_I32LE; - } - EXTERNAL_LINK "ext_link4" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group/elink_t2" - } - EXTERNAL_LINK "ext_link5" { - TARGETFILE "textlinktar.h5" - TARGETPATH "empty_group" - GROUP "empty_group" { - } - } - } - } - EXTERNAL_LINK "elink_t2" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/ext_link4" - } - GROUP "subgroup" { - GROUP "link_to_group" { - HARDLINK "/group" - } - } - } - } - EXTERNAL_LINK "ext_link2" { - TARGETFILE "textlinktar.h5" - TARGETPATH "dset" - DATASET "dset" { - HARDLINK "/dset" - } - } - EXTERNAL_LINK "ext_link3" { - TARGETFILE "textlinktar.h5" - TARGETPATH "type" - DATATYPE "type" HARDLINK "/type" - } - EXTERNAL_LINK "ext_link4" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group/elink_t2" - } - EXTERNAL_LINK "ext_link5" { - TARGETFILE "textlinktar.h5" - TARGETPATH "empty_group" - GROUP "empty_group" { - HARDLINK "/empty_group" - } - } -} -} diff --git a/tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl new file mode 100644 index 0000000..9a9a9aa --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl @@ -0,0 +1,150 @@ +HDF5 "out-textlinksrc-base.textlinksrc.h5" { +GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + HARDLINK "/dset1" + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + HARDLINK "/group" + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + HARDLINK "/dset" + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" HARDLINK "/type" + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + HARDLINK "/empty_group" + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl deleted file mode 100644 index 3f02ff2..0000000 --- a/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl +++ /dev/null @@ -1,168 +0,0 @@ -HDF5 "out-textlinktar-base.textlinktar.h5" { -GROUP "/" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 2048 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - GROUP "empty_group" { - } - GROUP "group" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 2072 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - EXTERNAL_LINK "elink_t1" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - EXTERNAL_LINK "ext2soft_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dset1" - DATASET "/soft_dset1" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2848 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext2softdangle_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dangle" - } - EXTERNAL_LINK "ext_link1" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group" - GROUP "group" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3136 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - EXTERNAL_LINK "elink_t1" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - HARDLINK "/" - } - } - EXTERNAL_LINK "elink_t2" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/ext_link4" - } - GROUP "subgroup" { - GROUP "link_to_group" { - HARDLINK "/group" - } - } - } - } - EXTERNAL_LINK "ext_link2" { - TARGETFILE "textlinktar.h5" - TARGETPATH "dset" - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3160 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext_link3" { - TARGETFILE "textlinktar.h5" - TARGETPATH "type" - DATATYPE "type" H5T_STD_I32LE; - } - EXTERNAL_LINK "ext_link4" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group/elink_t2" - } - EXTERNAL_LINK "ext_link5" { - TARGETFILE "textlinktar.h5" - TARGETPATH "empty_group" - GROUP "empty_group" { - } - } - } - } - EXTERNAL_LINK "elink_t2" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/ext_link4" - } - GROUP "subgroup" { - GROUP "link_to_group" { - HARDLINK "/group" - } - } - } - DATATYPE "type" H5T_STD_I32LE; -} -} diff --git a/tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl new file mode 100644 index 0000000..3f02ff2 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl @@ -0,0 +1,168 @@ +HDF5 "out-textlinktar-base.textlinktar.h5" { +GROUP "/" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "empty_group" { + } + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2072 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + DATATYPE "type" H5T_STD_I32LE; +} +} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl deleted file mode 100644 index b0cd32d..0000000 --- a/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl +++ /dev/null @@ -1,77 +0,0 @@ -HDF5 "out-tsoftlinks-base.tsoftlinks.h5" { -GROUP "/" { - DATASET "dset1" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2048 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - DATASET "dset2" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2080 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - DATATYPE "dtype" H5T_STD_I32BE; - GROUP "group1" { - SOFTLINK "soft_dangle" { - LINKTARGET "not_yet" - } - SOFTLINK "soft_dset1" { - LINKTARGET "/dset1" - } - SOFTLINK "soft_dset2" { - LINKTARGET "/dset2" - } - SOFTLINK "soft_dtype" { - LINKTARGET "/dtype" - } - SOFTLINK "soft_empty_grp" { - LINKTARGET "/group_empty" - } - } - GROUP "group_empty" { - } - SOFTLINK "soft_dangle" { - LINKTARGET "not_yet" - } - SOFTLINK "soft_dset1" { - LINKTARGET "/dset1" - } - SOFTLINK "soft_dtype" { - LINKTARGET "/dtype" - } - SOFTLINK "soft_empty_grp" { - LINKTARGET "/group_empty" - } - SOFTLINK "soft_group1" { - LINKTARGET "/group1" - } -} -} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl new file mode 100644 index 0000000..b0cd32d --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl @@ -0,0 +1,77 @@ +HDF5 "out-tsoftlinks-base.tsoftlinks.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "dtype" H5T_STD_I32BE; + GROUP "group1" { + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dset2" { + LINKTARGET "/dset2" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + } + GROUP "group_empty" { + } + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + SOFTLINK "soft_group1" { + LINKTARGET "/group1" + } +} +} -- cgit v0.12 From 7603d2c8be5418370467f14e8c180a0280c0d557 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 16:39:40 -0500 Subject: HDFFV-9984 fix test logic --- tools/test/h5repack/CMakeTests.cmake | 7 +++---- tools/test/h5repack/h5repack.sh.in | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 1bf3fa2..af73b75 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1626,16 +1626,15 @@ ADD_H5_DMP_TEST (textlinkfar-base "TEST" 0 textlinkfar.h5 --enable-error-stack) ADD_H5_DMP_TEST (textlinksrc-base "TEST" 0 textlinksrc.h5 --enable-error-stack) ADD_H5_DMP_TEST (textlinktar-base "TEST" 0 textlinktar.h5 --enable-error-stack) -### HDFFV-11128 needs fixed to enable the following test -#ADD_H5_DIFF_TEST (textlinksrc-merge "TEST" 1 textlinksrc.h5 --merge) +ADD_H5_DIFF_TEST (h5copy_extlinks_src-merge "TEST" 0 h5copy_extlinks_src.h5 --merge) ADD_H5_DIFF_TEST (tsoftlinks-merge "TEST" 1 tsoftlinks.h5 --merge) ADD_H5_DIFF_TEST (textlink-merge "TEST" 0 textlink.h5 --merge) ### HDFFV-11128 needs fixed to enable the following test #ADD_H5_DIFF_TEST (textlinkfar-merge "TEST" 1 textlinkfar.h5 --merge) ### HDFFV-11128 needs fixed to enable the following test -#ADD_H5_DIFF_TEST (textlinktar-merge "TEST" 1 textlinktar.h5 --merge) +#ADD_H5_DIFF_TEST (textlinksrc-merge "TEST" 1 textlinksrc.h5 --merge) ### HDFFV-11128 needs fixed to enable the following test -#ADD_H5_DIFF_TEST (h5copy_extlinks_src-merge "TEST" 0 h5copy_extlinks_src.h5 --merge) +#ADD_H5_DIFF_TEST (textlinktar-merge "TEST" 1 textlinktar.h5 --merge) ADD_H5_DMP_TEST (h5copy_extlinks_src-prune "TEST" 0 h5copy_extlinks_src.h5 --prune --enable-error-stack) ADD_H5_DMP_TEST (tsoftlinks-prune "TEST" 0 tsoftlinks.h5 --prune --enable-error-stack) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index e4ae008..02f515c 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -871,13 +871,13 @@ TOOLTESTSV() nerrors="`expr $nerrors + 1`" else echo " PASSED" - VERIFY h5diff unequal $@ + VERIFY h5diff equal $@ ( cd $TESTDIR $RUNSERIAL $H5DIFF_BIN -v $infile $outfile ) >$actual 2>$actual_err RET=$? - if [ $RET == 0 ] ; then + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else -- cgit v0.12 From c5b176594082f6e5a8b6d9140f9db1f13530e087 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 15 Aug 2020 07:32:50 -0700 Subject: Trivialities noticed while merging things to 1.10 --- Makefile.am | 8 ++++---- src/H5Z.c | 6 +++--- src/H5Zdeflate.c | 2 +- src/H5private.h | 2 +- src/H5public.h | 42 +++++++++++++++++++------------------- src/Makefile.am | 4 ++-- test/cache_image.c | 2 +- test/cache_tagging.c | 16 +++++++-------- test/dsets.c | 14 ++++++------- test/dt_arith.c | 34 +++++++++++++++--------------- tools/src/h5repack/h5repack_refs.c | 1 - 11 files changed, 65 insertions(+), 66 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8565788..9cb5d02 100644 --- a/Makefile.am +++ b/Makefile.am @@ -190,10 +190,10 @@ trace: # Run tests with different Virtual File Drivers. # Currently, only invoke check-vfd in the test directory. check-vfd: - for d in src utils test; do \ - if test $$d != .; then \ - (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - fi; \ + for d in src utils test; do \ + if test $$d != .; then \ + (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ + fi; \ done # Run tests with different passthrough Virtual Object Layer Connectors. diff --git a/src/H5Z.c b/src/H5Z.c index 616db1f..0b70731 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -346,8 +346,8 @@ done: * * Purpose: This function unregisters a filter. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1340,7 +1340,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, fstats->stats[1].times.system += times.system; fstats->stats[1].times.user += times.user; - fstats->stats[1].total += MAX(*nbytes, new_nbytes); + fstats->stats[1].total += MAX(*nbytes, new_nbytes); if(0 == new_nbytes) fstats->stats[1].errors += *nbytes; #endif diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 09cca14..d46108f 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -43,7 +43,7 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{ H5Z_FILTER_DEFLATE, /* Filter id number */ 1, /* encoder_present flag (set to true) */ 1, /* decoder_present flag (set to true) */ - "deflate", /* Filter name for debugging */ + "deflate", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ H5Z__filter_deflate, /* The actual filter function */ diff --git a/src/H5private.h b/src/H5private.h index 0c3dcd1..9c5b450 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1517,7 +1517,7 @@ typedef off_t h5_stat_size_t; #endif /* HDstrtoul */ #ifndef HDstrtoumax #define HDstrtoumax(S,R,N) strtoumax(S,R,N) -#endif /* HDstrtoul */ +#endif /* HDstrtoumax */ #ifndef HDstrxfrm #define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z) #endif /* HDstrxfrm */ diff --git a/src/H5public.h b/src/H5public.h index d3edd23..ba2505a 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -26,28 +26,28 @@ * it via H5public.h. The #ifndef _H5public_H guard above would * prevent repeated include. */ -#include "H5pubconf.h" /*from configure */ +#include "H5pubconf.h" /* From configure */ /* API Version macro wrapper definitions */ #include "H5version.h" #ifdef H5_HAVE_FEATURES_H -#include /*for setting POSIX, BSD, etc. compatibility */ +#include /* For setting POSIX, BSD, etc. compatibility */ #endif #ifdef H5_HAVE_SYS_TYPES_H #include #endif #ifdef H5_STDC_HEADERS -# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ -# include /*for variadic functions in H5VLpublic.h */ +# include /* For H5T_NATIVE_CHAR defn in H5Tpublic.h */ +# include /* For variadic functions in H5VLpublic.h */ #endif #ifndef __cplusplus # ifdef H5_HAVE_STDINT_H -# include /*for C9x types */ +# include /* For C9x types */ # endif #else # ifdef H5_HAVE_STDINT_H_CXX -# include /*for C9x types when include from C++ */ +# include /* For C9x types (when included from C++) */ # endif #endif #ifdef H5_HAVE_INTTYPES_H @@ -61,7 +61,7 @@ # define MPICH_SKIP_MPICXX 1 # define OMPI_SKIP_MPICXX 1 # include -#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ +#ifndef MPI_FILE_NULL /* MPIO may be defined in mpi.h already */ # include #endif #endif @@ -94,14 +94,14 @@ extern "C" { #endif /* Version numbers */ -#define H5_VERS_MAJOR 1 /* For major interface/format changes */ -#define H5_VERS_MINOR 13 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ +#define H5_VERS_MAJOR 1 /* For major interface/format changes */ +#define H5_VERS_MINOR 13 /* For minor interface/format changes */ +#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ #define H5_VERS_INFO "HDF5 library version: 1.13.0" /* Full version string */ -#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ +#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) /* macros for comparing the version */ @@ -122,8 +122,8 @@ extern "C" { * The negative failure value is most commonly -1, but don't bet on it. The * proper way to detect failure is something like: * - * if((dset = H5Dopen2(file, name)) < 0) - * fprintf(stderr, "unable to open the requested dataset\n"); + * if((dset = H5Dopen2(file, name)) < 0) + * fprintf(stderr, "unable to open the requested dataset\n"); */ typedef int herr_t; @@ -135,13 +135,13 @@ typedef int herr_t; * (false), positive (true), or negative (failure). The proper way to test * for truth from a htri_t function is: * - * if ((retval = H5Tcommitted(type))>0) { - * printf("data type is committed\n"); - * } else if (!retval) { - * printf("data type is not committed\n"); - * } else { - * printf("error determining whether data type is committed\n"); - * } + * if ((retval = H5Tcommitted(type)) > 0) { + * printf("data type is committed\n"); + * } else if (!retval) { + * printf("data type is not committed\n"); + * } else { + * printf("error determining whether data type is committed\n"); + * } */ #ifdef H5_HAVE_STDBOOL_H #include diff --git a/src/Makefile.am b/src/Makefile.am index 787b502..cbecccd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -141,8 +141,8 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5Apublic.h H5ACpublic.h \ H5Cpublic.h H5Dpublic.h \ H5Epubgen.h H5Epublic.h H5ESpublic.h H5Fpublic.h \ - H5FDpublic.h H5FDcore.h H5FDdirect.h H5FDfamily.h H5FDhdfs.h \ - H5FDlog.h H5FDmirror.h H5FDmpi.h H5FDmpio.h H5FDmulti.h H5FDros3.h \ + H5FDpublic.h H5FDcore.h H5FDdirect.h H5FDfamily.h H5FDhdfs.h \ + H5FDlog.h H5FDmirror.h H5FDmpi.h H5FDmpio.h H5FDmulti.h H5FDros3.h \ H5FDsec2.h H5FDsplitter.h H5FDstdio.h H5FDwindows.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ H5Mpublic.h H5MMpublic.h H5Opublic.h H5Ppublic.h \ diff --git a/test/cache_image.c b/test/cache_image.c index 59689a9..9f8c4c5 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -15,7 +15,7 @@ * 7/13/15 * * This file contains tests specific to the cache image - * feature implemented in H5C.c + * feature implemented in H5C.c */ #include "cache_common.h" #include "genall5.h" diff --git a/test/cache_tagging.c b/test/cache_tagging.c index cf0cd8d..531138c 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -30,16 +30,16 @@ /* Test Defines */ /* ============ */ -#define FILENAME "tagging_test.h5" -#define FILENAME2 "tagging_ext_test.h5" -#define GROUPNAME "Group" +#define FILENAME "tagging_test.h5" +#define FILENAME2 "tagging_ext_test.h5" +#define GROUPNAME "Group" #define GROUPNAMEPATH "/Group" #define GROUPNAMECOPY "GroupCopy" -#define ATTRNAME "Attribute 1" -#define ATTRNAME3 "Attribute 3" -#define DATASETNAME "Dataset" -#define DATASETNAME2 "Dataset2" -#define LINKNAME "Link" +#define ATTRNAME "Attribute 1" +#define ATTRNAME3 "Attribute 3" +#define DATASETNAME "Dataset" +#define DATASETNAME2 "Dataset2" +#define LINKNAME "Link" #define RANK 2 #define DIMS 32 diff --git a/test/dsets.c b/test/dsets.c index e4cf2a4..eb2ffa6 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -1888,7 +1888,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; } @@ -1934,7 +1934,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Default behavior is failure when data is corrupted. */ /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; @@ -1947,7 +1947,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; } @@ -2048,7 +2048,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Default behavior is failure when data is corrupted. */ /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; @@ -2061,12 +2061,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; } else { - if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check_data) < 0) + if(H5Dread(dataset, H5T_NATIVE_INT, sid, sid, dxpl, check_data) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ @@ -13366,7 +13366,7 @@ test_versionbounds(void) return FAIL; } /* end test_versionbounds() */ - + /*----------------------------------------------------------------------------- * Function: test_object_header_minimization_dcpl * diff --git a/test/dt_arith.c b/test/dt_arith.c index 775f4ee..9b89225 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -770,7 +770,7 @@ static int test_particular_fp_integer(void) /* Print errors */ if(dst_c != SCHAR_MAX) { - double x = 0.; + double x = 0.0; signed char y; if(0 == fails_this_test++) @@ -814,7 +814,7 @@ static int test_particular_fp_integer(void) /* Print errors */ if(dst_i != fill_value) { - float x = 0.; + float x = 0.0; int y; if(0 == fails_this_test++) @@ -2723,16 +2723,16 @@ my_isnan(dtype_t type, void *val) char s[256]; if (FLT_FLOAT==type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, val, sizeof(float)); retval = (x!=x); } else if (FLT_DOUBLE==type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, val, sizeof(double)); retval = (x!=x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (FLT_LDOUBLE==type) { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); #endif @@ -2746,18 +2746,18 @@ my_isnan(dtype_t type, void *val) */ if (!retval) { if (FLT_FLOAT==type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, val, sizeof(float)); HDsnprintf(s, sizeof(s), "%g", (double)x); } else if (FLT_DOUBLE==type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, val, sizeof(double)); HDsnprintf(s, sizeof(s), "%g", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (FLT_LDOUBLE==type) { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, val, sizeof(long double)); HDsnprintf(s, sizeof(s), "%Lg", x); @@ -3197,7 +3197,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) int check_expo[2]; if (FLT_FLOAT==dst_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); if (underflow && HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) @@ -3208,7 +3208,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) check_mant[0] = HDfrexpf(x, check_expo+0); check_mant[1] = HDfrexpf(hw_f, check_expo+1); } else if (FLT_DOUBLE==dst_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); if (underflow && HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) @@ -3220,7 +3220,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) check_mant[1] = HDfrexp(hw_d, check_expo+1); #if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE) } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(long double)); /* dst is largest float, no need to check underflow. */ check_mant[0] = (double)HDfrexpl(x, check_expo+0); @@ -3265,16 +3265,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]); HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); if (FLT_FLOAT==src_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &saved[j*src_size], sizeof(float)); HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==src_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &saved[j*src_size], sizeof(double)); HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &saved[j*src_size], sizeof(long double)); HDfprintf(stdout," %29.20Le\n", x); #endif @@ -3285,16 +3285,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]); HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); if (FLT_FLOAT==dst_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==dst_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(long double)); HDfprintf(stdout," %29.20Le\n", x); #endif diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 2685823..5baabb6 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -537,7 +537,6 @@ static int copy_refs_attr(hid_t loc_in, KY 2020-02-07 */ is_ref_comp = (ref_comp_field_n > 0); - } -- cgit v0.12 From 57c4aeb0cc0d1f2aca2be85895dd3ecef92f36dd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sat, 15 Aug 2020 17:25:22 -0500 Subject: TRILABS-277 Use JIRA number as #ifdef --- MANIFEST | 1 + tools/src/h5diff/h5diff_common.c | 9 +++++---- tools/test/h5diff/CMakeTests.cmake | 8 ++++++++ tools/test/h5diff/testfiles/h5diff_830.txt | 30 ++++++++++++++++++++++++++++++ tools/test/h5diff/testh5diff.sh.in | 6 ++++++ 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_830.txt diff --git a/MANIFEST b/MANIFEST index 826c0d5..f26d0b8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2493,6 +2493,7 @@ ./tools/test/h5diff/testfiles/h5diff_80.txt ./tools/test/h5diff/testfiles/h5diff_800.txt ./tools/test/h5diff/testfiles/h5diff_801.txt +./tools/test/h5diff/testfiles/h5diff_830.txt ./tools/test/h5diff/testfiles/h5diff_90.txt ./tools/test/h5diff/testfiles/h5diff_100.txt ./tools/test/h5diff/testfiles/h5diff_101.txt diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index a4fe3bb..8ed2d37 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -75,6 +75,7 @@ static void check_options(diff_opt_t* opts) } } +#if TRILABS-227 /*------------------------------------------------------------------------- * Function: parse_hsize_list * @@ -90,7 +91,6 @@ static void check_options(diff_opt_t* opts) * Return: *------------------------------------------------------------------------- */ -#if 0 static void parse_hsize_list(const char *h_list, subset_d *d) { @@ -140,7 +140,6 @@ parse_hsize_list(const char *h_list, subset_d *d) d->len = size_count; H5TOOLS_ENDDEBUG(""); } -#endif /*------------------------------------------------------------------------- * Function: parse_subset_params @@ -151,7 +150,6 @@ parse_hsize_list(const char *h_list, subset_d *d) * Failure: NULL *------------------------------------------------------------------------- */ -#if 0 static struct subset_t * parse_subset_params(const char *dset) { @@ -482,10 +480,13 @@ void parse_command_line(int argc, const char* argv[], const char** fname1, const /* * TRILABS-227 is complete except for an issue with printing indices * the following calls will enable subsetting + */ +#if TRILABS-227 opts->sset[0] = parse_subset_params(*objname1); opts->sset[1] = parse_subset_params(*objname2); - */ +#endif + H5TOOLS_ENDDEBUG(""); } diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 5aa1d1a..4e8e8d1 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -293,6 +293,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_800.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_801.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_830.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8625.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8639.txt @@ -919,6 +920,8 @@ h5diff_800.out.err h5diff_801.out h5diff_801.out.err + h5diff_830.out + h5diff_830.out.err h5diff_8625.out h5diff_8625.out.err h5diff_8639.out @@ -1544,6 +1547,11 @@ ADD_H5_TEST (h5diff_800 1 -v ${FILE7} ${FILE8} /g1/array /g1/array) ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array) # ############################################################################## +# # dataset subsets +# ############################################################################## +#TRILABS-227 ADD_H5_TEST (h5diff_830 1 --enable-error-stack -v ${FILE7} ${FILE8} /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;]) + +# ############################################################################## # # VDS tests # ############################################################################## ADD_H5_TEST (h5diff_v1 0 -v ${FILEV1} ${FILEV2}) diff --git a/tools/test/h5diff/testfiles/h5diff_830.txt b/tools/test/h5diff/testfiles/h5diff_830.txt new file mode 100644 index 0000000..8f00d8b --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_830.txt @@ -0,0 +1,30 @@ +dataset: and +size: [4x3x2] [4x3x2] +position array3D array3D difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 0 ] 2 0 2 +[ 0 0 0 ] 3 0 3 +[ 0 0 1 ] 4 0 4 +[ 0 0 1 ] 5 0 5 +[ 0 0 1 ] 6 0 6 +[ 0 2 0 ] 13 0 13 +[ 0 2 0 ] 14 0 14 +[ 0 2 0 ] 15 0 15 +[ 0 2 1 ] 16 0 16 +[ 0 2 1 ] 17 0 17 +[ 0 2 1 ] 18 0 18 +[ 2 0 0 ] 37 0 37 +[ 2 0 0 ] 38 0 38 +[ 2 0 0 ] 39 0 39 +[ 2 0 1 ] 40 0 40 +[ 2 0 1 ] 41 0 41 +[ 2 0 1 ] 42 0 42 +[ 2 2 0 ] 49 0 49 +[ 2 2 0 ] 50 0 50 +[ 2 2 0 ] 51 0 51 +[ 2 2 1 ] 52 0 52 +[ 2 2 1 ] 53 0 53 +[ 2 2 1 ] 54 0 54 +24 differences found +EXIT CODE: 1 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 9f88ee1..587c340 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -354,6 +354,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_710.txt $SRC_H5DIFF_TESTFILES/h5diff_80.txt $SRC_H5DIFF_TESTFILES/h5diff_800.txt $SRC_H5DIFF_TESTFILES/h5diff_801.txt +$SRC_H5DIFF_TESTFILES/h5diff_830.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt $SRC_H5DIFF_TESTFILES/h5diff_8625.txt $SRC_H5DIFF_TESTFILES/h5diff_8639.txt @@ -1202,6 +1203,11 @@ TOOLTEST h5diff_800.txt -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array /g1/array TOOLTEST h5diff_801.txt -v h5diff_dset1.h5 h5diff_dset3.h5 /g1/array /g1/array # ############################################################################## +# # dataset subsets +# ############################################################################## +#TRILABS-227 TOOLTEST h5diff_830.txt --enable-error-stack -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;] + +# ############################################################################## # VDS tests # ############################################################################## TOOLTEST h5diff_v1.txt -v 1_vds.h5 2_vds.h5 -- cgit v0.12 From 6a344232f641135e6bc5f89d66a01c68d29bfa00 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sat, 15 Aug 2020 18:10:57 -0500 Subject: Add testfiles --- MANIFEST | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MANIFEST b/MANIFEST index f26d0b8..b53e4e7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2743,24 +2743,31 @@ ./tools/test/h5repack/testfiles/4_vds.h5-vds_compa-v.ddl ./tools/test/h5repack/testfiles/attrregion.tattrreg.h5.ddl ./tools/test/h5repack/testfiles/dataregion.tdatareg.h5.ddl +./tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl ./tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst ./tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl ./tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl +./tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl ./tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst ./tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl ./tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl +./tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl ./tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst ./tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl ./tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl +./tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl ./tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst ./tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl ./tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl +./tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl ./tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst ./tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl ./tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl +./tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl ./tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst ./tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl ./tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl +./tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 # jam utility and tests ./tools/src/h5jam/Makefile.am -- cgit v0.12