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 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 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 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