summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5CX.c5
-rw-r--r--src/H5FDs3comms.c3
-rw-r--r--src/H5FDsec2.h18
-rw-r--r--src/H5FDsubfiling/H5FDioc.c9
-rw-r--r--src/H5FDsubfiling/H5FDioc_int.c6
-rw-r--r--src/H5FDsubfiling/H5FDsubfile_int.c25
-rw-r--r--src/H5FDsubfiling/H5FDsubfiling.c4
-rw-r--r--src/H5FDsubfiling/H5FDsubfiling_priv.h2
-rw-r--r--src/H5Fsfile.c15
-rw-r--r--src/H5system.c41
10 files changed, 82 insertions, 46 deletions
diff --git a/src/H5CX.c b/src/H5CX.c
index aa9d0b5..b3b2fca 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -778,6 +778,11 @@ H5CX__push_common(H5CX_node_t *cnode)
cnode->ctx.tag = H5AC__INVALID_TAG;
cnode->ctx.ring = H5AC_RING_USER;
+#ifdef H5_HAVE_PARALLEL
+ cnode->ctx.btype = MPI_BYTE;
+ cnode->ctx.ftype = MPI_BYTE;
+#endif
+
/* Push context node onto stack */
cnode->next = *head;
*head = cnode;
diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c
index 58fc435..dae1149 100644
--- a/src/H5FDs3comms.c
+++ b/src/H5FDs3comms.c
@@ -1713,7 +1713,8 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c
} /* end while node is not NULL */
/* remove trailing ';' from signed headers sequence */
- signed_headers_dest[strlen(signed_headers_dest) - 1] = '\0';
+ if (*signed_headers_dest != '\0')
+ signed_headers_dest[strlen(signed_headers_dest) - 1] = '\0';
/* append signed headers and payload hash
* NOTE: at present, no HTTP body is handled, per the nature of
diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h
index 56f4575..a2590ae 100644
--- a/src/H5FDsec2.h
+++ b/src/H5FDsec2.h
@@ -23,7 +23,23 @@
extern "C" {
#endif
-H5_DLL hid_t H5FD_sec2_init(void);
+H5_DLL hid_t H5FD_sec2_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Modifies the file access property list to use the #H5FD_SEC2 driver
+ *
+ * \fapl_id
+ *
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_sec2() modifies the file access property list to use the
+ * #H5FD_SEC2 driver.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_sec2(hid_t fapl_id);
#ifdef __cplusplus
diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c
index 39766de..80771c0 100644
--- a/src/H5FDsubfiling/H5FDioc.c
+++ b/src/H5FDsubfiling/H5FDioc.c
@@ -32,8 +32,6 @@
#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
-#define CANBE_UNUSED(X) (void)(X)
-
/* The driver identification number, initialized at runtime */
static hid_t H5FD_IOC_g = H5I_INVALID_HID;
@@ -1219,13 +1217,14 @@ static herr_t
H5FD__ioc_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
size_t size, void *buf)
{
- H5FD_ioc_t *file = (H5FD_ioc_t *)_file;
- herr_t ret_value = SUCCEED;
+#ifndef NDEBUG
+ H5FD_ioc_t *file = (H5FD_ioc_t *)_file;
+#endif
+ herr_t ret_value = SUCCEED;
H5FD_IOC_LOG_CALL(__func__);
assert(file && file->pub.cls);
- CANBE_UNUSED(file);
assert(buf);
/* Check for overflow conditions */
diff --git a/src/H5FDsubfiling/H5FDioc_int.c b/src/H5FDsubfiling/H5FDioc_int.c
index 674b08d..5528fc8 100644
--- a/src/H5FDsubfiling/H5FDioc_int.c
+++ b/src/H5FDsubfiling/H5FDioc_int.c
@@ -423,8 +423,14 @@ ioc__async_completion(MPI_Request *mpi_reqs, size_t num_reqs)
assert(mpi_reqs);
H5_CHECK_OVERFLOW(num_reqs, size_t, int);
+
+ /* Have to supppress gcc warnings regarding MPI_STATUSES_IGNORE
+ * with MPICH (https://github.com/pmodels/mpich/issues/5687)
+ */
+ H5_GCC_DIAG_OFF("stringop-overflow")
if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int)num_reqs, mpi_reqs, MPI_STATUSES_IGNORE)))
H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code);
+ H5_GCC_DIAG_ON("stringop-overflow")
done:
H5_SUBFILING_FUNC_LEAVE;
diff --git a/src/H5FDsubfiling/H5FDsubfile_int.c b/src/H5FDsubfiling/H5FDsubfile_int.c
index cb210b6..a7dd864 100644
--- a/src/H5FDsubfiling/H5FDsubfile_int.c
+++ b/src/H5FDsubfiling/H5FDsubfile_int.c
@@ -143,17 +143,19 @@ H5FD__subfiling__truncate_sub_files(hid_t context_id, int64_t logical_file_eof,
}
/* Wait for truncate operations to complete */
+ H5_GCC_DIAG_OFF("stringop-overflow")
if (MPI_SUCCESS != (mpi_code = MPI_Waitall(num_subfiles_owned, recv_reqs, MPI_STATUSES_IGNORE)))
H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Waitall", mpi_code);
-
- /* sanity check -- compute the file eof using the same mechanism used to
- * compute the subfile eof. Assert that the computed value and the
- * actual value match.
- *
- * Do this only for debug builds -- probably delete this before release.
- *
- * JRM -- 12/15/21
- */
+ H5_GCC_DIAG_ON("stringop-overflow")
+
+ /* sanity check -- compute the file eof using the same mechanism used to
+ * compute the subfile eof. Assert that the computed value and the
+ * actual value match.
+ *
+ * Do this only for debug builds -- probably delete this before release.
+ *
+ * JRM -- 12/15/21
+ */
#ifndef NDEBUG
{
@@ -339,15 +341,18 @@ H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_eof_ptr)
}
/* Wait for EOF communication to complete */
+ H5_GCC_DIAG_OFF("stringop-overflow")
if (MPI_SUCCESS != (mpi_code = MPI_Waitall(num_subfiles, recv_reqs, MPI_STATUSES_IGNORE)))
H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Waitall", mpi_code);
+ H5_GCC_DIAG_ON("stringop-overflow")
for (int i = 0; i < num_subfiles; i++) {
+#ifndef NDEBUG
int ioc_rank = (int)recv_msg[3 * i];
+#endif
assert(ioc_rank >= 0);
assert(ioc_rank < n_io_concentrators);
- CANBE_UNUSED(ioc_rank);
assert(sf_eofs[i] == -1);
sf_eofs[i] = recv_msg[(3 * i) + 1];
diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c
index d8616c8..a2daba0 100644
--- a/src/H5FDsubfiling/H5FDsubfiling.c
+++ b/src/H5FDsubfiling/H5FDsubfiling.c
@@ -1556,7 +1556,7 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i
H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %" PRIuHADDR, addr);
if (REGION_OVERFLOW(addr, size))
H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL,
- "addr overflow, addr = %" PRIuHADDR ", size = %" PRIuHADDR, addr, size);
+ "addr overflow, addr = %" PRIuHADDR ", size = %zu", addr, size);
/* Temporarily reject collective I/O until support is implemented (unless types are simple MPI_BYTE) */
{
@@ -1789,7 +1789,7 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_
H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %" PRIuHADDR, addr);
if (REGION_OVERFLOW(addr, size))
H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL,
- "addr overflow, addr = %" PRIuHADDR ", size = %" PRIuHADDR, addr, size);
+ "addr overflow, addr = %" PRIuHADDR ", size = %zu", addr, size);
/* Temporarily reject collective I/O until support is implemented (unless types are simple MPI_BYTE) */
{
diff --git a/src/H5FDsubfiling/H5FDsubfiling_priv.h b/src/H5FDsubfiling/H5FDsubfiling_priv.h
index 9cc32f1..08fef7d 100644
--- a/src/H5FDsubfiling/H5FDsubfiling_priv.h
+++ b/src/H5FDsubfiling/H5FDsubfiling_priv.h
@@ -63,6 +63,4 @@ H5_DLL herr_t H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_e
}
#endif
-#define CANBE_UNUSED(X) (void)(X)
-
#endif /* H5FDsubfiling_priv_H */
diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c
index ef80a79..6cf2c80 100644
--- a/src/H5Fsfile.c
+++ b/src/H5Fsfile.c
@@ -47,14 +47,17 @@ static H5F_sfile_node_t *H5F_sfile_head_s = NULL;
*-------------------------------------------------------------------------
*/
void
-H5F_sfile_assert_num(unsigned n)
+H5F_sfile_assert_num(unsigned H5_ATTR_NDEBUG_UNUSED n)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
+ /* The only useful work this function does is asserting so when NDEBUG
+ * is defined it's a no-op.
+ */
+#ifndef NDEBUG
if (n == 0) {
- /* Sanity checking */
assert(H5F_sfile_head_s == NULL);
- } /* end if */
+ }
else {
unsigned count; /* Number of open shared files */
H5F_sfile_node_t *curr; /* Current shared file node */
@@ -68,11 +71,11 @@ H5F_sfile_assert_num(unsigned n)
/* Advance to next shared file node */
curr = curr->next;
- } /* end while */
+ }
- /* Sanity checking */
assert(count == n);
- } /* end else */
+ }
+#endif
FUNC_LEAVE_NOAPI_VOID
} /* H5F_sfile_assert_num() */
diff --git a/src/H5system.c b/src/H5system.c
index 7ff521e..30a89a1 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -620,7 +620,6 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
FUNC_ENTER_NOAPI_NOINIT
- /* Sanity check */
assert(name);
assert(extpath);
@@ -634,8 +633,9 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
if (H5_CHECK_ABSOLUTE(name)) {
if (NULL == (full_path = (char *)H5MM_strdup(name)))
HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed");
- } /* end if */
- else { /* relative pathname */
+ }
+ else {
+ /* relative pathname */
char *retcwd;
size_t name_len;
int drive;
@@ -655,12 +655,12 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
drive = HDtoupper(name[0]) - 'A' + 1;
retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN);
strncpy(new_name, &name[2], name_len);
- } /* end if */
- /*
- * Windows: name[0] is a '/' or '\'
- * Get current drive
- * Unix: does not apply
- */
+ }
+ /*
+ * Windows: name[0] is a '/' or '\'
+ * Get current drive
+ * Unix: does not apply
+ */
else if (H5_CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) {
snprintf(cwdpath, MAX_PATH_LEN, "%c:%c", (drive + 'A' - 1), name[0]);
retcwd = cwdpath;
@@ -670,28 +670,32 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
else {
retcwd = HDgetcwd(cwdpath, MAX_PATH_LEN);
strncpy(new_name, name, name_len);
- } /* end if */
+ }
if (retcwd != NULL) {
size_t cwdlen;
size_t path_len;
- assert(cwdpath);
cwdlen = strlen(cwdpath);
- assert(cwdlen);
- assert(new_name);
+ if (cwdlen == 0)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "cwd length is zero");
path_len = cwdlen + strlen(new_name) + 2;
if (NULL == (full_path = (char *)H5MM_malloc(path_len)))
HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed");
- strncpy(full_path, cwdpath, cwdlen + 1);
+ /* path_len will always be greater than zero, so no check before
+ * setting the terminal NUL byte of full_path
+ */
+ strncpy(full_path, cwdpath, path_len);
+ full_path[path_len - 1] = '\0';
+
if (!H5_CHECK_DELIMITER(cwdpath[cwdlen - 1]))
strncat(full_path, H5_DIR_SEPS, path_len - (cwdlen + 1));
strncat(full_path, new_name, path_len - (cwdlen + 1) - strlen(H5_DIR_SEPS));
- } /* end if */
- } /* end else */
+ }
+ }
- /* strip out the last component (the file name itself) from the path */
+ /* Strip out the last component (the file name itself) from the path */
if (full_path) {
char *ptr = NULL;
@@ -699,10 +703,9 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
assert(ptr);
*++ptr = '\0';
*extpath = full_path;
- } /* end if */
+ }
done:
- /* Release resources */
if (cwdpath)
H5MM_xfree(cwdpath);
if (new_name)