Skip to content
Snippets Groups Projects
Commit 594b81fe authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add timing output to hdf5_tools

parent 5355899f
No related branches found
No related tags found
No related merge requests found
#include "hdf5_tools.hpp" #include "hdf5_tools.hpp"
#include "scope_timer.hpp"
#include <cfloat> #include <cfloat>
#include <climits> #include <climits>
int hdf5_tools::require_size_single_dataset(hid_t dset, int tsize) int hdf5_tools::require_size_single_dataset(hid_t dset, int tsize)
{ {
TIMEZONE("hdf5_tools::require_size_single_dataset");
int ndims; int ndims;
hsize_t space; hsize_t space;
space = H5Dget_space(dset); space = H5Dget_space(dset);
...@@ -24,6 +26,7 @@ int hdf5_tools::require_size_single_dataset(hid_t dset, int tsize) ...@@ -24,6 +26,7 @@ int hdf5_tools::require_size_single_dataset(hid_t dset, int tsize)
int hdf5_tools::grow_single_dataset(hid_t dset, int tincrement) int hdf5_tools::grow_single_dataset(hid_t dset, int tincrement)
{ {
TIMEZONE("hdf5_tools::grow_single_dataset");
int ndims; int ndims;
hsize_t space; hsize_t space;
space = H5Dget_space(dset); space = H5Dget_space(dset);
...@@ -48,6 +51,7 @@ herr_t hdf5_tools::require_size_dataset_visitor( ...@@ -48,6 +51,7 @@ herr_t hdf5_tools::require_size_dataset_visitor(
const H5O_info_t *info, const H5O_info_t *info,
void *op_data) void *op_data)
{ {
TIMEZONE("hdf5_tools::require_size_dataset_visitor");
if (info->type == H5O_TYPE_DATASET) if (info->type == H5O_TYPE_DATASET)
{ {
hsize_t dset = H5Dopen(o_id, name, H5P_DEFAULT); hsize_t dset = H5Dopen(o_id, name, H5P_DEFAULT);
...@@ -63,6 +67,7 @@ herr_t hdf5_tools::grow_dataset_visitor( ...@@ -63,6 +67,7 @@ herr_t hdf5_tools::grow_dataset_visitor(
const H5O_info_t *info, const H5O_info_t *info,
void *op_data) void *op_data)
{ {
TIMEZONE("hdf5_tools::grow_dataset_visitor");
if (info->type == H5O_TYPE_DATASET) if (info->type == H5O_TYPE_DATASET)
{ {
hsize_t dset = H5Dopen(o_id, name, H5P_DEFAULT); hsize_t dset = H5Dopen(o_id, name, H5P_DEFAULT);
...@@ -78,6 +83,7 @@ int hdf5_tools::grow_file_datasets( ...@@ -78,6 +83,7 @@ int hdf5_tools::grow_file_datasets(
const std::string group_name, const std::string group_name,
int tincrement) int tincrement)
{ {
TIMEZONE("hdf5_tools::grow_file_datasets");
int file_problems = 0; int file_problems = 0;
hid_t group; hid_t group;
...@@ -98,6 +104,7 @@ int hdf5_tools::require_size_file_datasets( ...@@ -98,6 +104,7 @@ int hdf5_tools::require_size_file_datasets(
const std::string group_name, const std::string group_name,
int tsize) int tsize)
{ {
TIMEZONE("hdf5_tools::require_size_file_datasets");
int file_problems = 0; int file_problems = 0;
hid_t group; hid_t group;
...@@ -117,6 +124,7 @@ std::vector<number> hdf5_tools::read_vector( ...@@ -117,6 +124,7 @@ std::vector<number> hdf5_tools::read_vector(
const hid_t group, const hid_t group,
const std::string dset_name) const std::string dset_name)
{ {
TIMEZONE("hdf5_tools::read_vector");
std::vector<number> result; std::vector<number> result;
hsize_t vector_length; hsize_t vector_length;
// first, read size of array // first, read size of array
...@@ -143,6 +151,7 @@ number hdf5_tools::read_value( ...@@ -143,6 +151,7 @@ number hdf5_tools::read_value(
const hid_t group, const hid_t group,
const std::string dset_name) const std::string dset_name)
{ {
TIMEZONE("hdf5_tools::read_value");
number result; number result;
hid_t dset; hid_t dset;
hid_t mem_dtype; hid_t mem_dtype;
...@@ -177,6 +186,7 @@ std::vector<dtype> hdf5_tools::read_vector_with_single_rank( ...@@ -177,6 +186,7 @@ std::vector<dtype> hdf5_tools::read_vector_with_single_rank(
const hid_t file_id, const hid_t file_id,
const std::string dset_name) const std::string dset_name)
{ {
TIMEZONE("hdf5_tools::read_vector_with_single_rank");
std::vector<dtype> data; std::vector<dtype> data;
int vector_size; int vector_size;
if (myrank == rank_to_use) if (myrank == rank_to_use)
...@@ -208,6 +218,7 @@ std::string hdf5_tools::read_string( ...@@ -208,6 +218,7 @@ std::string hdf5_tools::read_string(
const hid_t group, const hid_t group,
const std::string dset_name) const std::string dset_name)
{ {
TIMEZONE("hdf5_tools::read_string");
if (H5Lexists(group, dset_name.c_str(), H5P_DEFAULT)) if (H5Lexists(group, dset_name.c_str(), H5P_DEFAULT))
{ {
hid_t dset = H5Dopen(group, dset_name.c_str(), H5P_DEFAULT); hid_t dset = H5Dopen(group, dset_name.c_str(), H5P_DEFAULT);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment