Skip to content

Commit

Permalink
Fixes parallel issues from recent C99 changes (#809)
Browse files Browse the repository at this point in the history
* Fixes parallel issues from recent C99 changes

* Adds MPE FUNC --> __func__ changes missed in earlier PRs

* Even more missed FUNC --> __func__ macros
  • Loading branch information
derobins authored Jun 30, 2021
1 parent 858a2b2 commit f0e0c7e
Show file tree
Hide file tree
Showing 29 changed files with 486 additions and 474 deletions.
8 changes: 4 additions & 4 deletions doxygen/examples/ThreadSafeLibrary.html
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ <h2>E.3 <code>H5_API_UNSET_CANCEL</code></h2>
<blockquote>
<pre>
#define H5_API_UNSET_CANCEL \
if (H5_IS_API(FUNC)) { \
if (H5_IS_API(__func__)) { \
H5_cancel_count_inc(); \
}
</pre>
Expand All @@ -721,7 +721,7 @@ <h2>E.4 <code>H5_API_LOCK_BEGIN</code></h2>
<blockquote>
<pre>
#define H5_API_LOCK_BEGIN \
if (H5_IS_API(FUNC)) { \
if (H5_IS_API(__func__)) { \
H5_mutex_lock(&amp;H5_g.init_lock);
</pre>
</blockquote>
Expand Down Expand Up @@ -755,7 +755,7 @@ <h2>E.7 <code>H5_API_UNLOCK_BEGIN</code></h2>
<blockquote>
<pre>
#define H5_API_UNLOCK_BEGIN \
if (H5_IS_API(FUNC)) { \
if (H5_IS_API(__func__)) { \
H5_mutex_unlock(&amp;H5_g.init_lock);
</pre>
</blockquote>
Expand All @@ -774,7 +774,7 @@ <h2>E.9 <code>H5_API_SET_CANCEL</code></h2>
<blockquote>
<pre>
#define H5_API_SET_CANCEL \
if (H5_IS_API(FUNC)) { \
if (H5_IS_API(__func__)) { \
H5_cancel_count_dec(); \
}
</pre>
Expand Down
10 changes: 5 additions & 5 deletions src/H5Cmpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
HDmemset(entries_to_clear, 0, sizeof(entries_to_clear));

#if H5C_APPLY_CANDIDATE_LIST__DEBUG
HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", FUNC, mpi_rank);
HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", __func__, mpi_rank);

HDmemset(tbl_buf, 0, sizeof(tbl_buf));

Expand Down Expand Up @@ -272,10 +272,10 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);

HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", FUNC, mpi_rank, first_entry_to_flush,
HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", __func__, mpi_rank, first_entry_to_flush,
last_entry_to_flush);

HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank);
HDfprintf(stdout, "%s:%d: marking entries.\n", __func__, mpi_rank);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */

for (u = 0; u < num_candidates; u++) {
Expand Down Expand Up @@ -353,8 +353,8 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
#endif /* H5C_DO_SANITY_CHECKS */

#if H5C_APPLY_CANDIDATE_LIST__DEBUG
HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", FUNC, mpi_rank, num_candidates,
total_entries_to_clear, total_entries_to_flush);
HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", __func__, mpi_rank,
num_candidates, total_entries_to_clear, total_entries_to_flush);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */

/* We have now marked all the entries on the candidate list for
Expand Down
8 changes: 4 additions & 4 deletions src/H5FAdblkpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts)
FUNC_ENTER_PACKAGE

#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr);
HDfprintf(stderr, "%s: Called, addr = %a\n", __func__, addr);
#endif /* H5FA_DEBUG */

/* Sanity check */
Expand All @@ -162,7 +162,7 @@ H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts)
dblk_page->addr = addr;
dblk_page->size = H5FA_DBLK_PAGE_SIZE(hdr, nelmts);
#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size);
HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", __func__, dblk_page->size);
#endif /* H5FA_DEBUG */

/* Clear any elements in data block page to fill value */
Expand Down Expand Up @@ -223,7 +223,7 @@ H5FA__dblk_page_protect(H5FA_hdr_t *hdr, haddr_t dblk_page_addr, size_t dblk_pag
FUNC_ENTER_PACKAGE

#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: Called\n", FUNC);
HDfprintf(stderr, "%s: Called\n", __func__);
#endif /* H5FA_DEBUG */

/* Sanity check */
Expand Down Expand Up @@ -293,7 +293,7 @@ H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, unsigned cache_flags)
FUNC_ENTER_PACKAGE

#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: Called\n", FUNC);
HDfprintf(stderr, "%s: Called\n", __func__);
#endif /* H5FA_DEBUG */

/* Sanity check */
Expand Down
2 changes: 1 addition & 1 deletion src/H5FAstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ H5FA_get_stats(const H5FA_t *fa, H5FA_stat_t *stats)
FUNC_ENTER_NOAPI_NOERR

#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: Called\n", FUNC);
HDfprintf(stderr, "%s: Called\n", __func__);
#endif /* H5FA_DEBUG */

/* Check arguments */
Expand Down
36 changes: 18 additions & 18 deletions src/H5FDhdfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ H5FD_hdfs_init(void)
FUNC_ENTER_NOAPI(H5I_INVALID_HID)

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

if (H5I_VFL != H5I_get_type(H5FD_HDFS_g))
Expand Down Expand Up @@ -406,7 +406,7 @@ H5FD__hdfs_term(void)
FUNC_ENTER_STATIC_NOERR

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

/* Reset VFL ID */
Expand Down Expand Up @@ -440,7 +440,7 @@ H5FD__hdfs_handle_open(const char *path, const char *namenode_name, const int32_
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

if (path == NULL || path[0] == '\0')
Expand Down Expand Up @@ -525,7 +525,7 @@ H5FD__hdfs_handle_close(hdfs_t *handle)
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

if (handle == NULL)
Expand Down Expand Up @@ -616,7 +616,7 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa)
HDassert(fa != NULL);

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
Expand Down Expand Up @@ -657,7 +657,7 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_dst /*out*/)
H5TRACE2("e", "ix", fapl_id, fa_dst);

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

if (fa_dst == NULL)
Expand Down Expand Up @@ -814,7 +814,7 @@ hdfs__reset_stats(H5FD_hdfs_t *file)
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

if (file == NULL)
Expand Down Expand Up @@ -872,7 +872,7 @@ H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif /* HDFS_DEBUG */

/* Sanity check on file offsets */
Expand Down Expand Up @@ -1210,7 +1210,7 @@ H5FD__hdfs_close(H5FD_t *_file)
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

/* Sanity checks */
Expand Down Expand Up @@ -1266,7 +1266,7 @@ H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
FUNC_ENTER_STATIC_NOERR

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif /* HDFS_DEBUG */

HDassert(f1->hdfs_handle != NULL);
Expand Down Expand Up @@ -1339,7 +1339,7 @@ H5FD__hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
FUNC_ENTER_STATIC_NOERR

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

if (flags) {
Expand Down Expand Up @@ -1377,7 +1377,7 @@ H5FD__hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_STATIC_NOERR

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

FUNC_LEAVE_NOAPI(file->eoa)
Expand Down Expand Up @@ -1408,7 +1408,7 @@ H5FD__hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
FUNC_ENTER_STATIC_NOERR

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

file->eoa = addr;
Expand Down Expand Up @@ -1442,7 +1442,7 @@ H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_STATIC_NOERR

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

HDassert(file->hdfs_handle != NULL);
Expand Down Expand Up @@ -1477,7 +1477,7 @@ H5FD__hdfs_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_hand
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif /* HDFS_DEBUG */

if (!file_handle)
Expand Down Expand Up @@ -1527,7 +1527,7 @@ H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif /* HDFS_DEBUG */

HDassert(file != NULL);
Expand Down Expand Up @@ -1599,7 +1599,7 @@ H5FD__hdfs_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, h
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file")
Expand Down Expand Up @@ -1637,7 +1637,7 @@ H5FD__hdfs_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id,
FUNC_ENTER_STATIC

#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
HDfprintf(stdout, "called %s.\n", __func__);
#endif

HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file")
Expand Down
Loading

0 comments on commit f0e0c7e

Please sign in to comment.