core API:

- debugging macros simplified
- cleanup
- h5_delete_attachment(): check of file mode added
This commit is contained in:
2016-06-24 15:51:39 +02:00
parent fba78db1c0
commit f97e3c8f2d
51 changed files with 1664 additions and 1715 deletions
+3 -2
View File
@@ -48,10 +48,11 @@ lib_LTLIBRARIES = libH5hut.la
libH5hut_la_SOURCES = \
h5_attachments.c \
h5_attribs.c \
h5_log.c \
h5_err.c \
h5_model.c \
h5_log.c \
h5_file.c \
h5_model.c \
h5_syscall.c \
h5u_io.c \
h5b_io.c \
h5u_model.c \
+25 -20
View File
@@ -32,13 +32,13 @@ h5_add_attachment (
H5_CORE_API_ENTER (h5_err_t, "f=%p, fname='%s'", f, fname);
// allowed file modes: O_RDWR, O_WRONLY; O_APPEND
if (f->props->flags & H5_O_RDONLY) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5priv_handle_file_mode_error (f->props->flags));
}
struct stat st;
if (stat (fname, &st) < 0) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot stat file '%s'",
@@ -52,7 +52,7 @@ h5_add_attachment (
write_length = fsize;
int fd;
if ((fd = open (fname, O_RDONLY)) < 0) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot open file '%s' for reading",
@@ -63,7 +63,7 @@ h5_add_attachment (
if (errno == EINTR) {
goto again;
} else {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot read file '%s'",
@@ -71,7 +71,7 @@ h5_add_attachment (
}
}
if (close (fd) < 0) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot close file '%s'",
@@ -88,7 +88,7 @@ h5_add_attachment (
h5_err_t exists;
TRY (exists = hdf5_link_exists (loc_id, fname));
if (exists && (f->props->flags & H5_O_APPENDONLY)) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5priv_handle_file_mode_error (f->props->flags));
}
hid_t diskspace_id;
@@ -125,7 +125,7 @@ h5_add_attachment (
TRY (h5_free (buf));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -135,7 +135,7 @@ h5_has_attachments (
h5_file_p f = (h5_file_p)f_;
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
TRY (ret_value = hdf5_link_exists (f->file, H5_ATTACHMENT));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_ssize_t
@@ -153,7 +153,7 @@ h5_get_num_attachments (
TRY (group_id = hdf5_open_group (f->file, H5_ATTACHMENT));
TRY (ret_value = hdf5_get_num_datasets (group_id));
TRY (hdf5_close_group (group_id));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -184,7 +184,7 @@ h5_get_attachment_info_by_idx (
*fsize = ssize;
}
TRY (hdf5_close_group (loc_id));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -197,7 +197,7 @@ h5_has_attachment (
hid_t loc_id;
TRY (loc_id = hdf5_open_group (f->file, H5_ATTACHMENT));
TRY (ret_value = hdf5_link_exists (f->file, fname));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -218,7 +218,7 @@ h5_get_attachment_info_by_name (
*fsize = ssize;
}
TRY (hdf5_close_group (loc_id));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -231,7 +231,7 @@ h5_get_attachment (
// allowed modes: O_RDWR, O_RDONLY; O_APPEND
// forbidden modes: O_WRONLY
if (f->props->flags & H5_O_WRONLY) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5priv_handle_file_mode_error (f->props->flags));
}
@@ -248,11 +248,11 @@ h5_get_attachment (
hsize_t read_length;
char* buf = NULL;
if (f->myproc == 0) {
buf = malloc (fsize);
buf = h5_calloc (1, fsize);
read_length = fsize;
} else {
buf = malloc (1);
buf = h5_calloc (1, 1);
read_length = 0;
}
@@ -284,21 +284,21 @@ h5_get_attachment (
if (f->myproc == 0) {
int fd;
if ((fd = open (fname, O_WRONLY|O_CREAT|O_TRUNC, 0600)) < 0) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_H5,
"Error opening file '%s': %s",
fname, strerror(errno)));
}
if (write (fd, buf, fsize) != fsize) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_H5,
"Error writing to file '%s': %s",
fname, strerror(errno)));
}
if (close (fd) < 0) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_H5,
"Error closing file '%s': %s",
@@ -307,7 +307,7 @@ h5_get_attachment (
}
TRY (h5_free (buf));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -317,10 +317,15 @@ h5_delete_attachment (
) {
h5_file_p f = (h5_file_p)f_;
H5_CORE_API_ENTER (h5_err_t, "f=%p, fname='%s'", f, fname);
// allowed file modes: O_RDWR, O_WRONLY; O_APPEND
if (f->props->flags & H5_O_RDONLY) {
H5_LEAVE (
h5priv_handle_file_mode_error (f->props->flags));
}
hid_t loc_id;
TRY (loc_id = hdf5_open_group (f->file, H5_ATTACHMENT));
TRY (hdf5_delete_link (loc_id, fname, H5P_DEFAULT));
TRY (hdf5_close_group (loc_id));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+12 -12
View File
@@ -28,7 +28,7 @@ h5_has_file_attrib (
attrib_name);
CHECK_FILEHANDLE (f);
TRY (ret_value = hdf5_attribute_exists(f->root_gid, attrib_name));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -44,7 +44,7 @@ h5_has_step_attrib (
attrib_name);
CHECK_FILEHANDLE (f);
TRY (ret_value = hdf5_attribute_exists (f->step_gid, attrib_name));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_ssize_t
@@ -55,7 +55,7 @@ h5_get_num_file_attribs (
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
CHECK_FILEHANDLE (f);
TRY (ret_value = hdf5_get_num_attribute (f->root_gid));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_ssize_t
@@ -67,7 +67,7 @@ h5_get_num_step_attribs (
CHECK_FILEHANDLE (f);
CHECK_TIMEGROUP (f);
TRY (ret_value = hdf5_get_num_attribute (f->step_gid));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -95,7 +95,7 @@ h5_get_file_attrib_info_by_idx (
attrib_idx,
attrib_name, len_attrib_name,
attrib_type, attrib_nelem));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -118,7 +118,7 @@ h5_get_file_attrib_info_by_name (
f->root_gid,
attrib_name,
attrib_type, attrib_nelem));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
@@ -148,7 +148,7 @@ h5_get_step_attrib_info_by_idx (
attrib_idx,
attrib_name, len_attrib_name,
attrib_type, attrib_nelem));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -172,7 +172,7 @@ h5_get_step_attrib_info_by_name (
f->step_gid,
attrib_name,
attrib_type, attrib_nelem));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -196,7 +196,7 @@ h5_read_file_attrib (
attrib_name,
attrib_type,
attrib_value));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -222,7 +222,7 @@ h5_read_step_attrib (
attrib_name,
attrib_type,
attrib_value));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
@@ -252,7 +252,7 @@ h5_write_file_attrib (
attrib_value,
attrib_nelem,
!is_appendonly (f)));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -282,7 +282,7 @@ h5_write_step_attrib (
attrib_value,
attrib_nelem,
!is_appendonly (f)));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
+36 -35
View File
@@ -10,6 +10,7 @@
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "h5core/h5_log.h"
@@ -55,7 +56,7 @@ h5_get_hdf5_file(
) {
h5_file_p f = (h5_file_p)f_;
H5_CORE_API_ENTER (hid_t, "f=%p", f);
H5_CORE_API_RETURN (f->file);
H5_RETURN (f->file);
}
/*!
@@ -140,7 +141,7 @@ mpi_init (
}
#endif
#endif /* PARALLEL_IO */
H5_INLINE_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -162,7 +163,7 @@ set_alignment (
(long long int)f->props->align);
TRY (H5Pset_meta_block_size (f->props->access_prop, f->props->align));
}
H5_INLINE_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -180,7 +181,7 @@ set_default_file_props (
H5_STEPNAME_LEN - 1);
props->width_step_idx = H5_STEPWIDTH;
props->comm = MPI_COMM_WORLD;
H5_INLINE_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -192,7 +193,7 @@ h5_set_prop_file_mpio_collective (
H5_CORE_API_ENTER (h5_err_t, "props=%p, comm=%p", props, comm);
if (props->class != H5_PROP_FILE) {
H5_INLINE_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld",
@@ -206,7 +207,7 @@ h5_set_prop_file_mpio_collective (
props->throttle = 0;
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -218,7 +219,7 @@ h5_set_prop_file_mpio_independent (
H5_CORE_API_ENTER (h5_err_t, "props=%p, comm=%p", props, comm);
if (props->class != H5_PROP_FILE) {
H5_INLINE_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld",
@@ -227,7 +228,7 @@ h5_set_prop_file_mpio_independent (
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_POSIX | H5_VFD_CORE);
props->flags |= H5_VFD_MPIO_INDEPENDENT;
props->comm = *comm;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#if H5_VERSION_LE(1,8,12)
@@ -240,7 +241,7 @@ h5_set_prop_file_mpio_posix (
H5_CORE_API_ENTER (h5_err_t, "props=%p, comm=%p", props, comm);
if (props->class != H5_PROP_FILE) {
H5_INLINE_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld",
@@ -249,7 +250,7 @@ h5_set_prop_file_mpio_posix (
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_POSIX | H5_VFD_CORE);
props->flags |= H5_VFD_MPIO_INDEPENDENT;
props->comm = *comm;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif
@@ -262,7 +263,7 @@ h5_set_prop_file_core_vfd (
H5_CORE_API_ENTER (h5_err_t, "props=%p, increment=%lld", props, (long long int)increment);
if (props->class != H5_PROP_FILE) {
H5_INLINE_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld",
@@ -276,7 +277,7 @@ h5_set_prop_file_core_vfd (
h5_warn ("Throttling is not permitted with core VFD. Reset throttling.");
props->throttle = 0;
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -291,14 +292,14 @@ h5_set_prop_file_align (
"props=%p, align=%lld",
props, (long long int)align);
if (props->class != H5_PROP_FILE) {
H5_INLINE_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld",
(long long int)props->class));
}
props->align = align;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -312,7 +313,7 @@ h5_set_prop_file_throttle (
"props=%p, throttle=%lld",
props, (long long int)throttle);
if (props->class != H5_PROP_FILE) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld",
@@ -337,7 +338,7 @@ h5_set_prop_file_throttle (
}
props->throttle = throttle;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -356,13 +357,13 @@ h5_create_prop (
set_default_file_props ((h5_prop_file_t*)prop);
break;
default:
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld",
(long long int)class));
}
H5_CORE_API_RETURN ((h5_prop_t)prop);
H5_RETURN ((h5_prop_t)prop);
}
h5_err_t
@@ -378,13 +379,13 @@ h5_close_prop (
break;
}
default:
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld",
(long long int)prop->class));
}
H5_CORE_API_RETURN (h5_free (prop));
H5_RETURN (h5_free (prop));
}
static inline h5_err_t
@@ -440,7 +441,7 @@ open_file (
}
}
else {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid file access mode '%lld'.",
@@ -448,7 +449,7 @@ open_file (
}
if (f->file < 0)
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot open file '%s' with mode '%s'",
@@ -458,7 +459,7 @@ open_file (
TRY (h5upriv_open_file (f));
TRY (h5bpriv_open_file (f));
H5_INLINE_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_file_t
@@ -481,7 +482,7 @@ h5_open_file2 (
if (props != H5_PROP_DEFAULT) {
if (props->class != H5_PROP_FILE) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Invalid property class: %lld.",
@@ -501,7 +502,7 @@ h5_open_file2 (
TRY (open_file (f, filename, mode));
H5_CORE_API_RETURN ((h5_file_t)f);
H5_RETURN ((h5_file_t)f);
}
/*!
@@ -539,7 +540,7 @@ h5_open_file1 (
TRY (f = h5_open_file2 (filename, mode, (h5_prop_t)props));
TRY (h5_close_prop ((h5_prop_t)props));
h5_file_p _f = (h5_file_p)f;
H5_CORE_API_RETURN (_f);
H5_RETURN (_f);
}
@@ -574,7 +575,7 @@ h5_close_file (
TRY (hdf5_close_file (f->file));
TRY (h5_free (f->step_name));
TRY (h5_free (f));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -583,7 +584,7 @@ h5_close_hdf5 (
) {
H5_CORE_API_ENTER (h5_err_t, "%s", "");
TRY (ret_value = hdf5_close ());
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -593,7 +594,7 @@ h5_flush_step (
h5_file_p f = (h5_file_p)f_;
H5_CORE_API_ENTER (h5_err_t, "f=%p", f);
TRY (ret_value = hdf5_flush (f->step_gid, H5F_SCOPE_LOCAL));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -603,7 +604,7 @@ h5_flush_file (
h5_file_p f = (h5_file_p)f_;
H5_CORE_API_ENTER (h5_err_t, "f=%p", f);
TRY (ret_value = hdf5_flush (f->file, H5F_SCOPE_GLOBAL));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
@@ -635,7 +636,7 @@ h5_set_stepname_fmt (
H5_STEPNAME_LEN - 1);
f->props->width_step_idx = width;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -673,7 +674,7 @@ h5_get_step (
) {
h5_file_p f = (h5_file_p)f_;
H5_CORE_API_ENTER (h5_id_t, "f=%p", f);
H5_CORE_API_RETURN (f->step_idx);
H5_RETURN (f->step_idx);
}
/*!
@@ -689,7 +690,7 @@ h5_get_num_procs (
) {
h5_file_p f = (h5_file_p)f_;
H5_CORE_API_ENTER (int, "f=%p", f);
H5_CORE_API_RETURN (f->nprocs);
H5_RETURN (f->nprocs);
}
/*!
@@ -708,7 +709,7 @@ h5_get_num_steps(
TRY (ret_value = hdf5_get_num_groups_matching_prefix (
f->root_gid,
f->props->prefix_step_name));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
/*!
@@ -731,7 +732,7 @@ h5_start_traverse_steps (
loop over all steps and get smallest step number
*/
H5_CORE_API_RETURN (h5_error_not_implemented ());
H5_RETURN (h5_error_not_implemented ());
}
/*!
+6 -6
View File
@@ -20,12 +20,12 @@ h5priv_close_step (
) {
H5_PRIV_API_ENTER (h5_err_t, "f=%p", f);
if (f->step_gid <= 0)
H5_PRIV_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
TRY (hdf5_close_group (f->step_gid));
f->step_gid = -1;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -53,7 +53,7 @@ h5_set_step (
TRY (f->step_gid = h5priv_open_group (is_writable(f),
f->file,
f->step_name));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -75,7 +75,7 @@ h5_has_step (
f->props->prefix_step_name, f->props->width_step_idx,
(long long)step_idx);
TRY (ret_value = hdf5_link_exists (f->file, name));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -93,12 +93,12 @@ h5priv_normalize_dataset_name (
}
if ( strcmp( name2, H5BLOCK_GROUPNAME_BLOCK ) == 0 ) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Can't create dataset or field with name '%s'"
" because it is reserved by H5Block.",
H5BLOCK_GROUPNAME_BLOCK));
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+99
View File
@@ -0,0 +1,99 @@
/*
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 __H5CORE_H5_SYSCALL_H
#define __H5CORE_H5_SYSCALL_H
#include <stdlib.h>
#include <string.h>
#include "h5core/h5_types.h"
#include "private/h5_log.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MALLOC_WRAPPER_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_MALLOC, fmt, __VA_ARGS__)
h5_err_t
h5_free (
void* ptr
) {
MALLOC_WRAPPER_ENTER (h5_err_t, "ptr=%p", ptr);
if (ptr) {
free (ptr);
}
H5_RETURN (H5_SUCCESS);
}
void_p
h5_alloc (
void* ptr,
const size_t size
) {
MALLOC_WRAPPER_ENTER (void_p, "ptr=%p, size=%lu", ptr, size);
if (size < 1) {
ret_value = (void_p) h5_free (ptr);
H5_LEAVE (NULL);
}
ptr = realloc (ptr, size);
if (ptr == NULL) {
H5_LEAVE (
(void_p)h5_error (
H5_ERR_NOMEM,
"Out of memory. Tried to alloc %lld", (long long int)size));
}
H5_RETURN (ptr);
}
void_p
h5_calloc (
const size_t count,
const size_t size
) {
MALLOC_WRAPPER_ENTER (void_p, "count=%zu , size=%zu", count, size);
void* ptr = NULL;
if (count * size < 1) {
H5_LEAVE (ptr);
}
ptr = calloc (count, size);
if (ptr == NULL) {
H5_LEAVE (
(void_p)h5_error (
H5_ERR_NOMEM,
"Out of memory. Tried to alloc %lld", (long long int)count* size));
}
H5_RETURN (ptr);
}
char_p
h5_strdup (
const char* s1
) {
MALLOC_WRAPPER_ENTER (char_p, "s='%s'", s1);
char_p s2 = (char_p)h5_calloc (1, strlen (s1)+1 );
if (s2 == NULL) {
H5_LEAVE (
(char_p)h5_error (
H5_ERR_NOMEM,
"Out of memory."));
}
H5_RETURN (strcpy (s2, s1));
}
#ifdef __cplusplus
}
#endif
#endif
+8 -8
View File
@@ -47,7 +47,7 @@ h5b_write_field_attrib (
attrib_nelem,
!is_appendonly (f)) );
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -79,7 +79,7 @@ h5b_read_field_attrib (
attrib_type,
buffer));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -104,7 +104,7 @@ h5b_has_field_attrib (
TRY (ret_value = hdf5_attribute_exists (
f->b->field_gid,
attrib_name));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_ssize_t
@@ -120,7 +120,7 @@ h5b_get_num_field_attribs (
TRY (h5bpriv_open_field_group(f, field_name));
TRY (ret_value = hdf5_get_num_attribute (f->b->field_gid));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -153,7 +153,7 @@ h5b_get_field_attrib_info_by_idx (
attrib_idx,
attrib_name, len_attrib_name,
attrib_type, attrib_nelem));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -181,7 +181,7 @@ h5b_get_field_attrib_info_by_name (
f->b->field_gid,
attrib_name,
attrib_type, attrib_nelem));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
static inline h5_err_t
@@ -254,7 +254,7 @@ h5b_set_3d_field_coords (
coords,
n_coords));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -289,7 +289,7 @@ h5b_get_3d_field_coords (
H5_FLOAT64,
coords));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+17 -15
View File
@@ -19,6 +19,8 @@
#include "h5core/h5_syscall.h"
#include "h5core/h5b_io.h"
#include <string.h>
/*!
\ingroup h5_private
@@ -38,7 +40,7 @@ h5bpriv_open_file (
h5b_fdata_t* b;
if (f->b)
H5_PRIV_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
TRY (f->b = (h5b_fdata_t*)h5_calloc (1, sizeof (*f->b)));
@@ -61,7 +63,7 @@ h5bpriv_open_file (
TRY (b->dcreate_prop = hdf5_create_property (H5P_DATASET_CREATE));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -92,7 +94,7 @@ h5bpriv_close_file (
TRY (h5_free (f->b));
f->b = NULL;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -104,7 +106,7 @@ _select_hyperslab_for_writing (
re-use existing hyperslab
*/
if ( f->b->shape >= 0 )
H5_PRIV_FUNC_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
h5b_fdata_t *b = f->b;
h5b_partition_t *p = b->write_layout;
@@ -189,7 +191,7 @@ _select_hyperslab_for_writing (
part_dims,
NULL));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -213,7 +215,7 @@ _write_data (
hid_t type_file;
TRY( type_file = hdf5_get_dataset_type (dataset) );
if ( type != type_file ) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Field '%s' already has type '%s' "
@@ -241,7 +243,7 @@ _write_data (
TRY (h5priv_end_throttle (f));
TRY (hdf5_close_dataset (dataset));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -263,7 +265,7 @@ h5b_write_scalar_data (
TRY( _select_hyperslab_for_writing(f) );
TRY( _write_data(f, field_name, H5_BLOCKNAME_X, data, type) );
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -293,7 +295,7 @@ h5b_write_vector3d_data (
TRY( _write_data(f, field_name, H5_BLOCKNAME_Y, ydata, type) );
TRY( _write_data(f, field_name, H5_BLOCKNAME_Z, zdata, type) );
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -326,7 +328,7 @@ _select_hyperslab_for_reading (
TRY (rank = hdf5_get_dims_of_dataspace(b->diskshape, field_dims, NULL));
if (rank != 3)
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_INVAL,
"H5Block dataset has bad rank '%d' instead"
@@ -336,7 +338,7 @@ _select_hyperslab_for_reading (
if ( (field_dims[0] < (hsize_t)b->k_max) ||
(field_dims[1] < (hsize_t)b->j_max) ||
(field_dims[2] < (hsize_t)b->i_max) )
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_VIEW,
"H5Block dataset has invalid view. "
@@ -373,7 +375,7 @@ _select_hyperslab_for_reading (
(long long)part_dims[1],
(long long)part_dims[0] );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -402,7 +404,7 @@ read_data (
TRY (h5priv_end_throttle (f));
TRY (hdf5_close_dataset(dataset));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -422,7 +424,7 @@ h5b_read_scalar_data (
TRY( h5bpriv_open_field_group(f, field_name) );
TRY( read_data(f, H5_BLOCKNAME_X, data, type) );
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -450,6 +452,6 @@ h5b_read_vector3d_data (
TRY( read_data(f, H5_BLOCKNAME_Y, ydata, type) );
TRY( read_data(f, H5_BLOCKNAME_Z, zdata, type) );
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+27 -27
View File
@@ -43,7 +43,7 @@ h5b_has_field_data (
H5_CORE_API_ENTER (h5_err_t, "f=%p", f);
CHECK_FILEHANDLE (f);
TRY (ret_value = hdf5_link_exists (f->step_gid, H5BLOCK_GROUPNAME_BLOCK));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
static void
@@ -420,7 +420,7 @@ _dissolve_ghostzones (
}
h5_free (p_begin);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif
@@ -441,7 +441,7 @@ h5bpriv_release_hyperslab (
TRY (hdf5_close_dataspace(f->b->memshape));
f->b->memshape = -1;
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -454,11 +454,11 @@ h5bpriv_open_block_group (
TRY (hdf5_close_group (b->block_gid));
b->block_gid = hdf5_open_group (f->step_gid, H5BLOCK_GROUPNAME_BLOCK);
if (f->b->block_gid < 0)
H5_PRIV_API_LEAVE (h5_error(
H5_LEAVE (h5_error(
H5_ERR_INVAL,
"Time step does not contain H5Block data!"));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -476,7 +476,7 @@ _create_block_group (
TRY (f->b->block_gid = hdf5_create_group(
f->step_gid, H5BLOCK_GROUPNAME_BLOCK) );
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -496,7 +496,7 @@ h5bpriv_open_field_group (
H5_ERR_INVAL,
"Field '%s' does not exist!", name2);
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -522,7 +522,7 @@ h5bpriv_create_field_group (
TRY (b->field_gid = hdf5_create_group (b->block_gid, name2));
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_int64_t
@@ -609,7 +609,7 @@ h5b_3d_set_view (
TRY( h5bpriv_release_hyperslab(f) );
b->have_layout = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -641,7 +641,7 @@ h5b_3d_get_view (
*k_start = p->k_start;
*k_end = p->k_end;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -673,7 +673,7 @@ h5b_3d_get_reduced_view (
*k_start = p->k_start;
*k_end = p->k_end;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -702,7 +702,7 @@ h5b_3d_set_chunk (
TRY (hdf5_set_chunk_property (f->b->dcreate_prop, 1, dims));
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -742,7 +742,7 @@ h5b_3d_get_chunk (
(long long)hdims[1],
(long long)hdims[2] );
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#ifdef PARALLEL_IO
@@ -761,7 +761,7 @@ h5b_3d_set_grid (
(long long unsigned)j,
(long long unsigned)k);
if (i*j*k != f->nprocs) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(H5_ERR_INVAL,
"Grid dimensions (%lld,%lld,%lld) do not multiply "
"out to %d MPI processors!",
@@ -782,7 +782,7 @@ h5b_3d_set_grid (
f->b->have_grid = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -798,7 +798,7 @@ h5b_3d_get_grid_coords (
"f=%p, proc=%d, i=%p, j=%p, k=%p",
f, proc, i, j, k);
if ( !f->b->have_grid )
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(H5_ERR_INVAL,
"Grid dimensions have not been set!"));
@@ -807,7 +807,7 @@ h5b_3d_get_grid_coords (
*k = coords[0];
*j = coords[1];
*i = coords[2];
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -825,7 +825,7 @@ h5b_3d_set_dims (
(long long unsigned)j,
(long long unsigned)k);
if ( !f->b->have_grid )
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(H5_ERR_INVAL,
"Grid dimensions have not been set!"));
@@ -839,7 +839,7 @@ h5b_3d_set_dims (
dims[1] != check_dims[1] ||
dims[2] != check_dims[2]
) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(H5_ERR_INVAL,
"[%d] Block dimensions do not agree: "
"(%lld,%lld,%lld) != (%lld,%lld,%lld)!",
@@ -872,7 +872,7 @@ h5b_3d_set_dims (
b->have_layout = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif
@@ -892,11 +892,11 @@ h5b_3d_set_halo (
(long long unsigned)k);
if ( !f->b->have_grid ) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(H5_ERR_INVAL,
"Grid dimensions have not been set!"));
} else if ( !f->b->have_layout ) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(H5_ERR_INVAL,
"Block dimensions for grid have not been set!"));
}
@@ -909,7 +909,7 @@ h5b_3d_set_halo (
b->user_layout->k_start -= k;
b->user_layout->k_end += k;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_ssize_t
@@ -922,7 +922,7 @@ h5b_get_num_fields (
TRY (h5bpriv_open_block_group(f));
TRY (ret_value = hdf5_get_num_objs_in_group (f->b->block_gid));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -938,7 +938,7 @@ h5b_has_field (
const char* path[] = { H5BLOCK_GROUPNAME_BLOCK, name };
TRY (ret_value = h5priv_link_exists_(f->step_gid, path, 2));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -991,7 +991,7 @@ h5b_get_field_info_by_name (
TRY (hdf5_close_dataspace (dataspace_id));
TRY (hdf5_close_dataset (dataset_id));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -1026,6 +1026,6 @@ h5b_get_field_info (
TRY (h5b_get_field_info_by_name (
(h5_file_t)f,
name, field_rank, field_dims, elem_rank, type));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+3 -3
View File
@@ -27,7 +27,7 @@ h5t_get_adjacencies (
"m=%p, entity_id=%llu, dim=%d, list=%p",
m, (long long unsigned)entity_id, dim, list);
TRY (ret_value = h5tpriv_get_adjacencies (m, entity_id, dim, list));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -38,7 +38,7 @@ h5t_release_list_of_adjacencies (
H5_CORE_API_ENTER (h5_err_t, "m=%p, list=%p", m, list);
UNUSED_ARGUMENT (m);
TRY (ret_value = h5priv_free_loc_idlist (list));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -55,5 +55,5 @@ h5t_find_te2 (
(long long)elem_idx,
retval);
TRY (ret_value = h5tpriv_find_te2 (m,face_idx,elem_idx,retval));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
+215 -330
View File
File diff suppressed because it is too large Load Diff
+34 -31
View File
@@ -17,6 +17,8 @@
#include "private/h5t_model.h"
#include "private/h5_mpi.h"
#include <stdlib.h>
/*
Mapping of global to local id's:
@@ -70,7 +72,7 @@ h5tpriv_sort_local_vertex_indices (
}
indices[j] = idx;
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -95,7 +97,7 @@ h5tpriv_find_glb_idx_in_map (
if (loc_idx < 0) { // set to next position
loc_idx = map->num_items;
}
H5_CORE_API_RETURN (loc_idx);
H5_RETURN (loc_idx);
}
/*!
@@ -112,12 +114,12 @@ h5t_map_global_vertex_idx2local (
// loc_idx is position in map
h5_loc_idx_t loc_idx = h5priv_search_idxmap (&m->map_vertex_g2l, glb_idx);
if (loc_idx < 0) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5tpriv_error_global_id_nexist ("vertex", glb_idx));
}
// loc_idx is position in m->vertices!
TRY (ret_value = m->map_vertex_g2l.items[loc_idx].loc_idx);
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -135,7 +137,7 @@ h5t_map_global_vertex_indices2local (
TRY (loc_indices[i] =
h5t_map_global_vertex_idx2local (m, glb_indices[i]));
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -158,13 +160,13 @@ h5t_map_glb_elem_idx2loc (
m, (long long)glb_idx);
// global index is -1, if the cell is at the geometric border
if (glb_idx < 0) H5_CORE_API_LEAVE (-1);
if (glb_idx < 0) H5_LEAVE (-1);
h5_loc_idx_t i = h5priv_search_idxmap (&m->map_elem_g2l, glb_idx);
// global index >= 0 && negative result means: element is on other proc
if (i < 0) H5_CORE_API_LEAVE (-glb_idx-2);
if (i < 0) H5_LEAVE (-glb_idx-2);
H5_CORE_API_RETURN (m->map_elem_g2l.items[i].loc_idx);
H5_RETURN (m->map_elem_g2l.items[i].loc_idx);
}
@@ -185,7 +187,7 @@ h5t_map_glb_elem_indices2loc (
loc_indices++;
glb_indices++;
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -211,7 +213,7 @@ h5tpriv_rebuild_map_vertex_g2l (
m->map_vertex_g2l.num_items++;
}
h5priv_sort_idxmap (&m->map_vertex_g2l);
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
rebuild mapping of global vertex indices to their local indices
@@ -234,7 +236,7 @@ h5tpriv_rebuild_map_vertex_g2l_partial (
m->map_vertex_g2l.num_items++;
}
h5priv_sort_idxmap (&m->map_vertex_g2l);
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
Get local vertex indices of entity given by it's local ID.
@@ -260,7 +262,7 @@ h5t_get_loc_vertex_indices_of_entity (
case H5T_TYPE_TRIANGLE: dim = 2; break;
case H5T_TYPE_TET: dim = 3; break;
default:
H5_CORE_API_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
h5_loc_idx_t* indices = h5tpriv_get_loc_elem_vertex_indices (m, elem_idx);
const h5t_ref_elem_t* ref_elem = m->ref_elem;
@@ -269,7 +271,7 @@ h5t_get_loc_vertex_indices_of_entity (
int idx = h5tpriv_ref_elem_get_vertex_idx(m, dim, face_idx, i);
vertex_indices[i] = indices[idx];
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -293,7 +295,7 @@ h5t_get_glb_vertex_indices_of_entity (
case H5T_TYPE_TRIANGLE: dim = 2; break;
case H5T_TYPE_TET: dim = 3; break;
default:
H5_CORE_API_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
h5_loc_idx_t* indices = h5tpriv_get_loc_elem_vertex_indices (m, elem_idx);
const h5t_ref_elem_t* ref_elem = m->ref_elem;
@@ -303,7 +305,7 @@ h5t_get_glb_vertex_indices_of_entity (
h5_loc_idx_t loc_idx = indices[idx];
vertex_indices[i] = m->vertices[loc_idx].idx;
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -321,7 +323,7 @@ h5tpriv_get_loc_vtx_idx_of_vtx (
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
TRY (ret_value = h5tpriv_get_loc_vtx_idx_of_vtx2 (
m, face_idx, elem_idx, vertex_index));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -338,7 +340,7 @@ h5tpriv_get_loc_vtx_idx_of_vtx2 (
(long long unsigned)elem_idx,
vertex_indices);
vertex_indices[0] = h5tpriv_get_loc_elem_vertex_idx (m, elem_idx, face_idx);
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -360,7 +362,7 @@ h5t_get_loc_vertex_indices_of_edge (
TRY (ret_value = h5t_get_loc_vertex_indices_of_edge2 (
m, face_idx, elem_idx, vertex_indices));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
/*!
@@ -390,7 +392,7 @@ h5t_get_loc_vertex_indices_of_edge2 (
vertex_indices[0] = indices[idx];
idx = h5tpriv_ref_elem_get_vertex_idx (m, 1, face_idx, 1);
vertex_indices[1] = indices[idx];
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -408,7 +410,7 @@ h5t_get_loc_vertex_indices_of_triangle (
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
TRY (ret_value = h5t_get_loc_vertex_indices_of_triangle2 (
m, face_idx, elem_idx, vertex_indices));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -433,7 +435,7 @@ h5t_get_loc_vertex_indices_of_triangle2 (
vertex_indices[1] = indices[idx];
idx = h5tpriv_ref_elem_get_vertex_idx (m, 2, face_idx, 2);
vertex_indices[2] = indices[idx];
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -461,7 +463,7 @@ h5t_get_loc_vertex_indices_of_tet (
vertex_indices[2] = indices[idx];
idx = h5tpriv_ref_elem_get_vertex_idx (m, 3, 0, 3);
vertex_indices[3] = indices[idx];
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#ifdef WITH_PARALLEL_H5GRID
@@ -476,10 +478,10 @@ compare_glb_idx_oct (const void * p_a,const void* p_b) {
*/
h5_err_t
h5priv_exchange_loc_list_to_glb (
h5t_mesh_t* const m,
h5_glb_idxlist_t** glb_list
) {
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p, glb_list=%p", m, glb_list);
h5t_mesh_t* const m,
h5_glb_idxlist_t** glb_list
) {
H5_PRIV_API_ENTER (h5_err_t, "m=%p, glb_list=%p", m, glb_list);
int* num_elems = NULL;
TRY (num_elems = h5_calloc (m->f->nprocs, sizeof (*num_elems)));
@@ -498,7 +500,8 @@ h5priv_exchange_loc_list_to_glb (
// loc -> glb
for (int i = 0; i < m->marked_entities->num_items; i++) {
if (m->marked_entities->items[i] > m->last_stored_eid) {
H5_PRIV_FUNC_LEAVE (h5_error (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Element chosen to be refined is %d but there are only %d elements",
m->marked_entities->items[i],
@@ -536,7 +539,7 @@ h5priv_exchange_loc_list_to_glb (
TRY (h5_free (num_elems));
TRY (h5_free (sendbuf));
TRY (h5_free (recvdispls));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif
@@ -552,7 +555,7 @@ h5priv_find_idlist (
"list=%p, item=%llu",
list, (long long unsigned)item);
if (!list) {
H5_PRIV_API_LEAVE (-1);
H5_LEAVE (-1);
}
register size_t low = 0;
register size_t mid;
@@ -572,8 +575,8 @@ h5priv_find_idlist (
else if ( diff < 0 )
low = mid + 1;
else
H5_PRIV_API_LEAVE (mid); // found
H5_LEAVE (mid); // found
}
H5_PRIV_API_RETURN (-(low+1)); // not found
H5_RETURN (-(low+1)); // not found
}
+25 -25
View File
@@ -264,7 +264,7 @@ h5tpriv_init_mesh (
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -283,7 +283,7 @@ release_elems (
TRY (h5_free (m->num_interior_leaf_elems)); m->num_interior_leaf_elems = NULL;
TRY (h5_free (m->num_ghost_elems)); m->num_ghost_elems = NULL;
TRY (h5_free (m->map_elem_g2l.items)); m->map_elem_g2l.items = NULL;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -297,7 +297,7 @@ release_vertices (
TRY (h5_free (m->map_vertex_g2l.items)); m->map_vertex_g2l.items = NULL;
TRY (h5_free (m->first_b_vtx)); m->first_b_vtx = NULL;
TRY (h5_free (m->num_b_vtx)); m->num_b_vtx = NULL;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -316,7 +316,7 @@ release_memory (
}
#endif
TRY (h5_free (m));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -364,7 +364,7 @@ write_timing (
m->timing.measure[26] - m->timing.measure[25]);
fclose (file);
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
set_timing_file (
@@ -373,7 +373,7 @@ set_timing_file (
) {
H5_CORE_API_ENTER (h5_err_t, "m=%p", m);
m->timing.f = time_f;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
h5t_close_mesh (
@@ -386,7 +386,7 @@ h5t_close_mesh (
#endif
// check if tagsets are still open
if (m->mtagsets && m->mtagsets->num_items > 0)
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_H5FED,
"Mesh cannot be closed: Mesh is referenced by open tagsets"));
@@ -399,7 +399,7 @@ h5t_close_mesh (
TRY (write_timing (m));
#endif
TRY (release_memory (m));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -410,7 +410,7 @@ h5t_set_level (
H5_CORE_API_ENTER (h5_err_t, "m=%p, level_id=%d", m, level_id);
if ((level_id < 0) || (level_id >= m->num_leaf_levels))
H5_CORE_API_LEAVE (HANDLE_H5_OUT_OF_RANGE_ERR ("Level", level_id));
H5_LEAVE (HANDLE_H5_OUT_OF_RANGE_ERR ("Level", level_id));
h5_lvl_idx_t prev_level = m->leaf_level;
m->leaf_level = level_id;
@@ -418,7 +418,7 @@ h5t_set_level (
if (level_id >= m->num_loaded_levels) {
TRY (h5tpriv_update_internal_structs (m, ++prev_level));
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -427,7 +427,7 @@ h5t_set_mesh_changed (
) {
H5_CORE_API_ENTER (h5_err_t, "m=%p",m);
m->mesh_changed = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -438,14 +438,14 @@ h5tpriv_alloc_loc_vertices (
h5t_mesh_t* const m,
const h5_size_t num
) {
H5_PRIV_FUNC_ENTER (h5_err_t,
H5_PRIV_API_ENTER (h5_err_t,
"m=%p, num=%llu",
m,
(long long unsigned)num);
ssize_t size = num * sizeof (m->vertices[0]);
TRY (m->vertices = h5_alloc (m->vertices, size));
TRY (h5priv_grow_idxmap (&m->map_vertex_g2l, num));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -469,12 +469,12 @@ get_num_meshes (
h5_err_t exists;
TRY (exists = hdf5_link_exists (f->root_gid, H5T_CONTAINER_GRPNAME));
if (!exists) H5_CORE_API_LEAVE (0);
if (!exists) H5_LEAVE (0);
TRY (topo_gid = hdf5_open_group (f->root_gid, H5T_CONTAINER_GRPNAME));
TRY (exists = hdf5_link_exists (topo_gid, grpname));
if (!exists) H5_CORE_API_LEAVE (0);
if (!exists) H5_LEAVE (0);
TRY (meshes_gid = hdf5_open_group (topo_gid, grpname));
h5_ssize_t num_meshes;
@@ -482,7 +482,7 @@ get_num_meshes (
TRY (hdf5_close_group (meshes_gid) );
TRY (hdf5_close_group (topo_gid) );
H5_CORE_API_RETURN (num_meshes);
H5_RETURN (num_meshes);
}
h5_ssize_t
@@ -491,7 +491,7 @@ h5t_get_num_tetmeshes (
) {
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", (h5_file_p)fh);
TRY (ret_value = get_num_meshes (fh, TETRAHEDRAL_MESHES_GRPNAME));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_ssize_t
@@ -500,7 +500,7 @@ h5t_get_num_trimeshes (
) {
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", (h5_file_p)fh);
TRY (ret_value = get_num_meshes (fh, TRIANGLE_MESHES_GRPNAME));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
/*!
@@ -515,7 +515,7 @@ h5t_get_num_leaf_levels (
h5t_mesh_t* const m
) {
H5_CORE_API_ENTER (h5_ssize_t, "m=%p", m);
H5_CORE_API_RETURN (m->num_leaf_levels);
H5_RETURN (m->num_leaf_levels);
}
/*!
@@ -530,7 +530,7 @@ h5t_get_level (
h5t_mesh_t* const m
) {
H5_CORE_API_ENTER (h5_lvl_idx_t, "m=%p", m);
H5_CORE_API_RETURN (m->leaf_level);
H5_RETURN (m->leaf_level);
}
/*!
@@ -557,9 +557,9 @@ h5t_get_num_leaf_elems (
UNUSED_ARGUMENT (cnode);
if (m->leaf_level < 0) {
H5_CORE_API_LEAVE (h5tpriv_error_undef_level ());
H5_LEAVE (h5tpriv_error_undef_level ());
}
H5_CORE_API_RETURN (m->num_interior_leaf_elems[m->leaf_level]);
H5_RETURN (m->num_interior_leaf_elems[m->leaf_level]);
}
/*!
Return number of vertices on compute node \c cnode_id
@@ -585,9 +585,9 @@ h5t_get_num_vertices (
UNUSED_ARGUMENT (cnode);
if (m->leaf_level < 0) {
H5_CORE_API_LEAVE (h5tpriv_error_undef_level ());
H5_LEAVE (h5tpriv_error_undef_level ());
}
H5_CORE_API_RETURN (m->num_loc_vertices[m->leaf_level]);
H5_RETURN (m->num_loc_vertices[m->leaf_level]);
}
/*!
@@ -602,6 +602,6 @@ h5t_is_chunked (
h5t_mesh_t* const m
) {
H5_CORE_API_ENTER (h5_lvl_idx_t, "m=%p", m);
H5_CORE_API_RETURN (m->is_chunked);
H5_RETURN (m->is_chunked);
}
+290 -236
View File
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -83,7 +83,7 @@ iterate_boundary_facets (
h5_loc_id_t elem_id;
TRY( elem_id = iterate_geom_boundary_elems (iter) );
if (elem_id == H5_NOK) {
H5_PRIV_FUNC_LEAVE (H5_NOK); // done!
H5_LEAVE (H5_NOK); // done!
}
it->elem_idx = h5tpriv_get_elem_idx (elem_id);
it->face_idx = 0;
@@ -93,7 +93,7 @@ iterate_boundary_facets (
} while (!h5tpriv_is_boundary_facet (it->mesh, it->elem_idx, it->face_idx));
int type = h5tpriv_ref_elem_get_entity_type (it, dim);
TRY (ret_value = h5tpriv_build_entity_id (type, it->face_idx, it->elem_idx));
H5_PRIV_FUNC_RETURN (ret_value);
H5_RETURN (ret_value);
}
/*!
@@ -112,7 +112,7 @@ iterate_leaf_faces (
do {
if (it->face_idx >= num_faces) {
if (iter_leaf_elem_idx (it) == H5_NOK) {
H5_PRIV_FUNC_LEAVE (H5_NOK); // done!
H5_LEAVE (H5_NOK); // done!
}
it->face_idx = 0;
} else {
@@ -141,7 +141,7 @@ iterate_leaf_faces (
current level and the element index of entry->items[i] is the smallest
element index with the given face on the current level.
*/
H5_PRIV_FUNC_RETURN (entry->items[i]);
H5_RETURN (entry->items[i]);
}
/*
@@ -165,7 +165,7 @@ iterate_boundary_faces (
h5_loc_id_t elem_id;
TRY( elem_id = iterate_geom_boundary_elems (iter) );
if (elem_id == H5_NOK) {
H5_PRIV_FUNC_LEAVE (H5_NOK); // done!
H5_LEAVE (H5_NOK); // done!
}
it->face_idx = 0;
} else {
@@ -175,7 +175,7 @@ iterate_boundary_faces (
it->mesh, dim, it->elem_idx, it->face_idx));
// Skip already visited faces
} while (0);
H5_PRIV_FUNC_RETURN (h5_error_internal ());
H5_RETURN (h5_error_internal ());
}
static h5_loc_id_t
@@ -196,7 +196,7 @@ iterate_tags (
tags = iter->tagset->elems[iter->elem_idx];
} while ((tags == NULL) || (tags->idx[iter->subentity_idx]));
#endif
H5_PRIV_FUNC_RETURN (h5_error_internal ());
H5_RETURN (h5_error_internal ());
}
h5_err_t
@@ -220,7 +220,7 @@ h5t_init_leaf_iterator (
it->iter = iterate_leaf_elems;
}
TRY (h5tpriv_init_entity_iterator (m, iter, codim));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -239,14 +239,14 @@ h5t_init_boundary_face_iterator (
it->ref_elem = m->ref_elem;
if (it->codim <= 0 || it->codim > it->ref_elem->dim) {
H5_CORE_API_LEAVE (h5tpriv_inval_codim (codim, 1, it->ref_elem->dim));
H5_LEAVE (h5tpriv_inval_codim (codim, 1, it->ref_elem->dim));
} else if (it->codim == 1) {
it->iter = iterate_boundary_facets;
}
else if (it->codim > 1) {
it->iter = iterate_boundary_faces;
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -263,7 +263,7 @@ h5t_init_mtag_iterator (
it->subentity_idx = 999;
it->level_idx = m->leaf_level;
it->iter = iterate_tags;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -272,7 +272,7 @@ h5t_release_entity_iterator (
) {
H5_CORE_API_ENTER (h5_err_t, "iter=%p", iter);
TRY (ret_value = h5_free (iter));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_loc_id_t
@@ -280,7 +280,7 @@ h5t_iterate_entities (
h5t_iterator_t* iter
) {
H5_CORE_API_ENTER (h5_err_t, "iter=%p", iter);
H5_CORE_API_RETURN (iter->iter (iter));
H5_RETURN (iter->iter (iter));
}
h5_err_t
@@ -293,7 +293,7 @@ h5t_end_iterate_entities (
it->face_idx = -1;
it->elem_idx = -1;
it->codim = -1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -309,7 +309,7 @@ h5t_get_vertex_coords_by_index (
P);
h5_loc_vertex_t *vertex = &m->vertices[vertex_index];
memcpy ( P, &vertex->P, sizeof ( vertex->P ) );
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -326,7 +326,7 @@ h5t_get_vertex_coords_by_id (
h5_loc_idx_t vertex_index;
TRY (h5tpriv_get_loc_vtx_idx_of_vtx (m, vertex_id, &vertex_index));
TRY (h5t_get_vertex_coords_by_index (m, vertex_index, P));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -344,7 +344,7 @@ h5t_get_vertex_by_id (
TRY (h5tpriv_get_loc_vtx_idx_of_vtx (m, vertex_id, &idx));
*glb_idx = m->vertices[idx].idx;
*P = m->vertices[idx].P;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -365,5 +365,5 @@ h5t_get_neighbor_indices (
for (int i = 0; i < num_facets; i++) {
neighbor_indices[i] = indices[i];
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+232 -242
View File
File diff suppressed because it is too large Load Diff
+35 -35
View File
@@ -35,7 +35,7 @@ read_dataset (
hid_t (*set_dspace)(h5t_mesh_t*,hid_t),
void* const data
) {
H5_PRIV_API_ENTER (h5_err_t,
H5_PRIV_FUNC_ENTER (h5_err_t,
"f=%p, dset_id=%lld (%s), dsinfo=%p, set_mspace=%p, "
"set_dspace=%p, data=%p",
f, (long long int)dset_id, hdf5_get_objname(dset_id),
@@ -59,7 +59,7 @@ read_dataset (
TRY (hdf5_close_dataspace (dspace_id));
TRY (hdf5_close_dataspace (mspace_id));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static hid_t
@@ -83,14 +83,14 @@ h5t_get_num_mtagsets (
h5_ssize_t num_mtagsets = 0;
h5_err_t exists = 0;
TRY (exists = h5priv_link_exists (m->mesh_gid, "Tags"));
if (!exists) H5_CORE_API_LEAVE (0);
if (!exists) H5_LEAVE (0);
hid_t loc_id;
TRY (loc_id = h5priv_open_group (0, m->mesh_gid, "Tags"));
TRY (num_mtagsets = hdf5_get_num_groups (loc_id));
TRY (hdf5_close_group (loc_id));
H5_CORE_API_RETURN (num_mtagsets);
H5_RETURN (num_mtagsets);
}
@@ -121,7 +121,7 @@ get_tagset_info (
TRY (hdf5_close_dataset (dset_id));
TRY (hdf5_close_group (tag_id));
TRY (hdf5_close_group (tags_id));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -142,7 +142,7 @@ h5t_get_mtagset_info (
m, (long long unsigned)idx, name,
(long long unsigned)len_name, type);
TRY (ret_value = get_tagset_info(m->mesh_gid, idx, name, len_name, type));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
/*!
@@ -155,7 +155,7 @@ h5t_mtagset_exists (
) {
H5_CORE_API_ENTER (h5_err_t, "m=%p, name=%s", m, name);
TRY (ret_value = h5priv_link_exists (m->mesh_gid, "Tags", name));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
static h5_err_t
@@ -185,7 +185,7 @@ new_tagset (
TRY (h5priv_search_strlist (&m->mtagsets, name));
*rtagset = tagset;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -203,13 +203,13 @@ h5t_create_mtagset (
m, name, (long long unsigned)type, set);
// validate name
if (name == NULL || name[0] == '\0') {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (H5_ERR_INVAL, "Invalid name" ));
}
// validate type
if (type != H5_INT64 && type != H5_FLOAT64) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (H5_ERR_INVAL, "Unsupported data type." ));
}
@@ -217,12 +217,12 @@ h5t_create_mtagset (
h5_err_t exists;
TRY (exists = h5priv_link_exists (m->mesh_gid, "Tags", name));
if (exists || h5priv_find_strlist (m->mtagsets, name) >= 0)
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_H5FED,
"Cannot create tagset '%s': Tagset exists", name));
TRY (ret_value = new_tagset (m, m->mesh_gid, name, type, set));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
static int
@@ -258,7 +258,7 @@ remove_tag (
"tagset=%p, face_id=%lld, elem_idx=%lld",
tagset, (long long)face_id, (long long)elem_idx);
if (tagset->elems[elem_idx] == NULL) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_warn (
"Tag %s not set for face %llx of element %lld",
tagset->name,
@@ -270,7 +270,7 @@ remove_tag (
// remove values
int idx = find_face_id (eleminfo, face_id);
if (idx < 0) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_warn (
"Tag %s not set for face %llx of element %lld",
tagset->name,
@@ -290,7 +290,7 @@ remove_tag (
(eleminfo->num_tags-idx-1)*sizeof (ti[0]) );
// we don't resize the eleminfo structure!!!
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -328,7 +328,7 @@ add_tag (
dim*sizeof (*tagset->values));
ti->val_idx = tagset->num_values;
tagset->num_values += dim;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -387,7 +387,7 @@ set_tag (
if (tagset->m->leaf_level > tagset->scope.max_level) {
tagset->scope.max_level = tagset->m->leaf_level;
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -491,7 +491,7 @@ read_tagset (
TRY (h5_free (elems));
TRY (h5_free (entities));
TRY (h5_free (vals));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -508,20 +508,20 @@ h5t_open_mtagset (
m, name, set);
// validate name
if (name == NULL || name[0] == '\0') {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (H5_ERR_INVAL, "Invalid name" ));
}
// check if a tagset with given name exists
h5_err_t exists;
TRY (exists = h5priv_link_exists (m->mesh_gid, "Tags", name));
if (!exists) H5_CORE_API_LEAVE (
if (!exists) H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Cannot open tagset '%s': No such tagset ", name));
// check if tagset has already been opened
if (h5priv_find_strlist (m->mtagsets, name) >= 0) H5_CORE_API_LEAVE (
if (h5priv_find_strlist (m->mtagsets, name) >= 0) H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Cannot open tagset '%s': Already open ", name));
@@ -529,7 +529,7 @@ h5t_open_mtagset (
TRY (new_tagset (m, m->mesh_gid, name, -1, set));
TRY (read_tagset (*set));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -555,11 +555,11 @@ write_tagset (
h5t_mesh_t* m = tagset->m;
if (m->num_leaf_levels <= 0) {
H5_PRIV_FUNC_LEAVE (H5_SUCCESS); // nothing to do
H5_LEAVE (H5_SUCCESS); // nothing to do
}
num_interior_elems = m->num_interior_elems[m->num_leaf_levels-1];
if (num_interior_elems == 0 || tagset->num_entities == 0) {
H5_PRIV_FUNC_LEAVE (H5_SUCCESS); // nothing to do
H5_LEAVE (H5_SUCCESS); // nothing to do
}
// allocate memory per element (plus 1)
TRY (elems = h5_calloc (num_interior_elems+1, sizeof(*elems)));
@@ -664,7 +664,7 @@ write_tagset (
TRY (h5_free (elems));
TRY (h5_free (entities));
TRY (h5_free (values));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -691,7 +691,7 @@ release_mtagset (
TRY (h5_free (tagset->values));
TRY (h5_free (tagset));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -708,7 +708,7 @@ h5t_close_mtagset (
TRY (write_tagset (tagset));
}
TRY (release_mtagset (tagset));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -745,7 +745,7 @@ remove_tagset (
TRY (hdf5_delete_link (loc_id, "values", H5P_DEFAULT));
TRY (hdf5_close_group (loc_id));
TRY (hdf5_delete_link (tagsets_id, name, H5P_DEFAULT));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -764,7 +764,7 @@ h5t_remove_mtagset (
H5_CORE_API_ENTER (h5_err_t, "m=%p, name='%s'", m, name);
// check if tagset has a copy in memory
if (h5priv_find_strlist (m->mtagsets, name) >= 0) H5_CORE_API_LEAVE (
if (h5priv_find_strlist (m->mtagsets, name) >= 0) H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Cannot remove tagset '%s': Still open ", name));
@@ -773,7 +773,7 @@ h5t_remove_mtagset (
TRY (loc_id = hdf5_open_group (m->mesh_gid, "Tags"));
TRY (remove_tagset (loc_id, name));
TRY (hdf5_close_group (loc_id));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -796,7 +796,7 @@ h5t_set_tag (
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
TRY (set_tag (tagset, face_id, elem_idx, size, val));
tagset->changed = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -845,7 +845,7 @@ h5t_get_tag (
dim,
values);
if (tagset->m->leaf_level < tagset->scope.min_level) {
H5_CORE_API_LEAVE (H5_NOK); // entity not tagged
H5_LEAVE (H5_NOK); // entity not tagged
}
h5_loc_id_t id = entity_id;
h5_err_t h5err;
@@ -856,7 +856,7 @@ h5t_get_tag (
(id = h5tpriv_get_loc_entity_parent (tagset->m, id)) >= 0) ;
if (h5err < 0)
H5_CORE_API_LEAVE (H5_NOK); // entity not tagged
H5_LEAVE (H5_NOK); // entity not tagged
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (id);
h5t_taginfo_t* ti = &tagset->elems[elem_idx]->ti[ti_idx];
@@ -867,7 +867,7 @@ h5t_get_tag (
if (values != NULL) {
memcpy (values, v + val_idx, *dim*sizeof(*v) );
}
H5_CORE_API_RETURN (id);
H5_RETURN (id);
}
/*!
@@ -887,6 +887,6 @@ h5t_remove_tag (
h5_loc_idx_t face_id = h5tpriv_get_face_id (entity_id);
h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
TRY (ret_value = remove_tag (tagset, face_id, elem_idx));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
+4 -4
View File
@@ -44,7 +44,7 @@ h5upriv_open_file (
TRY (u->dcreate_prop = hdf5_create_property (H5P_DATASET_CREATE));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -72,7 +72,7 @@ h5upriv_close_file (
TRY (h5_free (f->u));
f->u = NULL;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -172,7 +172,7 @@ h5u_read_data (
TRY (hdf5_close_dataset (dataset_id));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -236,5 +236,5 @@ h5u_write_data (
f->empty = 0;
TRY (hdf5_flush (f->step_gid, H5F_SCOPE_LOCAL));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+39 -37
View File
@@ -38,7 +38,7 @@ h5u_get_num_points (
TRY (nparticles = h5u_get_totalnum_particles_by_idx (fh, 0));
}
H5_CORE_API_RETURN (nparticles);
H5_RETURN (nparticles);
}
h5_ssize_t
@@ -50,14 +50,14 @@ h5u_get_num_points_in_view (
h5_ssize_t nparticles;
if (!h5u_has_view (fh)) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_H5PART,
"No view has been set."));
}
TRY (nparticles = hdf5_get_selected_npoints_of_dataspace(f->u->diskshape));
h5_debug ("Found %lld particles in view.", (long long)nparticles );
H5_CORE_API_RETURN (nparticles);
H5_RETURN (nparticles);
}
h5_ssize_t
@@ -74,7 +74,7 @@ h5u_get_totalnum_particles_by_name (
f->step_gid, dataset_name));
h5_debug ("Found %lld particles in dataset %s.",
(long long)nparticles, dataset_name);
H5_CORE_API_RETURN (nparticles);
H5_RETURN (nparticles);
}
h5_ssize_t
@@ -93,13 +93,13 @@ h5u_get_totalnum_particles_by_idx (
dataset_name,
H5_DATANAME_LEN));
if (h5err == H5_NOK)
H5_CORE_API_LEAVE (H5_NOK);
H5_LEAVE (H5_NOK);
h5_ssize_t nparticles;
TRY (nparticles = hdf5_get_npoints_of_dataset_by_name (
f->step_gid, dataset_name));
h5_debug ("Found %lld particles in dataset %s.",
(long long)nparticles, dataset_name);
H5_CORE_API_RETURN (nparticles);
H5_RETURN (nparticles);
}
h5_err_t
@@ -118,7 +118,7 @@ h5u_set_num_points (
hsize_t dmax = H5S_UNLIMITED;
if (nparticles < 0)
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_INVAL,
"Invalid number of particles: %lld!\n",
@@ -132,7 +132,7 @@ h5u_set_num_points (
we don't know if things have changed globally
*/
if ( u->nparticles == nparticles && stride == 1 ) {
H5_CORE_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
}
#endif
@@ -214,7 +214,7 @@ h5u_set_num_points (
TRY (hdf5_select_none (u->diskshape));
}
#endif
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -223,7 +223,7 @@ h5u_has_view (
) {
h5_file_p f = (h5_file_p)fh;
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
H5_CORE_API_RETURN (f->u->viewindexed || f->u->viewstart >= 0);
H5_RETURN (f->u->viewindexed || f->u->viewstart >= 0);
}
h5_err_t
@@ -242,7 +242,7 @@ h5u_reset_view (
TRY (hdf5_close_dataspace (u->memshape));
u->memshape = H5S_ALL;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -267,7 +267,7 @@ h5u_set_view (
TRY (h5u_reset_view (fh));
if (start == -1 && end == -1) // we are already done
H5_CORE_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
if (f->u->shape > 0) {
TRY (total = hdf5_get_npoints_of_dataspace (f->u->shape) );
@@ -285,7 +285,7 @@ h5u_set_view (
:FIXME: why not gather total size?
*/
if (start < 0) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_INVAL,
"Start of selection '%lld' out of range: "
@@ -294,7 +294,7 @@ h5u_set_view (
);
}
if (end < start) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_INVAL,
"End of selection '%lld' out of range: "
@@ -322,21 +322,21 @@ h5u_set_view (
}
if (start < 0 || start >= total) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_INVAL,
"Start of selection '%lld' out of range: "
"must be in [0..%lld]",
(long long)start, (long long)total-1));
} else if (end < 0 || end >= total) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_INVAL,
"End of selection '%lld' out of range: "
"must be in [0..%lld]",
(long long)end, (long long)total-1));
} else if (end+1 < start) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_INVAL,
"Invalid selection: start=%lld > end=%lld!\n",
@@ -371,7 +371,7 @@ h5u_set_view (
/* declare local memory datasize */
TRY (u->memshape = hdf5_create_dataspace (1, &hcount, &dmax));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -389,7 +389,7 @@ h5u_set_view_length (
TRY (h5u_reset_view (fh));
if (start == -1 && length == -1)
H5_CORE_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
hsize_t total = 0;
if (u->shape > 0) {
@@ -404,11 +404,11 @@ h5u_set_view_length (
/* No datasets have been created yet and no views are set.
* We have to leave the view empty because we don't know how
* many particles there should be! */
H5_CORE_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
}
if (start < 0 || length < 0 || start+length > total)
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_INVAL,
"Invalid view: start=%lld, length=%lld, total=%lld",
@@ -440,7 +440,7 @@ h5u_set_view_length (
/* declare local memory datasize */
hsize_t dmax = H5S_UNLIMITED;
TRY (u->memshape = hdf5_create_dataspace (1, &hcount, &dmax));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -466,7 +466,7 @@ h5u_set_view_indices (
if ( indices == NULL ) {
h5_warn ("View indices array is null: reseting view.");
H5_CORE_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
}
if (f->u->shape > 0) {
TRY (total = hdf5_get_npoints_of_dataspace (f->u->shape) );
@@ -480,7 +480,7 @@ h5u_set_view_indices (
/* No datasets have been created yet and no views are set.
* We have to leave the view empty because we don't know how
* many particles there should be! */
H5_CORE_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
}
u->nparticles = nelems;
@@ -501,7 +501,7 @@ h5u_set_view_indices (
}
u->viewindexed = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_int64_t
@@ -517,7 +517,7 @@ h5u_get_view (
struct h5u_fdata *u = f->u;
if ( u->viewindexed ) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"The current view has an index selection, but "
@@ -540,7 +540,7 @@ h5u_get_view (
if ( start ) *start = viewstart;
if ( end ) *end = viewend;
H5_CORE_API_RETURN (viewend - viewstart + 1); // view range is *inclusive*
H5_RETURN (viewend - viewstart + 1); // view range is *inclusive*
}
h5_err_t
@@ -576,7 +576,7 @@ h5u_set_canonical_view (
h5_int64_t length = u->nparticles;
TRY (h5u_set_view_length (fh, start, length));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_ssize_t
@@ -586,7 +586,7 @@ h5u_get_num_datasets (
h5_file_p f = (h5_file_p)fh;
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
TRY (ret_value = hdf5_get_num_datasets (f->step_gid));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
h5_err_t
@@ -599,7 +599,7 @@ h5u_has_dataset (
"f=%p, name='%s'",
f, name);
TRY (ret_value = hdf5_link_exists (f->step_gid, name));
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
static inline h5_err_t
@@ -619,7 +619,7 @@ get_dataset_info (
TRY (nelem_ = hdf5_get_npoints_of_dataset (dataset_id));
*dataset_nelem = nelem_;
}
H5_INLINE_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -652,7 +652,8 @@ h5priv_get_dataset_info_by_idx (
strncpy (dataset_name, dataset_name_, len_dataset_name);
}
TRY (get_dataset_info (dataset_id, dataset_type, dataset_nelem));
H5_PRIV_API_RETURN (H5_SUCCESS);
TRY (hdf5_close_dataset (dataset_id));
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -684,7 +685,7 @@ h5u_get_dataset_info_by_idx (
idx,
dataset_name, len_dataset_name,
dataset_type, dataset_nelem));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -704,7 +705,8 @@ h5priv_get_dataset_info_by_name (
hid_t dataset_id;
TRY (dataset_id = hdf5_open_dataset_by_name (id, dataset_name));
TRY (get_dataset_info (dataset_id, dataset_type, dataset_nelem));
H5_PRIV_API_RETURN (H5_SUCCESS);
TRY (hdf5_close_dataset (dataset_id));
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -730,7 +732,7 @@ h5u_get_dataset_info_by_name (
f->step_gid,
dataset_name,
dataset_type, dataset_nelem));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -752,7 +754,7 @@ h5u_set_chunk (
TRY (hdf5_set_chunk_property(
f->u->dcreate_prop, 1, (hsize_t*)&size));
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -776,6 +778,6 @@ h5u_get_chunk (
*size = (h5_size_t)hsize;
h5_info ("Found chunk size of %lld particles", (long long)*size);
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+8 -8
View File
@@ -25,7 +25,7 @@ h5priv_get_normalized_attribute_type (
(long long int)attr_id, hdf5_get_objname (attr_id));
TRY (ret_value = hdf5_get_attribute_type (attr_id));
TRY (ret_value = h5priv_normalize_type (ret_value));
H5_PRIV_FUNC_RETURN (ret_value);
H5_RETURN (ret_value);
}
static inline h5_err_t
@@ -65,7 +65,7 @@ h5priv_read_attrib (
hid_t normalized_file_type;
TRY (normalized_file_type = h5priv_normalize_type (file_type));
if (normalized_file_type != normalized_type)
H5_PRIV_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Attribute '%s' has type '%s' but "
@@ -82,7 +82,7 @@ h5priv_read_attrib (
TRY (hdf5_read_attribute (attrib_id, mem_type, attrib_value));
TRY (hdf5_close_dataspace(space_id));
TRY (hdf5_close_attribute (attrib_id));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -120,7 +120,7 @@ h5priv_write_attrib (
if (overwrite) {
TRY (hdf5_delete_attribute (id, attrib_name));
} else {
H5_PRIV_API_LEAVE (
H5_LEAVE (
h5_error (H5_ERR_H5,
"Cannot overwrite attribute %s/%s",
hdf5_get_objname (id), attrib_name));
@@ -137,7 +137,7 @@ h5priv_write_attrib (
TRY (hdf5_close_attribute (attrib_id));
TRY (hdf5_close_dataspace (space_id));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -170,7 +170,7 @@ get_attrib_info (
TRY (*attrib_type = h5priv_map_hdf5_type_to_enum (datatype_id));
}
TRY (hdf5_close_attribute (attrib_id));
H5_INLINE_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -189,7 +189,7 @@ h5priv_get_attrib_info_by_name (
attrib_type, attrib_nelem);
hid_t attrib_id;
TRY (attrib_id = hdf5_open_attribute_by_name (id, attrib_name));
H5_PRIV_API_RETURN (
H5_RETURN (
get_attrib_info (
attrib_id, attrib_type, attrib_nelem));
}
@@ -224,7 +224,7 @@ h5priv_get_attrib_info_by_idx (
(size_t)len_attrib_name,
attrib_name));
}
H5_PRIV_API_RETURN (
H5_RETURN (
get_attrib_info (
attrib_id, attrib_type, attrib_nelem));
}
+20 -18
View File
@@ -10,11 +10,13 @@
#include <string.h>
#include <hdf5.h>
#include "private/h5_log.h"
#include "private/h5_hdf5.h"
#include "h5core/h5_types.h"
#include "h5core/h5_syscall.h"
/*
Test whether given path exists.
*/
@@ -38,16 +40,16 @@ h5priv_link_exists_ (
*s++ = '/';
*s = '\0';
}
if (s+strlen(path[i])+1 >= end) H5_PRIV_API_LEAVE (
if (s+strlen(path[i])+1 >= end) H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"path %s... to long", name));
s = stpcpy (s, path[i]); // return ptr to end!!!
h5_err_t exists;
TRY (exists = hdf5_link_exists (loc_id, name));
if (!exists) H5_PRIV_FUNC_LEAVE (0);
if (!exists) H5_LEAVE (0);
}
H5_PRIV_FUNC_RETURN (1);
H5_RETURN (1);
}
h5_err_t
@@ -71,7 +73,7 @@ h5priv_open_group_ (
} else if (create_intermediate) {
TRY (hid2 = hdf5_create_group (hid, path[i]));
} else {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"No such group '%s/%s'.",
@@ -84,7 +86,7 @@ h5priv_open_group_ (
}
hid = hid2;
}
H5_PRIV_FUNC_RETURN (hid);
H5_RETURN (hid);
}
typedef struct op_data {
@@ -212,12 +214,12 @@ iter_op_count_match (
H5O_type_t type;
TRY (type = iter_op_get_obj_type (g_id, name, info));
if (type != op_data->type)
H5_PRIV_FUNC_LEAVE (0);
H5_LEAVE (0);
/* count if prefix matches */
if (strncmp (name, op_data->prefix, strlen(op_data->prefix)) == 0) {
op_data->cnt++;
}
H5_PRIV_FUNC_RETURN (0);
H5_RETURN (0);
}
ssize_t
@@ -235,13 +237,13 @@ hdf5_get_num_groups (
&start_idx,
iter_op_count, &op_data);
if (herr < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get number of groups in '%s'.",
hdf5_get_objname (loc_id)));
}
HDF5_WRAPPER_RETURN (op_data.cnt);
H5_RETURN (op_data.cnt);
}
ssize_t
@@ -261,14 +263,14 @@ hdf5_get_num_groups_matching_prefix (
&start_idx,
iter_op_count_match, &op_data);
if (herr < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get number of groups with prefix"
" '%s' in '%s'.",
prefix, hdf5_get_objname (loc_id)));
}
HDF5_WRAPPER_RETURN (op_data.cnt);
H5_RETURN (op_data.cnt);
}
h5_err_t
@@ -294,7 +296,7 @@ hdf5_get_name_of_group_by_idx (
&start_idx,
iter_op_idx, &op_data);
if (herr < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get name of group with index"
@@ -302,7 +304,7 @@ hdf5_get_name_of_group_by_idx (
(long unsigned int)idx,
hdf5_get_objname (loc_id)));
}
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
ssize_t
@@ -320,13 +322,13 @@ hdf5_get_num_datasets (
&start_idx,
iter_op_count, &op_data);
if (herr < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get number of datasets in '%s'.",
hdf5_get_objname (loc_id)));
}
HDF5_WRAPPER_RETURN (op_data.cnt);
H5_RETURN (op_data.cnt);
}
/*
@@ -355,7 +357,7 @@ hdf5_get_name_of_dataset_by_idx (
&start_idx,
iter_op_idx, &op_data);
if (herr < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get name of dataset with index"
@@ -364,8 +366,8 @@ hdf5_get_name_of_dataset_by_idx (
hdf5_get_objname (loc_id)));
}
if (op_data.cnt < 0)
HDF5_WRAPPER_LEAVE (H5_NOK);
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (H5_NOK);
H5_RETURN (H5_SUCCESS);
}
/****** I d e n t i f i e r **************************************************/
+148 -139
View File
@@ -14,6 +14,8 @@
#include "h5core/h5_types.h"
#include "h5core/h5_err.h"
#include "h5core/h5_syscall.h"
#include "private/h5_log.h"
#include "private/h5_va_macros.h"
@@ -89,12 +91,12 @@ hdf5_link_exists (
H5Eset_auto(H5E_DEFAULT, old_func, old_client_data);
if (exists < 0 )
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot query link %s/%s.",
hdf5_get_objname (loc_id), name));
HDF5_WRAPPER_RETURN (exists);
H5_RETURN (exists);
}
static inline h5_err_t
@@ -108,13 +110,13 @@ hdf5_delete_link (
(long long int)loc_id, hdf5_get_objname (loc_id), name,
(long long int)lapl_id);
if (H5Ldelete (loc_id, name, lapl_id) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot delete link %s/%s.",
hdf5_get_objname (loc_id), name));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/****** G r o u p ************************************************************/
@@ -131,13 +133,13 @@ hdf5_open_group (
group_name);
hid_t group_id = H5Gopen (loc_id, group_name, H5P_DEFAULT);
if (group_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot open group '%s/%s'.",
hdf5_get_objname (loc_id),
group_name));
HDF5_WRAPPER_RETURN (group_id);
H5_RETURN (group_id);
}
static inline hid_t
@@ -153,13 +155,13 @@ hdf5_create_group (
hid_t group_id = H5Gcreate (
loc_id, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (group_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot create group '%s/%s'.",
hdf5_get_objname (loc_id),
group_name));
HDF5_WRAPPER_RETURN (group_id);
H5_RETURN (group_id);
}
h5_err_t
@@ -193,15 +195,15 @@ hdf5_close_group (
hdf5_get_objname (group_id));
if (group_id == 0 || group_id == -1)
HDF5_WRAPPER_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
if (H5Gclose (group_id) < 0 ) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot terminate access to group '%s').",
hdf5_get_objname (group_id)));
}
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_ssize_t
@@ -214,13 +216,13 @@ hdf5_get_num_objs_in_group (
hdf5_get_objname (group_id));
H5G_info_t group_info;
if (H5Gget_info (group_id, &group_info) < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get number of objects in group '%s'.",
hdf5_get_objname(group_id)));
}
HDF5_WRAPPER_RETURN ((h5_ssize_t)group_info.nlinks);
H5_RETURN ((h5_ssize_t)group_info.nlinks);
}
@@ -246,13 +248,13 @@ hdf5_get_objname_by_idx (
name, size,
H5P_DEFAULT);
if (len < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get name of object %llu in group '%s'.",
(unsigned long long)idx,
hdf5_get_objname (loc_id)));
HDF5_WRAPPER_RETURN (len);
H5_RETURN (len);
}
/****** D a t a s p a c e ****************************************************/
@@ -273,12 +275,12 @@ hdf5_create_dataspace (
);
hid_t dataspace_id = H5Screate_simple (rank, dims, maxdims);
if (dataspace_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot create dataspace with rank %d.",
rank));
HDF5_WRAPPER_RETURN (dataspace_id);
H5_RETURN (dataspace_id);
}
static inline hid_t
@@ -288,11 +290,11 @@ hdf5_create_dataspace_scalar (
HDF5_WRAPPER_ENTER (hid_t, "%s", "void");
hid_t dataspace_id = H5Screate (H5S_SCALAR);
if (dataspace_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot create scalar dataspace."));
HDF5_WRAPPER_RETURN (dataspace_id);
H5_RETURN (dataspace_id);
}
static inline h5_err_t
@@ -313,12 +315,12 @@ hdf5_select_hyperslab_of_dataspace (
count,
block);
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot set select hyperslap region or add the "
"specified region"));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -340,12 +342,12 @@ hdf5_select_elements_of_dataspace (
herr = H5Sselect_none ( space_id );
}
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot set select hyperslap region or add the "
"specified region"));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -357,12 +359,12 @@ hdf5_select_none (
(long long int)space_id);
herr_t herr = H5Sselect_none (space_id);
if (herr < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Selection for writing zero-length data failed"));
}
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_ssize_t
@@ -372,12 +374,12 @@ hdf5_get_selected_npoints_of_dataspace (
HDF5_WRAPPER_ENTER (h5_ssize_t, "%lld", (long long int)space_id);
hssize_t size = H5Sget_select_npoints (space_id);
if (size < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Cannot determine number of "
"selected elements in dataspace."));
HDF5_WRAPPER_RETURN (size);
H5_RETURN (size);
}
static inline h5_ssize_t
@@ -387,12 +389,12 @@ hdf5_get_npoints_of_dataspace (
HDF5_WRAPPER_ENTER (h5_ssize_t, "%lld", (long long int)space_id);
hssize_t size = H5Sget_simple_extent_npoints (space_id);
if (size < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Cannot determine number of"
"elements in dataspace."));
HDF5_WRAPPER_RETURN (size);
H5_RETURN (size);
}
static inline int
@@ -404,11 +406,11 @@ hdf5_get_dims_of_dataspace (
HDF5_WRAPPER_ENTER (int, "%lld", (long long int)space_id);
int rank = H5Sget_simple_extent_dims (space_id, dims, maxdims);
if (rank < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot determine rank of dataspace."));
HDF5_WRAPPER_RETURN (rank);
H5_RETURN (rank);
}
@@ -421,16 +423,16 @@ hdf5_close_dataspace (
) {
HDF5_WRAPPER_ENTER (h5_err_t, "dataspace=%lld", (long long int)dataspace_id);
if (dataspace_id <= 0 || dataspace_id == H5S_ALL)
HDF5_WRAPPER_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
herr_t herr = H5Sclose (dataspace_id);
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Cannot terminate access to dataspace!"));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/****** D a t a s e t ********************************************************/
@@ -452,13 +454,13 @@ hdf5_open_dataset_by_name (
dataset_name,
H5P_DEFAULT);
if (dataset_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot open dataset '%s/%s'.",
hdf5_get_objname (loc_id),
dataset_name));
HDF5_WRAPPER_RETURN (dataset_id);
H5_RETURN (dataset_id);
}
/*!
@@ -490,13 +492,13 @@ hdf5_create_dataset (
create_proplist,
H5P_DEFAULT);
if (dataset_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Cannot create dataset '%s/%s'",
hdf5_get_objname (loc_id),
dataset_name));
HDF5_WRAPPER_RETURN (dataset_id);
H5_RETURN (dataset_id);
}
/*!
@@ -511,16 +513,16 @@ hdf5_close_dataset (
(long long int)dataset_id,
hdf5_get_objname (dataset_id));
if (dataset_id < 0)
HDF5_WRAPPER_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
if (H5Dclose (dataset_id) < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Close of dataset '%s' failed.",
hdf5_get_objname (dataset_id)));
}
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -536,12 +538,12 @@ hdf5_get_dataset_space (
hdf5_get_objname(dataset_id));
hid_t dataspace_id = H5Dget_space (dataset_id);
if (dataspace_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get dataspace for dataset '%s'.",
hdf5_get_objname (dataset_id)));
HDF5_WRAPPER_RETURN (dataspace_id);
H5_RETURN (dataspace_id);
}
/*!
@@ -570,13 +572,13 @@ hdf5_write_dataset (
xfer_prop,
buf);
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Write to dataset '%s' failed.", \
hdf5_get_objname (dataset_id)));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -603,13 +605,13 @@ hdf5_read_dataset (
xfer_prop,
buf);
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Error reading dataset '%s'.",
hdf5_get_objname (dataset_id)));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline hid_t
@@ -622,12 +624,12 @@ hdf5_get_dataset_type (
hdf5_get_objname(dataset_id));
hid_t datatype_id = H5Dget_type (dataset_id);
if (datatype_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Cannot determine dataset type."));
HDF5_WRAPPER_RETURN (datatype_id);
H5_RETURN (datatype_id);
}
static inline h5_err_t
@@ -641,13 +643,13 @@ hdf5_set_dataset_extent (
hdf5_get_objname(dataset_id),
*size);
if (H5Dset_extent(dataset_id, size) < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Changing size of dataset '%s' dimensions failed.",
hdf5_get_objname (dataset_id)));
}
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_ssize_t
@@ -663,7 +665,7 @@ hdf5_get_npoints_of_dataset (
TRY (dspace_id = hdf5_get_dataset_space (dataset_id));
TRY (size = hdf5_get_npoints_of_dataspace (dspace_id));
TRY (hdf5_close_dataspace (dspace_id));
HDF5_WRAPPER_RETURN (size);
H5_RETURN (size);
}
static inline h5_ssize_t
@@ -681,7 +683,7 @@ hdf5_get_npoints_of_dataset_by_name (
TRY (dset_id = hdf5_open_dataset_by_name (loc_id, name));
TRY (size = hdf5_get_npoints_of_dataset (dset_id));
TRY (hdf5_close_dataset (dset_id));
HDF5_WRAPPER_RETURN (size);
H5_RETURN (size);
}
/****** D a t a t y p e ******************************************************/
@@ -705,27 +707,27 @@ hdf5_get_native_type (
switch (tclass){
case H5T_INTEGER:
if (size==8) {
HDF5_WRAPPER_LEAVE (H5T_NATIVE_INT64);
H5_LEAVE (H5T_NATIVE_INT64);
} else if (size==4) {
HDF5_WRAPPER_LEAVE (H5T_NATIVE_INT32);
H5_LEAVE (H5T_NATIVE_INT32);
} else if (size==2) {
HDF5_WRAPPER_LEAVE (H5T_NATIVE_INT16);
H5_LEAVE (H5T_NATIVE_INT16);
}
break;
case H5T_FLOAT:
if (size==8) {
HDF5_WRAPPER_LEAVE (H5T_NATIVE_FLOAT);
H5_LEAVE (H5T_NATIVE_FLOAT);
}
else if (size==4) {
HDF5_WRAPPER_LEAVE (H5T_NATIVE_DOUBLE);
H5_LEAVE (H5T_NATIVE_DOUBLE);
}
break;
case H5T_STRING:
HDF5_WRAPPER_LEAVE (H5T_NATIVE_CHAR);
H5_LEAVE (H5T_NATIVE_CHAR);
default:
; /* NOP */
}
HDF5_WRAPPER_RETURN (
H5_RETURN (
h5_error (
H5_ERR_INVAL,
"Unknown data type %lld",
@@ -771,7 +773,7 @@ hdf5_get_type_name (
default:
ret_value = "unknown";
}
HDF5_WRAPPER_RETURN (ret_value);
H5_RETURN (ret_value);
}
static inline const char*
@@ -810,7 +812,7 @@ hdf5_create_array_type (
rank);
hid_t type_id = H5Tarray_create (base_type_id, rank, dims);
if (type_id < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Can't create array datatype object with base "
@@ -818,7 +820,7 @@ hdf5_create_array_type (
hdf5_get_type_name (base_type_id),
rank));
}
HDF5_WRAPPER_RETURN (type_id);
H5_RETURN (type_id);
}
static inline hid_t
@@ -832,13 +834,13 @@ hdf5_create_type (
get_class_type_name (class));
hid_t type_id = H5Tcreate (class, size);
if (type_id < 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Can't create datatype object of class %s.",
get_class_type_name (class)));
}
HDF5_WRAPPER_RETURN (type_id);
H5_RETURN (type_id);
}
static inline hid_t
@@ -848,18 +850,18 @@ hdf5_create_string_type(
HDF5_WRAPPER_ENTER (hid_t, "len = %llu", len);
hid_t type_id = H5Tcopy (H5T_C_S1);
if (type_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Can't duplicate C string type."));
herr_t herr = H5Tset_size (type_id, len);
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Can't set length of C string type."));
HDF5_WRAPPER_RETURN (type_id);
H5_RETURN (type_id);
}
static inline h5_err_t
@@ -874,12 +876,12 @@ hdf5_insert_type (
(long long int)type_id, name);
herr_t herr = H5Tinsert (type_id, name, offset, field_id);
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Can't insert field %s to compound datatype.",
name));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline H5T_class_t
@@ -889,12 +891,12 @@ hdf5_get_class_type (
HDF5_WRAPPER_ENTER (h5_err_t, "dtype_id=%lld", (long long int)dtype_id);
H5T_class_t class = H5Tget_class (dtype_id);
if (class < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Can't determine class of type %lld.",
(long long int)dtype_id));
HDF5_WRAPPER_RETURN (class);
H5_RETURN (class);
}
static inline h5_ssize_t
@@ -906,13 +908,13 @@ hdf5_get_sizeof_type (
(long long int)dtype_id);
h5_ssize_t size = H5Tget_size (dtype_id);
if (size == 0) {
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error(
H5_ERR_HDF5,
"Can't determine size of type %lld.",
(long long int)dtype_id));
}
HDF5_WRAPPER_RETURN (size);
H5_RETURN (size);
}
@@ -925,11 +927,11 @@ hdf5_close_type (
(long long int)dtype_id);
herr_t herr = H5Tclose (dtype_id);
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot release datatype."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/****** P r o p e r t y ******************************************************/
@@ -943,11 +945,11 @@ hdf5_create_property (
(long long int)cls_id);
hid_t prop_id = H5Pcreate (cls_id);
if (prop_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot create property list."));
HDF5_WRAPPER_RETURN (prop_id);
H5_RETURN (prop_id);
}
/*!
@@ -963,12 +965,12 @@ hdf5_get_dataset_create_plist (
hdf5_get_objname (dataset_id));
hid_t plist_id = H5Dget_create_plist (dataset_id);
if (plist_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get create properties for dataset '%s'.",
hdf5_get_objname (dataset_id)));
HDF5_WRAPPER_RETURN (plist_id);
H5_RETURN (plist_id);
}
static inline h5_err_t
@@ -981,12 +983,12 @@ hdf5_set_chunk_property (
"plist=%lld, rank=%d, dims[0]=%llu ...",
(long long int)plist, rank, dims[0]);
if (H5Pset_chunk (plist, rank, dims) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot add chunking property to list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -999,12 +1001,12 @@ hdf5_get_chunk_property (
"plist=%lld, rank=%d",
(long long int)plist, rank);
if (H5Pget_chunk (plist, rank, dims) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get chunking property from list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1016,12 +1018,12 @@ hdf5_set_layout_property (
"plist=%lld",
(long long int)plist);
if (H5Pset_layout (plist, layout) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot add layout property to list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#ifdef PARALLEL_IO
@@ -1035,12 +1037,12 @@ hdf5_set_fapl_mpio_property (
"fapl_id=%lld, comm=..., info=...",
(long long int)fapl_id);
if (H5Pset_fapl_mpio (fapl_id, comm, info) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot store IO communicator information to the "
"file access property list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#if H5_VERSION_LE(1,8,12)
@@ -1054,12 +1056,12 @@ hdf5_set_fapl_mpiposix_property (
"fapl_id=%lld, comm=..., use_gpfs=%d",
(long long int)fapl_id, (int)use_gpfs);
if ( H5Pset_fapl_mpiposix (fapl_id, comm, use_gpfs) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot store IO communicator information to"
" the file access property list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif
@@ -1072,12 +1074,12 @@ hdf5_set_dxpl_mpio_property (
"dxpl_id=%lld, mode=%d",
(long long int)dxpl_id, (int)mode);
if (H5Pset_dxpl_mpio (dxpl_id, mode) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot store IO communicator information to"
" the dataset transfer property list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif
@@ -1090,12 +1092,12 @@ hdf5_set_mdc_property (
"fapl_id=%lld, config=%p",
(long long int)fapl_id, config);
if (H5Pset_mdc_config (fapl_id, config) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot store metadata cache configuration in"
" the file access property list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1107,12 +1109,12 @@ hdf5_get_mdc_property (
"fapl_id=%lld, config=%p",
(long long int)fapl_id, config);
if (H5Pget_mdc_config (fapl_id, config) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get metadata cache configuration in"
" the file access property list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1124,12 +1126,12 @@ hdf5_set_btree_ik_property (
"fapl_id=%lld, btree_ik=%llu",
(long long int)fcpl_id, btree_ik);
if (H5Pset_istore_k (fcpl_id, btree_ik) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot set btree size in the "
"file access property list."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1142,13 +1144,13 @@ hdf5_set_alignment_property (
"plist=%lld, threshold=%llu, alignment=%llu",
(long long int)plist, threshold, alignment);
if (H5Pset_alignment (plist, threshold, alignment) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot set alignment property to %llu "
"and threshold %llu",
alignment, threshold));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1160,12 +1162,12 @@ hdf5_set_meta_block_size (
"fapl_id=%lld, size=%llu",
(long long int)fapl_id, size);
if (H5Pset_meta_block_size (fapl_id, size) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot set meta block size property to %llu",
size));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1178,11 +1180,11 @@ hdf5_set_fapl_core (
"fapl_id=%lld, size=%zu, backing_store=%d",
(long long int)fapl_id, increment, backing_store);
if (H5Pset_fapl_core (fapl_id, increment, backing_store))
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot set property to use the H5FD_CORE driver."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1193,11 +1195,11 @@ hdf5_close_property (
"prop=%lld",
(long long int)prop);
if (H5Pclose (prop) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot close property."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/****** F i l e **************************************************************/
@@ -1209,13 +1211,20 @@ hdf5_close_file (
HDF5_WRAPPER_ENTER (h5_err_t,
"file_id=%lld (%s)",
(long long int)file_id, hdf5_get_objname (file_id));
if (H5Fclose (file_id) < 0)
HDF5_WRAPPER_LEAVE (
if (H5Fclose (file_id) < 0) {
ssize_t max_objs = H5Fget_obj_count (file_id, H5F_OBJ_ALL);
hid_t* obj_id_list = h5_calloc (max_objs, sizeof (hid_t));
H5Fget_obj_ids (file_id, H5F_OBJ_ALL, max_objs, obj_id_list);
for (ssize_t i = 0; i < max_objs; i++) {
h5_debug ("Open object: %lld", (long long)obj_id_list[i]);
}
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot close file '%s'.",
hdf5_get_objname (file_id)));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
}
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1224,11 +1233,11 @@ hdf5_close (
) {
HDF5_WRAPPER_ENTER (h5_err_t, "%s", "void");
if (H5close () < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot close HDF5 library."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -1241,12 +1250,12 @@ hdf5_flush (
(long long int)obj_id,
hdf5_get_objname (obj_id));
if (H5Fflush (obj_id, scope) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot flush data \"%s\".",
hdf5_get_objname (obj_id)));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/****** E r r o r h a n d l i n g ********************************************/
@@ -1261,11 +1270,11 @@ hdf5_set_errorhandler (
"estack_id=%lld, func=%p, client_data=%p",
(long long int)estack_id, func, client_data);
if (H5Eset_auto (estack_id, func, client_data) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot initialize H5."));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/****** A t t r i b u t e ****************************************************/
@@ -1280,13 +1289,13 @@ hdf5_attribute_exists (
hdf5_get_objname (loc_id), attrib_name);
htri_t exists = H5Aexists (loc_id, attrib_name);
if (exists < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot query attribute '%s' of '%s'.",
attrib_name,
hdf5_get_objname (loc_id)));
HDF5_WRAPPER_RETURN (exists);
H5_RETURN (exists);
}
static inline hid_t
@@ -1300,13 +1309,13 @@ hdf5_open_attribute_by_name (
hdf5_get_objname (loc_id), attrib_name);
hid_t attrib_id = H5Aopen (loc_id, attrib_name, H5P_DEFAULT);
if (attrib_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot open attribute '%s' of '%s'.",
attrib_name,
hdf5_get_objname (loc_id)));
HDF5_WRAPPER_RETURN (attrib_id);
H5_RETURN (attrib_id);
}
static inline hid_t
@@ -1319,13 +1328,13 @@ hdf5_open_attribute_by_idx (
(long long int)loc_id, hdf5_get_objname (loc_id), idx);
hid_t attr_id = H5Aopen_idx (loc_id, idx);
if (attr_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot open attribute '%u' of '%s'.",
idx,
hdf5_get_objname (loc_id)));
HDF5_WRAPPER_RETURN (attr_id);
H5_RETURN (attr_id);
}
static inline hid_t
@@ -1349,13 +1358,13 @@ hdf5_create_attribute (
acpl_id,
aapl_id);
if (attr_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot create attribute '%s' for '%s'.",
attr_name,
hdf5_get_objname (loc_id)));
HDF5_WRAPPER_RETURN (attr_id);
H5_RETURN (attr_id);
}
static inline h5_err_t
@@ -1369,12 +1378,12 @@ hdf5_read_attribute (
(long long int)attr_id, hdf5_get_objname (attr_id),
(long long int)mem_type_id, buf);
if (H5Aread (attr_id, mem_type_id, buf) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot read attribute '%s'.",
hdf5_get_objname (attr_id)));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -1391,13 +1400,13 @@ hdf5_write_attribute (
(long long int)attr_id, hdf5_get_objname (attr_id),
(long long int)mem_type_id, buf);
if (H5Awrite (attr_id, mem_type_id, buf) < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot write attribute '%s'.",
hdf5_get_objname (attr_id)));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_ssize_t
@@ -1412,11 +1421,11 @@ hdf5_get_attribute_name (
(unsigned long long)buf_size, buf);
ssize_t size = H5Aget_name ( attr_id, buf_size, buf );
if (size < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get attribute name." ));
HDF5_WRAPPER_RETURN ((h5_size_t)size);
H5_RETURN ((h5_size_t)size);
}
static inline hid_t
@@ -1428,12 +1437,12 @@ hdf5_get_attribute_type (
(long long int)attr_id, hdf5_get_objname (attr_id));
hid_t datatype_id = H5Aget_type (attr_id);
if (datatype_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get type of attribute '%s'.",
hdf5_get_objname (attr_id)));
HDF5_WRAPPER_RETURN (datatype_id);
H5_RETURN (datatype_id);
}
static inline hid_t
@@ -1445,12 +1454,12 @@ hdf5_get_attribute_dataspace (
(long long int)attr_id, hdf5_get_objname (attr_id));
hid_t space_id = H5Aget_space (attr_id);
if (space_id < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get dataspace of attribute '%s'.",
hdf5_get_objname (attr_id)));
HDF5_WRAPPER_RETURN (space_id);
H5_RETURN (space_id);
}
static inline int
@@ -1462,12 +1471,12 @@ hdf5_get_num_attribute (
(long long int)loc_id, hdf5_get_objname (loc_id));
int num = H5Aget_num_attrs (loc_id);
if (num < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot get number of attributes of '%s'.",
hdf5_get_objname (loc_id)));
HDF5_WRAPPER_RETURN (num);
H5_RETURN (num);
}
static inline herr_t
@@ -1480,13 +1489,13 @@ hdf5_delete_attribute (
(long long int)loc_id, hdf5_get_objname (loc_id), attrib_name);
herr_t herr = H5Adelete (loc_id, attrib_name);
if (herr < 0)
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot delete attribute '%s' of '%s'.",
attrib_name,
hdf5_get_objname (loc_id)));
HDF5_WRAPPER_RETURN (herr);
H5_RETURN (herr);
}
static inline h5_err_t
@@ -1497,13 +1506,13 @@ hdf5_close_attribute (
"attr_id=%lld (%s)",
(long long int)attr_id, hdf5_get_objname (attr_id));
if (H5Aclose (attr_id))
HDF5_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_HDF5,
"Cannot close attribute '%s'.",
hdf5_get_objname (attr_id)));
HDF5_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif
+14 -14
View File
@@ -90,7 +90,7 @@ h5priv_hcreate (
/* Test for correct arguments. */
if (htab == NULL) {
H5_PRIV_API_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
/* Change nel to the first prime number not smaller as nel. */
nel |= 1; /* make odd */
@@ -108,7 +108,7 @@ h5priv_hcreate (
htab->size + 1, sizeof (_ENTRY)));
/* everything went alright */
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -157,7 +157,7 @@ h5priv_hgrow (
h5_debug ("Old hash table removed");
}
*htab = __htab;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -172,7 +172,7 @@ hwalk (
TRY ((*visit)(&htab->table[idx].entry));
}
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
void*
@@ -201,7 +201,7 @@ h5priv_hdestroy (
H5_PRIV_API_ENTER (h5_err_t, "htab=%p", htab);
/* Test for correct arguments. */
if (htab == NULL) {
H5_PRIV_API_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
/* Free used memory. */
if (htab->free_entry) {
@@ -211,7 +211,7 @@ h5priv_hdestroy (
/* the sign for an existing table is an value != NULL in htable */
htab->table = NULL;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -256,7 +256,7 @@ h5priv_hsearch (
if (retval) {
*retval = htab->table[idx].entry;
}
H5_PRIV_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
}
/* Second hash function, as suggested in [Knuth] */
@@ -283,7 +283,7 @@ h5priv_hsearch (
if (retval) {
*retval = htab->table[idx].entry;
}
H5_PRIV_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
}
} while (htab->table[idx].used);
}
@@ -296,7 +296,7 @@ h5priv_hsearch (
if (retval) {
*retval = NULL;
}
H5_PRIV_API_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
htab->table[idx].used = hval;
@@ -307,15 +307,15 @@ h5priv_hsearch (
if (retval) {
*retval = htab->table[idx].entry;
}
H5_PRIV_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
} else if (action == H5_REMOVE) {
htab->table[idx].used = 0; /* mark as unused, but */
*retval = htab->table[idx].entry; /* return ptr to entry */
H5_PRIV_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
}
if (retval) *retval = NULL;
h5_debug ("Key not found in hash table.");
H5_PRIV_API_RETURN (H5_NOK);
H5_RETURN (H5_NOK);
}
typedef struct {
@@ -355,7 +355,7 @@ free_string_keyed (
h5_hitem_string_keyed_t* entry = (h5_hitem_string_keyed_t*) __entry;
TRY (h5_free (entry->key));
TRY (h5_free (entry));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -376,5 +376,5 @@ h5priv_hcreate_string_keyed (
compute_string_keyed,
free_entry));
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+14 -14
View File
@@ -66,7 +66,7 @@ create_array_types (
1,
dims)
);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -92,7 +92,7 @@ create_vertex_type (
HOFFSET (h5_glb_vertex_t, P),
h5_dta_types.h5_coord3d_t) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -154,7 +154,7 @@ create_triangle_type (
HOFFSET(h5_glb_tri_t, neighbor_indices),
h5_dta_types.h5_3glb_idx_t) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -180,7 +180,7 @@ create_tag_types (
HOFFSET (h5t_glb_tag_idx_t, idx),
H5_ID) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -242,7 +242,7 @@ create_tet_type (
HOFFSET (h5_glb_tet_t, neighbor_indices),
h5_dta_types.h5_4glb_idx_t) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#if defined(WITH_PARALLEL_H5GRID)
@@ -298,7 +298,7 @@ create_chunk_type (
// "num_vtx",
// HOFFSET (h5t_chunk_t, num_vtx),
// H5_INT64) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -347,7 +347,7 @@ create_octree_type (
HOFFSET (h5t_octant_t, userlevels),
H5_INT32) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -366,7 +366,7 @@ create_userdata_type (
HOFFSET (h5t_oct_userdata_t, idx),
h5_dta_types.h5_4chk_idx_t) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -439,7 +439,7 @@ create_mpi_type_glb_tet (
// commit new type
TRY (h5priv_mpi_type_commit (&h5_dta_types.mpi_glb_tet));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -512,7 +512,7 @@ create_mpi_type_glb_tri (
// commit new type
TRY (h5priv_mpi_type_commit (&h5_dta_types.mpi_glb_triangle));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
create_mpi_type_glb_vtx (
@@ -548,7 +548,7 @@ create_mpi_type_glb_vtx (
// commit new type
TRY (h5priv_mpi_type_commit (&h5_dta_types.mpi_glb_vtx));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -597,7 +597,7 @@ create_mpi_type_edge_list_elem (
// commit new type
TRY (h5priv_mpi_type_commit (&h5_dta_types.mpi_edge_list_elem));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
create_mpi_type_chunk (
@@ -652,7 +652,7 @@ create_mpi_type_chunk (
// commit new type
TRY (h5priv_mpi_type_commit (&h5_dta_types.mpi_chunk));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif
@@ -697,5 +697,5 @@ h5priv_initialize (
TRY (create_mpi_type_chunk ());
TRY (create_mpi_type_edge_list_elem());
#endif
H5_CORE_API_RETURN ((ret_value != H5_SUCCESS) ? _h5_exit (42) : H5_SUCCESS);
H5_RETURN ((ret_value != H5_SUCCESS) ? _h5_exit (42) : H5_SUCCESS);
}
+4 -4
View File
@@ -46,7 +46,7 @@ h5priv_write_dataset_by_name (
if ((exists > 0) && (f->props->flags & H5_O_APPENDONLY)) {
h5_warn ("Dataset %s/%s already exist.",
hdf5_get_objname (loc_id), dsinfo->name);
H5_PRIV_API_LEAVE (h5priv_handle_file_mode_error(f->props->flags));
H5_LEAVE (h5priv_handle_file_mode_error(f->props->flags));
}
/*
@@ -93,7 +93,7 @@ h5priv_write_dataset_by_name (
TRY (hdf5_close_dataset (dset_id));
f->empty = 0;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -133,7 +133,7 @@ h5priv_write_dataset_by_name_id (
if ((exists > 0) && (f->props->flags & H5_O_APPENDONLY)) {
h5_warn ("Dataset %s/%s already exist.",
hdf5_get_objname (loc_id), dsinfo->name);
H5_PRIV_API_LEAVE (h5priv_handle_file_mode_error(f->props->flags));
H5_LEAVE (h5priv_handle_file_mode_error(f->props->flags));
}
TRY (h5priv_start_throttle (f));
@@ -146,5 +146,5 @@ h5priv_write_dataset_by_name_id (
data));
TRY (h5priv_end_throttle (f));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+20 -24
View File
@@ -14,43 +14,39 @@
#include "h5core/h5_log.h"
#include "private/h5_init.h"
#if defined(NDEBUG)
#define __FUNC_ENTER(type, mask, fmt, ...) \
type ret_value = (type)H5_ERR;
#else // NDEBUG not defined
#define __FUNC_ENTER(type, mask, fmt, ...) \
type ret_value = (type)H5_ERR; \
int __log__ = h5_log_level & mask; \
if (__log__ ) { \
h5_call_stack_push (__func__,e_##type); \
h5_debug ("(" fmt ")", __VA_ARGS__); \
}
#endif
#define H5_CORE_API_ENTER(type, fmt, ...) \
if (!h5_initialized) { \
h5priv_initialize(); \
} \
__FUNC_ENTER(type, H5_DEBUG_CORE_API, fmt, __VA_ARGS__)
#define H5_CORE_API_LEAVE(value) __FUNC_LEAVE(value)
#define H5_CORE_API_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_CORE_API)
#define H5_PRIV_API_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_PRIV_API, fmt, __VA_ARGS__)
#define H5_PRIV_API_LEAVE(value) __FUNC_LEAVE(value)
#define H5_PRIV_API_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_PRIV_API)
#define H5_PRIV_FUNC_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_PRIV_FUNC, fmt, __VA_ARGS__ )
#define H5_PRIV_FUNC_LEAVE(value) __FUNC_LEAVE(value)
#define H5_PRIV_FUNC_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_PRIV_FUNC)
#define H5_INLINE_FUNC_ENTER(type) \
type ret_value = (type)H5_ERR; int __log__ = 0;
#define HDF5_WRAPPER_ENTER(type, fmt, ...) \
#define HDF5_WRAPPER_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_HDF5, fmt, __VA_ARGS__ )
#define HDF5_WRAPPER_LEAVE(value) __FUNC_LEAVE(value)
#define HDF5_WRAPPER_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_HDF5)
#define MPI_WRAPPER_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_MPI, fmt, __VA_ARGS__ )
#define MPI_WRAPPER_LEAVE(value) __FUNC_LEAVE(value)
#define MPI_WRAPPER_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_MPI)
#define H5_INLINE_FUNC_ENTER(type) type ret_value = (type)H5_ERR;
#define H5_INLINE_FUNC_LEAVE(expr) __FUNC_LEAVE(expr)
#define H5_INLINE_FUNC_RETURN(expr) __FUNC_RETURN(expr, 0)
#endif
+1 -1
View File
@@ -162,7 +162,7 @@ h5_optimize_for_lustre (
config.flash_incr_mode = H5C_flash_incr__off;
TRY( H5Pset_mdc_config( f->access_prop, &config ) );
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#endif // H5_USE_LUSTRE
+21 -19
View File
@@ -10,6 +10,8 @@
#include "private/h5_err.h"
#include "private/h5_maps.h"
#include <stdlib.h>
/*
Allocate new/empty string-list
*/
@@ -24,7 +26,7 @@ h5priv_alloc_strlist (
TRY (*list = h5_calloc (
1, sizeof (**list)+size*sizeof ((*list)->items[0])));
(*list)->size = size;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -32,14 +34,14 @@ h5priv_free_strlist (
h5_strlist_t** list
) {
H5_PRIV_API_ENTER (h5_err_t, "list=%p", list);
if (list == NULL || *list == NULL) H5_PRIV_API_LEAVE (H5_SUCCESS);
if (list == NULL || *list == NULL) H5_LEAVE (H5_SUCCESS);
h5_strlist_t* l = *list;
for (size_t i = 0; i < l->size; i++) {
TRY (h5_free(l->items[i]));
}
TRY (h5_free (l));
l = NULL;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -47,11 +49,11 @@ grow_strlist (
h5_strlist_t** list,
size_t new_size
) {
H5_PRIV_API_ENTER (h5_err_t, "list=%p, new_size=%zu", list, new_size);
H5_PRIV_FUNC_ENTER (h5_err_t, "list=%p, new_size=%zu", list, new_size);
size_t num_bytes = sizeof (**list) + (new_size-1)*sizeof((*list)->items[0]);
TRY (*list = h5_alloc (*list, num_bytes));
(*list)->size = new_size;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -88,7 +90,7 @@ h5priv_insert_strlist (
}
TRY (l->items[idx] = h5_strdup(item));
l->num_items++;
H5_PRIV_API_RETURN (idx);
H5_RETURN (idx);
}
/*
@@ -101,7 +103,7 @@ h5priv_find_strlist (
) {
H5_PRIV_API_ENTER (ssize_t, "list=%p, item=%s", list, item);
if (!list) {
H5_PRIV_API_LEAVE (-1);
H5_LEAVE (-1);
}
register h5_loc_idx_t low = 0;
register h5_loc_idx_t high = list->num_items - 1;
@@ -115,9 +117,9 @@ h5priv_find_strlist (
else if ( diff < 0 )
low = mid + 1;
else
H5_PRIV_API_LEAVE (mid); // found
H5_LEAVE (mid); // found
}
H5_PRIV_API_RETURN (-(low+1)); // not found
H5_RETURN (-(low+1)); // not found
}
/*
@@ -134,7 +136,7 @@ h5priv_search_strlist (
idx = -(idx+1);
TRY (idx = h5priv_insert_strlist (list, item, idx));
}
H5_PRIV_API_RETURN (idx);
H5_RETURN (idx);
}
h5_err_t
@@ -144,14 +146,14 @@ h5priv_remove_strlist (
) {
H5_PRIV_API_ENTER (h5_err_t, "list=%p, item=%s", list, item);
ssize_t idx = h5priv_find_strlist (list, item);
if (idx < 0) H5_PRIV_API_LEAVE (-1);
if (idx < 0) H5_LEAVE (-1);
list->num_items--;
memmove (
&list->items[idx],
&list->items[idx+1],
(list->num_items - idx) * sizeof (list->items[0]));
H5_PRIV_API_RETURN (idx);
H5_RETURN (idx);
}
@@ -168,7 +170,7 @@ h5priv_new_idxmap (
TRY (map->items = h5_calloc (size, sizeof (map->items[0])));
map->size = size;
map->num_items = 0;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -183,13 +185,13 @@ h5priv_insert_idxmap (
(long long unsigned)glb_idx,
(long long unsigned)loc_idx);
if (map->num_items == map->size)
H5_PRIV_API_LEAVE (
H5_LEAVE (
HANDLE_H5_OVERFLOW_ERR (
(long long)map->size));
h5_loc_idx_t i = h5priv_search_idxmap (map, glb_idx);
if (i >= 0) /* global id already in use ? */
H5_PRIV_API_LEAVE (-1);
H5_LEAVE (-1);
i = -(i+1);
@@ -201,7 +203,7 @@ h5priv_insert_idxmap (
map->items[i].loc_idx = loc_idx;
map->num_items++;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -232,9 +234,9 @@ h5priv_search_idxmap (
else if ( diff < 0 )
low = mid + 1;
else
H5_PRIV_API_LEAVE (mid); // found
H5_LEAVE (mid); // found
}
H5_PRIV_API_RETURN (-(low+1)); // not found
H5_RETURN (-(low+1)); // not found
}
//static int
@@ -265,5 +267,5 @@ h5priv_sort_idxmap (
H5_PRIV_API_ENTER (h5_err_t, "map=%p", map);
qsort ( map->items, map->num_items, sizeof (map->items[0]),
cmp_idxmap_items);
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+12 -10
View File
@@ -16,6 +16,8 @@
#include "h5core/h5_syscall.h"
#include "private/h5_log.h"
#include <string.h>
// Allocate new list
#define h5priv_alloc_xlist( type ) \
static inline h5_err_t \
@@ -27,7 +29,7 @@
TRY (*list = h5_calloc ( \
1, sizeof (**list)+size*sizeof ((*list)->items[0]))); \
(*list)->size = size; \
H5_PRIV_API_RETURN (H5_SUCCESS); \
H5_RETURN (H5_SUCCESS); \
}
// Free list
@@ -37,10 +39,10 @@
h5_ ## type ## list_t**list \
) { \
H5_PRIV_API_ENTER (h5_err_t, "list=%p", list); \
if (*list == NULL) H5_PRIV_API_LEAVE (H5_SUCCESS); \
if (*list == NULL) H5_LEAVE (H5_SUCCESS); \
TRY (h5_free (*list)); \
*list = NULL; \
H5_PRIV_API_RETURN (H5_SUCCESS); \
H5_RETURN (H5_SUCCESS); \
}
// Insert item
@@ -80,7 +82,7 @@
} \
l->items[idx] = id; \
l->num_items++; \
H5_PRIV_API_RETURN (idx); \
H5_RETURN (idx); \
}
/*
@@ -100,7 +102,7 @@
"list=%p, item=%llu", \
list, (long long unsigned)item); \
if (!list) { \
H5_PRIV_API_LEAVE (-1); \
H5_LEAVE (-1); \
} \
register ssize_t low = 0; \
register ssize_t mid; \
@@ -112,9 +114,9 @@
else if (list->items[mid] < item) \
low = mid + 1; \
else \
H5_PRIV_API_LEAVE (mid); \
H5_LEAVE (mid); \
} \
H5_PRIV_API_RETURN (-(low+1)); \
H5_RETURN (-(low+1)); \
}
@@ -134,7 +136,7 @@
idx = -(idx+1); \
TRY (idx = h5priv_insert_into_ ## type ## list (list, item, idx)); \
} \
H5_PRIV_API_RETURN (idx); \
H5_RETURN (idx); \
}
@@ -184,13 +186,13 @@ h5priv_grow_idxmap (
"map=%p, size=%llu",
map, (long long unsigned)size);
if (map->num_items >= size)
H5_PRIV_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
int new = (map->items == NULL);
size_t size_in_bytes = size * sizeof (map->items[0]);
TRY (map->items = h5_alloc (map->items, size_in_bytes));
map->size = size;
if (new) map->num_items = 0;
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
+15 -10
View File
@@ -48,7 +48,7 @@ h5priv_start_throttle (
h5_warn (
"Throttling is only permitted with the MPI-POSIX "
"or MPI-IO Independent VFD." );
H5_CORE_API_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
}
int token = 1;
@@ -71,7 +71,7 @@ h5priv_start_throttle (
}
h5_debug ("throttle: received token");
}
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -96,7 +96,7 @@ h5priv_end_throttle (
));
}
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#else // PARALLEL_IO
static inline h5_err_t
@@ -169,12 +169,12 @@ h5priv_map_enum_to_normalized_type (
ret_value = H5_FLOAT64;
break;
default:
H5_PRIV_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Unknown type %d", (int)type));
}
H5_PRIV_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
/*
@@ -227,12 +227,15 @@ h5priv_normalize_type (
ret_value = H5_STRING;
break;
default:
H5_PRIV_API_LEAVE (
break;
}
if (ret_value < 0) {
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Unknown type %d", (int)type));
}
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
/*
@@ -271,6 +274,8 @@ h5priv_map_hdf5_type_to_enum (
} else {
ret_value = H5_UINT16_T;
}
} else {
ret_value = H5_STRING_T;
}
break;
case H5T_FLOAT:
@@ -285,12 +290,12 @@ h5priv_map_hdf5_type_to_enum (
ret_value = H5_STRING_T;
break;
default:
H5_PRIV_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Unknown type %d", (int)type));
}
H5_CORE_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
@@ -303,7 +308,7 @@ h5priv_get_normalized_dataset_type (
(long long)dataset);
TRY (ret_value = hdf5_get_dataset_type (dataset));
TRY (ret_value = h5priv_normalize_type (ret_value));
H5_PRIV_API_RETURN (ret_value);
H5_RETURN (ret_value);
}
#endif
+44 -41
View File
@@ -16,6 +16,9 @@
#include "h5core/h5_err.h"
#include "private/h5_log.h"
#define MPI_WRAPPER_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_MPI, fmt, __VA_ARGS__ )
static inline h5_err_t
h5priv_mpi_alltoall (
void* sendbuf,
@@ -39,11 +42,11 @@ h5priv_mpi_alltoall (
recvtype,
comm);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_MPI,
"Cannot perform all to all communication"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -75,11 +78,11 @@ h5priv_mpi_alltoallv (
recvtype,
comm);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_MPI,
"Cannot perform all to all communication"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
// barrier
@@ -90,11 +93,11 @@ h5priv_mpi_barrier (
MPI_WRAPPER_ENTER (h5_err_t, "comm=%p",&comm);
int err = MPI_Barrier(comm);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_MPI,
"MPI Barrier was not successful"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
// communication routines
@@ -120,8 +123,8 @@ h5priv_mpi_recv(
MPI_STATUS_IGNORE
);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot receive data"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot receive data"));
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -145,8 +148,8 @@ h5priv_mpi_send(
comm
);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot send data"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot send data"));
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -168,8 +171,8 @@ h5priv_mpi_bcast (
comm
);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform broadcast"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform broadcast"));
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -192,8 +195,8 @@ h5priv_mpi_sum (
comm
);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform MPI_SUM reduction"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform MPI_SUM reduction"));
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -215,9 +218,9 @@ h5priv_mpi_allreduce_max (
MPI_MAX,
comm
) != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI,
H5_LEAVE (h5_error (H5_ERR_MPI,
"Cannot perform MPI_MAX reduction"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -240,8 +243,8 @@ h5priv_mpi_prefix_sum (
comm
);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform prefix sum"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot perform prefix sum"));
H5_RETURN (H5_SUCCESS);
}
#define h5priv_mpi_allgather mpi_allgather
@@ -268,8 +271,8 @@ mpi_allgather (
recvtype,
comm);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot gather data"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot gather data"));
H5_RETURN (H5_SUCCESS);
}
#define h5priv_mpi_allgatherv mpi_allgatherv
static inline h5_err_t
@@ -298,8 +301,8 @@ mpi_allgatherv (
recvtype,
comm);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot gather data"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot gather data"));
H5_RETURN (H5_SUCCESS);
}
///
@@ -311,8 +314,8 @@ h5priv_mpi_comm_size (
MPI_WRAPPER_ENTER (h5_err_t, "comm=?, size=%p", size);
int err = MPI_Comm_size (comm, size);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot get communicator size"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot get communicator size"));
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -323,8 +326,8 @@ h5priv_mpi_comm_rank (
MPI_WRAPPER_ENTER (h5_err_t, "comm=?, rank=%p", rank);
int err = MPI_Comm_rank (comm, rank);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot get this task's rank"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot get this task's rank"));
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -339,11 +342,11 @@ h5priv_mpi_type_contiguous (
int err;
err = MPI_Type_contiguous ( nelems, oldtype, newtype );
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot create new MPI type"));
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot create new MPI type"));
err = MPI_Type_commit ( newtype );
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error (H5_ERR_MPI, "Cannot commit new MPI type"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error (H5_ERR_MPI, "Cannot commit new MPI type"));
H5_RETURN (H5_SUCCESS);
}
#define h5priv_mpi_get_address mpi_get_address
@@ -355,12 +358,12 @@ mpi_get_address (
MPI_WRAPPER_ENTER (h5_err_t, "location=%p, address=%p", location, address);
int err = MPI_Get_address (location, address);
if (err != MPI_SUCCESS) {
MPI_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_MPI,
"Cannot get MPI address of location=%p", location));
}
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#define h5priv_mpi_create_type_struct mpi_create_type_struct
@@ -377,12 +380,12 @@ mpi_create_type_struct (
count, blocklens, indices, old_types, new_type);
int err = MPI_Type_create_struct (count, blocklens, indices, old_types, new_type);
if (err != MPI_SUCCESS) {
MPI_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_MPI,
"Cannot create new MPI struct"));
}
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -392,12 +395,12 @@ h5priv_mpi_type_commit (
MPI_WRAPPER_ENTER (h5_err_t, "type=%p", type);
int err = MPI_Type_commit (type);
if (err != MPI_SUCCESS) {
MPI_WRAPPER_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_MPI,
"Cannot commit MPI datatype"));
}
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -408,8 +411,8 @@ h5priv_mpi_type_free (
MPI_WRAPPER_ENTER (h5_err_t, "type=%p", type);
int err = MPI_Type_free( type );
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error(H5_ERR_MPI, "Cannot free MPI type"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error(H5_ERR_MPI, "Cannot free MPI type"));
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -427,8 +430,8 @@ h5priv_mpi_cart_create (
int err = MPI_Cart_create(
old_comm, ndims, dims, period, reorder, new_comm);
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error(H5_ERR_MPI, "Cannot create cartesian grid"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error(H5_ERR_MPI, "Cannot create cartesian grid"));
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -442,8 +445,8 @@ h5priv_mpi_cart_coords (
rank, maxdim, coords);
int err = MPI_Cart_coords( comm, rank, maxdim, coords );
if (err != MPI_SUCCESS)
MPI_WRAPPER_LEAVE (h5_error(H5_ERR_MPI, "Cannot create cartesian grid"));
MPI_WRAPPER_RETURN (H5_SUCCESS);
H5_LEAVE (h5_error(H5_ERR_MPI, "Cannot create cartesian grid"));
H5_RETURN (H5_SUCCESS);
}
#endif
+10 -7
View File
@@ -17,6 +17,9 @@
#include "private/h5t_model.h"
#include "private/h5t_access.h"
#include <string.h>
#include <stdlib.h>
/*** op's on local elements ***/
#if defined(WITH_PARALLEL_H5GRID)
@@ -182,7 +185,7 @@ alloc_glb_elems (
H5_PRIV_FUNC_ENTER (h5_glb_elem_p, "m=%p, size=%zu", m, size);
h5_glb_elem_p buf;
TRY (buf = h5_calloc (size, sizeof(h5_glb_tet_t)));
H5_PRIV_FUNC_RETURN (buf);
H5_RETURN (buf);
}
static h5_glb_elem_t*
@@ -664,27 +667,27 @@ get_loc_entity_children (
const h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
if (h5tpriv_is_leaf_elem (m, &((h5_loc_tet_t*)m->loc_elems)[elem_idx])) {
H5_PRIV_FUNC_LEAVE (H5_NOK); // not refined
H5_LEAVE (H5_NOK); // not refined
}
switch (type_id) {
case H5T_TYPE_TET: {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
get_children_of_loc_elem (m, face_idx, elem_idx, children));
break;
}
case H5T_TYPE_TRIANGLE: {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
get_children_of_loc_triangle (m, face_idx, elem_idx, children));
break;
}
case H5T_TYPE_EDGE: {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
get_children_of_loc_edge (m, face_idx, elem_idx, children));
}
default:
H5_PRIV_FUNC_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
struct h5t_access_methods h5tpriv_access_tetm_methods = {
+8 -5
View File
@@ -16,6 +16,9 @@
#include "private/h5t_model.h"
#include "private/h5t_access.h"
#include <string.h>
#include <stdlib.h>
#if defined(WITH_PARALLEL_H5GRID)
static MPI_Datatype
get_mpi_type_of_glb_elem (
@@ -180,7 +183,7 @@ alloc_glb_elems (
H5_PRIV_FUNC_ENTER (h5_glb_elem_p, "m=%p, size=%zu", m, size);
h5_glb_elem_p buf;
TRY (buf = h5_calloc (size, sizeof(h5_glb_tri_t)));
H5_PRIV_FUNC_RETURN (buf);
H5_RETURN (buf);
}
static h5_glb_elem_t*
@@ -371,20 +374,20 @@ get_loc_entity_children (
const h5_loc_idx_t elem_idx = h5tpriv_get_elem_idx (entity_id);
if (h5tpriv_is_leaf_elem (m, &((h5_loc_tri_t*)m->loc_elems)[elem_idx])) {
H5_PRIV_FUNC_LEAVE (H5_NOK); // not refined
H5_LEAVE (H5_NOK); // not refined
}
switch (type_id) {
case H5T_TYPE_TRIANGLE: {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
get_children_of_loc_elem (m, face_idx, elem_idx, children));
break;
}
case H5T_TYPE_EDGE: {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
get_children_of_loc_edge (m, face_idx, elem_idx, children));
}
}
H5_PRIV_FUNC_RETURN (h5_error_internal ());
H5_RETURN (h5_error_internal ());
}
struct h5t_access_methods h5tpriv_access_trim_methods = {
+2 -2
View File
@@ -34,9 +34,9 @@ h5tpriv_get_adjacencies (
"m=%p, entity_id=%lld, dim=%d, list=%p",
m, (long long)entity_id, dim, list);
if (m->methods->adjacency == NULL) {
H5_PRIV_API_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
H5_PRIV_API_RETURN (m->methods->adjacency->get_adjacencies(
H5_RETURN (m->methods->adjacency->get_adjacencies(
m, entity_id, dim, list));
}
+22 -22
View File
@@ -69,7 +69,7 @@ get_descendant_of_edge (
TRY( get_descendant_of_edge (m, edge_ids[1], children) );
}
} while (++edge_idp < end);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -100,7 +100,7 @@ get_sections_of_edge (
if (!refined) {
TRY( h5priv_insert_into_loc_idlist (children, te->items[0], -1) );
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -131,7 +131,7 @@ get_descendant_of_triangle (
TRY (get_descendant_of_triangle (m, triangle_ids[3], children));
}
} while (++triangle_idp < end);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -164,7 +164,7 @@ get_sections_of_triangle (
if (!refined) {
TRY( h5priv_insert_into_loc_idlist (children, td->items[0], -1) );
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -185,7 +185,7 @@ add_vertex2 (
h5_loc_idlist_t* tv;
TRY( h5tpriv_find_tv2 (m, face_idx, elem_idx, &tv) );
TRY( h5priv_search_in_loc_idlist (list, tv->items[0]) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -204,7 +204,7 @@ add_edge (
h5_loc_idlist_t* te = NULL;
TRY( h5tpriv_find_te (m, entity_id, &te) );
TRY( h5priv_search_in_loc_idlist (list, te->items[0]) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -222,7 +222,7 @@ add_edge2 (
h5_loc_idlist_t* te;
TRY( h5tpriv_find_te2 (m, face_idx, elem_idx, &te) );
TRY( h5priv_search_in_loc_idlist (list, te->items[0]) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -242,7 +242,7 @@ add_triangle (
TRY( h5tpriv_find_td (m, entity_id, &td) );
TRY( h5priv_search_in_loc_idlist (list, td->items[0]) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -261,7 +261,7 @@ add_triangle2 (
TRY( h5tpriv_find_td2 (m, face_idx, elem_idx, &td) );
TRY( h5priv_search_in_loc_idlist (list, td->items[0]) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -276,7 +276,7 @@ add_elem2 (
h5_loc_id_t elem_id = h5tpriv_build_tet_id ((h5_loc_idx_t)0, elem_idx);
TRY( h5priv_search_in_loc_idlist (list, elem_id) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -319,7 +319,7 @@ get_edges_uadj_to_vertex (
m, 0, face_idx, 2),
elem_idx) );
} while (++vertex_idp < end);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -362,7 +362,7 @@ get_triangles_uadj_to_vertex (
m, 0, face_idx, 2),
elem_idx) );
} while (++vertex_idp < end);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -389,7 +389,7 @@ get_tets_uadj_to_vertex (
}
TRY( add_elem2 (list, elem_idx) );
} while (++vertex_idp < end);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -421,7 +421,7 @@ get_triangles_uadj_to_edge (
} while (++edge_idp < end);
TRY (h5priv_free_loc_idlist (&children));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -443,7 +443,7 @@ get_tets_uadj_to_edge (
TRY( add_elem2 (list, h5tpriv_get_elem_idx (*edge_idp)) );
} while (++edge_idp < end);
TRY( h5priv_free_loc_idlist (&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -465,7 +465,7 @@ get_tets_uadj_to_triangle (
TRY( add_elem2 (list, h5tpriv_get_elem_idx (*triangle_idp)) );
} while (++triangle_idp < end);
TRY( h5priv_free_loc_idlist (&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -498,7 +498,7 @@ get_vertices_dadj_to_edge (
elem_idx) );
} while (++edge_idp < end);
TRY( h5priv_free_loc_idlist(&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -545,7 +545,7 @@ get_vertices_dadj_to_triangle (
elem_idx) );
} while (++edge_idp < end );
TRY( h5priv_free_loc_idlist(&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -589,7 +589,7 @@ get_vertices_dadj_to_tet (
elem_idx) );
} while (++edge_idp < end);
TRY( h5priv_free_loc_idlist(&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -624,7 +624,7 @@ get_edges_dadj_to_triangle (
TRY( add_edge (m, list, *edge_idp) );
} while (++edge_idp < end);
TRY( h5priv_free_loc_idlist (&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -656,7 +656,7 @@ get_edges_dadj_to_tet (
TRY( add_edge (m, list, *edge_idp) );
} while (++edge_idp < end);
TRY( h5priv_free_loc_idlist (&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -686,7 +686,7 @@ get_triangles_dadj_to_tet (
TRY( add_triangle (m, list, *triangle_idp) );
} while (++triangle_idp < end);
TRY( h5priv_free_loc_idlist (&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
+13 -13
View File
@@ -48,7 +48,7 @@ get_descendant_of_edge (
}
} while (++edge_idp < end);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -79,7 +79,7 @@ get_sections_of_edge (
if (!refined) {
TRY (h5priv_insert_into_loc_idlist (children, te->items[0], -1));
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -100,7 +100,7 @@ add_vertex2 (
h5_loc_idlist_t* tv;
TRY( h5tpriv_find_tv2 (m, face_idx, elem_idx, &tv) );
TRY( h5priv_search_in_loc_idlist (list, tv->items[0]) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -119,7 +119,7 @@ add_edge (
h5_loc_idlist_t* te;
TRY( h5tpriv_find_te (m, entity_id, &te) );
TRY( h5priv_search_in_loc_idlist (list, te->items[0]) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -137,7 +137,7 @@ add_edge2 (
h5_loc_idlist_t *te;
TRY( h5tpriv_find_te2 (m, face_idx, elem_idx, &te) );
TRY( h5priv_search_in_loc_idlist (list, te->items[0]) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -152,7 +152,7 @@ add_elem2 (
h5_loc_id_t elem_id = h5tpriv_build_triangle_id ((h5_loc_idx_t)0, elem_idx);
TRY( h5priv_search_in_loc_idlist (list, elem_id) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -191,7 +191,7 @@ get_edges_uadj_to_vertex (
m, 0, face_idx, 1),
elem_idx) );
} while (++vertex_idp < end);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -219,7 +219,7 @@ get_triangles_uadj_to_vertex (
}
TRY (add_elem2 (list, elem_idx));
} while (++vertex_idp < end);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -243,7 +243,7 @@ get_triangles_uadj_to_edge (
} while (++edge_idp < end);
TRY( h5priv_free_loc_idlist (&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -267,7 +267,7 @@ get_edges_adj_to_edge (
TRY( add_edge (m, list, *edge_idp) );
} while (++edge_idp < end);
TRY( h5priv_free_loc_idlist(&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -299,7 +299,7 @@ get_vertices_dadj_to_edge (
elem_idx) );
} while (++edge_idp < end);
TRY( h5priv_free_loc_idlist (&children) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -344,7 +344,7 @@ get_vertices_dadj_to_triangle (
elem_idx) );
} while (++edge_idp < end);
TRY (h5priv_free_loc_idlist(&children));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -374,7 +374,7 @@ get_edges_dadj_to_triangle (
TRY( add_edge (m, list, *edge_idp) );
} while (++edge_idp < end);
TRY (h5priv_free_loc_idlist(&children));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
+15 -15
View File
@@ -46,7 +46,7 @@ h5tpriv_enter_tv2 (
*idlist = m->adjacencies.tv.v[vertex_idx];
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -92,7 +92,7 @@ h5tpriv_enter_te2 (
if (idlist) {
*idlist = te_entry->value;
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -138,7 +138,7 @@ h5tpriv_enter_td2 (
if (idlist) {
*idlist = td_entry->value;
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static int
@@ -178,7 +178,7 @@ release_te_entry (
h5_loc_idlist_t* list = entry->value;
TRY (h5priv_free_loc_idlist (&list));
TRY (h5_free (entry));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -199,7 +199,7 @@ h5tpriv_grow_te_htab (
} else {
TRY (h5priv_hgrow (nel, &a->te_hash));
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -223,12 +223,12 @@ find_te (
&m->adjacencies.te_hash));
h5t_te_entry_t* entry = (h5t_te_entry_t*)__entry;
if (entry == NULL) {
H5_PRIV_FUNC_LEAVE (H5_NOK); // not found
H5_LEAVE (H5_NOK); // not found
}
if (idlist) {
*idlist = entry->value;
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -252,7 +252,7 @@ h5tpriv_find_te (
item.key.vids));
TRY (find_te (m, &item, idlist));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -272,7 +272,7 @@ h5tpriv_find_te2 (
elem_idx,
item.key.vids));
TRY (find_te (m, &item, idlist));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static int
@@ -312,7 +312,7 @@ release_td_entry (
h5_loc_idlist_t* list = entry->value;
TRY (h5priv_free_loc_idlist (&list));
TRY (h5_free (entry));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -334,7 +334,7 @@ h5tpriv_grow_td_htab (
} else {
TRY (h5priv_hgrow (nel, &a->td_hash));
}
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -372,7 +372,7 @@ h5tpriv_find_td (
triangle_id,
item.key.vids));
TRY (find_td (m, &item, idlist));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -392,7 +392,7 @@ h5tpriv_find_td2 (
elem_idx,
item.key.vids));
TRY (find_td (m, &item, idlist));
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -411,7 +411,7 @@ h5tpriv_find_tv2 (
h5_loc_idx_t idx;
TRY (idx = h5tpriv_get_loc_elem_vertex_idx (m, elem_idx, face_idx));
*idlist = m->adjacencies.tv.v[idx];
H5_PRIV_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -427,5 +427,5 @@ h5tpriv_find_tv3 (
"m=%p, vtx_idx=%lld, idlist=%p",
m, (long long)vtx_idx, idlist);
*idlist = m->adjacencies.tv.v[vtx_idx];
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+4 -4
View File
@@ -192,9 +192,9 @@ h5tpriv_release_adjacency_structs (
) {
H5_PRIV_API_ENTER (h5_err_t, "m=%p", m);
if (m->methods->adjacency == NULL) {
H5_PRIV_API_LEAVE (H5_OK);
H5_LEAVE (H5_OK);
}
H5_PRIV_API_RETURN (m->methods->core->release_internal_structs(m));
H5_RETURN (m->methods->core->release_internal_structs(m));
}
static inline h5_err_t
@@ -204,9 +204,9 @@ h5tpriv_update_internal_structs (
) {
H5_PRIV_API_ENTER (h5_err_t, "m=%p, level_id=%d", m, level_id);
if (m->methods->adjacency == NULL) {
H5_PRIV_API_LEAVE (H5_OK);
H5_LEAVE (H5_OK);
}
H5_PRIV_API_RETURN (m->methods->core->update_internal_structs(m, level_id));
H5_RETURN (m->methods->core->update_internal_structs(m, level_id));
}
#endif
+5 -5
View File
@@ -179,7 +179,7 @@ alloc_tv (
size_t i = from_lvl <= 0 ? 0 : m->num_loc_vertices[from_lvl-1];
memset (adj->tv.v+i, 0, (num_loc_vertices-i)*sizeof(*adj->tv.v));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -246,7 +246,7 @@ update_internal_structs (
TRY (h5tpriv_enter_td2 (m, face_idx, elem_idx, NULL));
}
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -259,7 +259,7 @@ release_tv (
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p", m);
h5t_adjacencies_t* adj = &m->adjacencies;
if (adj->tv.v == NULL)
H5_PRIV_FUNC_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
h5_loc_idx_t vertex_idx = 0;
h5_loc_idx_t last = m->num_loc_vertices[m->num_loaded_levels-1];
@@ -268,7 +268,7 @@ release_tv (
}
TRY( h5_free (adj->tv.v) );
adj->tv.v = NULL;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -280,7 +280,7 @@ release_internal_structs (
TRY( h5priv_hdestroy (&m->adjacencies.te_hash) );
TRY( h5priv_hdestroy (&m->adjacencies.td_hash) );
memset (&m->adjacencies, 0, sizeof (m->adjacencies));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
struct h5t_core_methods h5tpriv_tetm_core_methods = {
+5 -5
View File
@@ -142,7 +142,7 @@ alloc_tv (
size_t i = from_lvl <= 0 ? 0 : m->num_loc_vertices[from_lvl-1];
memset (adj->tv.v+i, 0, (num_loc_vertices-i)*sizeof(*adj->tv.v));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -237,7 +237,7 @@ update_internal_structs (
}
}
#endif
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -247,7 +247,7 @@ release_tv (
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p", m);
h5t_adjacencies_t* adj = &m->adjacencies;
if (adj->tv.v == NULL)
H5_PRIV_FUNC_LEAVE (H5_SUCCESS);
H5_LEAVE (H5_SUCCESS);
h5_loc_idx_t vertex_idx = 0;
h5_loc_idx_t last = m->num_loc_vertices[m->num_loaded_levels-1];
@@ -256,7 +256,7 @@ release_tv (
}
TRY( h5_free (adj->tv.v) );
adj->tv.v = NULL;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static inline h5_err_t
@@ -267,7 +267,7 @@ release_internal_structs (
TRY( release_tv (m) );
TRY( h5priv_hdestroy (&m->adjacencies.te_hash) );
memset (&m->adjacencies, 0, sizeof (m->adjacencies));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
struct h5t_core_methods h5tpriv_trim_core_methods = {
+1 -7
View File
@@ -114,17 +114,11 @@ h5tpriv_get_list_of_chunks_to_read (
);
h5_int32_t
find_proc_to_write (
h5priv_find_proc_to_write (
h5t_mesh_t* const m,
h5_loc_idx_t elem_idx
);
//TODO this is a bugfix remove after xfer_prop fix has been done!
void
set_xfer_prop_to (const h5_file_p file, hid_t prop);
void
set_xfer_prop_to2 (h5t_mesh_t* const m, hid_t prop);
// TODO move this to appropriate place
typedef struct {
int (*compare) (const void *p_a, const void *p_b);
+6 -6
View File
@@ -76,7 +76,7 @@ init_loc_elems_struct (
num_facets,
loc_elem->neighbor_indices);
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
#define H5_LOC_ELEM_T h5_loc_tet_t
@@ -126,7 +126,7 @@ init_elem_flags (
}
elem++;
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -156,7 +156,7 @@ init_map_elem_g2l (
}
h5priv_sort_idxmap (map);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -189,7 +189,7 @@ init_glb_elems_struct (
loc_elem++;
glb_elem++;
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -200,9 +200,9 @@ init_glb_elems_struct_chk (
int num_chk
) {
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p", m);
H5_PRIV_FUNC_LEAVE (H5_ERR_NOT_IMPLEMENTED);
H5_LEAVE (H5_ERR_NOT_IMPLEMENTED);
// TODO just copy from readwrite_trim and replace 3 indices with 4...
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
struct h5t_read_methods h5tpriv_read_tetm_methods = {
+5 -5
View File
@@ -83,7 +83,7 @@ init_loc_elems_struct (
}
m->last_stored_eid = from_idx + count -1;
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -124,7 +124,7 @@ init_elem_flags (
}
elem++;
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
static h5_err_t
@@ -151,7 +151,7 @@ init_map_elem_g2l (
}
h5priv_sort_idxmap (map);
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -184,7 +184,7 @@ init_glb_elems_struct (
loc_elem++;
glb_elem++;
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
//TODO maybe use ifdef to have name without _chk
@@ -239,7 +239,7 @@ init_glb_elems_struct_chk (
}
#endif
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+3 -3
View File
@@ -32,7 +32,7 @@
"list=%p, item=%llu", \
list, (long long unsigned)item); \
if (!list) { \
H5_PRIV_API_LEAVE (-1); \
H5_LEAVE (-1); \
} \
register ssize_t low = 0; \
register ssize_t mid; \
@@ -51,9 +51,9 @@
else if ( diff < 0 ) \
low = mid + 1; \
else \
H5_PRIV_API_LEAVE (mid); \
H5_LEAVE (mid); \
} \
H5_PRIV_API_RETURN (-(low+1)); \
H5_RETURN (-(low+1)); \
}
+7 -7
View File
@@ -55,7 +55,7 @@ h5t_open_tetrahedral_mesh_by_idx (
TRY (hdf5_get_name_of_group_by_idx (ctn_hid, idx, name, sizeof (name)));
TRY (hdf5_close_group (ctn_hid));
H5_CORE_API_RETURN (h5t_open_tetrahedral_mesh ((h5_file_t)f, name, mesh));
H5_RETURN (h5t_open_tetrahedral_mesh ((h5_file_t)f, name, mesh));
}
h5_err_t
@@ -92,7 +92,7 @@ h5t_open_tetrahedral_mesh (
#else
TRY (h5tpriv_read_mesh (m));
#endif
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
h5_err_t
@@ -126,7 +126,7 @@ h5t_open_tetrahedral_mesh_part (
0));
TRY (h5tpriv_read_mesh_part (m, elem_indices, dim));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -151,7 +151,7 @@ h5t_add_tetrahedral_mesh (
TETRAHEDRAL_MESHES_GRPNAME,
name));
if (exists) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR,
"Tetrahedral mesh '%s' already exists!",
@@ -183,7 +183,7 @@ h5t_add_tetrahedral_mesh (
TRY (h5tpriv_add_level (m));
m->mesh_changed = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -209,7 +209,7 @@ h5t_add_chunked_tetrahedral_mesh (
TETRAHEDRAL_MESHES_GRPNAME,
name));
if (exists) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR,
"Tetrahedral mesh '%s' already exists!",
@@ -241,5 +241,5 @@ h5t_add_chunked_tetrahedral_mesh (
TRY (h5tpriv_add_level (m));
m->mesh_changed = 1;
#endif
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+8 -8
View File
@@ -54,7 +54,7 @@ h5t_open_triangle_mesh_by_idx (
TRY (hdf5_get_name_of_group_by_idx (ctn_hid, idx, name, sizeof (name)));
TRY (hdf5_close_group (ctn_hid));
H5_CORE_API_RETURN (h5t_open_triangle_mesh ((h5_file_t)f, name, mesh));
H5_RETURN (h5t_open_triangle_mesh ((h5_file_t)f, name, mesh));
}
h5_err_t
@@ -100,7 +100,7 @@ h5t_open_triangle_mesh (
m->is_chunked && m->f->nprocs > 1 ?
h5tpriv_read_chunked_mesh (m) : h5tpriv_read_mesh (m)
);
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -145,7 +145,7 @@ h5t_open_triangle_mesh_part (
TRY (h5tpriv_read_mesh_part (m, elem_indices, dim));
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -170,7 +170,7 @@ h5t_add_triangle_mesh (
TRIANGLE_MESHES_GRPNAME,
name));
if (exists) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR,
"Tetrahedral mesh '%s' already exists!",
@@ -201,7 +201,7 @@ h5t_add_triangle_mesh (
TRY (h5tpriv_add_level (m));
m->mesh_changed = 1;
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
Add new chunked mesh
@@ -221,7 +221,7 @@ h5t_add_chunked_triangle_mesh(
int size = -1;
TRY (h5priv_mpi_comm_size (f->props->comm, &size));
if (size != 1) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR,
"Trying to create a chunked mesh with '%d' procs instead of 1!",
@@ -236,7 +236,7 @@ h5t_add_chunked_triangle_mesh(
TRIANGLE_MESHES_GRPNAME,
name));
if (exists) {
H5_CORE_API_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR,
"Triangle mesh '%s' already exists!",
@@ -268,5 +268,5 @@ h5t_add_chunked_triangle_mesh(
TRY (h5tpriv_add_level (m));
m->mesh_changed = 1;
#endif
H5_CORE_API_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
+2 -2
View File
@@ -167,8 +167,8 @@ h5_oct_idx_t H5t_find_leafoctant_of_point (h5t_octree_t* octree, h5_oct_idx_t oc
h5_oct_level_t H5t_oct_has_level (h5t_octree_t* octree, h5_oct_idx_t oct_idx, h5_oct_level_t level);
// for debug purposes only
h5_err_t plot_octants (h5t_octree_t* octree);
h5_err_t plot_octant_anc (h5t_octree_t* octree, h5_oct_idx_t oct_idx);
h5_err_t h5priv_plot_octants (h5t_octree_t* octree);
h5_err_t h5priv_plot_octant_anc (h5t_octree_t* octree, h5_oct_idx_t oct_idx);
h5_err_t plot_leaf_octants (h5t_octree_t* octree);
void print_array (h5_int32_t* neigh, h5_oct_idx_t nbr_neigh, int rank);
+13 -13
View File
@@ -36,7 +36,7 @@ alloc_loc_elems (
-1,
(new-cur) * sizeof (h5_loc_tet_t) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
@@ -75,9 +75,9 @@ bisect_edge (
TRY( h5t_get_loc_vertex_indices_of_edge (m, kids[0], edge0) );
TRY( h5t_get_loc_vertex_indices_of_edge (m, kids[1], edge1) );
if ((edge0[0] == edge1[0]) || (edge0[0] == edge1[1])) {
H5_PRIV_FUNC_LEAVE (edge0[0]); // return first vertex
H5_LEAVE (edge0[0]); // return first vertex
} else {
H5_PRIV_FUNC_LEAVE (edge0[1]); // return second vertex
H5_LEAVE (edge0[1]); // return second vertex
}
}
}
@@ -94,7 +94,7 @@ bisect_edge (
P[1] = (P0[1] + P1[1]) / 2.0;
P[2] = (P0[2] + P1[2]) / 2.0;
H5_PRIV_FUNC_RETURN (h5t_store_vertex (m, -1, P)); // return idx of new vertex
H5_RETURN (h5t_store_vertex (m, -1, P)); // return idx of new vertex
}
/*
@@ -128,7 +128,7 @@ pre_refine_tet (
unsigned int num_interior_elems_to_refine = m->marked_entities->num_items;
TRY (h5t_begin_store_vertices (m, num_interior_elems_to_refine*3 + 192));
TRY (h5t_begin_store_elems (m, num_interior_elems_to_refine*8));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -151,7 +151,7 @@ refine_tet (
h5_loc_tet_t* el = (h5_loc_tet_t*)m->loc_elems + elem_idx;
if ( el->child_idx >= 0 )
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Tetrahedron %lld already refined.",
@@ -256,7 +256,7 @@ refine_tet (
((h5_loc_tet_t*)m->loc_elems)[elem_idx].child_idx = elem_idx_of_first_child;
m->num_interior_leaf_elems[m->leaf_level]--;
H5_PRIV_FUNC_RETURN (elem_idx_of_first_child);
H5_RETURN (elem_idx_of_first_child);
}
static inline h5_loc_idx_t
@@ -278,7 +278,7 @@ compute_neighbor_of_face (
elem_idx,
&td) );
if (td == NULL) {
H5_PRIV_FUNC_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
if (td->num_items == 1) {
// neighbor is coarser or face is on the boundary
@@ -296,10 +296,10 @@ compute_neighbor_of_face (
}
} else {
H5_PRIV_FUNC_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
} while (neighbor_idx < -1);
H5_PRIV_FUNC_RETURN (neighbor_idx);
H5_RETURN (neighbor_idx);
}
/*
@@ -312,7 +312,7 @@ compute_neighbors_of_elems (
) {
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p, level=%d", m, level);
if (level < 0 || level >= m->num_leaf_levels) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"level idx %lld out of bound, must be in [%lld,%lld]",
@@ -333,7 +333,7 @@ compute_neighbors_of_elems (
el++;
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
* returns number of newly created tetrahedra when refining a tetrahedral
@@ -357,7 +357,7 @@ end_store_elems (
TRY( h5tpriv_update_internal_structs (m, m->leaf_level) );
TRY( compute_neighbors_of_elems (m, m->leaf_level) );
TRY( h5tpriv_init_elem_flags (m, start_idx, count) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
struct h5t_store_methods h5tpriv_tetm_store_methods = {
+16 -16
View File
@@ -36,7 +36,7 @@ alloc_loc_elems (
-1,
(new-cur) * sizeof (h5_loc_tri_t));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
@@ -63,7 +63,7 @@ bisect_edge (
// for (int j = 0; j < num_b_edges; j++) {
// if (b_edges[j].idx == my_glb_idx &&
// b_edges[j].face_idx == face_idx) {
// H5_PRIV_FUNC_LEAVE (b_edges[j].vtx);
// H5_LEAVE (b_edges[j].vtx);
// }
// }
// }
@@ -75,9 +75,9 @@ bisect_edge (
TRY (h5t_get_loc_vertex_indices_of_edge (m, kids[0], edge0));
TRY (h5t_get_loc_vertex_indices_of_edge (m, kids[1], edge1));
if ((edge0[0] == edge1[0]) || (edge0[0] == edge1[1])) {
H5_PRIV_FUNC_LEAVE (edge0[0]);
H5_LEAVE (edge0[0]);
} else {
H5_PRIV_FUNC_LEAVE (edge0[1]);
H5_LEAVE (edge0[1]);
}
}
}
@@ -94,7 +94,7 @@ bisect_edge (
P[1] = (P0[1] + P1[1]) / 2.0;
P[2] = (P0[2] + P1[2]) / 2.0;
H5_PRIV_FUNC_RETURN (h5t_store_vertex (m, -1, P));
H5_RETURN (h5t_store_vertex (m, -1, P));
}
/*
@@ -109,7 +109,7 @@ pre_refine_triangle (
unsigned int num_interior_elems_to_refine = m->marked_entities->num_items;
TRY (h5t_begin_store_vertices (m, num_interior_elems_to_refine*3 + 64));
TRY (h5t_begin_store_elems (m, num_interior_elems_to_refine*4));
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*!
@@ -130,7 +130,7 @@ refine_triangle (
h5_loc_tri_t* el = (h5_loc_tri_t*)m->loc_elems + elem_idx;
if (el->child_idx >= 0)
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"Element %lld already refined.",
@@ -169,7 +169,7 @@ refine_triangle (
((h5_loc_tri_t*)m->loc_elems)[elem_idx].child_idx = elem_idx_of_first_child;
m->num_interior_leaf_elems[m->leaf_level]--;
H5_PRIV_FUNC_RETURN (elem_idx_of_first_child);
H5_RETURN (elem_idx_of_first_child);
}
static inline h5_loc_idx_t
@@ -191,7 +191,7 @@ compute_neighbor_of_face (
elem_idx,
&te) );
if (te == NULL) {
H5_PRIV_FUNC_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
if (te->num_items == 1) {
h5_loc_idx_t old_elem_idx = elem_idx;
@@ -207,8 +207,8 @@ compute_neighbor_of_face (
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);
}
assert (m->f->myproc != find_proc_to_write (m, old_elem_idx));
H5_PRIV_FUNC_LEAVE (~0); //TODO what is a resonable output here?
assert (m->f->myproc != h5priv_find_proc_to_write (m, old_elem_idx));
H5_LEAVE (~0); //TODO what is a resonable output here?
}
} else if (te->num_items == 2) {
// neighbor has same level of coarsness
@@ -220,10 +220,10 @@ compute_neighbor_of_face (
} else {
printf ("elem %d face %d num_items %d", elem_idx, face_idx, te->num_items);
H5_PRIV_FUNC_LEAVE (h5_error_internal ());
H5_LEAVE (h5_error_internal ());
}
} while (neighbor_idx < -1);
H5_PRIV_FUNC_RETURN (neighbor_idx);
H5_RETURN (neighbor_idx);
}
/*
@@ -236,7 +236,7 @@ compute_neighbors_of_elems (
) {
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p, level=%d", m, level);
if (level < 0 || level >= m->num_leaf_levels) {
H5_PRIV_FUNC_LEAVE (
H5_LEAVE (
h5_error (
H5_ERR_INVAL,
"level idx %lld out of bound, must be in [%lld,%lld]",
@@ -257,7 +257,7 @@ compute_neighbors_of_elems (
el++;
}
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
/*
* returns number of newly created triangles when refining a triangle
@@ -280,7 +280,7 @@ end_store_elems (
TRY( h5tpriv_update_internal_structs (m, m->leaf_level) );
TRY( compute_neighbors_of_elems (m, m->leaf_level) );
TRY( h5tpriv_init_elem_flags (m, start_idx, count) );
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
H5_RETURN (H5_SUCCESS);
}
struct h5t_store_methods h5tpriv_trim_store_methods = {
+66 -110
View File
@@ -81,16 +81,6 @@ extern struct call_stack h5_call_stack;
extern "C" {
#endif
static inline void
h5_call_stack_init (
const char* fname,
enum h5_rtypes type
) {
h5_call_stack.level = 0;
h5_call_stack.entry[0].name = (char *)fname;
h5_call_stack.entry[0].type = type;
}
static inline void
h5_call_stack_push (
const char* fname,
@@ -189,106 +179,6 @@ __attribute__ ((format (printf, 1, 2)))
#endif
;
//////////////////////////////////////////////////////////////////////////////
// function enter macro
#if defined(NDEBUG)
#define __API_ENTER(type, mask, fmt, ...) \
h5_call_stack_init (__func__,e_##type); \
type ret_value = (type)H5_ERR;
#define __FUNC_ENTER(type, mask, fmt, ...) \
type ret_value = (type)H5_ERR;
#else // NDEBUG not defined
#define __API_ENTER(type, mask, fmt, ...) \
h5_call_stack_push (__func__,e_##type); \
type ret_value = (type)H5_ERR; \
if (h5_log_level & mask ) { \
h5_debug ("(" fmt ")", __VA_ARGS__); \
}
#define __FUNC_ENTER(type, mask, fmt, ...) \
type ret_value = (type)H5_ERR; \
if (h5_log_level & mask ) { \
h5_call_stack_push (__func__,e_##type); \
h5_debug ("(" fmt ")", __VA_ARGS__); \
} \
#endif
//
//////////////////////////////////////////////////////////////////////////////
#define __API_LEAVE(expr) { \
ret_value = expr; \
goto done; \
}
#define __FUNC_LEAVE(expr) { \
ret_value = expr; \
goto done; \
}
//////////////////////////////////////////////////////////////////////////////
// function return macro
#if defined(NDEBUG)
#define __API_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
return ret_value;
#define __FUNC_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
return ret_value;
#else // NDEBUG not defined
#define __API_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
if (h5_log_level & mask ) { \
char fmt[256]; \
snprintf (fmt, sizeof(fmt), "return: %s", \
h5_rfmts[h5_call_stack_get_type()]); \
h5_debug (fmt, ret_value); \
} \
h5_call_stack_reset (); \
return ret_value;
#define __FUNC_RETURN(expr, mask) \
ret_value = expr; \
goto done; \
done: \
if (h5_log_level & mask ) { \
char fmt[256]; \
snprintf (fmt, sizeof(fmt), "return: %s", \
h5_rfmts[h5_call_stack_get_type()]); \
h5_debug (fmt, ret_value); \
h5_call_stack_pop(); \
} \
return ret_value;
#endif
//
//////////////////////////////////////////////////////////////////////////////
#define H5_API_ENTER(type, fmt, ...) \
__API_ENTER(type, H5_DEBUG_API, fmt, __VA_ARGS__)
#define H5_API_LEAVE(expr) __API_LEAVE(expr)
#define H5_API_RETURN(expr) __API_RETURN(expr, H5_DEBUG_API);
#define TRY( func ) \
if ((int64_t)(ptrdiff_t)(func) <= (int64_t)H5_ERR) { \
goto done; \
}
h5_err_t
h5_set_loglevel (
const h5_id_t);
@@ -301,4 +191,70 @@ h5_get_loglevel (
}
#endif
//////////////////////////////////////////////////////////////////////////////
// function enter macro
#if defined(NDEBUG)
#define H5_API_ENTER(type, fmt, ...) \
type ret_value = (type)H5_ERR;
#else // NDEBUG not defined
#define H5_API_ENTER(type, fmt, ...) \
h5_call_stack_reset (); \
type ret_value = (type)H5_ERR; \
int __log__ = h5_log_level & H5_DEBUG_API; \
if (__log__) { \
h5_call_stack_push (__func__,e_##type); \
h5_debug ("(" fmt ")", __VA_ARGS__); \
}
#endif
//
//////////////////////////////////////////////////////////////////////////////
#define H5_LEAVE(expr) { \
ret_value = expr; \
goto done; \
}
//////////////////////////////////////////////////////////////////////////////
// function return macro
#if defined(NDEBUG)
#define H5_RETURN(expr) \
ret_value = expr; \
goto done; \
done: \
return ret_value;
#else // NDEBUG not defined
#define H5_RETURN(expr) \
ret_value = expr; \
goto done; \
done: \
if (__log__ ) { \
char fmt[256]; \
snprintf (fmt, sizeof(fmt), "return: %s", \
h5_rfmts[h5_call_stack_get_type()]); \
h5_debug (fmt, ret_value); \
h5_call_stack_pop(); \
} \
return ret_value;
#endif
//
//////////////////////////////////////////////////////////////////////////////
#define H5_API_LEAVE(expr) H5_LEAVE(expr)
#define H5_API_RETURN(expr) H5_RETURN(expr);
#define TRY( func ) \
if ((int64_t)(ptrdiff_t)(func) <= (int64_t)H5_ERR) { \
goto done; \
}
#endif
+4 -72
View File
@@ -10,84 +10,16 @@
#ifndef __H5CORE_H5_SYSCALL_H
#define __H5CORE_H5_SYSCALL_H
#include <stdlib.h>
#include <string.h>
#include "h5core/h5_types.h"
#include "h5core/h5_log.h"
#define MALLOC_WRAPPER_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_MALLOC, fmt, __VA_ARGS__)
#define MALLOC_WRAPPER_LEAVE(value) __FUNC_LEAVE(value)
#define MALLOC_WRAPPER_RETURN(value) __FUNC_RETURN(value, H5_DEBUG_MALLOC)
#ifdef __cplusplus
extern "C" {
#endif
static inline h5_err_t
h5_free (
void* ptr
) {
MALLOC_WRAPPER_ENTER (h5_err_t, "ptr=%p", ptr);
if (ptr) {
free (ptr);
}
MALLOC_WRAPPER_RETURN (H5_SUCCESS);
}
static inline void_p
h5_alloc (
void* ptr,
const size_t size
) {
MALLOC_WRAPPER_ENTER (void_p, "ptr=%p, size=%lu", ptr, size);
if (size < 1) {
ret_value = (void_p) h5_free (ptr);
MALLOC_WRAPPER_LEAVE (NULL);
}
ptr = realloc (ptr, size);
if (ptr == NULL) {
MALLOC_WRAPPER_LEAVE (
(void_p)h5_error (H5_ERR_NOMEM, "Out of memory. Tried to alloc %lld", (long long int)size));
}
MALLOC_WRAPPER_RETURN (ptr);
}
static inline void_p
h5_calloc (
const size_t count,
const size_t size
) {
MALLOC_WRAPPER_ENTER (void_p, "count=%zu , size=%zu", count, size);
void* ptr = NULL;
if (count * size < 1) {
MALLOC_WRAPPER_LEAVE (ptr);
}
ptr = calloc (count, size);
if (ptr == NULL) {
MALLOC_WRAPPER_LEAVE (
(void_p)h5_error (H5_ERR_NOMEM, "Out of memory. Tried to alloc %lld", (long long int)count* size));
}
MALLOC_WRAPPER_RETURN (ptr);
}
static inline char_p
h5_strdup (
const char* s1
) {
MALLOC_WRAPPER_ENTER (char_p, "s='%s'", s1);
char_p s2 = (char_p)h5_calloc (1, strlen (s1)+1 );
if (s2 == NULL) {
MALLOC_WRAPPER_LEAVE (
(char_p)h5_error (H5_ERR_NOMEM, "Out of memory."));
}
MALLOC_WRAPPER_RETURN (strcpy (s2, s1));
}
h5_err_t h5_free (void* ptr);
void_p h5_alloc (void* ptr, const size_t size);
void_p h5_calloc (const size_t count, const size_t size);
char_p h5_strdup (const char* s1);
#ifdef __cplusplus
}