Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes parallel issues from recent C99 changes #809

Merged
merged 3 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions src/H5FDmpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag)

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif

/* set atomicity value */
Expand All @@ -711,7 +711,7 @@ H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag)
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif

FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -744,7 +744,7 @@ H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag)

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif

/* Get atomicity value */
Expand All @@ -759,7 +759,7 @@ H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag)
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif

FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -825,7 +825,7 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR
(H5FD_mpio_debug_rank_s < 0 || H5FD_mpio_debug_rank_s == mpi_rank));
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Entering - name = \"%s\", flags = 0x%x, fapl_id = %d, maxaddr = %lu\n",
FUNC, mpi_rank, name, flags, (int)fapl_id, (unsigned long)maxaddr);
__func__, mpi_rank, name, flags, (int)fapl_id, (unsigned long)maxaddr);
#endif

/* Convert HDF5 flags to MPI-IO flags */
Expand Down Expand Up @@ -905,7 +905,7 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, mpi_rank);
HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, mpi_rank);
#endif

FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -938,7 +938,7 @@ H5FD__mpio_close(H5FD_t *_file)

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif

/* Sanity checks */
Expand All @@ -957,7 +957,7 @@ H5FD__mpio_close(H5FD_t *_file)
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, mpi_rank);
HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, mpi_rank);
#endif

FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -1177,7 +1177,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif

/* Sanity checks */
Expand Down Expand Up @@ -1239,7 +1239,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_r_flag)
HDfprintf(stderr, "%s: (%d) using MPIO collective mode\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) using MPIO collective mode\n", __func__, file->mpi_rank);
#endif
/* Get the collective_opt property to check whether the application wants to do IO individually. */
if (H5CX_get_mpio_coll_opt(&coll_opt_mode) < 0)
Expand All @@ -1248,13 +1248,13 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
if (coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) {
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_r_flag)
HDfprintf(stderr, "%s: (%d) doing MPI collective IO\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) doing MPI collective IO\n", __func__, file->mpi_rank);
#endif
/* Check whether we should read from rank 0 and broadcast to other ranks */
if (H5CX_get_mpio_rank0_bcast()) {
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_r_flag)
HDfprintf(stderr, "%s: (%d) doing read-rank0-and-MPI_Bcast\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) doing read-rank0-and-MPI_Bcast\n", __func__, file->mpi_rank);
#endif
/* Indicate path we've taken */
rank0_bcast = TRUE;
Expand All @@ -1276,7 +1276,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
else {
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_r_flag)
HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", __func__, file->mpi_rank);
#endif

/* Perform independent read operation */
Expand All @@ -1295,7 +1295,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
else {
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_r_flag)
HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", __func__, file->mpi_rank);
#endif

/* Perform independent read operation */
Expand Down Expand Up @@ -1345,8 +1345,8 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_r_flag)
HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_read = %lld\n", FUNC, file->mpi_rank, (long)mpi_off,
bytes_read);
HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_read = %lld\n", __func__, file->mpi_rank,
(long)mpi_off, bytes_read);
#endif

/*
Expand All @@ -1358,7 +1358,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif

FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -1417,7 +1417,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif

/* Sanity checks */
Expand Down Expand Up @@ -1489,7 +1489,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_w_flag)
HDfprintf(stderr, "%s: (%d) using MPIO collective mode\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) using MPIO collective mode\n", __func__, file->mpi_rank);
#endif

/* Get the collective_opt property to check whether the application wants to do IO individually. */
Expand All @@ -1499,7 +1499,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
if (coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) {
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_w_flag)
HDfprintf(stderr, "%s: (%d) doing MPI collective IO\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) doing MPI collective IO\n", __func__, file->mpi_rank);
#endif
/* Perform collective write operation */
if (MPI_SUCCESS !=
Expand All @@ -1513,7 +1513,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_w_flag)
HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", __func__, file->mpi_rank);
#endif
/* Perform independent write operation */
if (MPI_SUCCESS !=
Expand All @@ -1529,7 +1529,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
else {
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_w_flag)
HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", __func__, file->mpi_rank);
#endif

/* Perform independent write operation */
Expand Down Expand Up @@ -1562,7 +1562,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_w_flag)
HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_written = %lld\n", FUNC, file->mpi_rank,
HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_written = %lld\n", __func__, file->mpi_rank,
(long)mpi_off, bytes_written);
#endif

Expand All @@ -1583,7 +1583,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Leaving: ret_value = %d\n", FUNC, file->mpi_rank, ret_value);
HDfprintf(stderr, "%s: (%d) Leaving: ret_value = %d\n", __func__, file->mpi_rank, ret_value);
#endif

FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -1615,7 +1615,7 @@ H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif

/* Sanity checks */
Expand All @@ -1630,7 +1630,7 @@ H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif

FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -1672,7 +1672,7 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR

#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif

/* Sanity checks */
Expand Down Expand Up @@ -1741,7 +1741,7 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR
done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_t_flag)
HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank);
HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif

