updated h5_lustre.c to user new macros; changed library targets to ../lib/lib*.a to avoid the mv and mkdir hacks in Makefile.am; fixed problem in h5u_test with H5PartSetViewIndices; OPEN BUG with h5u_test for >1 MPI task (strange pthread setfault?)
This commit is contained in:
+5
-6
@@ -194,8 +194,8 @@ AC_MSG_CHECKING([if C interface enabled])
|
||||
if test "X$USE_C" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
BINDINGS="$BINDINGS C"
|
||||
LIB_C="libH5hutC.a"
|
||||
BUILD_LIBS="$BUILD_LIBS $LIB_C"
|
||||
LIB_C="../lib/libH5hutC.a"
|
||||
BUILD_LIBS="$BUILD_LIBS libH5hutC.a"
|
||||
BUILD_TESTS="$BUILD_TESTS h5u_test h5b_test"
|
||||
BUILD_TOOLS="$BUILD_TOOLS h5hutcc"
|
||||
fi
|
||||
@@ -205,8 +205,8 @@ AC_MSG_CHECKING([if fortran interface enabled])
|
||||
if test "X$USE_FORTRAN" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
BINDINGS="$BINDINGS Fortran"
|
||||
LIB_FORTRAN="libH5hutF.a"
|
||||
BUILD_LIBS="$BUILD_LIBS $LIB_FORTRAN"
|
||||
LIB_FORTRAN="../lib/libH5hutF.a"
|
||||
BUILD_LIBS="$BUILD_LIBS libH5hutF.a"
|
||||
|
||||
AC_PROG_FC(pgf90 ifort xlf_r pathf90 g95 g90 ftn gfortran)
|
||||
if test -z "$FC" ; then
|
||||
@@ -507,8 +507,7 @@ AC_CONFIG_FILES([
|
||||
src/h5core/Makefile
|
||||
src/Fortran/Makefile
|
||||
test/Makefile
|
||||
test/H5Fed/Makefile
|
||||
test/H5Part/Makefile
|
||||
test/H5Fed/Makefile
|
||||
tools/Makefile
|
||||
tools/h5hutcc
|
||||
])
|
||||
|
||||
+12
-2
@@ -41,6 +41,16 @@
|
||||
Open file with name \c filbename. This function is available in the parallel
|
||||
and serial version. In the serial case \c comm may have any value.
|
||||
|
||||
File mode flags are:
|
||||
- H5_O_RDONLY: only reading allowed
|
||||
- H5_O_WRONLY: create new file, dataset must not exist
|
||||
- H5_O_APPEND: allows to append a new datasets to an existing file
|
||||
- H5_O_RDWR: dataset may exist
|
||||
|
||||
You can also select a "virtual file driver" in the HDF5 layer using:
|
||||
- H5_VFD_INDEPENDENT: MPI-IO in independent (asynchronous) mode
|
||||
- H5_VFD_MPIPOSIX: parallel I/O implemented directly by HDF5, bypassing MPI-IO
|
||||
|
||||
\return File handle.
|
||||
\return NULL on error.
|
||||
*/
|
||||
@@ -59,7 +69,7 @@ H5OpenFile (
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Close file.
|
||||
Close file and free all memory associated with the file handle.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
@@ -74,7 +84,7 @@ H5CloseFile (
|
||||
/*!
|
||||
\ingroup h5hut_file
|
||||
|
||||
Close file.
|
||||
Verify that the file handle points to a valid H5hut file structure.
|
||||
|
||||
\return \c H5_SUCCESS or error code
|
||||
*/
|
||||
|
||||
+6
-1
@@ -539,6 +539,11 @@ H5PartSetView (
|
||||
is set, or the number of particles in a dataset changes, or the view is
|
||||
"unset" by calling \c H5PartSetViewIndices(NULL,0);
|
||||
|
||||
When you perform a read or write on a view consisting of indices, it
|
||||
is assumed that your buffer is \b unpacked, meaning that there is room
|
||||
for all the intermediate values (which will not be touched by the read
|
||||
or write).
|
||||
|
||||
Before you set a view, the \c H5PartGetNumParticles() will return the
|
||||
total number of particles in the current time-step (even for the parallel
|
||||
reads). However, after you set a view, it will return the number of
|
||||
@@ -549,7 +554,7 @@ H5PartSetView (
|
||||
h5_err_t
|
||||
H5PartSetViewIndices (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_id_t *indices, /*!< [in] List of indices */
|
||||
const h5_size_t *indices, /*!< [in] List of indices */
|
||||
h5_size_t nelems /*!< [in] Size of list */
|
||||
) {
|
||||
H5_API_ENTER3 (h5_err_t,
|
||||
|
||||
+3
-6
@@ -9,7 +9,7 @@ INCLUDES = -I../include @INCLUDES@
|
||||
lib_LIBRARIES = @LIB_C@
|
||||
|
||||
# Listing of all possible targets that I may build.
|
||||
EXTRA_LIBRARIES = libH5hutC.a
|
||||
EXTRA_LIBRARIES = ../lib/libH5hutC.a
|
||||
|
||||
# Header files that I wish to install in $(prefix)/include
|
||||
include_HEADERS = \
|
||||
@@ -31,7 +31,7 @@ include_HEADERS = \
|
||||
EXTRA_HEADERS =
|
||||
|
||||
# Listing of sources
|
||||
libH5hutC_a_SOURCES = \
|
||||
___lib_libH5hutC_a_SOURCES = \
|
||||
H5.c \
|
||||
H5_attribs.c \
|
||||
H5_attachments.c \
|
||||
@@ -45,10 +45,7 @@ libH5hutC_a_SOURCES = \
|
||||
H5Fed_store.c \
|
||||
H5Fed_tags.c
|
||||
|
||||
all: all-am install-libs-local
|
||||
|
||||
install-libs-local:
|
||||
-cp ${lib_LIBRARIES} ../lib
|
||||
all: all-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ h5pt_setview (
|
||||
|
||||
h5_file_t *filehandle = (h5_file_t*)(size_t)*f;
|
||||
h5_set_funcname( filehandle, __func__ );
|
||||
return h5u_set_view ( filehandle, *start, *end );
|
||||
return h5u_set_view ( filehandle, (*start)-1, (*end)-1 );
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
|
||||
+6
-6
@@ -78,7 +78,7 @@ h5_openr (
|
||||
) {
|
||||
|
||||
char *file_name2 = h5_strdupfor2c ( file_name, l_file_name );
|
||||
h5_file_t* f = h5_open_file ( file_name2, H5_O_RDONLY, 0, __func__ );
|
||||
h5_file_t* f = h5_open_file ( file_name2, H5_O_RDONLY, 0 );
|
||||
free ( file_name2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ h5_openw (
|
||||
) {
|
||||
|
||||
char *file_name2 = h5_strdupfor2c ( file_name, l_file_name );
|
||||
h5_file_t* f = h5_open_file ( file_name2, H5_O_WRONLY, 0, __func__ );
|
||||
h5_file_t* f = h5_open_file ( file_name2, H5_O_WRONLY, 0 );
|
||||
free ( file_name2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ h5pt_opena (
|
||||
) {
|
||||
|
||||
char *file_name2 = h5_strdupfor2c ( file_name, l_file_name );
|
||||
h5_file_t* f = h5_open_file ( file_name2, H5_O_APPEND, 0, __func__ );
|
||||
h5_file_t* f = h5_open_file ( file_name2, H5_O_APPEND, 0 );
|
||||
free ( file_name2 );
|
||||
return (h5_int64_t)(size_t)f;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ h5_openr_par (
|
||||
|
||||
h5_int32_t fbits = H5_O_RDONLY | _flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = h5_open_file ( file_name2, fbits, ccomm, __func__ );
|
||||
h5_file_t* f = h5_open_file ( file_name2, fbits, ccomm );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
@@ -145,7 +145,7 @@ h5_openw_par (
|
||||
|
||||
h5_int32_t fbits = H5_O_WRONLY | _flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = h5_open_file ( file_name2, ccomm, fbits, __func__ );
|
||||
h5_file_t* f = h5_open_file ( file_name2, ccomm, fbits );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
@@ -168,7 +168,7 @@ h5pt_opena_par_align (
|
||||
|
||||
h5_int32_t fbits = H5_O_APPEND | _flagsfor2c ( flags2 );
|
||||
|
||||
h5_file_t* f = h5_open_file( file_name2, ccomm, fbits, __func__ );
|
||||
h5_file_t* f = h5_open_file( file_name2, ccomm, fbits );
|
||||
|
||||
free ( file_name2 );
|
||||
free ( flags2 );
|
||||
|
||||
@@ -26,15 +26,16 @@ nodist_include_HEADERS = ../include/H5hutF.h
|
||||
lib_LIBRARIES = @LIB_FORTRAN@
|
||||
|
||||
# Listing of all possible targets that I may build.
|
||||
EXTRA_LIBRARIES = libH5hutF.a
|
||||
EXTRA_LIBRARIES = ../lib/libH5hutF.a
|
||||
|
||||
libH5hutF_a_SOURCES = H5_F.c \
|
||||
H5_attribs_F.c \
|
||||
H5Part_F.c \
|
||||
H5Block_F.c \
|
||||
H5Block_readwrite_F.c
|
||||
___lib_libH5hutF_a_SOURCES = \
|
||||
H5_F.c \
|
||||
H5_attribs_F.c \
|
||||
H5Part_F.c \
|
||||
H5Block_F.c \
|
||||
H5Block_readwrite_F.c
|
||||
|
||||
libH5hutF_a_DEPENDENCIES = ../include/H5hutF.h
|
||||
___lib_libH5hutF_a_DEPENDENCIES = ../include/H5hutF.h
|
||||
|
||||
../include/H5hutF.h: $(F90_FILES)
|
||||
awk '/INTEGER\*8 FUNCTION/{print "\t" $$1 " " $$3}' $^ >$@
|
||||
|
||||
+11
-12
@@ -32,19 +32,22 @@ 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_attribs_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_maps_private.h \
|
||||
h5_mpi_private.h \
|
||||
h5_qsort_private.h \
|
||||
h5_readwrite_private.h \
|
||||
h5_syscall_private.h \
|
||||
h5_types_private.h \
|
||||
h5b_errorhandling_private.h \
|
||||
h5b_model_private.h \
|
||||
h5b_types_private.h \
|
||||
h5t_access_private.h \
|
||||
h5t_adjacencies_private.h \
|
||||
h5t_consts_private.h \
|
||||
@@ -60,7 +63,6 @@ EXTRA_HEADERS = \
|
||||
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
|
||||
|
||||
@@ -68,13 +70,13 @@ EXTRA_HEADERS = \
|
||||
EXTRA_DIST = $(EXTRA_HEADERS)
|
||||
|
||||
# What to build... Will be determined by configure script.
|
||||
lib_LIBRARIES = libH5hut.a
|
||||
lib_LIBRARIES = ../lib/libH5hut.a
|
||||
|
||||
# Listing of all possible targets that I may build.
|
||||
EXTRA_LIBRARIES = libH5hut.a
|
||||
EXTRA_LIBRARIES = ../lib/libH5hut.a
|
||||
|
||||
# Listing of sources
|
||||
libH5hut_a_SOURCES = \
|
||||
___lib_libH5hut_a_SOURCES = \
|
||||
h5_attach.c \
|
||||
h5_attribs.c \
|
||||
h5_errorhandling.c \
|
||||
@@ -117,12 +119,9 @@ libH5hut_a_SOURCES = \
|
||||
h5t_store_trim.c \
|
||||
h5t_tags.c
|
||||
|
||||
libH5hut_a_DEPENDENCIES = $(EXTRA_HEADERS)
|
||||
___lib_libH5hut_a_DEPENDENCIES = $(EXTRA_HEADERS)
|
||||
|
||||
all: all-am install-libs-local
|
||||
|
||||
install-libs-local:
|
||||
-cp ${lib_LIBRARIES} ../lib
|
||||
all: all-am
|
||||
|
||||
install-exec-local:
|
||||
@$(INSTALL) -d $(DESTDIR)$(includedir)/h5core
|
||||
|
||||
@@ -83,7 +83,7 @@ h5_set_debuglevel (
|
||||
|
||||
\return current debug level
|
||||
*/
|
||||
h5_id_t
|
||||
h5_err_t
|
||||
h5_get_debuglevel (
|
||||
void
|
||||
) {
|
||||
|
||||
@@ -262,7 +262,7 @@ hdf5_close_dataset (
|
||||
"dataset_id=%d (%s)",
|
||||
dataset_id,
|
||||
hdf5_get_objname (dataset_id));
|
||||
if (dataset_id == 0 || dataset_id == -1)
|
||||
if (dataset_id < 0)
|
||||
HDF5_WRAPPER_LEAVE (H5_SUCCESS);
|
||||
|
||||
if (H5Dclose (dataset_id) < 0) {
|
||||
@@ -537,7 +537,7 @@ hdf5_select_elements_of_dataspace (
|
||||
herr = H5Sselect_elements (
|
||||
space_id,
|
||||
op,
|
||||
nelems,
|
||||
(size_t)nelems,
|
||||
indices);
|
||||
} else {
|
||||
herr = H5Sselect_none ( space_id );
|
||||
|
||||
+30
-24
@@ -8,6 +8,7 @@
|
||||
#define __USE_GNU
|
||||
#include <fcntl.h>
|
||||
#undef __USE_GNU
|
||||
#include <unistd.h>
|
||||
#include <lustre/liblustreapi.h>
|
||||
|
||||
#include "h5core/h5_core.h"
|
||||
@@ -32,25 +33,29 @@ _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);
|
||||
struct lov_user_md *lum;
|
||||
TRY( lum = h5_calloc (1, nbytes) );
|
||||
struct lov_user_md *lum = h5_calloc(1, nbytes);
|
||||
if (!lum) {
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"cannot allocate lustre struct");
|
||||
return -1;
|
||||
}
|
||||
lum->lmm_magic = LOV_USER_MAGIC;
|
||||
|
||||
int fd = open64(path, O_RDONLY);
|
||||
int fd = open(path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
extern int errno;
|
||||
if (errno == EINVAL)
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
"open64: a flag is invalid!");
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"open: a flag is invalid!");
|
||||
else if (errno == EACCES)
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
"open64: access denied or file does not exist!");
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"open: access denied or file does not exist!");
|
||||
else if (errno == ENAMETOOLONG)
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
"open64: path is too long!");
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"open: path is too long!");
|
||||
else
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
"open64: unspecific error!");
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"open: unspecific error!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -58,22 +63,22 @@ _get_lustre_stripe_size(h5_file_t *const f, const char *path )
|
||||
if (ret == -1) {
|
||||
extern int errno;
|
||||
if (errno == EBADF)
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"ioctl: bad file handle!");
|
||||
else if (errno == EINVAL)
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"ioctl: invalid argument!");
|
||||
else if (errno == EIO)
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"ioctl: physical I/O problem!");
|
||||
else if (errno == ENOTTY)
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"ioctl: file handle does not accept control functions!");
|
||||
else if (errno == ENODEV)
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"ioctl: driver doesn't support control functions!");
|
||||
else
|
||||
h5_error(f, H5_ERR_INTERNAL, MSG_HEADER
|
||||
h5_error(H5_ERR_INTERNAL, MSG_HEADER
|
||||
"ioctl: unspecific error!");
|
||||
return -1;
|
||||
}
|
||||
@@ -95,6 +100,7 @@ h5_optimize_for_lustre (
|
||||
const char *filename
|
||||
) {
|
||||
|
||||
H5_CORE_API_ENTER2 (h5_err_t, "f=0x%p, filename=\"%s\"", f, filename);
|
||||
ssize_t stripe_size;
|
||||
if ( f->myproc == 0 )
|
||||
{
|
||||
@@ -119,23 +125,23 @@ h5_optimize_for_lustre (
|
||||
h5_free(path);
|
||||
}
|
||||
|
||||
TRY( h5priv_mpi_bcast(f, &stripe_size, 1, MPI_LONG_LONG, 0, f->comm) );
|
||||
h5_info(f, MSG_HEADER
|
||||
TRY( h5priv_mpi_bcast(&stripe_size, 1, MPI_LONG_LONG, 0, f->comm) );
|
||||
h5_info(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, MSG_HEADER
|
||||
h5_info(MSG_HEADER
|
||||
"Setting HDF5 btree ik to %lld (= %lld bytes at rank 3)",
|
||||
(long long)btree_ik, (long long)btree_bytes);
|
||||
TRY( hdf5_set_btree_ik_property(f, f->create_prop, btree_ik) );
|
||||
TRY( hdf5_set_btree_ik_property(f->create_prop, btree_ik) );
|
||||
|
||||
/* set alignment to lustre stripe size */
|
||||
TRY( hdf5_set_alignment_property(f,
|
||||
TRY( hdf5_set_alignment_property(
|
||||
f->access_prop, 0, stripe_size) );
|
||||
|
||||
h5_info(f, MSG_HEADER "Disabling metadata cache flushes.");
|
||||
h5_info(MSG_HEADER "Disabling metadata cache flushes.");
|
||||
/* disable metadata cache flushes */
|
||||
/* defer metadata writes */
|
||||
H5AC_cache_config_t config;
|
||||
@@ -149,7 +155,7 @@ h5_optimize_for_lustre (
|
||||
config.flash_incr_mode = H5C_flash_incr__off;
|
||||
TRY( H5Pset_mdc_config( f->access_prop, &config ) );
|
||||
|
||||
return H5_SUCCESS;
|
||||
H5_CORE_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
#endif // H5_USE_LUSTRE
|
||||
|
||||
@@ -348,7 +348,8 @@ h5_set_stepname_fmt (
|
||||
strncpy (
|
||||
f->prefix_step_name,
|
||||
name,
|
||||
H5_STEPNAME_LEN - 1);
|
||||
//H5_STEPNAME_LEN - 1);
|
||||
63);
|
||||
f->width_step_idx = width;
|
||||
|
||||
H5_CORE_API_RETURN (H5_SUCCESS);
|
||||
@@ -474,10 +475,11 @@ h5_strdupfor2c (
|
||||
|
||||
char *dup = (char*)malloc ( len + 1 );
|
||||
strncpy ( dup, s, len );
|
||||
char *p = dup + len;
|
||||
do {
|
||||
*p-- = '\0';
|
||||
} while ( *p == ' ' );
|
||||
dup[len] = '\0';
|
||||
for (int i=len-1; i>=0; i--) {
|
||||
if (dup[i] == ' ') dup[i] = '\0';
|
||||
else break;
|
||||
}
|
||||
return dup;
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ h5_normalize_dataset_name (
|
||||
H5_CORE_API_ENTER2 (h5_err_t,
|
||||
"name=\"%s\", name2=\"%s\"",
|
||||
name, name2);
|
||||
if ( strlen(name) > H5_DATANAME_LEN ) {
|
||||
if ( strlen(name) > H5_DATANAME_LEN-1 ) {
|
||||
strncpy ( name2, name, H5_DATANAME_LEN-1 );
|
||||
name2[H5_DATANAME_LEN-1] = '\0';
|
||||
h5_warn ("Truncated name '%s' to '%s'.", name, name2);
|
||||
|
||||
@@ -275,8 +275,8 @@ h5u_set_view (
|
||||
h5_err_t
|
||||
h5u_set_view_indices (
|
||||
h5_file_t *const f, /*!< [in] Handle to open file */
|
||||
const h5_id_t *const indices, /*!< [in] List of indices */
|
||||
const h5_size_t nelems /*!< [in] Size of list */
|
||||
const h5_size_t *const indices, /*!< [in] List of indices */
|
||||
h5_size_t nelems /*!< [in] Size of list */
|
||||
) {
|
||||
H5_CORE_API_ENTER3 (h5_err_t,
|
||||
"f=0x%p, indices=0x%p, nelems=%llu",
|
||||
@@ -299,7 +299,7 @@ h5u_set_view_indices (
|
||||
For now, we interpret start=-1 to mean 0 and
|
||||
end==-1 to mean end of file
|
||||
*/
|
||||
TRY ( total = (hsize_t) h5u_get_num_particles ( f ) );
|
||||
TRY ( total = h5u_get_num_particles ( f ) );
|
||||
if ( total == 0 ) {
|
||||
/* No datasets have been created yet and no veiws are set.
|
||||
* We have to leave the view empty because we don't know how
|
||||
@@ -309,19 +309,19 @@ h5u_set_view_indices (
|
||||
|
||||
if ( total == 0 ) return H5_SUCCESS;
|
||||
|
||||
u->nparticles = (hsize_t) nelems;
|
||||
u->nparticles = nelems;
|
||||
h5_debug ("This view selected %lld particles.", (long long)u->nparticles );
|
||||
|
||||
/* declare overall data size but then will select a subset */
|
||||
TRY (u->diskshape = hdf5_create_dataspace (1, &total, NULL));
|
||||
|
||||
/* declare local memory datasize */
|
||||
total = (size_t)u->nparticles;
|
||||
total = u->nparticles;
|
||||
TRY (u->memshape = hdf5_create_dataspace (1, &total, &dmax));
|
||||
TRY (hdf5_select_elements_of_dataspace (
|
||||
u->diskshape,
|
||||
H5S_SELECT_SET,
|
||||
nelems, (hsize_t*)indices ) );
|
||||
u->diskshape,
|
||||
H5S_SELECT_SET,
|
||||
nelems, indices ) );
|
||||
|
||||
u->viewindexed = 1;
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ H5PartSetView (
|
||||
h5_err_t
|
||||
H5PartSetViewIndices (
|
||||
h5_file_t *f, /*!< [in] Handle to open file */
|
||||
const h5_id_t *indices, /*!< [in] List of indices */
|
||||
const h5_size_t *indices, /*!< [in] List of indices */
|
||||
h5_size_t nelems /*!< [in] Size of list */
|
||||
);
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ h5u_set_view (
|
||||
h5_err_t
|
||||
h5u_set_view_indices (
|
||||
h5_file_t *const f,
|
||||
const h5_id_t *const indices,
|
||||
const h5_size_t nelems
|
||||
const h5_size_t *const indices,
|
||||
h5_size_t nelems
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
|
||||
+1
-12
@@ -2,15 +2,6 @@
|
||||
|
||||
OBJEXT = o
|
||||
|
||||
# COMPILER SETTING
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
FC = @FC@
|
||||
|
||||
# COMPILER FLAG SETTING
|
||||
AM_CFLAGS = @CFLAGS@
|
||||
FFLAGS = @FFLAGS@
|
||||
|
||||
AM_LDFLAGS = -L../../src/lib @LDFLAGS@
|
||||
LIBS = -lH5hutC -lH5hut @LIBS@
|
||||
INCLUDES = -I../../src/include @INCLUDES@
|
||||
@@ -35,7 +26,7 @@ EXTRA_DIST = \
|
||||
tetmesh_adjacencies.c \
|
||||
tetmesh_read.c \
|
||||
tetmesh_read_tags.c \
|
||||
g tetmesh_write.c \
|
||||
tetmesh_write.c \
|
||||
tetmesh_write2.c \
|
||||
tetmesh_write_tags.c \
|
||||
trimesh_adjacencies.c \
|
||||
@@ -47,8 +38,6 @@ g tetmesh_write.c \
|
||||
# map_triangle2globalid.c \
|
||||
# $(bin_SCRIPTS)
|
||||
|
||||
all: $(noinst_PROGRAMS)
|
||||
|
||||
clean: clean-am
|
||||
rm -f *.h5
|
||||
|
||||
|
||||
+4
-4
@@ -10,7 +10,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_H5PART
|
||||
#include "H5Part.h"
|
||||
#include "H5hut.h"
|
||||
#endif
|
||||
|
||||
#define FILENAME "testio"
|
||||
@@ -217,7 +217,7 @@ int main(int argc,char *argv[]){
|
||||
if(rank==0) unlink(filename);
|
||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||
|
||||
f = H5PartOpenFileParallel(filename,H5PART_WRITE,MPI_COMM_WORLD);
|
||||
f = H5OpenFile(filename,H5_O_WRONLY,MPI_COMM_WORLD);
|
||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||
/* start the timer */
|
||||
starttime=endtime=MPI_Wtime();
|
||||
@@ -228,7 +228,7 @@ int main(int argc,char *argv[]){
|
||||
for(n=0;n<localnp;n++)
|
||||
(data[j])[n]=(double)rank;
|
||||
}
|
||||
H5PartSetStep(f,i);
|
||||
H5SetStep(f,i);
|
||||
H5PartWriteDataFloat64(f,"x",x);
|
||||
H5PartWriteDataFloat64(f,"y",y);
|
||||
H5PartWriteDataFloat64(f,"z",z);
|
||||
@@ -239,7 +239,7 @@ int main(int argc,char *argv[]){
|
||||
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
||||
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
||||
}
|
||||
H5PartCloseFile(f);
|
||||
H5CloseFile(f);
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
endtime=MPI_Wtime();
|
||||
if(rank==0){
|
||||
|
||||
+6
-5
@@ -1,10 +1,11 @@
|
||||
# test level Makefile.am
|
||||
|
||||
#SUBDIRS = H5Block H5Fed H5Part
|
||||
SUBDIRS = H5Fed
|
||||
|
||||
OBJEXT=o
|
||||
|
||||
AM_LDFLAGS = -L../src/h5core -L../src/C @LDFLAGS@
|
||||
AM_LDFLAGS = -L../src/lib @LDFLAGS@
|
||||
LIBS = -lH5hutC -lH5hut @LIBS@
|
||||
|
||||
INCLUDES = -I../src/include @INCLUDES@
|
||||
@@ -25,8 +26,8 @@ h5u_test_SOURCES = \
|
||||
params.h
|
||||
|
||||
h5u_test_DEPENDENCIES = \
|
||||
../src/h5core/libH5hut.a \
|
||||
../src/C/libH5hutC.a
|
||||
../src/lib/libH5hut.a \
|
||||
../src/lib/libH5hutC.a
|
||||
|
||||
h5b_test_SOURCES = \
|
||||
h5b_test.c \
|
||||
@@ -37,8 +38,8 @@ h5b_test_SOURCES = \
|
||||
params.h
|
||||
|
||||
h5b_test_DEPENDENCIES = \
|
||||
../src/h5core/libH5hut.a \
|
||||
../src/C/libH5hutC.a
|
||||
../src/lib/libH5hut.a \
|
||||
../src/lib/libH5hutC.a
|
||||
|
||||
clean: clean-am
|
||||
rm -f *.h5
|
||||
|
||||
+5
-4
@@ -96,7 +96,7 @@ test_read_data64(h5_file_t *file, int nparticles, int step)
|
||||
h5_int64_t val, start, end, type;
|
||||
char name1[4];
|
||||
char name2[8];
|
||||
h5_id_t indices[8];
|
||||
h5_size_t indices[8];
|
||||
h5_size_t size;
|
||||
|
||||
double *x,*y,*z;
|
||||
@@ -212,9 +212,10 @@ test_read_data64(h5_file_t *file, int nparticles, int step)
|
||||
val = H5PartGetNumParticles(file);
|
||||
IVALUE(val, 4, "particle count");
|
||||
|
||||
x[3] = 0;
|
||||
status = H5PartReadDataFloat64(file, "x", x);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataFloat64");
|
||||
FVALUE(x[2], (double)(rank*2+9+nparticles*t), "x data");
|
||||
FVALUE(x[3], (double)(rank*2+3+nparticles*t), "x data");
|
||||
|
||||
val = H5PartGetNumParticles(file);
|
||||
IVALUE(val, 4, "particle count");
|
||||
@@ -330,7 +331,7 @@ test_read_data32(h5_file_t *file, int nparticles, int step)
|
||||
px=(float*)malloc(nparticles*sizeof(float));
|
||||
py=(float*)malloc(nparticles*sizeof(float));
|
||||
pz=(float*)malloc(nparticles*sizeof(float));
|
||||
id=(int*)malloc(nparticles*sizeof(int));
|
||||
id=(h5_int32_t*)malloc(nparticles*sizeof(h5_int32_t));
|
||||
|
||||
TEST("Reading 32-bit data");
|
||||
|
||||
@@ -365,7 +366,7 @@ test_read_data32(h5_file_t *file, int nparticles, int step)
|
||||
status = H5PartReadDataFloat32(file, "pz", pz);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataFloat32");
|
||||
|
||||
status = H5PartReadDataInt32(file, LONGNAME, id);
|
||||
status = H5PartReadDataInt32(file, LONGNAME2, id);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataInt32");
|
||||
|
||||
for (i=0; i<nparticles; i++)
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ test_write_data32(h5_file_t *file, int nparticles, int step)
|
||||
status = H5PartWriteDataFloat32(file, "pz", pz);
|
||||
RETURN(status, H5_SUCCESS, "H5PartWriteDataFloat32");
|
||||
|
||||
status = H5PartWriteDataInt32(file, LONGNAME, id);
|
||||
status = H5PartWriteDataInt32(file, LONGNAME2, id);
|
||||
RETURN(status, H5_SUCCESS, "H5PartWriteDataInt32");
|
||||
|
||||
/* the second write phase... */
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#define FILENAME "test.h5"
|
||||
#define LONGNAME "thisisaverylongnamethatshouldexceedthelimitof64charcausingawarningtoprint"
|
||||
#define LONGNAME2 "thisisaverylongnamethatshouldexceedthelimitof64charcausingawarni"
|
||||
#define NTIMESTEPS 10
|
||||
|
||||
/* do not decrease this value below 99, or it will break assumptions
|
||||
|
||||
Reference in New Issue
Block a user