summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-03-23 21:37:51 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-03-23 21:37:51 (GMT)
commitca3721e3d72861573c3343a5b20e377e446bb96f (patch)
tree80e86a285f94aab89f554b88942ddda8ae09abbe /src
parent1e71b31e8a3d264bd7cf4fec1292cf786d745689 (diff)
parent13d4ed7e3a7500ccfabc8837c15bb8ec3f164350 (diff)
downloadhdf5-ca3721e3d72861573c3343a5b20e377e446bb96f.zip
hdf5-ca3721e3d72861573c3343a5b20e377e446bb96f.tar.gz
hdf5-ca3721e3d72861573c3343a5b20e377e446bb96f.tar.bz2
Merge remote-tracking branch 'canonical/feature/vfd_swmr' into vfd_swmr/thg_standards
Diffstat (limited to 'src')
-rw-r--r--src/H5FDdirect.c1
-rw-r--r--src/H5FDmpio.c1
-rw-r--r--src/H5FDros3.c1
-rw-r--r--src/H5Fvfd_swmr.c6
-rw-r--r--src/H5private.h11
-rw-r--r--src/H5time_private.h109
6 files changed, 16 insertions, 113 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 34c4346..498d5f8 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -171,6 +171,7 @@ static const H5FD_class_t H5FD_direct_g = {
H5FD_direct_truncate, /*truncate */
H5FD_direct_lock, /*lock */
H5FD_direct_unlock, /*unlock */
+ NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /*fl_map */
};
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 3d2e0cf..4fce560 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -127,6 +127,7 @@ static const H5FD_class_mpi_t H5FD_mpio_g = {
H5FD__mpio_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
+ NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /*fl_map */
}, /* End of superclass information */
H5FD__mpio_mpi_rank, /*get_rank */
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index d99272c..a936f55 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -272,6 +272,7 @@ static const H5FD_class_t H5FD_ros3_g = {
H5FD_ros3_truncate, /* truncate */
H5FD_ros3_lock, /* lock */
H5FD_ros3_unlock, /* unlock */
+ NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c
index 0b0befd..b55f157 100644
--- a/src/H5Fvfd_swmr.c
+++ b/src/H5Fvfd_swmr.c
@@ -1320,7 +1320,7 @@ insert_eot_entry(eot_queue_entry_t *entry_ptr)
/* Find the insertion point for the entry on the EOT queue */
TAILQ_FOREACH_REVERSE(prec_ptr, &eot_queue_g, eot_queue, link) {
- if (timespeccmp(&prec_ptr->end_of_tick, &entry_ptr->end_of_tick, <=))
+ if (HDtimespeccmp(&prec_ptr->end_of_tick, &entry_ptr->end_of_tick, <=))
break;
}
@@ -1964,7 +1964,7 @@ H5F_vfd_swmr_process_eot_queue(hbool_t entering_api)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get time via clock_gettime");
}
#endif
- if(timespeccmp(&now, &head->end_of_tick, <))
+ if(HDtimespeccmp(&now, &head->end_of_tick, <))
break;
/* If the H5F_shared_t is labeled with a later EOT time than
* the queue entry is, then we have already performed the
@@ -1972,7 +1972,7 @@ H5F_vfd_swmr_process_eot_queue(hbool_t entering_api)
* multiple H5F_t share the H5F_shared_t. Just update the
* EOT queue entry and move to the next.
*/
- if (timespeccmp(&head->end_of_tick, &shared->end_of_tick, <)) {
+ if (HDtimespeccmp(&head->end_of_tick, &shared->end_of_tick, <)) {
H5F_vfd_swmr_update_entry_eot(head);
} else if (shared->vfd_swmr_writer) {
if (H5F_vfd_swmr_writer_end_of_tick(f, FALSE) < 0)
diff --git a/src/H5private.h b/src/H5private.h
index 4e190a6..3741d4a 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1575,6 +1575,16 @@ typedef off_t h5_stat_size_t;
#ifndef HDtimes
#define HDtimes(T) times(T)
#endif /* HDtimes*/
+#ifndef HDtimespeccmp
+#ifdef H5_HAVE_TIMESPECCMP
+ #define HDtimespeccmp(tsp, usp, cmp) timespeccmp(tsp, usp, cmp)
+#else
+#define HDtimespeccmp(tsp, usp, cmp) \
+ (((tsp)->tv_sec == (usp)->tv_sec) ? \
+ ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \
+ ((tsp)->tv_sec cmp (usp)->tv_sec))
+#endif
+#endif /* HDtimespeccmp */
#ifndef HDtmpfile
#define HDtmpfile() tmpfile()
#endif /* HDtmpfile */
@@ -2187,7 +2197,6 @@ H5_DLL herr_t H5CX_pop(void);
BEGIN_MPE_LOG
#include "H5FDvfd_swmr_private.h"
-#include "H5time_private.h" /* for timespeccmp */
#define VFD_SWMR_ENTER(err) \
do { \
diff --git a/src/H5time_private.h b/src/H5time_private.h
deleted file mode 100644
index 603c273..0000000
--- a/src/H5time_private.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2019 The HDF Group. All rights reserved.
- *
- * This file is part of HDF5. The full HDF5 copyright notice, including
- * terms governing use, modification, and redistribution, is contained in
- * the COPYING file, which can be found at the root of the source code
- * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
- * If you do not have access to either file, you may request a copy from
- * help@hdfgroup.org.
- */
-
-/*
- * Portions of this file derive from <sys/time.h> in NetBSD. Applicable
- * copyright notices and licenses are reproduced here:
- */
-
-/*-
- * Copyright (c) 2017 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)time.h 8.5 (Berkeley) 5/4/95
- */
-
-#ifndef H5time_private_H
-#define H5time_private_H
-
-#ifdef __NetBSD__
-#include <sys/time.h>
-#else
-#define timespecclear(tsp) (tsp)->tv_sec = (time_t)((tsp)->tv_nsec = 0L)
-#define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec)
-#define timespeccmp(tsp, usp, cmp) \
- (((tsp)->tv_sec == (usp)->tv_sec) ? \
- ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \
- ((tsp)->tv_sec cmp (usp)->tv_sec))
-#define timespecadd(tsp, usp, vsp) \
- do { \
- (vsp)->tv_sec = (tsp)->tv_sec + (usp)->tv_sec; \
- (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \
- if ((vsp)->tv_nsec >= 1000000000L) { \
- (vsp)->tv_sec++; \
- (vsp)->tv_nsec -= 1000000000L; \
- } \
- } while (/* CONSTCOND */ 0)
-#define timespecsub(tsp, usp, vsp) \
- do { \
- (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
- (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \
- if ((vsp)->tv_nsec < 0) { \
- (vsp)->tv_sec--; \
- (vsp)->tv_nsec += 1000000000L; \
- } \
- } while (/* CONSTCOND */ 0)
-#define timespec2ns(x) (((uint64_t)(x)->tv_sec) * 1000000000UL + (uint64_t)(x)->tv_nsec)
-#endif
-
-#endif /* H5time_private_H */