FUNC_LEAVE_NOAPI(ret_value)
Expand Down
16 changes: 8 additions & 8 deletions src/H5Smpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
rank = sel_iter.u.hyp.iter_rank;
#ifdef H5S_DEBUG
if (H5DEBUG(S))
HDfprintf(H5DEBUG(S), "%s: Flattened selection\n", FUNC);
HDfprintf(H5DEBUG(S), "%s: Flattened selection\n", __func__);
#endif
for (u = 0; u < rank; ++u) {
H5_CHECK_OVERFLOW(diminfo[u].start, hsize_t, hssize_t)
Expand All @@ -700,7 +700,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
HDfprintf(H5DEBUG(S),
"%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE
" block=%" PRIuHSIZE " xtent=%" PRIuHSIZE,
FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
__func__, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
if (u == 0)
HDfprintf(H5DEBUG(S), " rank=%u\n", rank);
else
Expand All @@ -719,7 +719,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
rank = space->extent.rank;
#ifdef H5S_DEBUG
if (H5DEBUG(S))
HDfprintf(H5DEBUG(S), "%s: Non-flattened selection\n", FUNC);
HDfprintf(H5DEBUG(S), "%s: Non-flattened selection\n", __func__);
#endif
for (u = 0; u < rank; ++u) {
H5_CHECK_OVERFLOW(diminfo[u].start, hsize_t, hssize_t)
Expand All @@ -734,7 +734,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
HDfprintf(H5DEBUG(S),
"%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE
" block=%" PRIuHSIZE " xtent=%" PRIuHSIZE,
FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
__func__, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
if (u == 0)
HDfprintf(H5DEBUG(S), " rank=%u\n", rank);
else
Expand Down Expand Up @@ -783,7 +783,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
*******************************************************/
#ifdef H5S_DEBUG
if (H5DEBUG(S)) {
HDfprintf(H5DEBUG(S), "%s: Making contig type %zu MPI_BYTEs\n", FUNC, elmt_size);
HDfprintf(H5DEBUG(S), "%s: Making contig type %zu MPI_BYTEs\n", __func__, elmt_size);
for (i = ((int)rank) - 1; i >= 0; --i)
HDfprintf(H5DEBUG(S), "d[%d].xtent=%" PRIuHSIZE "\n", i, d[i].xtent);
}
Expand Down Expand Up @@ -817,12 +817,12 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
"%s: Dimension i=%d \n"
"start=%" PRIdHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE " stride=%" PRIuHSIZE
", xtent=%" PRIuHSIZE " max_xtent=%" PRIuHSIZE "\n",
FUNC, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]);
__func__, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]);
#endif

#ifdef H5S_DEBUG
if (H5DEBUG(S))
HDfprintf(H5DEBUG(S), "%s: i=%d Making vector-type \n", FUNC, i);
HDfprintf(H5DEBUG(S), "%s: i=%d Making vector-type \n", __func__, i);
#endif
/****************************************
* Build vector type of the selection.
Expand Down Expand Up @@ -957,7 +957,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new

#ifdef H5S_DEBUG
if (H5DEBUG(S))
HDfprintf(H5DEBUG(S), "Leave %s, count=%d is_derived_type=%s\n", FUNC, *count,
HDfprintf(H5DEBUG(S), "Leave %s, count=%d is_derived_type=%s\n", __func__, *count,
(*is_derived_type) ? "TRUE" : "FALSE");
#endif
FUNC_LEAVE_NOAPI(ret_value)
Expand Down
18 changes: 9 additions & 9 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
#define eventa(func_name) h5_mpe_eventa
#define eventb(func_name) h5_mpe_eventb
#define MPE_LOG_VARS \
static int eventa(FUNC) = -1; \
static int eventb(FUNC) = -1; \
static int eventa(__func__) = -1; \
static int eventb(__func__) = -1; \
char p_event_start[128];

/* Hardwire the color to "red", since that's what all the routines are using
Expand All @@ -163,14 +163,14 @@
*/
#define BEGIN_MPE_LOG \
if (H5_MPEinit_g) { \
sprintf(p_event_start, "start %s", FUNC); \
if (eventa(FUNC) == -1 && eventb(FUNC) == -1) { \
sprintf(p_event_start, "start %s", __func__); \
if (eventa(__func__) == -1 && eventb(__func__) == -1) { \
const char *p_color = "red"; \
eventa(FUNC) = MPE_Log_get_event_number(); \
eventb(FUNC) = MPE_Log_get_event_number(); \
MPE_Describe_state(eventa(FUNC), eventb(FUNC), FUNC, p_color); \
eventa(__func__) = MPE_Log_get_event_number(); \
eventb(__func__) = MPE_Log_get_event_number(); \
MPE_Describe_state(eventa(__func__), eventb(__func__), __func__, p_color); \
} \
MPE_Log_event(eventa(FUNC), 0, p_event_start); \
MPE_Log_event(eventa(__func__), 0, p_event_start); \
}

/*------------------------------------------------------------------------
Expand All @@ -181,7 +181,7 @@
*/
#define FINISH_MPE_LOG \
if (H5_MPEinit_g) { \
MPE_Log_event(eventb(FUNC), 0, FUNC); \
MPE_Log_event(eventb(__func__), 0, __func__); \
}

#else /* H5_HAVE_MPE */
Expand Down
4 changes: 2 additions & 2 deletions testpar/t_bigio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ main(int argc, char **argv)
HDprintf("Failed to turn off atexit processing. Continue.\n");

/* set alarm. */
ALARM_ON;
TestAlarmOn();

dataset_big_write();
MPI_Barrier(MPI_COMM_WORLD);
Expand All @@ -1878,7 +1878,7 @@ main(int argc, char **argv)
single_rank_independent_io();

/* turn off alarm */
ALARM_OFF;
TestAlarmOff();

if (mpi_rank_g == 0)
HDremove(FILENAME[0]);
Expand Down
Loading