#include "mhdf.h"
#include "util.h"
#include "status.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <H5Tpublic.h>
#include <H5Dpublic.h>
#include <H5Ppublic.h>
Go to the source code of this file.
Macros | |
#define | FIX_OFFSET(TYPE, FIELD) |
Functions | |
static struct mhdf_FileDesc * | alloc_file_desc (mhdf_Status *status) |
static void * | realloc_data (struct mhdf_FileDesc **data, size_t append_bytes, mhdf_Status *status, int alignment) |
void | mhdf_fixFileDesc (struct mhdf_FileDesc *copy_ptr, const struct mhdf_FileDesc *orig_addr) |
Fix nested pointers for copied/moved FileDesc struct. More... | |
static struct mhdf_FileDesc * | get_elem_desc (mhdf_FileHandle file_handle, struct mhdf_FileDesc *result, const char *elem_handle, int idx, mhdf_Status *status) |
static unsigned | get_file_id_size (hid_t file_id_type, mhdf_Status *status) |
static struct mhdf_FileDesc * | get_tag_desc (mhdf_FileHandle file_handle, struct mhdf_FileDesc *result, const char *name, int idx, hid_t type, mhdf_Status *status) |
static void | free_string_list (char **list, int count) |
struct mhdf_FileDesc * | mhdf_getFileSummary (mhdf_FileHandle file_handle, hid_t file_id_type, mhdf_Status *status, int extraSetInfo) |
Get summary of data tables contained within file. More... | |
Variables | |
static char | buffer [512] |
#define FIX_OFFSET | ( | TYPE, | |
FIELD | |||
) |
Definition at line 73 of file file-desc.c.
|
static |
Definition at line 15 of file file-desc.c.
References mhdf_isError(), mhdf_malloc(), mhdf_FileDesc::offset, and mhdf_FileDesc::total_size.
Referenced by mhdf_getFileSummary().
|
static |
Definition at line 377 of file file-desc.c.
Referenced by mhdf_getFileSummary().
|
static |
Definition at line 120 of file file-desc.c.
References buffer, mhdf_EntDesc::count, mhdf_EntDesc::dense_tag_indices, mhdf_ElemDesc::desc, mhdf_FileDesc::elems, mhdf_ElemDesc::handle, mhdf_ElemDesc::have_adj, mhdf_closeData(), mhdf_getElemTypeName(), mhdf_haveAdjacency(), mhdf_isError(), mhdf_isPolyElement(), mhdf_openConnectivity(), mhdf_openPolyConnectivity(), mhdf_EntDesc::num_dense_tags, realloc_data(), mhdf_EntDesc::start_id, mhdf_ElemDesc::type, and mhdf_EntDesc::vals_per_ent.
Referenced by mhdf_getFileSummary().
|
static |
Definition at line 192 of file file-desc.c.
References mhdf_setFail().
Referenced by get_tag_desc().
|
static |
Definition at line 203 of file file-desc.c.
References mhdf_TagDesc::bytes, mhdf_TagDesc::default_value, mhdf_TagDesc::default_value_size, get_file_id_size(), mhdf_TagDesc::global_value, mhdf_TagDesc::global_value_size, mhdf_TagDesc::have_sparse, mhdf_BITFIELD, mhdf_BOOLEAN, mhdf_ENTITY_ID, mhdf_FLOAT, mhdf_getTagInfo(), mhdf_getTagValues(), mhdf_INTEGER, mhdf_isError(), mhdf_OPAQUE, mhdf_setFail(), mhdf_TagDesc::name, realloc_data(), mhdf_TagDesc::size, size, mhdf_TagDesc::storage, mhdf_FileDesc::tags, and mhdf_TagDesc::type.
Referenced by mhdf_getFileSummary().
void mhdf_fixFileDesc | ( | struct mhdf_FileDesc * | copy_ptr, |
const struct mhdf_FileDesc * | orig_addr | ||
) |
Fix nested pointers for copied/moved FileDesc struct.
This is a utility method to facility copying/moving/communicating struct FileDesc instances. The structure and all data it references are allocated in a single contiguous block of memory of size FileDesc::total_size. As such, the struct can be copied with a single memcpy, packed into a single network packet, communicated with a single MPI call, etc. However, the pointers contained within the struct will not be valid in the copied instance (they will still point into the original instance.) Given a pointer to the copied struct and the address of the original struct, this function will updated all contained pointers.
Definition at line 77 of file file-desc.c.
References API_BEGIN, API_END, mhdf_FileDesc::defTagsEntSets, mhdf_FileDesc::defTagsVals, mhdf_EntDesc::dense_tag_indices, mhdf_FileDesc::elems, FIX_OFFSET, mhdf_FileDesc::nodes, mhdf_FileDesc::num_elem_desc, mhdf_FileDesc::num_tag_desc, mhdf_FileDesc::numEntSets, mhdf_FileDesc::sets, and mhdf_FileDesc::tags.
Referenced by realloc_data(), and moab::ReadHDF5::set_up_read().
struct mhdf_FileDesc* mhdf_getFileSummary | ( | mhdf_FileHandle | file_handle, |
hid_t | file_id_type, | ||
mhdf_Status * | status, | ||
int | extraSetInfo | ||
) |
Get summary of data tables contained within file.
Returned struct, including all pointed-to data, is allocated in a single contiguous block of memory with a size equal to 'total_size'. Caller is responsible for freeing the returned struct FileDesc pointer (and only that pointer, not pointers nexted within the struct!). Caller may copy (e.g. MPI_BCast) entire struct as one contiguous block, assuming all nested pointers in the copy are updated to the correct relative offset from the beginning of the struct.
Definition at line 385 of file file-desc.c.
References alloc_file_desc(), API_BEGIN, API_END, mhdf_EntDesc::count, mhdf_FileDesc::defTagsEntSets, mhdf_FileDesc::defTagsVals, mhdf_TagDesc::dense_elem_indices, mhdf_EntDesc::dense_tag_indices, mhdf_ElemDesc::desc, mhdf_FileDesc::elems, free_string_list(), get_elem_desc(), get_tag_desc(), mhdf_FileDesc::have_set_children, mhdf_FileDesc::have_set_contents, mhdf_FileDesc::have_set_parents, mhdf_TagDesc::have_sparse, mhdf_closeData(), mhdf_getElemHandles(), mhdf_getTagNames(), mhdf_haveDenseTag(), mhdf_haveNodes(), mhdf_haveSets(), mhdf_isError(), mhdf_malloc(), mhdf_node_type_handle(), mhdf_openDenseTagData(), mhdf_openNodeCoords(), mhdf_openSetMeta(), mhdf_openSparseTagData(), mhdf_read_data(), mhdf_readTagValues(), mhdf_set_type_handle(), mhdf_setOkay(), mhdf_TagDesc::name, mhdf_FileDesc::nodes, mhdf_TagDesc::num_dense_indices, mhdf_EntDesc::num_dense_tags, mhdf_FileDesc::num_elem_desc, mhdf_FileDesc::num_tag_desc, mhdf_FileDesc::numEntSets, mhdf_FileDesc::offset, realloc_data(), mhdf_FileDesc::sets, size, mhdf_EntDesc::start_id, mhdf_FileDesc::tags, mhdf_FileDesc::total_size, and mhdf_EntDesc::vals_per_ent.
Referenced by iMOAB_ReadHeaderInfo(), main(), and moab::ReadHDF5::set_up_read().
|
static |
Definition at line 28 of file file-desc.c.
References mhdf_fixFileDesc(), mhdf_isError(), mhdf_realloc(), mhdf_FileDesc::offset, and mhdf_FileDesc::total_size.
Referenced by get_elem_desc(), get_tag_desc(), and mhdf_getFileSummary().
|
static |
Definition at line 13 of file file-desc.c.
Referenced by moab::WriteHDF5Parallel::append_serial_tag_data(), moab::WriteHDF5Parallel::check_serial_tag_data(), check_valid_adjacencies(), check_valid_elem_conn(), check_valid_poly_conn(), moab::convert_to_ranged_ids(), file_exists(), get_elem_desc(), moab::ReadHDF5::get_tagged_entities(), moab::INT_IO_ERROR(), moab::mem_to_string(), mhdf_getElemHandles(), mhdf_getElemName(), mhdf_getElemTypeName(), mhdf_name_to_path_cat(), mhdf_name_to_path_copy(), moab::mpi_err_str(), moab::WriteHDF5::ExportSet::name(), moab::WriteHDF5Parallel::pack_set(), print_iGeom_error(), print_iMesh_error(), moab::print_range(), moab::DebugOutput::print_real(), moab::ErrorOutput::print_real(), moab::ReadHDF5Dataset::read(), moab::ReadHDF5::read_adjacencies(), moab::ReadHDF5::read_elems(), moab::ReadHDF5::read_node_adj_elems(), moab::ReadHDF5::read_nodes(), moab::ReadHDF5VarLen::read_offsets(), moab::ReadHDF5::read_poly(), moab::ReadHDF5::read_set_data(), moab::ReadHDF5::read_tag_values_partial(), moab::ReadHDF5::read_var_len_tag(), moab::ParCommGraph::receive_mesh(), moab::ParCommGraph::receive_tag_values(), moab::ReorderTool::reorder_tag_data(), moab::ReadHDF5::search_tag_values(), moab::ParCommGraph::send_graph_partition(), moab::ParCommGraph::send_mesh_parts(), moab::ParCommGraph::send_tag_values(), moab::ReadHDF5::store_file_ids(), moab::ReadHDF5::store_sets_file_ids(), string_tag_value(), moab::DebugOutput::tprint_real(), moab::WriteHDF5Parallel::unpack_set(), moab::WriteHDF5::write_adjacencies(), moab::WriteHDF5::write_elems(), moab::WriteHDF5::write_nodes(), moab::WriteHDF5::write_set_data(), moab::WriteHDF5::write_sets(), and moab::WriteHDF5::write_var_len_data().