summaryrefslogtreecommitdiffstats
path: root/src/H5FDfphdf5.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDfphdf5.c')
-rw-r--r--src/H5FDfphdf5.c300
1 files changed, 147 insertions, 153 deletions
diff --git a/src/H5FDfphdf5.c b/src/H5FDfphdf5.c
index 765c6b8..3aca1ad 100644
--- a/src/H5FDfphdf5.c
+++ b/src/H5FDfphdf5.c
@@ -12,18 +12,21 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include "H5private.h" /* Library functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Dprivate.h" /* Dataset functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* Files */
-#include "H5FDprivate.h" /* File driver */
-#include "H5FDfphdf5.h" /* Flexible PHDF5 I/O file driver */
-#include "H5FDmpio.h" /* MPI I/O file driver */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5Iprivate.h" /* Object IDs */
-#include "H5MMprivate.h" /* Memory allocation */
-#include "H5Pprivate.h" /* Property lists */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5FD_fphdf5_mask
+
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* Files access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDfphdf5.h" /* Flexible PHDF5 file driver */
+#include "H5FDmpio.h" /* MPI I/O file driver */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
#ifdef H5_HAVE_FPHDF5
@@ -109,9 +112,7 @@ const H5FD_class_t H5FD_fphdf5_g = {
};
/* Interface initialization */
-#define PABLO_MASK H5FD_fphdf5_mask
#define INTERFACE_INIT H5FD_fphdf5_init
-
static int interface_initialize_g = 0;
/*
@@ -155,7 +156,7 @@ H5FD_fphdf5_init(void)
{
hid_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_init, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_init, FAIL)
if (H5Iget_type(H5FD_FPHDF5_g) != H5I_VFL)
H5FD_FPHDF5_g = H5FDregister(&H5FD_fphdf5_g);
@@ -164,7 +165,7 @@ H5FD_fphdf5_init(void)
ret_value = H5FD_FPHDF5_g;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -206,19 +207,18 @@ H5Pset_fapl_fphdf5(hid_t fapl_id, MPI_Comm comm, MPI_Comm barrier_comm,
int mrc, comm_size;
herr_t ret_value;
- FUNC_ENTER_API(H5Pset_fapl_fphdf5, FAIL);
+ FUNC_ENTER_API(H5Pset_fapl_fphdf5, FAIL)
H5TRACE5("e","iMcMcMiIu",fapl_id,comm,barrier_comm,info,sap_rank);
if (fapl_id == H5P_DEFAULT)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL,
- "can't set values in default property list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list")
/* Check arguments */
if ((plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list")
if ((mrc = MPI_Comm_size(comm, &comm_size)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Comm_size failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Comm_size failed", mrc)
/* Initialize driver specific properties */
fa.comm = comm;
@@ -230,7 +230,7 @@ H5Pset_fapl_fphdf5(hid_t fapl_id, MPI_Comm comm, MPI_Comm barrier_comm,
ret_value = H5P_set_driver(plist, H5FD_FPHDF5, &fa);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -260,18 +260,18 @@ H5Pget_fapl_fphdf5(hid_t fapl_id, MPI_Comm *comm, MPI_Comm *barrier_comm,
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_API(H5Pget_fapl_fphdf5, FAIL);
+ FUNC_ENTER_API(H5Pget_fapl_fphdf5, FAIL)
H5TRACE6("e","i*Mc*Mc*Mi*Iu*Iu",fapl_id,comm,barrier_comm,info,sap_rank,
capt_rank);
if ((plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list")
if (H5P_get_driver(plist) != H5FD_FPHDF5)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
if ((fa = H5P_get_driver_info(plist)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
if (comm)
*comm = fa->comm;
@@ -289,7 +289,7 @@ H5Pget_fapl_fphdf5(hid_t fapl_id, MPI_Comm *comm, MPI_Comm *barrier_comm,
*capt_rank = fa->capt_rank;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -309,7 +309,7 @@ H5FD_fphdf5_communicator(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
MPI_Comm ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_communicator, MPI_COMM_NULL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_communicator, MPI_COMM_NULL)
/* check args */
assert(file);
@@ -319,7 +319,7 @@ H5FD_fphdf5_communicator(H5FD_t *_file)
ret_value = file->comm;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
@@ -340,7 +340,7 @@ H5FD_fphdf5_barrier_communicator(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
MPI_Comm ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_communicator, MPI_COMM_NULL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_communicator, MPI_COMM_NULL)
/* check args */
assert(file);
@@ -350,7 +350,7 @@ H5FD_fphdf5_barrier_communicator(H5FD_t *_file)
ret_value = file->barrier_comm;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -370,7 +370,7 @@ H5FD_fphdf5_mpi_rank(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
int ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_rank, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_rank, FAIL)
/* check args */
assert(file);
@@ -380,7 +380,7 @@ H5FD_fphdf5_mpi_rank(H5FD_t *_file)
ret_value = file->mpi_rank;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -400,7 +400,7 @@ H5FD_fphdf5_mpi_size(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
int ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_size, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_size, FAIL)
/* check args */
assert(file);
@@ -410,7 +410,7 @@ H5FD_fphdf5_mpi_size(H5FD_t *_file)
ret_value = file->mpi_size;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -430,7 +430,7 @@ H5FD_fphdf5_file_id(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
unsigned ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_file_id, 0);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_file_id, 0)
/* check args */
assert(file);
@@ -440,7 +440,7 @@ H5FD_fphdf5_file_id(H5FD_t *_file)
ret_value = file->file_id;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -460,7 +460,7 @@ H5FD_fphdf5_is_sap(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
hbool_t ret_value = FALSE;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_is_sap, FALSE);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_is_sap, FALSE)
/* check args */
assert(file);
@@ -470,7 +470,7 @@ H5FD_fphdf5_is_sap(H5FD_t *_file)
ret_value = ((unsigned)file->mpi_rank == H5FP_sap_rank);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -490,7 +490,7 @@ H5FD_fphdf5_is_captain(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
hbool_t ret_value = FALSE;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_is_sap, FALSE);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_is_sap, FALSE)
/* check args */
assert(file);
@@ -500,7 +500,7 @@ H5FD_fphdf5_is_captain(H5FD_t *_file)
ret_value = ((unsigned)file->mpi_rank == H5FP_capt_rank);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -520,7 +520,7 @@ H5FD_is_fphdf5_driver(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
hbool_t ret_value = FALSE;
- FUNC_ENTER_NOAPI(H5FD_is_fphdf5_driver, FALSE);
+ FUNC_ENTER_NOAPI(H5FD_is_fphdf5_driver, FALSE)
/* check args */
assert(file);
@@ -529,7 +529,7 @@ H5FD_is_fphdf5_driver(H5FD_t *_file)
ret_value = file->pub.driver_id == H5FD_FPHDF5;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -551,32 +551,32 @@ H5FD_fphdf5_setup(hid_t dxpl_id, MPI_Datatype btype,
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_setup, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_setup, FAIL)
/* Check arguments */
if ((plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list")
/* Set buffer MPI type */
if (H5P_insert(plist, H5FD_FPHDF5_XFER_MEM_MPI_TYPE_NAME,
H5FD_FPHDF5_XFER_MEM_MPI_TYPE_SIZE, &btype,
NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property")
/* Set file MPI type */
if (H5P_insert(plist, H5FD_FPHDF5_XFER_FILE_MPI_TYPE_NAME,
H5FD_FPHDF5_XFER_FILE_MPI_TYPE_SIZE, &ftype,
NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property")
/* Set 'use view' property */
if (H5P_insert(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME,
H5FD_FPHDF5_XFER_USE_VIEW_SIZE, &use_view,
NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -596,26 +596,26 @@ H5FD_fphdf5_teardown(hid_t dxpl_id)
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_teardown, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_teardown, FAIL)
/* Check arguments */
if ((plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list")
/* Remove buffer MPI type */
if (H5P_remove(dxpl_id, plist, H5FD_FPHDF5_XFER_MEM_MPI_TYPE_NAME) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property")
/* Remove file MPI type */
if (H5P_remove(dxpl_id, plist, H5FD_FPHDF5_XFER_FILE_MPI_TYPE_NAME) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property")
/* Remove 'use view' property */
if (H5P_remove(dxpl_id, plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -644,29 +644,28 @@ H5Pset_dxpl_fphdf5(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode)
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_API(H5Pset_dxpl_fphdf5, FAIL);
+ FUNC_ENTER_API(H5Pset_dxpl_fphdf5, FAIL)
H5TRACE2("e","iDt",dxpl_id,xfer_mode);
if (dxpl_id == H5P_DEFAULT)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL,
- "can't set values in default property list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list")
/* Check arguments */
if ((plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
if (xfer_mode != H5FD_MPIO_INDEPENDENT && xfer_mode != H5FD_MPIO_COLLECTIVE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode")
/* Set the transfer mode */
if (H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
/* Initialize driver-specific properties */
ret_value = H5P_set_driver(plist, H5FD_FPHDF5, NULL);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -689,22 +688,22 @@ H5Pget_dxpl_fphdf5(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode)
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_API(H5Pget_dxpl_fphdf5, FAIL);
+ FUNC_ENTER_API(H5Pget_dxpl_fphdf5, FAIL)
H5TRACE2("e","i*Dt",dxpl_id,xfer_mode);
if ((plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
if (H5P_get_driver(plist) != H5FD_FPHDF5)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
/* Get the transfer mode */
if (xfer_mode)
if (H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, xfer_mode) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get value");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get value")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -727,14 +726,14 @@ H5FD_fphdf5_fapl_get(H5FD_t *_file)
H5FD_fphdf5_fapl_t *fa = NULL;
void *ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_fapl_get, NULL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_fapl_get, NULL)
/* check args */
assert(file);
assert(file->pub.driver_id == H5FD_FPHDF5);
if ((fa = H5MM_calloc(sizeof(H5FD_fphdf5_fapl_t))) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* These should both be copied. --rpm, 1999-08-13 */
fa->comm = file->comm;
@@ -745,7 +744,7 @@ H5FD_fphdf5_fapl_get(H5FD_t *_file)
ret_value = fa;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -789,14 +788,14 @@ H5FD_fphdf5_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
/* Flag to indicate that the file was successfully opened */
unsigned file_opened = FALSE;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_open, NULL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_open, NULL)
/* check args */
assert(name);
/* Obtain a pointer to fphdf5-specific file access properties */
if ((plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
if (fapl_id == H5P_FILE_ACCESS_DEFAULT || H5P_get_driver(plist) != H5FD_FPHDF5) {
_fa.comm = MPI_COMM_SELF; /*default*/
@@ -820,21 +819,21 @@ H5FD_fphdf5_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
/* OKAY: CAST DISCARDS CONST */
if ((mrc = MPI_File_open(H5FP_SAP_BARRIER_COMM, (char *)name, mpi_amode,
fa->info, &fh)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mrc)
file_opened = TRUE;
if (H5P_get(plist, H5F_ACS_META_BLOCK_SIZE_NAME, &meta_block_size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get meta data block size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get meta data block size")
if (H5P_get(plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &sdata_block_size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'small data' block size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'small data' block size")
if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &threshold) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold")
if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &alignment) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment")
/* Retrieve the VFL driver feature flags */
H5FD_fphdf5_query(NULL, &feature_flags); /* doesn't fail */
@@ -843,50 +842,49 @@ H5FD_fphdf5_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
if (H5FP_request_open(H5FP_OBJ_FILE, maxaddr, feature_flags,
meta_block_size, sdata_block_size, threshold,
alignment, &file_id, &req_id) == FAIL)
- HGOTO_ERROR(H5E_FPHDF5, H5E_CANTOPENFILE, NULL,
- "can't inform SAP of file open");
+ HGOTO_ERROR(H5E_FPHDF5, H5E_CANTOPENFILE, NULL, "can't inform SAP of file open")
/* Broadcast the file ID */
if ((mrc = MPI_Bcast(&file_id, 1, MPI_UNSIGNED,
(int)H5FP_capt_barrier_rank,
H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc)
/* Grab the rank of this process */
if ((mrc = MPI_Comm_rank(H5FP_SAP_COMM, &mpi_rank)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mrc)
/* The captain rank will get the filesize and broadcast it. */
if ((unsigned)mpi_rank == H5FP_capt_rank)
/* Get current file size */
if ((mrc = MPI_File_get_size(fh, &size)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_File_get_size failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_File_get_size failed", mrc)
/* Broadcast file size */
if ((mrc = MPI_Bcast(&size, sizeof(MPI_Offset), MPI_BYTE,
(int)H5FP_capt_barrier_rank,
H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc)
/* Only if size > 0, truncate the file - if requested */
if (size && (flags & H5F_ACC_TRUNC)) {
if ((mrc = MPI_File_set_size(fh, (MPI_Offset)0)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_File_set_size (file truncation) failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_File_set_size (file truncation) failed", mrc)
/* Don't let any proc return until all have truncated the file. */
if ((mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mrc)
size = 0;
}
/* Grab the size of the communicator */
if ((mrc = MPI_Comm_size(H5FP_SAP_COMM, &mpi_size)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mrc)
/* Build the return value and initialize it */
if ((file = H5MM_calloc(sizeof(H5FD_fphdf5_t))) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
file->file_id = file_id;
file->f = fh;
@@ -903,7 +901,7 @@ done:
if (!ret_value && file_opened)
MPI_File_close(&fh);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -926,7 +924,7 @@ H5FD_fphdf5_close(H5FD_t *_file)
int mrc;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_close, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_close, FAIL)
/* check args */
assert(file);
@@ -934,23 +932,22 @@ H5FD_fphdf5_close(H5FD_t *_file)
/* Tell the SAP that we're closing the file... */
if (H5FP_request_close(_file, file->file_id, &req_id, &status) == FAIL)
- HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL,
- "can't inform SAP of file close");
+ HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "can't inform SAP of file close")
/* Let all of the processes catch up to this point. */
/* XXX: This barrier isn't necessary, MPI-I/O will syncronize for you -QAK */
if ((mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc)
/* MPI_File_close sets argument to MPI_FILE_NULL */
if ((mrc = MPI_File_close(&file->f)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_close failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_close failed", mrc)
/* Clean up other stuff */
H5MM_xfree(file);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -970,7 +967,7 @@ H5FD_fphdf5_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_query, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_query, FAIL)
/* Set the VFL feature flags that this driver supports */
if (flags) {
@@ -1007,7 +1004,7 @@ H5FD_fphdf5_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1029,7 +1026,7 @@ H5FD_fphdf5_get_eoa(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file;
haddr_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_get_eoa, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_get_eoa, HADDR_UNDEF)
/* check args */
assert(file);
@@ -1039,7 +1036,7 @@ H5FD_fphdf5_get_eoa(H5FD_t *_file)
ret_value = file->eoa;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1062,7 +1059,7 @@ H5FD_fphdf5_set_eoa(H5FD_t *_file, haddr_t addr)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_set_eoa, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_set_eoa, FAIL)
/* check args */
assert(file);
@@ -1071,7 +1068,7 @@ H5FD_fphdf5_set_eoa(H5FD_t *_file, haddr_t addr)
file->eoa = addr;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1100,7 +1097,7 @@ H5FD_fphdf5_get_eof(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
haddr_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_get_eof, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_get_eof, HADDR_UNDEF)
/* check args */
assert(file);
@@ -1110,7 +1107,7 @@ H5FD_fphdf5_get_eof(H5FD_t *_file)
ret_value = file->eof;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1130,18 +1127,18 @@ H5FD_fphdf5_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_get_handle, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_get_handle, FAIL)
/* check args */
assert(file);
if (!file_handle)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
*file_handle = &file->f;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1182,7 +1179,7 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_INDEPENDENT;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_read, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_read, FAIL)
/* check args */
assert(file);
@@ -1198,17 +1195,16 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
/* Some numeric conversions */
if (H5FD_fphdf5_haddr_to_MPIOff(addr, &mpi_off) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL,
- "can't convert from haddr_t to MPI offset");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr_t to MPI offset")
size_i = (int)size;
if ((hsize_t)size_i != size)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size_t to int");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size_t to int")
/* Obtain the data transfer properties */
if ((plist = H5I_object(dxpl_id)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
if (H5P_get_driver(plist) == H5FD_FPHDF5)
/* Get the transfer mode */
@@ -1222,15 +1218,15 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
*/
if (H5P_exist_plist(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME) > 0)
if (H5P_get(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME, &use_view_this_time) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
if (use_view_this_time) {
/* Prepare for a full-blown xfer using btype, ftype, and disp */
if (H5P_get(plist, H5FD_FPHDF5_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
if (H5P_get(plist, H5FD_FPHDF5_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
/*
* When using types, use the address as the displacement for
@@ -1243,7 +1239,7 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
if ((mrc = MPI_File_set_view(file->f, (MPI_Offset)mpi_disp, MPI_BYTE,
file_type, H5FD_mpio_native,
file->info)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc)
} else {
/*
* Prepare for a simple xfer of a contiguous block of bytes. The
@@ -1285,11 +1281,11 @@ HDfprintf(stderr, "%s:%d: Metadata cache read failed!\n", FUNC, __LINE__);
if (xfer_mode == H5FD_MPIO_INDEPENDENT) {
if ((mrc = MPI_File_read_at(file->f, mpi_off, buf, size_i,
buf_type, &status)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mrc)
} else {
if ((mrc = MPI_File_read_at_all(file->f, mpi_off, buf, size_i,
buf_type, &status)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at_all failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at_all failed", mrc)
}
/*
@@ -1304,12 +1300,12 @@ HDfprintf(stderr, "%s:%d: Metadata cache read failed!\n", FUNC, __LINE__);
if (use_view_this_time)
if ((mrc = MPI_File_set_view(file->f, (MPI_Offset)0, MPI_BYTE, MPI_BYTE,
H5FD_mpio_native, file->info)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc)
finished_read:
/* Check for read failure */
if (bytes_read < 0 || bytes_read > size_i)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed")
/*
* This gives us zeroes beyond end of physical MPI file. What about
@@ -1323,13 +1319,13 @@ finished_read:
* INCOMPLETE rky 1998-09-18
* Haven't implemented reading zeros beyond EOF. What to do???
*/
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "eof file read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "eof file read failed")
memset((char*)buf + bytes_read, 0, (size_t)n);
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1362,7 +1358,7 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_write, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_write, FAIL)
/* check args */
assert(file);
@@ -1375,17 +1371,16 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
/* some numeric conversions */
if (H5FD_fphdf5_haddr_to_MPIOff(addr, &mpi_off) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL,
- "can't convert from haddr to MPI off");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off")
size_i = (int)size;
if ((hsize_t)size_i != size)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i")
/* Obtain the data transfer properties */
if ((plist = H5I_object(dxpl_id)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
#if 0
/* Metadata specific actions */
@@ -1404,17 +1399,17 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
if (H5P_exist_plist(plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME) > 0)
if (H5P_get(plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME,
&block_before_meta_write) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get H5AC property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get H5AC property")
if (block_before_meta_write)
if ((mrc = MPI_Barrier(file->barrier_comm)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc)
}
#endif /* 0 */
if (H5P_exist_plist(plist, H5FD_FPHDF5_XFER_DUMPING_METADATA) > 0)
if (H5P_get(plist, H5FD_FPHDF5_XFER_DUMPING_METADATA, &dumping) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
/*
* If metadata, write to the metadata cache but only if we're not
@@ -1437,9 +1432,9 @@ HDfprintf(stderr, "%s:%d: Couldn't write metadata to SAP (%d)\n",
/* WAH-HOO! We've written it! We can leave now */
/* Forget the EOF value (see H5FD_fphdf5_get_eof()) */
file->eof = HADDR_UNDEF;
- HGOTO_DONE(ret_value);
+ HGOTO_DONE(ret_value)
case H5FP_STATUS_FILE_CLOSING:
- HGOTO_DONE(ret_value);
+ HGOTO_DONE(ret_value)
case H5FP_STATUS_DUMPING_FAILED:
case H5FP_STATUS_OOM:
case H5FP_STATUS_BAD_FILE_ID:
@@ -1455,7 +1450,7 @@ HDfprintf(stderr, "%s: Couldn't write metadata to SAP (%d)\n",
ret_value = H5FD_fphdf5_write_real(_file, dxpl_id, mpi_off, size_i, buf);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1486,7 +1481,7 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_INDEPENDENT;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_write_real, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_write_real, FAIL)
/* check args */
assert(file);
@@ -1502,7 +1497,7 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/* Obtain the data transfer properties */
if ((plist = H5I_object(dxpl_id)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
/*
* Set up for a fancy xfer using complex types, or single byte block.
@@ -1512,7 +1507,7 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
*/
if (H5P_exist_plist(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME) > 0)
if (H5P_get(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME, &use_view_this_time) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
if (use_view_this_time) {
@@ -1520,10 +1515,10 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/* Prepare for a full-blown xfer using btype, ftype, and disp */
if (H5P_get(plist, H5FD_FPHDF5_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
if (H5P_get(plist, H5FD_FPHDF5_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
/*
* When using types, use the address as the displacement for
@@ -1536,7 +1531,7 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
if ((mrc = MPI_File_set_view(file->f, mpi_disp, MPI_BYTE,
file_type, H5FD_mpio_native,
file->info)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc)
} else {
/*
* Prepare for a simple xfer of a contiguous block of bytes. The
@@ -1558,19 +1553,19 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/*OKAY: CAST DISCARDS CONST QUALIFIER*/
if ((mrc = MPI_File_write_at(file->f, mpi_off, (void*)buf,
size, buf_type, &status)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mrc)
} else {
/*OKAY: CAST DISCARDS CONST QUALIFIER*/
if ((mrc = MPI_File_write_at_all(file->f, mpi_off, (void*)buf,
size, buf_type, &status)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mrc)
}
/* Reset the file view when we used MPI derived types */
if (use_view_this_time)
if ((mrc = MPI_File_set_view(file->f, (MPI_Offset)0, MPI_BYTE, MPI_BYTE,
H5FD_mpio_native, file->info)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc)
/*
* MPI_Get_count incorrectly returns negative count; fake a complete
@@ -1580,13 +1575,13 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/* Check for write failure */
if (bytes_written < 0 || bytes_written > size)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file write failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file write failed")
/* Forget the EOF value (see H5FD_fphdf5_get_eof()) */
file->eof = HADDR_UNDEF;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1610,7 +1605,7 @@ H5FD_fphdf5_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
H5FP_status_t status = H5FP_STATUS_OK;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_flush, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_flush, FAIL)
/* check args */
assert(file);
@@ -1625,12 +1620,11 @@ H5FD_fphdf5_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
*/
if (file->eoa > file->last_eoa) {
if (H5FD_fphdf5_haddr_to_MPIOff(file->eoa, &mpi_off) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL,
- "cannot convert from haddr_t to MPI_Offset");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset")
/* Extend the file's size */
if ((mrc = MPI_File_set_size(file->f, mpi_off)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mrc)
/*
* Don't let any proc return until all have extended the file.
@@ -1640,7 +1634,7 @@ H5FD_fphdf5_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
* the file and dropping the new data written)
*/
if ((mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc)
/* Update the 'last' eoa value */
file->last_eoa = file->eoa;
@@ -1657,11 +1651,11 @@ HDfprintf(stderr, "%s:%d: Flush failed (%d)\n", FUNC, __LINE__, status);
/* Only sync the file if we are not going to immediately close it */
if (!closing)
if ((mrc = MPI_File_sync(file->f)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_sync failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_sync failed", mrc)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1680,9 +1674,9 @@ H5FD_fphdf5_MPIOff_to_haddr(MPI_Offset mpi_off)
{
haddr_t ret_value;
- FUNC_ENTER_NOINIT(H5FD_fphdf5_MPIOff_to_haddr);
+ FUNC_ENTER_NOINIT(H5FD_fphdf5_MPIOff_to_haddr)
ret_value = (mpi_off != (MPI_Offset)(haddr_t)mpi_off ? HADDR_UNDEF : (haddr_t)mpi_off);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1702,13 +1696,13 @@ H5FD_fphdf5_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off)
{
herr_t ret_value = FAIL;
- FUNC_ENTER_NOINIT(H5FD_fphdf5_haddr_to_MPIOff);
+ FUNC_ENTER_NOINIT(H5FD_fphdf5_haddr_to_MPIOff)
if (mpi_off)
*mpi_off = (MPI_Offset)addr;
ret_value = (addr != (haddr_t)(MPI_Offset)addr ? FAIL : SUCCEED);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /* H5_HAVE_FPHDF5 */