Commit f75ef09c authored by gsell's avatar gsell

consolidation of log/debug message interface

parent c831a90a
Pipeline #2 skipped
......@@ -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 \
......
......@@ -9,7 +9,7 @@
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_file.h"
#include <hdf5.h>
......@@ -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));
}
......
......@@ -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
......
......@@ -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 ( \
......
......@@ -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"
......
......@@ -8,7 +8,7 @@
*/
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5u_io.h"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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 */
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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"
......
......@@ -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);
}
......@@ -11,7 +11,7 @@
#include <errno.h>
#include <fcntl.h>
#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;
......
......@@ -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;
}
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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
......
......@@ -32,7 +32,7 @@
#include <assert.h>
#include <stddef.h>
#include "private/h5_debug.h"
#include "private/h5_log.h"
#include "private/h5_hsearch.h"
#include "h5core/h5_types.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, ...) \
......
......@@ -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;
......
......@@ -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 ) \
......
......@@ -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 (
......
......@@ -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"
......
......@@ -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"
......
......@@ -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)(
......
......@@ -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;
......
......@@ -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!"
......
......@@ -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"
......
......@@ -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);
}
......
......@@ -12,7 +12,7 @@
#include <string.h>
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5b_attribs.h"
#ifdef __cplusplus
......
......@@ -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
......
......@@ -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"
/**
......
......@@ -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
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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"
/**
......
......@@ -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"
......
!
! 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
/*
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
) {