Commit df552265 authored by gsell's avatar gsell

debug output added to MPI wrapper and some small fixes

parent ffe7b30b
......@@ -81,7 +81,7 @@ h5_read_attrib (
if (mode != H5_ATTRIB_FILE) CHECK_TIMEGROUP( f );
hid_t id;
hid_t id = 0;
TRY (get_hdf5_obj_id(f, mode, &id));
TRY (h5priv_read_attrib (id, attrib_name, attrib_type, attrib_value));
H5_CORE_API_RETURN (H5_SUCCESS);
......@@ -161,7 +161,7 @@ h5_write_attrib (
if (mode != H5_ATTRIB_FILE) CHECK_TIMEGROUP( f );
CHECK_WRITABLE_MODE( f );
hid_t id;
hid_t id = 0;
TRY (get_hdf5_obj_id(f, mode, &id));
TRY (h5priv_write_attrib (id, attrib_name, attrib_type,
attrib_value, attrib_nelem));
......@@ -245,7 +245,7 @@ h5_get_attrib_info (
if (mode != H5_ATTRIB_FILE) CHECK_TIMEGROUP( f );
hid_t id;
hid_t id = 0;
TRY (get_hdf5_obj_id(f, mode, &id));
TRY (h5priv_get_attrib_info (id, attrib_idx, attrib_name, len_attrib_name,
attrib_type, attrib_nelem));
......@@ -267,7 +267,7 @@ h5_get_num_attribs (
H5_CORE_API_ENTER2 (h5_ssize_t,
"f=%p, mode=%d", f, mode);
if (mode != H5_ATTRIB_FILE) CHECK_TIMEGROUP( f );
hid_t id;
hid_t id = 0;
TRY (get_hdf5_obj_id(f, mode, &id));
H5_CORE_API_RETURN (hdf5_get_num_attribute (id));
}
......
......@@ -81,6 +81,22 @@
#define MALLOC_WRAPPER_LEAVE(value) __FUNC_LEAVE(value)
#define MALLOC_WRAPPER_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_MALLOC)
#define MPI_WRAPPER_ENTER(type) __FUNC_ENTER(type)
#define MPI_WRAPPER_ENTER0(type) \
__FUNC_ENTER0(type, H5_DEBUG_MPI)
#define MPI_WRAPPER_ENTER1(type, fmt, a1) \
__FUNC_ENTER1(type, fmt, a1, H5_DEBUG_MPI)
#define MPI_WRAPPER_ENTER2(type, fmt, a1, a2) \
__FUNC_ENTER2(type, fmt, a1, a2, H5_DEBUG_MPI)
#define MPI_WRAPPER_ENTER3(type, fmt, a1, a2, a3) \
__FUNC_ENTER3(type, fmt, a1, a2, a3, H5_DEBUG_MPI)
#define MPI_WRAPPER_ENTER4(type, fmt, a1, a2, a3, a4) \
__FUNC_ENTER4(type, fmt, a1, a2, a3, a4, H5_DEBUG_MPI)
#define MPI_WRAPPER_ENTER5(type, fmt, a1, a2, a3, a4, a5) \
__FUNC_ENTER5(type, fmt, a1, a2, a3, a4, a5, H5_DEBUG_MPI)
#define MPI_WRAPPER_LEAVE(value) __FUNC_LEAVE(value)
#define MPI_WRAPPER_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_MPI)
/* WARNING! Changing these values will alter the data model and introduce
* file incompatibilities with previous versions. */
#define H5_DATANAME_LEN 64
......
......@@ -12,6 +12,9 @@ h5priv_mpi_recv(
const int tag,
const MPI_Comm comm
) {
MPI_WRAPPER_ENTER4 (h5_err_t,
"buf=0x%p, count=%d, type=?, from=%d, tag=%d, comm=?",
buf, count, from, tag);
int err = MPI_Recv(
buf,
count,
......@@ -22,8 +25,8 @@ h5priv_mpi_recv(
MPI_STATUS_IGNORE
);
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot receive data");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot receive data"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
......@@ -35,6 +38,9 @@ h5priv_mpi_send(
const int tag,
const MPI_Comm comm
) {
MPI_WRAPPER_ENTER4 (h5_err_t,
"buf=0x%p, count=%d, type=?, to=%d, tag=%d, comm=?",
buf, count, to, tag);
int err = MPI_Send(
buf,
count,
......@@ -44,8 +50,8 @@ h5priv_mpi_send(
comm
);
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot send data");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot send data"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
......@@ -56,6 +62,9 @@ h5priv_mpi_bcast (
const int root,
const MPI_Comm comm
) {
MPI_WRAPPER_ENTER3 (h5_err_t,
"buf=0x%p, count=%d, type=?, root=%d, comm=?",
buf, count, root);
int err = MPI_Bcast(
buf,
count,
......@@ -64,8 +73,8 @@ h5priv_mpi_bcast (
comm
);
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot perform broadcast");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform broadcast"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
......@@ -78,6 +87,9 @@ h5priv_mpi_sum (
const MPI_Datatype type,
const MPI_Comm comm
) {
MPI_WRAPPER_ENTER3 (h5_err_t,
"sendbuf=0x%p, recvbuf=0x%p, count=%d, type=?, comm=?",
sendbuf, recvbuf, count);
int err = MPI_Allreduce(
sendbuf,
recvbuf,
......@@ -87,8 +99,8 @@ h5priv_mpi_sum (
comm
);
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot perform sum reduction");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform sum reduction"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
......@@ -99,6 +111,9 @@ h5priv_mpi_prefix_sum (
const MPI_Datatype type,
const MPI_Comm comm
) {
MPI_WRAPPER_ENTER3 (h5_err_t,
"sendbuf=0x%p, recvbuf=0x%p, count=%d, type=?, comm=?",
sendbuf, recvbuf, count);
int err = MPI_Scan(
sendbuf,
recvbuf,
......@@ -108,8 +123,8 @@ h5priv_mpi_prefix_sum (
comm
);
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot perform prefix sum");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform prefix sum"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
......@@ -122,6 +137,9 @@ h5priv_mpi_allgather (
const MPI_Datatype recvtype,
const MPI_Comm comm
) {
MPI_WRAPPER_ENTER4 (h5_err_t,
"sendbuf=0x%p, sendcount=%d, sendtype=?, recvbuf=0x%p, recvcount=%d, recvtype=?, comm=?",
sendbuf, sendcount, recvbuf, recvcount);
int err = MPI_Allgather (
sendbuf,
sendcount,
......@@ -131,8 +149,8 @@ h5priv_mpi_allgather (
recvtype,
comm);
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot gather data");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot gather data"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
......@@ -140,10 +158,12 @@ h5priv_mpi_comm_size (
MPI_Comm comm,
int* size
) {
MPI_WRAPPER_ENTER1 (h5_err_t,
"comm=?, size=0x%p", size);
int err = MPI_Comm_size (comm, size);
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot get communicator size");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot get communicator size"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
......@@ -152,10 +172,12 @@ h5priv_mpi_comm_rank (
MPI_Comm comm,
int* rank
) {
MPI_WRAPPER_ENTER1 (h5_err_t,
"comm=?, rank=0x%p", rank);
int err = MPI_Comm_rank (comm, rank);
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot get this task's rank");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot get this task's rank"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
......@@ -164,24 +186,26 @@ h5priv_mpi_type_contiguous (
const MPI_Datatype oldtype,
MPI_Datatype *const newtype
) {
MPI_WRAPPER_ENTER1 (h5_err_t, "nelems=%lu, oldtype=?, newtype=?", (long unsigned)nelems);
int err;
err = MPI_Type_contiguous ( nelems, oldtype, newtype );
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot create new MPI type");
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot create new MPI type"));
err = MPI_Type_commit ( newtype );
if (err != MPI_SUCCESS)
return h5_error (H5_ERR_MPI, "Cannot commit new MPI type");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot commit new MPI type"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
h5priv_mpi_type_free (
MPI_Datatype *type
) {
MPI_WRAPPER_ENTER1 (h5_err_t, "type=0x%p", type);
int err = MPI_Type_free( type );
if (err != MPI_SUCCESS)
return h5_error(H5_ERR_MPI, "Cannot free MPI type");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error(H5_ERR_MPI, "Cannot free MPI type"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
......@@ -193,11 +217,13 @@ h5priv_mpi_cart_create (
int reorder,
MPI_Comm *new_comm
) {
MPI_WRAPPER_ENTER5 (h5_err_t, "old_comm=?, ndims=%d, dims=0x%p, period=0x%p, reorder=%d, new_comm=0x%p",
ndims, dims, period, reorder, new_comm);
int err = MPI_Cart_create(
old_comm, ndims, dims, period, reorder, new_comm);
if (err != MPI_SUCCESS)
return h5_error(H5_ERR_MPI, "Cannot create cartesian grid");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error(H5_ERR_MPI, "Cannot create cartesian grid"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
h5_err_t
......@@ -207,10 +233,12 @@ h5priv_mpi_cart_coords (
int maxdim,
int *coords
) {
MPI_WRAPPER_ENTER3 (h5_err_t, "comm=?, rank=%d, maxdim=%d, coords=0x%p",
rank, maxdim, coords);
int err = MPI_Cart_coords( comm, rank, maxdim, coords );
if (err != MPI_SUCCESS)
return h5_error(H5_ERR_MPI, "Cannot create cartesian grid");
return H5_SUCCESS;
MPI_WRAPPER_LEAVE (h5_error(H5_ERR_MPI, "Cannot create cartesian grid"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
}
#endif // PARALLEL_IO
......
......@@ -13,8 +13,10 @@ extern "C" {
#define H5_DEBUG_PRIV_API (1<<5)
#define H5_DEBUG_PRIV_FUNC (1<<6)
#define H5_DEBUG_HDF5 (1<<7)
#define H5_DEBUG_MALLOC (1<<8)
#define H5_DEBUG_CLIB (1<<9)
#define H5_DEBUG_MPI (1<<8)
#define H5_DEBUG_MALLOC (1<<9)
#define H5_DEBUG_CLIB (1<<10)
#define H5_DEBUG_ALL (-1)
extern char* h5_rfmts[];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment