tested out packaging a tarball and compiling/install on Franklin

fixed several issues with the build system
This commit is contained in:
Marc Howison
2010-07-24 00:10:41 +00:00
parent 421a92630a
commit 377af10fb0
25 changed files with 165 additions and 236 deletions
+14 -33
View File
@@ -1,6 +1,6 @@
# Every configure script must call AC_INIT before doing anything else.
# AC_INIT (package, version, [bug-report], [tarname])
AC_INIT([H5hut], [1.99.0], [h5part@lists.psi.ch], H5Part)
AC_INIT([H5hut], [1.99.0], [h5part@lists.psi.ch], H5hut)
# Ensure that a recent enough version of Autoconf is being used.
@@ -14,9 +14,7 @@ AC_PREREQ(2.59)
# The AC_CONFIG_HEADERS macro selects this kind of output.
AC_CONFIG_HEADER(config.h)
BINDINGS=''
BUILD_LIBS='libH5hut'
BUILD_LIBS='libH5hut.a'
USE_C='yes'
###############################################################################
@@ -53,12 +51,6 @@ AC_ARG_ENABLE(
[Compile the MPI/IO interface [default=no]])],
[USE_PARALLEL=$enableval])
AC_ARG_ENABLE(
[tools],
[AC_HELP_STRING([--enable-tools],
[Compile h5part tools [default=no]])],
[USE_TOOLS=$enableval])
AC_ARG_WITH(
[mpi],
[AC_HELP_STRING([--with-mpi],
@@ -83,12 +75,9 @@ AC_ARG_WITH(
SAVE_CC=$CC
SAVE_CXX=$CXX
SAVE_FC=$FC
SAVE_MPICC=$MPICC
SAVE_MPICXX=$MPICXX
SAVE_MPIFC=$MPIFC
SAVE_CFLAGS=$CFLAGS
SAVE_FFLAGS=$FFLAGS
SAVE_INCLUDES=$INCLUDES
SAVE_LDFLAGS=$LDFLAGS
SAVE_LIBS=$LIBS
@@ -206,7 +195,10 @@ AC_MSG_CHECKING([if C interface enabled])
if test "X$USE_C" = "Xyes"; then
AC_MSG_RESULT([yes])
BINDINGS="$BINDINGS C"
BUILD_LIBS="$BUILD_LIBS libH5hutC"
LIB_C="libH5hutC.a"
BUILD_LIBS="$BUILD_LIBS $LIB_C"
BUILD_TESTS="$BUILD_TESTS h5u_test h5b_test"
BUILD_TOOLS="$BUILD_TOOLS h5hutcc"
fi
############################ fortran enabled ##################################
@@ -214,8 +206,8 @@ AC_MSG_CHECKING([if fortran interface enabled])
if test "X$USE_FORTRAN" = "Xyes"; then
AC_MSG_RESULT([yes])
BINDINGS="$BINDINGS Fortran"
BUILD_LIBS="$BUILD_LIBS libH5hutF"
LIB_FORTRAN="libH5hutF.a"
BUILD_LIBS="$BUILD_LIBS $LIB_FORTRAN"
AC_PROG_FC(pgf90 ifort xlf_r pathf90 g95 g90 ftn gfortran)
if test -z "$FC" ; then
@@ -375,14 +367,6 @@ else # --enable-parallel=no
fi
fi
AC_MSG_CHECKING([wheter tools are enabled])
if test "X$USE_TOOLS" = "Xyes"; then
AC_MSG_RESULT([yes])
BUILD_TOOLS="h5pAttrib h5pToGNUplot # homdynToH5p"
else
AC_MSG_RESULT([no])
fi
###############################################################################
######################### PATH CHECKING & SETTING #############################
###############################################################################
@@ -443,8 +427,8 @@ if test -z "$LUSTREROOT"; then
AC_MSG_WARN([Couldn't locate the lustre API... building without support for lustre striping!])
else
CFLAGS="$CFLAGS -DH5_USE_LUSTRE"
INCLUDES="$INCLUDES -I$LUSTREROOT/include"
LDFLAGS="LDFLAGS -L$LUSTREROOT/lib"
INCLUDES="$INCLUDES -I$LUSTREROOT/usr/include"
LDFLAGS="$LDFLAGS -L$LUSTREROOT/usr/lib"
LIBS="$LIBS -llustreapi"
fi
@@ -532,25 +516,22 @@ AC_SUBST(FFLAGS)
AC_SUBST(INCLUDES)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AC_SUBST(STDCXX)
AC_SUBST(UNDERSCORE_H)
AC_SUBST(BUILD_TOOLS)
AC_SUBST(FORTRAN_LIB)
AC_SUBST(LIB_C)
AC_SUBST(LIB_FORTRAN)
AC_SUBST(BINDINGS)
AC_SUBST(BUILD_TESTS)
AC_SUBST(BUILD_TOOLS)
# Make AC_OUTPUT create each `file' by copying an input file (by default `file.in'),
# substituting the output variable values.
AC_CONFIG_FILES([
Makefile
doc/Makefile
src/Makefile
src/C/Makefile
src/h5core/Makefile
src/Fortran/Makefile
test/Makefile
test/H5Part/Makefile
test/H5Block/Makefile
test/H5Fed/Makefile
tools/Makefile
tools/h5hutcc
])
+3 -10
View File
@@ -1,17 +1,10 @@
DOXYGROUPS = \
h5part__attrib \
h5part__errhandle \
h5part__openclose \
h5part__read \
h5part__write \
h5block__c__api
EXTRA_DIST = \
Doxyfile doxyfooter
Doxyfile \
H5.dox
all:
doc: doxydoc
doc:
doxydoc:
doxygen
+1 -1
View File
@@ -107,7 +107,7 @@ H5FedGetVertexCoordByID (
h5_float64_t P[3]
) {
SET_FNAME (f, __func__);
return h5t_get_vertrex_coords_by_id (f, vertex_id, P);
return h5t_get_vertex_coords_by_id (f, vertex_id, P);
}
h5_err_t
+3 -5
View File
@@ -6,7 +6,7 @@ LIBS = @LIBS@
INCLUDES = -I../include @INCLUDES@
# What to build... Will be determined by configure script.
lib_LIBRARIES = libH5hutC.a
lib_LIBRARIES = @LIB_C@
# Listing of all possible targets that I may build.
EXTRA_LIBRARIES = libH5hutC.a
@@ -20,6 +20,7 @@ include_HEADERS = \
../include/H5Block.h \
../include/H5Block_readwrite.h \
../include/H5Fed.h \
../include/H5Fed_adjacency.h \
../include/H5Fed_inquiry.h \
../include/H5Fed_retrieve.h \
../include/H5Fed_store.h \
@@ -42,8 +43,5 @@ libH5hutC_a_SOURCES = \
H5Fed_store.c \
H5Fed_tags.c
all: ../lib/libH5hutC.a
../lib/libH5hutC.a: libH5hutC.a
-cp $^ $@
clean: cleam-am
+4 -4
View File
@@ -23,7 +23,7 @@ EXTRA_DIST = TestUnderscoreC.c \
nodist_include_HEADERS = ../include/H5hutF.h
# What to build... Will be determined by configure script.
lib_LIBRARIES = @FORTRAN_LIB@
lib_LIBRARIES = @LIB_FORTRAN@
# Listing of all possible targets that I may build.
EXTRA_LIBRARIES = libH5hutF.a
@@ -34,11 +34,11 @@ libH5hutF_a_SOURCES = H5_F.c \
H5Block_F.c \
H5Block_readwrite_F.c
all: ../include/H5hutF.h ../lib/libH5hutF.a
libH5hutF_a_DEPENDENCIES = ../include/H5hutF.h
../include/H5hutF.h: $(F90_FILES)
awk '/INTEGER\*8 FUNCTION/{print "\t" $$1 " " $$3}' $^ >$@
../lib/libH5hutF.a: libH5hutF.a
-cp $^ $@
clean: clean-am
$(RM) ../include/H5hutF.h
+1
View File
@@ -1,3 +1,4 @@
# test level Makefile.am
SUBDIRS = h5core @BINDINGS@
+19 -17
View File
@@ -8,6 +8,7 @@ INCLUDES = -I../include @INCLUDES@
EXTRA_HEADERS = \
../include/h5core/h5_attribs.h \
../include/h5core/h5_core.h \
../include/h5core/h5_errno.h \
../include/h5core/h5_errorhandling.h \
../include/h5core/h5_hdf5.h \
../include/h5core/h5_maps.h \
@@ -20,6 +21,7 @@ EXTRA_HEADERS = \
../include/h5core/h5b_model.h \
../include/h5core/h5b_attribs.h \
../include/h5core/h5t_adjacencies.h \
../include/h5core/h5t_core.h \
../include/h5core/h5t_inquiry.h \
../include/h5core/h5t_map.h \
../include/h5core/h5t_openclose.h \
@@ -28,45 +30,46 @@ EXTRA_HEADERS = \
../include/h5core/h5t_retrieve.h \
../include/h5core/h5t_storemesh.h \
../include/h5core/h5t_tags.h \
h5b_errorhandling_private.h \
h5b_model_private.h \
h5b_types_private.h \
h5_core_private.h \
h5_errorhandling_private.h \
h5_fcmp_private.h \
h5_hdf5_private.h \
h5_hsearch_private.h \
h5_lustre_private.h \
h5_mpi_private.h \
h5_qsort_private.h \
h5_readwrite_private.h \
h5_syscall_private.h \
h5_lustre_private.h \
h5u_errorhandling_private.h \
h5b_errorhandling_private.h \
h5b_model_private.h \
h5t_access_private.h \
h5t_adjacencies_private.h \
h5t_consts_private.h \
h5t_core_private.h \
h5t_errorhandling_private.h \
h5t_hsearch_private.h \
h5t_map_private.h \
h5t_openclose_private.h \
h5t_readwrite_private.h \
h5t_retrieve_private.h \
h5t_store_private.h \
h5t_tags_private.h
h5t_store_trim_private.h \
h5t_tags_private.h \
h5t_types_private.h \
h5_types_private.h \
h5u_errorhandling_private.h \
h5u_types_private.h
# Extra files that I wish to include in the dist tar ball.
EXTRA_DIST = $(EXTRA_HEADERS)
# Files that I don't want to include in the dist tar ball
nodist_include_HEADERS =
#OBJEXT = o
# What to build... Will be determined by configure script.
lib_LIBRARIES = libH5hut.a
# Listing of all possible targets that I may build.
EXTRA_LIBRARIES = libH5hut.a
# Header files that I wish to install in $(prefix)/include
include_HEADERS =
# Listing of sources
libH5hut_a_SOURCES = \
h5_attribs.c \
@@ -112,10 +115,9 @@ libH5hut_a_SOURCES = \
libH5hut_a_DEPENDENCIES = $(EXTRA_HEADERS)
all: ../lib/libH5hut.a
install-exec-local:
@$(INSTALL) -d $(DESTDIR)$(includedir)/h5core
@$(INSTALL) -m644 ../include/h5core/*.h $(DESTDIR)$(includedir)/h5core/
../lib/libH5hut.a: libH5hut.a
-cp $^ $@
$(libH5hut_a_OBJECTS): $(libH5hut_a_DEPENDENCIES)
clean: clean-am
+4
View File
@@ -152,7 +152,11 @@ h5_abort_errorhandler (
if (h5priv_debug_level > 0) {
h5_verror (f, fmt, ap);
}
#ifdef PARALLEL_IO
MPI_Abort(f->comm, -(int)f->__errno);
#else
exit (-(int)f->__errno);
#endif
}
static void
+10 -10
View File
@@ -28,7 +28,7 @@ _print_stripe_info(struct lov_user_md *lum)
}
static ssize_t
_get_lustre_stripe_size ( const char *path )
_get_lustre_stripe_size(h5_file_t *const f, const char *path )
{
size_t nbytes = sizeof(struct lov_user_md) +
INIT_ALLOC_NUM_OSTS * sizeof(struct lov_user_ost_data);
@@ -89,7 +89,7 @@ _get_lustre_stripe_size ( const char *path )
return stripe_size;
}
herr_t
h5_err_t
h5_optimize_for_lustre (
h5_file_t *const f,
const char *filename
@@ -114,17 +114,19 @@ h5_optimize_for_lustre (
}
else fclose(test);
stripe_size = _get_lustre_stripe_size(path);
stripe_size = _get_lustre_stripe_size(f, path);
free(path);
}
TRY( h5priv_mpi_bcast(f, &stripe_size, 1, MPI_LONG_LONG, 0, f->comm) );
h5_info(f, "Found lustre stripe size of %lld bytes", (long long)stripe_size);
h5_info(f, MSG_HEADER
"Found lustre stripe size of %lld bytes",
(long long)stripe_size);
hsize_t btree_ik = (stripe_size - 4096) / 96;
hsize_t btree_bytes = 64 + 96*btree_ik;
h5_info(f,
h5_info(f, MSG_HEADER
"Setting HDF5 btree ik to %lld (= %lld bytes at rank 3)",
(long long)btree_ik, (long long)btree_bytes);
TRY( h5priv_set_hdf5_btree_ik_property(f, f->create_prop, btree_ik) );
@@ -133,21 +135,19 @@ h5_optimize_for_lustre (
TRY( h5priv_set_hdf5_alignment_property(f,
f->access_prop, 0, stripe_size) );
if (_verbose) {
fprintf(MSG_STREAM, MSG_HEADER "disabling metadata cache flushes.\n");
}
h5_info(f, MSG_HEADER "Disabling metadata cache flushes.");
/* disable metadata cache flushes */
/* defer metadata writes */
H5AC_cache_config_t config;
config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
TRY( H5Pget_mdc_config( fapl_id, &config ) );
TRY( H5Pget_mdc_config( f->access_prop, &config ) );
config.set_initial_size = 1;
config.initial_size = 16 * 1024 * 1024;
config.evictions_enabled = 0;
config.incr_mode = H5C_incr__off;
config.decr_mode = H5C_decr__off;
config.flash_incr_mode = H5C_flash_incr__off;
TRY( H5Pset_mdc_config( fapl_id, &config ) );
TRY( H5Pset_mdc_config( f->access_prop, &config ) );
return H5_SUCCESS;
}
-2
View File
@@ -97,8 +97,6 @@ med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk
#ifndef I_AM_QSORT_R
#if __GNUC__
__attribute__((unused))
#else
__unused
#endif
#endif
)
+9 -53
View File
@@ -2,9 +2,6 @@
OBJEXT = o
# PATH SETTING
HDF5ROOT = @HDF5ROOT@
# COMPILER SETTING
CXX = @CXX@
FC = @FC@
@@ -13,30 +10,14 @@ MPICXX = @MPICXX@
MPICC = @MPICC@
# COMPILER FLAG SETTING
CFLAGS = @CFLAGS@
FFLAGS = @FFLAGS@ @MPIINC@
AM_CFLAGS = @CFLAGS@
FFLAGS = @FFLAGS@
# LIBRARIES
SZLIB = @SZLIB@
HDFLIB = -L$(HDF5ROOT)/lib -lhdf5 -lz $(SZLIB) @LDFLAGS@
MPILIB = @MPILIB@
H5LIB = -L${abs_top_builddir}/src/lib -lH5Core -lH5
AM_LDFLAGS = -L../../src/lib @LDFLAGS@
LIBS = -lH5hutC -lH5hut @LIBS@
INCLUDES = -I../../src/include @INCLUDES@
LIBS = ${H5LIB} $(HDFLIB) $(MPILIB) -lm @STDCXX@
# H5Part compiled library location
# H5PLIB = -L@prefix@/lib
# INCLUDES
HDFINC = -I$(HDF5ROOT)/include
MPIINC = @MPIINC@
H5INC = -I${abs_top_builddir}/src/include
INC = $(HDFINC) $(MPIINC) $(H5INC)
# What to build... make install will place these files in the $(prefix)/bin directory.
bin_PROGRAMS = \
noinst_PROGRAMS = \
tetmesh_write \
tetmesh_write2 \
tetmesh_read \
@@ -49,12 +30,6 @@ bin_PROGRAMS = \
# map_tet2globalid \
# map_triangle2globalid
# Some useful scripts that I wish to place in the $(prefix)/bin directory.
bin_SCRIPTS =
# Listing of all programs that maybe built. (Has to know statically...)
EXTRA_PROGRAMS =
# Extra files that I wish to include in the dist tar ball.
EXTRA_DIST = \
tetmesh_write.c \
@@ -70,27 +45,8 @@ EXTRA_DIST = \
# map_triangle2globalid.c \
# $(bin_SCRIPTS)
all: $(bin_PROGRAMS)
###############################################################################
% : %.o
$(CC) -o $@ $< $(H5LIB) $(LIBS)
%.o : %.c
$(CC) $(CFLAGS) $(INC) -g -c $<
%.o : %.f90
${FC} $(FFLAGS) -c $(H5INC) $<
###############################################################################
clean:
${RM} -f *~ *.o ${bin_PROGRAMS}
distclean: clean
${RM} -rf .deps
${RM} -rf .libs
${RM} -f parttest.h5
${RM} -rf config.status config.log config.h Makefile
all: $(noinst_PROGRAMS)
clean: clean-am
rm -f *.h5
+2 -3
View File
@@ -1,8 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <hdf5.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
#ifndef PARALLEL_IO
#ifndef MPI_COMM_WORLD
+2 -3
View File
@@ -1,8 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <hdf5.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
#ifndef PARALLEL_IO
#ifndef MPI_COMM_WORLD
+1 -2
View File
@@ -2,8 +2,7 @@
#include <stdlib.h>
#include <time.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
#define PRINT_UPADJACENCIES 1
#define PRINT_DOWNADJACENCIES 0
+1 -2
View File
@@ -2,8 +2,7 @@
#include <stdlib.h>
#include <time.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
const h5_oid_t MESH_TYPE = H5_TETRAHEDRAL_MESH;
const char* FNAME = "simple_tet.h5";
+2 -3
View File
@@ -1,9 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <hdf5.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
#ifndef PARALLEL_IO
#ifndef MPI_COMM_WORLD
+1 -2
View File
@@ -2,8 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
#ifndef PARALLEL_IO
#ifndef MPI_COMM_WORLD
+1 -2
View File
@@ -2,8 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
const h5_oid_t MESH_TYPE = H5_TETRAHEDRAL_MESH;
const char* FNAME = "simple_tet.h5";
+1 -2
View File
@@ -3,8 +3,7 @@
#include <time.h>
#include <string.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
const h5_oid_t MESH_TYPE = H5_TETRAHEDRAL_MESH;
const char* FNAME = "simple_tet.h5";
+1 -2
View File
@@ -1,8 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
const h5_oid_t MESH_TYPE = H5_TRIANGLE_MESH;
const char* FNAME = "simple_triangle.h5";
+1 -2
View File
@@ -1,8 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
const h5_oid_t MESH_TYPE = H5_TRIANGLE_MESH;
const char* FNAME = "simple_triangle.h5";
+2 -3
View File
@@ -1,8 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <hdf5.h>
#include "H5Part.h"
#include "H5Fed.h"
#include "H5hut.h"
#ifndef PARALLEL_IO
#ifndef MPI_COMM_WORLD
+7 -7
View File
@@ -4,15 +4,15 @@
OBJEXT=o
LDFLAGS = -L../src/lib @LDFLAGS@
AM_LDFLAGS = -L../src/h5core -L../src/C @LDFLAGS@
LIBS = -lH5hutC -lH5hut @LIBS@
INCLUDES = -I../src/include @INCLUDES@
noinst_PROGRAMS = h5u_test h5b_test
noinst_PROGRAMS = @BUILD_TESTS@
TESTS_ENVIRONMENT = env LD_LIBRARY_PATH=@HDF5ROOT@/lib:$(LD_LIBRARY_PATH)
TESTS = h5u_test h5b_test
TESTS = @BUILD_TESTS@
EXTRA_PROGRAMS = h5u_test h5b_test
@@ -25,8 +25,8 @@ h5u_test_SOURCES = \
params.h
h5u_test_DEPENDENCIES = \
../src/lib/libH5hut.a \
../src/lib/libH5hutC.a
../src/h5core/libH5hut.a \
../src/C/libH5hutC.a
h5b_test_SOURCES = \
h5b_test.c \
@@ -37,8 +37,8 @@ h5b_test_SOURCES = \
params.h
h5b_test_DEPENDENCIES = \
../src/lib/libH5hut.a \
../src/lib/libH5hutC.a
../src/h5core/libH5hut.a \
../src/C/libH5hutC.a
clean: clean-am
rm -f *.h5
+7 -8
View File
@@ -2,27 +2,26 @@
OBJEXT=o
LDFLAGS = -L../src/lib @LFLAGS@
AM_LDFLAGS = -L../src/lib @LFLAGS@
LIBS = -lH5hutC -lH5hut @LIBS@
INCLUDES = -I../src/include @INCLUDES@
# What to build... make install will place these files in the $(prefix)/bin directory.
bin_PROGRAMS = @BUILD_TOOLS@
bin_SCRIPTS = @BUILD_TOOLS@
# Listing of all programs that maybe built. (Has to know statically...)
EXTRA_PROGRAMS = h5pAttrib h5pToGNUplot # homdynToH5p
EXTRA_SCRIPTS = h5hutcc
# Extra files that I wish to include in the dist tar ball.
EXTRA_DIST = h5pAttrib.cc h5pToGNUplot.cc## TO BE TAILORED LATER...
#EXTRA_DIST = h5pAttrib.cc h5pToGNUplot.cc## TO BE TAILORED LATER...
# Listing of sources
h5pAttrib_SOURCES = h5pAttrib.cc
#h5pAttrib_SOURCES = h5pAttrib.cc
h5pToGNUplot_SOURCES = h5pToGNUplot.cc
#h5pToGNUplot_SOURCES = h5pToGNUplot.cc
#homdynToH5p_SOURCES = homdynToH5p.cc
install-exec-local:
@$(INSTALL) h5hutcc $(DESTDIR)$(bindir)/h5hutcc
clean: clean-am
+68 -60
View File
@@ -8,8 +8,8 @@
#include <stdlib.h>
#include <cctype>
#include <string.h>
#include <hdf5.h>
#include "H5Part.h"
#include "H5hut.h"
#define MAX_LEN 100
@@ -17,11 +17,11 @@
int get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts);
static void print_help();
static void free_handler(struct arg_handler *hand, int len);
static void print_all(H5PartFile* file);
static void print_nstep(H5PartFile* file, char * garbage);
static void print_file_attributes(H5PartFile* file, char * garbage);
static void print_step_attributes(H5PartFile* file, char *attr);
static void print_dataset(H5PartFile* file, char *attr);
static void print_all(h5_file_t* file);
static void print_nstep(h5_file_t* file, char * garbage);
static void print_file_attributes(h5_file_t* file, char * garbage);
static void print_step_attributes(h5_file_t* file, char *attr);
static void print_dataset(h5_file_t* file, char *attr);
static struct arg_handler* function_assign(int argc, const char *argv[]);
/* Global variables */
@@ -66,7 +66,7 @@ static struct long_options l_opts[] =
/* a structure for handling the order command-line parameters come in */
struct arg_handler {
void (*func)(H5PartFile *, char *);
void (*func)(h5_file_t *, char *);
char *obj;
};
@@ -335,27 +335,27 @@ static void print_help()
}
/* For priting everything (default option when no flags provided.) */
static void print_all(H5PartFile* file)
static void print_all(h5_file_t* file)
{
int nt;
char file_attrib[MAX_LEN];
h5part_int64_t type;
h5part_int64_t num_elem;
h5part_int64_t num_attrib;
h5_int64_t type;
h5_int64_t num_elem;
h5_int64_t num_attrib;
char step_attrib[MAX_LEN];
h5part_int64_t i, j, k;
h5part_int64_t count;
h5_int64_t i, j, k;
h5_int64_t count;
void* value = NULL;
h5part_int64_t timestep_ctr;
h5_int64_t timestep_ctr;
char data_name[MAX_LEN];
h5part_int64_t num_dataset;
h5part_int64_t nparticles;
h5_int64_t num_dataset;
h5_int64_t nparticles;
fprintf(stdout, "\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
fprintf(stdout, "\n");
nt=H5PartGetNumSteps(file);
nt=H5GetNumSteps(file);
fprintf(stdout, "There are total %d number of timesteps.\n",nt);
fprintf(stdout, "\nDump result for \"%s\"...\n\n", global_fname);
@@ -364,25 +364,33 @@ static void print_all(H5PartFile* file)
if(print_header)
{
num_attrib = H5PartGetNumFileAttribs(file);
num_attrib = H5GetNumFileAttribs(file);
for(i=0; i<num_attrib; i++)
{
H5PartGetFileAttribInfo(file, i, file_attrib, MAX_LEN, &type, &num_elem);
H5GetFileAttribInfo(file, i, file_attrib, MAX_LEN, &type, &num_elem);
fprintf(stdout, "\tAttribute #%lld = %s\n",(long long)i,file_attrib);
fprintf(stdout, "\tThere are %lld elements in the attribute\n",(long long)num_elem);
if (type == H5T_NATIVE_INT64)
if (type == H5_INT64_T)
{
fprintf(stdout, "\tAttribute Type: H5T_NATIVE_INT64\n");
fprintf(stdout, "\tAttribute Type: H5_INT64_T\n");
}
else if (type == H5T_NATIVE_CHAR)
else if (type == H5_INT32_T)
{
fprintf(stdout, "\tAttribute Type: H5T_NATIVE_CHAR\n");
fprintf(stdout, "\tAttribute Type: H5_INT32_T\n");
}
else if (type == H5T_NATIVE_DOUBLE)
else if (type == H5_FLOAT64_T)
{
fprintf(stdout, "\tAttribute Type: H5T_NATIVE_DOUBLE\n");
fprintf(stdout, "\tAttribute Type: H5_FLOAT64_T\n");
}
else if (type == H5_FLOAT32_T)
{
fprintf(stdout, "\tAttribute Type: H5_FLOAT32_T\n");
}
else if (type == H5_STRING_T)
{
fprintf(stdout, "\tAttribute Type: H5_STRING_T\n");
}
else
{
@@ -396,18 +404,18 @@ static void print_all(H5PartFile* file)
}
else
{
num_attrib = H5PartGetNumFileAttribs(file);
num_attrib = H5GetNumFileAttribs(file);
for(i=0; i<num_attrib; i++)
{
H5PartGetFileAttribInfo(file, i, file_attrib, MAX_LEN, &type, &num_elem);
H5GetFileAttribInfo(file, i, file_attrib, MAX_LEN, &type, &num_elem);
fprintf(stdout, "\tAttribute #%lld = %s\n",(long long)i,file_attrib);
fprintf(stdout, "\tThere are %lld elements in the attribute\n",(long long)num_elem);
if (type == H5T_NATIVE_INT64)
{
value = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*num_elem);
H5PartReadFileAttrib(file, file_attrib, (h5part_int64_t*)value);
value = (h5_int64_t*)malloc(sizeof(h5_int64_t)*num_elem);
H5PartReadFileAttrib(file, file_attrib, (h5_int64_t*)value);
fprintf(stdout, "\tAttribute Type: H5T_NATIVE_INT64\n");
@@ -546,8 +554,8 @@ static void print_all(H5PartFile* file)
if (type == H5T_NATIVE_INT64)
{
value = (long long int*)malloc(sizeof(h5part_int64_t)*num_elem);
H5PartReadStepAttrib(file, step_attrib, (h5part_int64_t*)value);
value = (long long int*)malloc(sizeof(h5_int64_t)*num_elem);
H5PartReadStepAttrib(file, step_attrib, (h5_int64_t*)value);
fprintf(stdout, "\tAttribute Type: H5T_NATIVE_INT64\n");
@@ -675,8 +683,8 @@ static void print_all(H5PartFile* file)
if (type == H5T_NATIVE_INT64)
{
value = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*nparticles);
H5PartReadDataInt64(file, data_name, (h5part_int64_t*)value);
value = (h5_int64_t*)malloc(sizeof(h5_int64_t)*nparticles);
H5PartReadDataInt64(file, data_name, (h5_int64_t*)value);
fprintf(stdout, "\tDataset Type: H5T_NATIVE_INT64\n");
fprintf(stdout, "\tPrinting %lld element value(s):\n", (long long)nparticles);
@@ -745,7 +753,7 @@ static void print_all(H5PartFile* file)
}
/* For printing number of timesteps in the file */
static void print_nstep(H5PartFile* file, char * garbage)
static void print_nstep(h5_file_t* file, char * garbage)
{
int nt;
@@ -758,14 +766,14 @@ static void print_nstep(H5PartFile* file, char * garbage)
}
/* For printing file attributes */
static void print_file_attributes(H5PartFile* file, char * garbage)
static void print_file_attributes(h5_file_t* file, char * garbage)
{
char file_attrib[MAX_LEN];
h5part_int64_t type;
h5part_int64_t num_elem;
h5part_int64_t num_attrib;
h5part_int64_t i, j, k;
h5part_int64_t count;
h5_int64_t type;
h5_int64_t num_elem;
h5_int64_t num_attrib;
h5_int64_t i, j, k;
h5_int64_t count;
void* value = NULL;
if(print_header)
@@ -820,8 +828,8 @@ static void print_file_attributes(H5PartFile* file, char * garbage)
if (type == H5T_NATIVE_INT64)
{
value = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*num_elem);
H5PartReadFileAttrib(file, file_attrib, (h5part_int64_t*)value);
value = (h5_int64_t*)malloc(sizeof(h5_int64_t)*num_elem);
H5PartReadFileAttrib(file, file_attrib, (h5_int64_t*)value);
fprintf(stdout, "Attribute Type: H5T_NATIVE_INT64\n");
@@ -914,14 +922,14 @@ static void print_file_attributes(H5PartFile* file, char * garbage)
}
/* For printing step attribute names [& values] */
static void print_step_attributes(H5PartFile* file, char *attr)
static void print_step_attributes(h5_file_t* file, char *attr)
{
char step_attrib[MAX_LEN];
h5part_int64_t type;
h5part_int64_t num_elem;
h5part_int64_t num_attrib;
h5part_int64_t i, j, k;
h5part_int64_t count;
h5_int64_t type;
h5_int64_t num_elem;
h5_int64_t num_attrib;
h5_int64_t i, j, k;
h5_int64_t count;
void* value = NULL;
if(print_header)
@@ -960,8 +968,8 @@ static void print_step_attributes(H5PartFile* file, char *attr)
if (type == H5T_NATIVE_INT64)
{
value = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*num_elem);
H5PartReadStepAttrib(file, step_attrib, (h5part_int64_t*)value);
value = (h5_int64_t*)malloc(sizeof(h5_int64_t)*num_elem);
H5PartReadStepAttrib(file, step_attrib, (h5_int64_t*)value);
fprintf(stdout, "Attribute Type is H5T_NATIVE_INT64\n");
@@ -1054,14 +1062,14 @@ static void print_step_attributes(H5PartFile* file, char *attr)
}
/* For printing dataset names [& values] */
static void print_dataset(H5PartFile* file, char *attr)
static void print_dataset(h5_file_t* file, char *attr)
{
char data_name[MAX_LEN];
int i, j, k;
long count;
h5part_int64_t type;
h5_int64_t type;
int num_dataset;
h5part_int64_t nparticles;
h5_int64_t nparticles;
void* value = NULL;
@@ -1108,7 +1116,7 @@ static void print_dataset(H5PartFile* file, char *attr)
fprintf(stdout, "\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
fprintf(stdout, "\nPrinting names of datasets for: %s ...\n", global_fname);
fprintf(stdout, "\n");
H5PartSetStep(file,atoi(attr));
H5SetStep(file,atoi(attr));
num_dataset = H5PartGetNumDatasets(file);
fprintf(stdout, "The number of datasets for timestep #%d is %d ...\n\n", atoi(attr), num_dataset);
@@ -1119,8 +1127,8 @@ static void print_dataset(H5PartFile* file, char *attr)
if (type == H5T_NATIVE_INT64)
{
value = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*nparticles);
H5PartReadDataInt64(file, data_name, (h5part_int64_t*)value);
value = (h5_int64_t*)malloc(sizeof(h5_int64_t)*nparticles);
H5PartReadDataInt64(file, data_name, (h5_int64_t*)value);
fprintf(stdout, "Dataset Type is H5T_NATIVE_INT64\n");
fprintf(stdout, "Printing %lld element value(s):\n", (long long)nparticles);
@@ -1206,7 +1214,7 @@ int main(int argc, const char *argv[])
/* Numerous variables */
struct arg_handler *hand = NULL;
int i;
H5PartFile *h5file = NULL;
h5_file_t *h5file = NULL;
const char *fname = NULL;
//h5pAttrib_function_table = &major_function_table;
@@ -1228,7 +1236,7 @@ int main(int argc, const char *argv[])
/* Process accordingly */
fname = argv[opt_ind];
global_fname = fname; // To use in funtions
h5file = H5PartOpenFile(fname,H5PART_READ);
h5file = H5OpenFile(fname,H5_O_RDONLY,0);
if ( h5file == NULL )
{
@@ -1253,7 +1261,7 @@ int main(int argc, const char *argv[])
}
free_handler(hand, argc);
H5PartCloseFile(h5file);
H5CloseFile(h5file);
fprintf(stdout,"done\n");
return 0;
}