From f75ef09cf9c265f8e60f700a6240734c48888aba Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 17 Jun 2016 13:50:07 +0200 Subject: [PATCH] consolidation of log/debug message interface --- src/C/Makefile.am | 1 - src/Fortran/H5.c | 6 +- src/Fortran/H5Block_attribs.c | 2 +- src/Fortran/H5Block_io.c | 2 +- src/Fortran/H5Block_model.c | 2 +- src/Fortran/H5Part_io.c | 2 +- src/Fortran/H5Part_model.c | 2 +- src/Fortran/H5_attribs.c | 2 +- src/Fortran/H5_model.c | 2 +- src/Fortran/Makefile.am | 1 - src/h5core/Makefile.am | 6 +- src/h5core/h5_attribs.c | 2 +- src/h5core/h5_err.c | 8 +-- src/h5core/h5_file.c | 4 +- src/h5core/{h5_debug.c => h5_log.c} | 14 ++-- src/h5core/h5b_attribs.c | 2 +- src/h5core/h5t_adjacencies.c | 2 +- src/h5core/h5t_io.c | 12 ++-- src/h5core/h5t_model.c | 2 +- src/h5core/h5t_retrieve.c | 2 +- src/h5core/h5u_model.c | 2 +- src/h5core/private/h5_file.h | 2 +- src/h5core/private/h5_hdf5.h | 2 +- src/h5core/private/h5_hsearch.c | 2 +- src/h5core/private/{h5_debug.h => h5_log.h} | 2 +- src/h5core/private/h5_lustre.c | 2 +- src/h5core/private/h5_maps.h | 4 +- src/h5core/private/h5_mpi.h | 2 +- src/h5core/private/h5t_access_tetm.c | 2 +- src/h5core/private/h5t_access_trim.c | 2 +- src/h5core/private/h5t_adjacencies.h | 2 +- src/h5core/private/h5t_core_trim.c | 2 +- src/h5core/private/h5t_err.h | 2 +- src/h5core/private/h5t_map.h | 4 +- src/h5core/private/h5t_store_trim.c | 2 +- src/include/H5Block_attribs.h | 2 +- src/include/H5Block_io.h | 2 +- src/include/H5Block_model.h | 2 +- src/include/H5Fed_adjacency.h | 2 +- src/include/H5Fed_model.h | 2 +- src/include/H5Fed_retrieve.h | 2 +- src/include/H5Fed_store.h | 2 +- src/include/H5Fed_tags.h | 2 +- src/include/H5Part_io.h | 2 +- src/include/H5Part_model.h | 2 +- src/include/H5_attachments.h | 2 +- src/include/H5_debug.f90 | 45 ------------ src/include/H5_debug.h | 76 --------------------- src/include/H5_err.h | 2 +- src/include/H5_file.h | 2 +- src/include/H5_file_attribs.h | 2 +- src/include/H5_log.f90 | 36 ++++++++++ src/include/H5_log.h | 65 ++++++++++++++++-- src/include/H5_model.h | 2 +- src/include/H5_step_attribs.h | 2 +- src/include/H5hut.f90 | 1 - src/include/H5hut.h | 1 - src/include/h5core/Makefile.am | 8 +-- src/include/h5core/{h5_debug.h => h5_log.h} | 24 +++---- src/include/h5core/h5_syscall.h | 2 +- 60 files changed, 184 insertions(+), 216 deletions(-) rename src/h5core/{h5_debug.c => h5_log.c} (89%) rename src/h5core/private/{h5_debug.h => h5_log.h} (98%) delete mode 100644 src/include/H5_debug.f90 delete mode 100644 src/include/H5_debug.h rename src/include/h5core/{h5_debug.h => h5_log.h} (95%) diff --git a/src/C/Makefile.am b/src/C/Makefile.am index 165022f..5e90fb0 100644 --- a/src/C/Makefile.am +++ b/src/C/Makefile.am @@ -12,7 +12,6 @@ include_HEADERS = \ $(top_srcdir)/src/include/H5Part_io.h \ $(top_srcdir)/src/include/H5Part_model.h \ $(top_srcdir)/src/include/H5_attachments.h \ - $(top_srcdir)/src/include/H5_debug.h \ $(top_srcdir)/src/include/H5_err.h \ $(top_srcdir)/src/include/H5_file.h \ $(top_srcdir)/src/include/H5_file_attribs.h \ diff --git a/src/Fortran/H5.c b/src/Fortran/H5.c index 6bb2a5f..0002726 100644 --- a/src/Fortran/H5.c +++ b/src/Fortran/H5.c @@ -9,7 +9,7 @@ #include "h5_private.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_file.h" #include @@ -248,7 +248,7 @@ h5_set_verbosity_level ( ) { H5_API_ENTER (h5_int64_t, "level=%lld", (long long)*level); - H5_API_RETURN(h5_set_debuglevel (*level)); + H5_API_RETURN(h5_set_loglevel (*level)); } #define h5_abort_on_error FC_MANGLING( \ @@ -259,7 +259,7 @@ h5_abort_on_error ( void ) { H5_API_ENTER (h5_int64_t, "%s", ""); - h5_set_debuglevel (1); + h5_set_loglevel (1); H5_API_RETURN (h5_set_errorhandler (h5_abort_errorhandler)); } diff --git a/src/Fortran/H5Block_attribs.c b/src/Fortran/H5Block_attribs.c index 9381621..f6e99c5 100644 --- a/src/Fortran/H5Block_attribs.c +++ b/src/Fortran/H5Block_attribs.c @@ -8,7 +8,7 @@ */ #include "h5_private.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5b_attribs.h" #define H5_R8_T H5_FLOAT64 diff --git a/src/Fortran/H5Block_io.c b/src/Fortran/H5Block_io.c index 05756da..e0ad786 100644 --- a/src/Fortran/H5Block_io.c +++ b/src/Fortran/H5Block_io.c @@ -8,7 +8,7 @@ */ #include "h5_private.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5b_io.h" #define h5bl_3d_write_scalar_field_r8 FC_MANGLING ( \ diff --git a/src/Fortran/H5Block_model.c b/src/Fortran/H5Block_model.c index 320bfe3..b002554 100755 --- a/src/Fortran/H5Block_model.c +++ b/src/Fortran/H5Block_model.c @@ -8,7 +8,7 @@ */ #include "h5_private.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5b_model.h" #include "h5core/h5b_io.h" diff --git a/src/Fortran/H5Part_io.c b/src/Fortran/H5Part_io.c index d5b94af..2959ba6 100644 --- a/src/Fortran/H5Part_io.c +++ b/src/Fortran/H5Part_io.c @@ -8,7 +8,7 @@ */ #include "h5_private.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5u_io.h" diff --git a/src/Fortran/H5Part_model.c b/src/Fortran/H5Part_model.c index a02fd50..00997ef 100755 --- a/src/Fortran/H5Part_model.c +++ b/src/Fortran/H5Part_model.c @@ -8,7 +8,7 @@ */ #include "h5_private.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5u_model.h" #include "h5core/h5u_io.h" diff --git a/src/Fortran/H5_attribs.c b/src/Fortran/H5_attribs.c index ad51324..044dc1c 100644 --- a/src/Fortran/H5_attribs.c +++ b/src/Fortran/H5_attribs.c @@ -9,7 +9,7 @@ #include "h5_private.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_file_attribs.h" #include "h5core/h5_step_attribs.h" diff --git a/src/Fortran/H5_model.c b/src/Fortran/H5_model.c index e492246..a2bc991 100644 --- a/src/Fortran/H5_model.c +++ b/src/Fortran/H5_model.c @@ -9,7 +9,7 @@ #include "h5_private.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_model.h" /* H5hut data model */ diff --git a/src/Fortran/Makefile.am b/src/Fortran/Makefile.am index 7702569..d3ee2c5 100644 --- a/src/Fortran/Makefile.am +++ b/src/Fortran/Makefile.am @@ -9,7 +9,6 @@ F90_FILES = \ $(top_srcdir)/src/include/H5_model.f90 \ $(top_srcdir)/src/include/H5_file_attribs.f90 \ $(top_srcdir)/src/include/H5_step_attribs.f90 \ - $(top_srcdir)/src/include/H5_debug.f90 \ $(top_srcdir)/src/include/H5_err.f90 \ $(top_srcdir)/src/include/H5_log.f90 \ $(top_srcdir)/src/include/H5Part_model.f90 \ diff --git a/src/h5core/Makefile.am b/src/h5core/Makefile.am index c36fd6c..066b09d 100644 --- a/src/h5core/Makefile.am +++ b/src/h5core/Makefile.am @@ -34,7 +34,7 @@ EXTRA_HEADERS = \ private/h5u_io.h \ private/h5u_types.h \ private/h5_attribs.h \ - private/h5_debug.h \ + private/h5_log.h \ private/h5_err.h \ private/h5_fcmp.h @@ -48,8 +48,8 @@ lib_LTLIBRARIES = libH5hut.la libH5hut_la_SOURCES = \ h5_attachments.c \ h5_attribs.c \ - h5_debug.c \ - h5_errorhandling.c \ + h5_log.c \ + h5_err.c \ h5_init.c \ h5_model.c \ h5_file.c \ diff --git a/src/h5core/h5_attribs.c b/src/h5core/h5_attribs.c index 6a29f17..b87947f 100644 --- a/src/h5core/h5_attribs.c +++ b/src/h5core/h5_attribs.c @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "private/h5_hdf5.h" #include "private/h5_attribs.h" diff --git a/src/h5core/h5_err.c b/src/h5core/h5_err.c index a063a77..c5333a7 100644 --- a/src/h5core/h5_err.c +++ b/src/h5core/h5_err.c @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_err.h" #include "private/h5_init.h" @@ -103,7 +103,7 @@ h5_report_errorhandler ( const char* fmt, va_list ap ) { - if (h5_debug_level > 0) { + if (h5_log_level > 0) { h5_verror (fmt, ap); } return h5_errno; @@ -120,7 +120,7 @@ h5_abort_errorhandler ( const char* fmt, va_list ap ) { - if (h5_debug_level > 0) { + if (h5_log_level > 0) { h5_verror (fmt, ap); } #ifdef PARALLEL_IO @@ -178,6 +178,6 @@ h5_verror ( const char* fmt, va_list ap ) { - if (h5_debug_level == 0) return; + if (h5_log_level == 0) return; h5priv_vprintf (stderr, "E", h5_call_stack.entry[0].name, fmt, ap); } diff --git a/src/h5core/h5_file.c b/src/h5core/h5_file.c index 563b927..d1e0397 100644 --- a/src/h5core/h5_file.c +++ b/src/h5core/h5_file.c @@ -11,7 +11,7 @@ #include #include -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "private/h5_file.h" #include "private/h5_hdf5.h" @@ -67,7 +67,7 @@ hdf5_error_handler ( void* __f ) { UNUSED_ARGUMENT (__f); - if (h5_get_debuglevel() >= 5) { + if (h5_get_loglevel() >= 5) { H5Eprint (estack_id, stderr); } return 0; diff --git a/src/h5core/h5_debug.c b/src/h5core/h5_log.c similarity index 89% rename from src/h5core/h5_debug.c rename to src/h5core/h5_log.c index 89d20ca..c5b4940 100644 --- a/src/h5core/h5_debug.c +++ b/src/h5core/h5_log.c @@ -7,10 +7,10 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "private/h5_init.h" -h5_int32_t h5_debug_level = H5_VERBOSE_ERROR; +h5_int32_t h5_log_level = H5_VERBOSE_ERROR; struct call_stack h5_call_stack; char *h5_rfmts[] = { @@ -54,13 +54,13 @@ char *h5_rfmts[] = { \return \c H5_ERR_INVAL if debug level is invalid. */ h5_err_t -h5_set_debuglevel ( +h5_set_loglevel ( const h5_id_t level /*!< debug level */ ) { if (level < 0) - h5_debug_level = ((1 << 20) - 1) & ~0x7; + h5_log_level = ((1 << 20) - 1) & ~0x7; else - h5_debug_level = level; + h5_log_level = level; return H5_SUCCESS; } @@ -72,8 +72,8 @@ h5_set_debuglevel ( \return current debug level */ h5_err_t -h5_get_debuglevel ( +h5_get_loglevel ( void ) { - return h5_debug_level; + return h5_log_level; } diff --git a/src/h5core/h5b_attribs.c b/src/h5core/h5b_attribs.c index 1e50c70..e831ac6 100644 --- a/src/h5core/h5b_attribs.c +++ b/src/h5core/h5b_attribs.c @@ -6,7 +6,7 @@ License: see file COPYING in top level of source distribution. */ -#include "private/h5_debug.h" +#include "private/h5_log.h" #include "private/h5_file.h" #include "private/h5_hdf5.h" diff --git a/src/h5core/h5t_adjacencies.c b/src/h5core/h5t_adjacencies.c index 92237f3..f8a9dd7 100644 --- a/src/h5core/h5t_adjacencies.c +++ b/src/h5core/h5t_adjacencies.c @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "private/h5_file.h" #include "private/h5t_types.h" diff --git a/src/h5core/h5t_io.c b/src/h5core/h5t_io.c index 1fbc427..2123db7 100644 --- a/src/h5core/h5t_io.c +++ b/src/h5core/h5t_io.c @@ -2019,7 +2019,7 @@ distribute_octree_parmetis ( TRY (vtxdist = h5_calloc (m->f->nprocs+1, sizeof (*vtxdist))); vtxdist[0] = 0; #if !defined(NDEBUG) - if (h5_debug_level & (1<<5) ) { + if (h5_log_level & (1<<5) ) { h5_debug ("vtxdist[%d]: %d", 0, 0); } #endif @@ -2031,7 +2031,7 @@ distribute_octree_parmetis ( vtxdist[i] = vtxdist[i-1] + n; } #if !defined(NDEBUG) - if (h5_debug_level & (1<<5) ) { + if (h5_log_level & (1<<5) ) { h5_debug ("vtxdist[%d]: %d", i, vtxdist[i]); } #endif @@ -2067,7 +2067,7 @@ distribute_octree_parmetis ( } xadj[i+1] = xadj[i] + num_neigh; #if !defined(NDEBUG) - if (h5_debug_level & (1<<5) ) { + if (h5_log_level & (1<<5) ) { h5_debug ("xadj[%d]: %d", i+1, xadj[i+1]); } #endif @@ -2077,7 +2077,7 @@ distribute_octree_parmetis ( if (new_numbering[j] == neighbors[k]) { adjncy[counter] = j; #if !defined(NDEBUG) - if (h5_debug_level & (1<<5) ) { + if (h5_log_level & (1<<5) ) { h5_debug ("adjncy[%d]: %d", counter, adjncy[counter]); } #endif @@ -2145,7 +2145,7 @@ distribute_octree_parmetis ( TRY (h5_free (ubvec)); #if !defined(NDEBUG) - if (h5_debug_level & (1<<5) ) { + if (h5_log_level & (1<<5) ) { for (i = 0; i < num_interior_oct; i++) { h5_debug ("part[%d]: %llu", i, (unsigned long long)part[i]); } @@ -2633,7 +2633,7 @@ read_chunked_elements ( #if NDEBUG == 0 - if (h5_debug_level & (1<<6) ) { + if (h5_log_level & (1<<6) ) { sleep (m->f->myproc*2); for (int i = 0; i < num_interior_elems;i++) { h5_debug ("\n" diff --git a/src/h5core/h5t_model.c b/src/h5core/h5t_model.c index 0ff0fd9..62c3115 100644 --- a/src/h5core/h5t_model.c +++ b/src/h5core/h5t_model.c @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "private/h5_file.h" #include "private/h5_mpi.h" diff --git a/src/h5core/h5t_retrieve.c b/src/h5core/h5t_retrieve.c index 217f504..b05e727 100644 --- a/src/h5core/h5t_retrieve.c +++ b/src/h5core/h5t_retrieve.c @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "private/h5_file.h" diff --git a/src/h5core/h5u_model.c b/src/h5core/h5u_model.c index 30435e3..3e03421 100644 --- a/src/h5core/h5u_model.c +++ b/src/h5core/h5u_model.c @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5u_model.h" #include "h5core/h5u_io.h" diff --git a/src/h5core/private/h5_file.h b/src/h5core/private/h5_file.h index 4cdc0ec..0c46162 100644 --- a/src/h5core/private/h5_file.h +++ b/src/h5core/private/h5_file.h @@ -2,7 +2,7 @@ #define __PRIVATE_H5_FILE_H #include "private/h5_types.h" -#include "private/h5_debug.h" +#include "private/h5_log.h" #include "private/h5_err.h" #include "h5core/h5_file.h" diff --git a/src/h5core/private/h5_hdf5.h b/src/h5core/private/h5_hdf5.h index e8c7dbd..72fea06 100644 --- a/src/h5core/private/h5_hdf5.h +++ b/src/h5core/private/h5_hdf5.h @@ -14,7 +14,7 @@ #include "h5core/h5_types.h" #include "h5core/h5_err.h" -#include "private/h5_debug.h" +#include "private/h5_log.h" #include "private/h5_va_macros.h" ssize_t diff --git a/src/h5core/private/h5_hsearch.c b/src/h5core/private/h5_hsearch.c index d2d66cd..bcb69f3 100644 --- a/src/h5core/private/h5_hsearch.c +++ b/src/h5core/private/h5_hsearch.c @@ -32,7 +32,7 @@ #include #include -#include "private/h5_debug.h" +#include "private/h5_log.h" #include "private/h5_hsearch.h" #include "h5core/h5_types.h" diff --git a/src/h5core/private/h5_debug.h b/src/h5core/private/h5_log.h similarity index 98% rename from src/h5core/private/h5_debug.h rename to src/h5core/private/h5_log.h index ff743d8..ccc93d8 100644 --- a/src/h5core/private/h5_debug.h +++ b/src/h5core/private/h5_log.h @@ -11,7 +11,7 @@ #define __PRIVATE_H5_DEBUG_H #include "h5core/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "private/h5_init.h" #define H5_CORE_API_ENTER(type, fmt, ...) \ diff --git a/src/h5core/private/h5_lustre.c b/src/h5core/private/h5_lustre.c index 41712ad..5c2bc98 100644 --- a/src/h5core/private/h5_lustre.c +++ b/src/h5core/private/h5_lustre.c @@ -92,7 +92,7 @@ _get_lustre_stripe_size(h5_file_t *const f, const char *path ) close(fd); - if ( f->myproc == 0 && h5_get_debuglevel() >= 5 ) + if ( f->myproc == 0 && h5_get_loglevel() >= 5 ) _print_stripe_info(lum); ssize_t stripe_size = (ssize_t)lum->lmm_stripe_size; diff --git a/src/h5core/private/h5_maps.h b/src/h5core/private/h5_maps.h index 24a3818..9529f99 100644 --- a/src/h5core/private/h5_maps.h +++ b/src/h5core/private/h5_maps.h @@ -11,10 +11,10 @@ #define __PRIVATE_H5_MAPS_H #include "private/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_err.h" #include "h5core/h5_syscall.h" -#include "private/h5_debug.h" +#include "private/h5_log.h" // Allocate new list #define h5priv_alloc_xlist( type ) \ diff --git a/src/h5core/private/h5_mpi.h b/src/h5core/private/h5_mpi.h index f39499d..028e138 100644 --- a/src/h5core/private/h5_mpi.h +++ b/src/h5core/private/h5_mpi.h @@ -14,7 +14,7 @@ #include "h5core/h5_types.h" #include "h5core/h5_err.h" -#include "private/h5_debug.h" +#include "private/h5_log.h" static inline h5_err_t h5priv_mpi_alltoall ( diff --git a/src/h5core/private/h5t_access_tetm.c b/src/h5core/private/h5t_access_tetm.c index 85a4f7f..e3c96e0 100644 --- a/src/h5core/private/h5t_access_tetm.c +++ b/src/h5core/private/h5t_access_tetm.c @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_syscall.h" #include "private/h5_file.h" diff --git a/src/h5core/private/h5t_access_trim.c b/src/h5core/private/h5t_access_trim.c index 0b71197..2df6610 100644 --- a/src/h5core/private/h5t_access_trim.c +++ b/src/h5core/private/h5t_access_trim.c @@ -7,7 +7,7 @@ License: see file COPYING in top level of source distribution. */ -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_syscall.h" #include "private/h5_file.h" diff --git a/src/h5core/private/h5t_adjacencies.h b/src/h5core/private/h5t_adjacencies.h index e069266..f1e5eb9 100644 --- a/src/h5core/private/h5t_adjacencies.h +++ b/src/h5core/private/h5t_adjacencies.h @@ -12,7 +12,7 @@ #include "h5core/h5_types.h" #include "private/h5t_types.h" -#include "private/h5_debug.h" +#include "private/h5_log.h" struct h5t_adjacency_methods { h5_err_t (*get_adjacencies)( diff --git a/src/h5core/private/h5t_core_trim.c b/src/h5core/private/h5t_core_trim.c index 5490b8a..501a631 100644 --- a/src/h5core/private/h5t_core_trim.c +++ b/src/h5core/private/h5t_core_trim.c @@ -219,7 +219,7 @@ update_internal_structs ( // create index sets -#if (!defined(NDEBUG) && (h5_debug_level & (1<<5))) +#if (!defined(NDEBUG) && (h5_log_level & (1<<5))) if (!m->is_chunked) { h5t_adjacencies_t* adj = &m->adjacencies; h5_loc_idx_t idx = 0; diff --git a/src/h5core/private/h5t_err.h b/src/h5core/private/h5t_err.h index 54648e6..7c22d8b 100644 --- a/src/h5core/private/h5t_err.h +++ b/src/h5core/private/h5t_err.h @@ -12,7 +12,7 @@ #include "h5core/h5_types.h" #include "h5core/h5_err.h" -#include "private/h5_debug.h" +#include "private/h5_log.h" #define ERR_ELEM_NEXIST "Element with local vertex IDs (%s) doesn't exist!" diff --git a/src/h5core/private/h5t_map.h b/src/h5core/private/h5t_map.h index 0ddaaf6..ada0684 100644 --- a/src/h5core/private/h5t_map.h +++ b/src/h5core/private/h5t_map.h @@ -11,10 +11,10 @@ #define __PRIVATE_H5T_MAP_H #include "private/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_err.h" #include "h5core/h5_syscall.h" -#include "private/h5_debug.h" +#include "private/h5_log.h" #include "private/h5_maps.h" #include "private/h5t_model.h" diff --git a/src/h5core/private/h5t_store_trim.c b/src/h5core/private/h5t_store_trim.c index 50842d5..b730144 100644 --- a/src/h5core/private/h5t_store_trim.c +++ b/src/h5core/private/h5t_store_trim.c @@ -203,7 +203,7 @@ compute_neighbor_of_face ( } if (elem_idx < -1) { // this should only happen if we are on the boarder // of a loaded chunk and the parent is on a different chunk - if (h5_debug_level >= 6) { + if (h5_log_level >= 6) { h5_debug ("Elem %d is on different proc than its parent %d \n" "therefore neighborhood idx is not correct resolved", old_elem_idx, elem_idx); } diff --git a/src/include/H5Block_attribs.h b/src/include/H5Block_attribs.h index 5700aea..818fd9f 100644 --- a/src/include/H5Block_attribs.h +++ b/src/include/H5Block_attribs.h @@ -12,7 +12,7 @@ #include -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5b_attribs.h" #ifdef __cplusplus diff --git a/src/include/H5Block_io.h b/src/include/H5Block_io.h index 0b6d726..8e37e10 100644 --- a/src/include/H5Block_io.h +++ b/src/include/H5Block_io.h @@ -10,7 +10,7 @@ #ifndef __H5BLOCK_IO_H #define __H5BLOCK_IO_H -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5b_io.h" #ifdef __cplusplus diff --git a/src/include/H5Block_model.h b/src/include/H5Block_model.h index 9c07669..23bae40 100644 --- a/src/include/H5Block_model.h +++ b/src/include/H5Block_model.h @@ -10,7 +10,7 @@ #ifndef __H5BLOCK_MODEL #define __H5BLOCK_MODEL -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5b_model.h" /** diff --git a/src/include/H5Fed_adjacency.h b/src/include/H5Fed_adjacency.h index a0a5b36..7fb7714 100644 --- a/src/include/H5Fed_adjacency.h +++ b/src/include/H5Fed_adjacency.h @@ -11,7 +11,7 @@ #define __H5FED_ADJACENCY_H #include "h5core/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5t_adjacencies.h" #ifdef __cplusplus diff --git a/src/include/H5Fed_model.h b/src/include/H5Fed_model.h index 9b89b40..9b42347 100644 --- a/src/include/H5Fed_model.h +++ b/src/include/H5Fed_model.h @@ -11,7 +11,7 @@ #define __H5FED_MODEL_H #include "h5core/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5t_model.h" #ifdef __cplusplus diff --git a/src/include/H5Fed_retrieve.h b/src/include/H5Fed_retrieve.h index 9b5cf2c..6b276ba 100644 --- a/src/include/H5Fed_retrieve.h +++ b/src/include/H5Fed_retrieve.h @@ -11,7 +11,7 @@ #define __H5FED_RETRIEVE_H #include "h5core/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_syscall.h" #include "h5core/h5t_map.h" #include "h5core/h5t_retrieve.h" diff --git a/src/include/H5Fed_store.h b/src/include/H5Fed_store.h index 4cc8df2..bdb5d0a 100644 --- a/src/include/H5Fed_store.h +++ b/src/include/H5Fed_store.h @@ -11,7 +11,7 @@ #define __H5FED_STORE_H #include "h5core/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5t_store.h" #ifdef __cplusplus diff --git a/src/include/H5Fed_tags.h b/src/include/H5Fed_tags.h index a611d47..5345968 100644 --- a/src/include/H5Fed_tags.h +++ b/src/include/H5Fed_tags.h @@ -11,7 +11,7 @@ #define __H5FED_TAGS_H #include "h5core/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5t_tags.h" #ifdef __cplusplus diff --git a/src/include/H5Part_io.h b/src/include/H5Part_io.h index eaefb8f..e8d483d 100644 --- a/src/include/H5Part_io.h +++ b/src/include/H5Part_io.h @@ -10,7 +10,7 @@ #ifndef H5PART_IO #define H5PART_IO -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5u_io.h" #ifdef __cplusplus diff --git a/src/include/H5Part_model.h b/src/include/H5Part_model.h index d800338..98297c4 100644 --- a/src/include/H5Part_model.h +++ b/src/include/H5Part_model.h @@ -10,7 +10,7 @@ #ifndef H5PART_MODEL #define H5PART_MODEL -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5u_model.h" /** diff --git a/src/include/H5_attachments.h b/src/include/H5_attachments.h index 1f8a20e..05e72f0 100644 --- a/src/include/H5_attachments.h +++ b/src/include/H5_attachments.h @@ -10,7 +10,7 @@ #ifndef __H5_ATTACHMENTS_H #define __H5_ATTACHMENTS_H -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_model.h" #include "h5core/h5_attachments.h" diff --git a/src/include/H5_debug.f90 b/src/include/H5_debug.f90 deleted file mode 100644 index 0833498..0000000 --- a/src/include/H5_debug.f90 +++ /dev/null @@ -1,45 +0,0 @@ -! -! Copyright (c) 2006-2016, The Regents of the University of California, -! through Lawrence Berkeley National Laboratory (subject to receipt of any -! required approvals from the U.S. Dept. of Energy) and the Paul Scherrer -! Institut (Switzerland). All rights reserved.! -! -! License: see file COPYING in top level of source distribution. -! - INTERFACE - - !> \addtogroup h5_debug_fvalue - !! @{ - - !> - !! Set debug mask. The debug mask is an or'ed value of - !! - !! - \c H5_DEBUG_API: C-API calls - !! - \c H5_DEBUG_CORE_API: core API calls. The core API is used by the C- and Fortran API. - !! - \c H5_DEBUG_PRIV_API: private API calls - !! - \c H5_DEBUG_PRIV_FUNC: static functions - !! - \c H5_DEBUG_HDF5: HDF5 wrapper calls - !! - \c H5_DEBUG_MPI: MPI wrapper calls - !! - \c H5_DEBUG_MALLOC: memory allocation - !! - \c H5_DEBUG_ALL: enable all - !! - !! \return \c H5_SUCCESS - !! - !! \see h5_get_debug_mask() - - SUBROUTINE h5_set_debug_mask ( mask ) - INTEGER*8, INTENT(IN) :: mask !< [in] debug mask - END SUBROUTINE h5_set_debug_mask - - !> - !! Get debug mask. - !! - !! \return debug mask - !! - !! \see h5_set_debug_mask() - - INTEGER*8 FUNCTION h5_get_debug_mask () - END FUNCTION h5_get_debug_mask - - !> @} - END INTERFACE diff --git a/src/include/H5_debug.h b/src/include/H5_debug.h deleted file mode 100644 index 5746d51..0000000 --- a/src/include/H5_debug.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (c) 2006-2016, The Regents of the University of California, - through Lawrence Berkeley National Laboratory (subject to receipt of any - required approvals from the U.S. Dept. of Energy) and the Paul Scherrer - Institut (Switzerland). All rights reserved. - - License: see file COPYING in top level of source distribution. -*/ - -#ifndef __H5_DEBUG_H -#define __H5_DEBUG_H - -#include "h5core/h5_debug.h" - -/** - \addtogroup h5_debug - @{ -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - Set debug mask. The debug mask is an or'ed value of - - - \c H5_DEBUG_API: C-API calls - - \c H5_DEBUG_CORE_API: core API calls. - - \c H5_DEBUG_PRIV_API: private API calls - - \c H5_DEBUG_PRIV_FUNC: static functions - - \c H5_DEBUG_HDF5: HDF5 wrapper calls - - \c H5_DEBUG_MPI: MPI wrapper calls - - \c H5_DEBUG_MALLOC: memory allocation - - \c H5_DEBUG_ALL: enable all - - \return \c H5_SUCCESS - - \see H5GetDebugMask() - - \note - | Release | Change | - | :------ | :----- | - | \c 1.99.15 | Function introduced in this release. | -*/ -static inline h5_err_t -H5SetDebugMask ( - const h5_id_t mask ///< [in] debug mask - ) { - return h5_set_debuglevel (mask & ~0x03); -} - -/** - Get debug mask. - - \return debug mask - - \see H5SetDebugMask() - - \note - | Release | Change | - | :------ | :----- | - | \c 1.99.15 | Function introduced in this release. | -*/ -static inline h5_id_t -H5GetDebugMask ( - void - ) { - return (h5_get_debuglevel () & ~0x03); -} - -#ifdef __cplusplus -} -#endif - -///< @} -#endif diff --git a/src/include/H5_err.h b/src/include/H5_err.h index f22eead..ab37828 100644 --- a/src/include/H5_err.h +++ b/src/include/H5_err.h @@ -10,7 +10,7 @@ #ifndef __H5_ERROR_H #define __H5_ERROR_H -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" /** \addtogroup h5_error diff --git a/src/include/H5_file.h b/src/include/H5_file.h index e95d470..0e4ed14 100644 --- a/src/include/H5_file.h +++ b/src/include/H5_file.h @@ -10,7 +10,7 @@ #ifndef __H5_FILE_H #define __H5_FILE_H -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_file.h" #include diff --git a/src/include/H5_file_attribs.h b/src/include/H5_file_attribs.h index ab158f0..036f424 100644 --- a/src/include/H5_file_attribs.h +++ b/src/include/H5_file_attribs.h @@ -12,7 +12,7 @@ #include -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_file_attribs.h" #ifdef __cplusplus diff --git a/src/include/H5_log.f90 b/src/include/H5_log.f90 index 34e97f4..a611c55 100644 --- a/src/include/H5_log.f90 +++ b/src/include/H5_log.f90 @@ -41,4 +41,40 @@ END FUNCTION h5_get_verbosity_level !> @} + + !> \addtogroup h5_debug_fvalue + !! @{ + + !> + !! Set debug mask. The debug mask is an or'ed value of + !! + !! - \c H5_DEBUG_API: C-API calls + !! - \c H5_DEBUG_CORE_API: core API calls. The core API is used by the C- and Fortran API. + !! - \c H5_DEBUG_PRIV_API: private API calls + !! - \c H5_DEBUG_PRIV_FUNC: static functions + !! - \c H5_DEBUG_HDF5: HDF5 wrapper calls + !! - \c H5_DEBUG_MPI: MPI wrapper calls + !! - \c H5_DEBUG_MALLOC: memory allocation + !! - \c H5_DEBUG_ALL: enable all + !! + !! \return \c H5_SUCCESS + !! + !! \see h5_get_debug_mask() + + SUBROUTINE h5_set_debug_mask ( mask ) + INTEGER*8, INTENT(IN) :: mask !< [in] debug mask + END SUBROUTINE h5_set_debug_mask + + !> + !! Get debug mask. + !! + !! \return debug mask + !! + !! \see h5_set_debug_mask() + + INTEGER*8 FUNCTION h5_get_debug_mask () + END FUNCTION h5_get_debug_mask + + !> @} + END INTERFACE diff --git a/src/include/H5_log.h b/src/include/H5_log.h index 3206359..4d80490 100644 --- a/src/include/H5_log.h +++ b/src/include/H5_log.h @@ -11,7 +11,7 @@ #define __H5_LOG_H #include "h5core/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #if H5HUT_API_VERSION == 2 #define H5SetVerbosityLevel2 H5SetVerbosityLevel @@ -52,7 +52,7 @@ static inline h5_err_t H5SetVerbosityLevel2 ( const h5_id_t level ///< [in] verbosity level. ) { - return h5_set_debuglevel (level & 0x03); + return h5_set_loglevel (level & 0x03); } /** @@ -74,7 +74,7 @@ static inline h5_err_t H5SetVerbosityLevel1 ( const h5_id_t level ///< [in] verbosity level. ) { - return h5_set_debuglevel (level); + return h5_set_loglevel (level); } /** @@ -88,7 +88,62 @@ static inline h5_id_t H5GetVerbosityLevel ( void ) { - return h5_get_debuglevel () & 0x03; + return h5_get_loglevel () & 0x03; +} + +///< @} + + +/** + \addtogroup h5_debug + @{ +*/ + +/** + Set debug mask. The debug mask is an or'ed value of + + - \c H5_DEBUG_API: C-API calls + - \c H5_DEBUG_CORE_API: core API calls. + - \c H5_DEBUG_PRIV_API: private API calls + - \c H5_DEBUG_PRIV_FUNC: static functions + - \c H5_DEBUG_HDF5: HDF5 wrapper calls + - \c H5_DEBUG_MPI: MPI wrapper calls + - \c H5_DEBUG_MALLOC: memory allocation + - \c H5_DEBUG_ALL: enable all + + \return \c H5_SUCCESS + + \see H5GetDebugMask() + + \note + | Release | Change | + | :------ | :----- | + | \c 1.99.15 | Function introduced in this release. | +*/ +static inline h5_err_t +H5SetDebugMask ( + const h5_id_t mask ///< [in] debug mask + ) { + return h5_set_loglevel (mask & ~0x03); +} + +/** + Get debug mask. + + \return debug mask + + \see H5SetDebugMask() + + \note + | Release | Change | + | :------ | :----- | + | \c 1.99.15 | Function introduced in this release. | +*/ +static inline h5_id_t +H5GetDebugMask ( + void + ) { + return (h5_get_loglevel () & ~0x03); } #ifdef __cplusplus @@ -96,5 +151,7 @@ H5GetVerbosityLevel ( #endif ///< @} + + #endif diff --git a/src/include/H5_model.h b/src/include/H5_model.h index 55dd46e..d4f6a57 100644 --- a/src/include/H5_model.h +++ b/src/include/H5_model.h @@ -10,7 +10,7 @@ #ifndef __H5_MODEL_H #define __H5_MODEL_H -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_model.h" /** diff --git a/src/include/H5_step_attribs.h b/src/include/H5_step_attribs.h index 0f2cd5d..cf53fcd 100644 --- a/src/include/H5_step_attribs.h +++ b/src/include/H5_step_attribs.h @@ -12,7 +12,7 @@ #include -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #include "h5core/h5_step_attribs.h" #ifdef __cplusplus diff --git a/src/include/H5hut.f90 b/src/include/H5hut.f90 index 13ac546..8511978 100644 --- a/src/include/H5hut.f90 +++ b/src/include/H5hut.f90 @@ -14,7 +14,6 @@ MODULE H5hut include 'H5_file_attribs.f90' include 'H5_step_attribs.f90' include 'H5_log.f90' - include 'H5_debug.f90' include 'H5_err.f90' include 'H5Part_model.f90' diff --git a/src/include/H5hut.h b/src/include/H5hut.h index 771daea..bb660f7 100644 --- a/src/include/H5hut.h +++ b/src/include/H5hut.h @@ -20,7 +20,6 @@ #include "H5_file_attribs.h" #include "H5_step_attribs.h" #include "H5_log.h" -#include "H5_debug.h" #include "H5_err.h" #include "H5Part_io.h" diff --git a/src/include/h5core/Makefile.am b/src/include/h5core/Makefile.am index a4367dd..666e149 100644 --- a/src/include/h5core/Makefile.am +++ b/src/include/h5core/Makefile.am @@ -2,12 +2,12 @@ otherincludedir = $(includedir)/h5core include_HEADERS = \ h5_attachments.h \ - h5_debug.h \ h5_err.h \ h5_file.h \ h5_file_attribs.h \ - h5_step_attribs.h \ + h5_log.h \ h5_model.h \ + h5_step_attribs.h \ h5_syscall.h \ h5_types.h \ h5b_attribs.h \ @@ -20,8 +20,8 @@ include_HEADERS = \ h5t_retrieve.h \ h5t_store.h \ h5t_tags.h \ - h5u_model.h \ - h5u_io.h + h5u_io.h \ + h5u_model.h clean-local: $(RM) *~ diff --git a/src/include/h5core/h5_debug.h b/src/include/h5core/h5_log.h similarity index 95% rename from src/include/h5core/h5_debug.h rename to src/include/h5core/h5_log.h index fecebfd..9a528a4 100644 --- a/src/include/h5core/h5_debug.h +++ b/src/include/h5core/h5_log.h @@ -7,8 +7,8 @@ License: see file COPYING in top level of source distribution. */ -#ifndef __H5CORE_H5_DEBUG_H -#define __H5CORE_H5_DEBUG_H +#ifndef __H5CORE_H5_LOG_H +#define __H5CORE_H5_LOG_H #include #include @@ -74,7 +74,7 @@ struct call_stack { struct call_stack_entry entry[1024]; }; -extern h5_int32_t h5_debug_level; +extern h5_int32_t h5_log_level; extern struct call_stack h5_call_stack; #ifdef __cplusplus @@ -190,7 +190,7 @@ h5_warn ( const char* fmt, ... ) { - if (h5_debug_level >= 2) { + if (h5_log_level >= 2) { va_list ap; va_start (ap, fmt); h5priv_vprintf (stderr, "W", h5_get_funcname(), fmt, ap); @@ -218,7 +218,7 @@ h5_info ( const char* fmt, ... ) { - if (h5_debug_level >= 3) { + if (h5_log_level >= 3) { va_list ap; va_start (ap, fmt); h5priv_vprintf (stdout, "I", h5_get_funcname(), fmt, ap); @@ -246,7 +246,7 @@ h5_debug ( const char *fmt, ... ) { - if (h5_debug_level >= 4) { + if (h5_log_level >= 4) { char prefix[1024]; snprintf (prefix, sizeof(prefix), "%*s %s", h5_call_stack_get_level(), "", @@ -274,13 +274,13 @@ h5_debug ( #define __API_ENTER(type, mask, fmt, ...) \ h5_call_stack_push (__func__,e_##type); \ type ret_value = (type)H5_ERR; \ - if (h5_debug_level & mask ) { \ + if (h5_log_level & mask ) { \ h5_debug ("(" fmt ")", __VA_ARGS__); \ } #define __FUNC_ENTER(type, mask, fmt, ...) \ type ret_value = (type)H5_ERR; \ - if (h5_debug_level & mask ) { \ + if (h5_log_level & mask ) { \ h5_call_stack_push (__func__,e_##type); \ h5_debug ("(" fmt ")", __VA_ARGS__); \ } \ @@ -321,7 +321,7 @@ done: \ ret_value = expr; \ goto done; \ done: \ - if (h5_debug_level & mask ) { \ + if (h5_log_level & mask ) { \ char fmt[256]; \ snprintf (fmt, sizeof(fmt), "return: %s", \ h5_rfmts[h5_call_stack_get_type()]); \ @@ -334,7 +334,7 @@ done: \ ret_value = expr; \ goto done; \ done: \ - if (h5_debug_level & mask ) { \ + if (h5_log_level & mask ) { \ char fmt[256]; \ snprintf (fmt, sizeof(fmt), "return: %s", \ h5_rfmts[h5_call_stack_get_type()]); \ @@ -359,11 +359,11 @@ done: \ } h5_err_t -h5_set_debuglevel ( +h5_set_loglevel ( const h5_id_t); h5_err_t -h5_get_debuglevel ( +h5_get_loglevel ( void); #ifdef __cplusplus diff --git a/src/include/h5core/h5_syscall.h b/src/include/h5core/h5_syscall.h index 35c12fb..ecaf755 100644 --- a/src/include/h5core/h5_syscall.h +++ b/src/include/h5core/h5_syscall.h @@ -14,7 +14,7 @@ #include #include "h5core/h5_types.h" -#include "h5core/h5_debug.h" +#include "h5core/h5_log.h" #define MALLOC_WRAPPER_ENTER(type, fmt, ...) \ __FUNC_ENTER(type, H5_DEBUG_MALLOC, fmt, __VA_ARGS__)