summaryrefslogtreecommitdiffstats
path: root/src/H5Fmpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Fmpi.c')
-rw-r--r--src/H5Fmpi.c61
1 files changed, 42 insertions, 19 deletions
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c
index 6786e07..8a8fdc1 100644
--- a/src/H5Fmpi.c
+++ b/src/H5Fmpi.c
@@ -188,7 +188,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F__set_mpi_atomicity(H5F_t *file, hbool_t flag)
+H5F__set_mpi_atomicity(H5F_t *file, bool flag)
{
herr_t ret_value = SUCCEED;
@@ -292,7 +292,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag /*out*/)
+H5Fget_mpi_atomicity(hid_t file_id, bool *flag /*out*/)
{
H5VL_object_t *vol_obj; /* File info */
H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
@@ -401,29 +401,52 @@ done:
* coordinates between the file-global flag and the flag set
* for the current operation in the current API context.
*
- * Return: TRUE/FALSE (can't fail)
+ * Return: true/false (can't fail)
*
*-------------------------------------------------------------------------
*/
-hbool_t
+bool
H5F_get_coll_metadata_reads(const H5F_t *file)
{
+ FUNC_ENTER_NOAPI_NOERR
+
+ assert(file && file->shared);
+
+ FUNC_LEAVE_NOAPI(H5F_shared_get_coll_metadata_reads(file->shared));
+} /* end H5F_get_coll_metadata_reads() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5F_shared_get_coll_metadata_reads
+ *
+ * Purpose: Determines whether collective metadata reads should be
+ * performed. This routine is meant to be the single source of
+ * truth for the collective metadata reads status, as it
+ * coordinates between the file-global flag and the flag set
+ * for the current operation in the current API context.
+ *
+ * Return: true/false (can't fail)
+ *
+ *-------------------------------------------------------------------------
+ */
+bool
+H5F_shared_get_coll_metadata_reads(const H5F_shared_t *f_sh)
+{
H5P_coll_md_read_flag_t file_flag = H5P_USER_FALSE;
- hbool_t ret_value = FALSE;
+ bool ret_value = false;
FUNC_ENTER_NOAPI_NOERR
- assert(file && file->shared);
+ assert(f_sh);
/* Retrieve the file-global flag */
- file_flag = H5F_COLL_MD_READ(file);
+ file_flag = H5F_SHARED_COLL_MD_READ(f_sh);
/* If file flag is set to H5P_FORCE_FALSE, exit early
- * with FALSE, since collective metadata reads have
+ * with false, since collective metadata reads have
* been explicitly disabled somewhere in the library.
*/
if (H5P_FORCE_FALSE == file_flag)
- ret_value = FALSE;
+ ret_value = false;
else {
/* If file flag is set to H5P_USER_TRUE, ignore
* any settings in the API context. A file-global
@@ -432,7 +455,7 @@ H5F_get_coll_metadata_reads(const H5F_t *file)
* Property List for an individual operation.
*/
if (H5P_USER_TRUE == file_flag)
- ret_value = TRUE;
+ ret_value = true;
else {
/* Get the collective metadata reads flag from
* the current API context.
@@ -442,7 +465,7 @@ H5F_get_coll_metadata_reads(const H5F_t *file)
}
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_get_coll_metadata_reads() */
+} /* end H5F_shared_get_coll_metadata_reads() */
/*-------------------------------------------------------------------------
* Function: H5F_set_coll_metadata_reads
@@ -484,10 +507,10 @@ H5F_get_coll_metadata_reads(const H5F_t *file)
*-------------------------------------------------------------------------
*/
void
-H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, hbool_t *context_flag)
+H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, bool *context_flag)
{
H5P_coll_md_read_flag_t prev_file_flag = H5P_USER_FALSE;
- hbool_t prev_context_flag = FALSE;
+ bool prev_context_flag = false;
FUNC_ENTER_NOAPI_NOERR
@@ -516,12 +539,12 @@ H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, hbo
* Function: H5F_mpi_get_file_block_type
*
* Purpose: Creates an MPI derived datatype for communicating an
- * H5F_block_t structure. If `commit` is specified as TRUE,
+ * H5F_block_t structure. If `commit` is specified as true,
* the resulting datatype will be committed and ready for
* use in communication. Otherwise, the type is only suitable
* for building other derived types.
*
- * If TRUE is returned through `new_type_derived`, this lets
+ * If true is returned through `new_type_derived`, this lets
* the caller know that the datatype has been derived and
* should be freed with MPI_Type_free once it is no longer
* needed.
@@ -531,7 +554,7 @@ H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, hbo
*-------------------------------------------------------------------------
*/
herr_t
-H5F_mpi_get_file_block_type(hbool_t commit, MPI_Datatype *new_type, hbool_t *new_type_derived)
+H5F_mpi_get_file_block_type(bool commit, MPI_Datatype *new_type, bool *new_type_derived)
{
MPI_Datatype types[2];
MPI_Aint displacements[2];
@@ -545,7 +568,7 @@ H5F_mpi_get_file_block_type(hbool_t commit, MPI_Datatype *new_type, hbool_t *new
assert(new_type);
assert(new_type_derived);
- *new_type_derived = FALSE;
+ *new_type_derived = false;
field_count = 2;
assert(field_count == sizeof(types) / sizeof(MPI_Datatype));
@@ -559,7 +582,7 @@ H5F_mpi_get_file_block_type(hbool_t commit, MPI_Datatype *new_type, hbool_t *new
if (MPI_SUCCESS !=
(mpi_code = MPI_Type_create_struct(field_count, block_lengths, displacements, types, new_type)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code)
- *new_type_derived = TRUE;
+ *new_type_derived = true;
if (commit && MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
@@ -569,7 +592,7 @@ done:
if (*new_type_derived) {
if (MPI_SUCCESS != (mpi_code = MPI_Type_free(new_type)))
HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
- *new_type_derived = FALSE;
+ *new_type_derived = false;
}
}