Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d368a60202 | |||
| 6b4b556ff1 | |||
| 0857443617 | |||
| e3b93e4383 | |||
| 3e99a8ccfa | |||
| bb41cc3288 | |||
| cf1368291d | |||
| 698b5e0c76 | |||
| ea40b3272e | |||
| 90f8506628 | |||
| a7727635a7 | |||
| 66476adf6a | |||
| 1c4c62192d | |||
| fb660f8459 | |||
| 20bff7f87c | |||
| 64c2b96f27 |
+5
-1
@@ -10,7 +10,6 @@
|
|||||||
/README -text
|
/README -text
|
||||||
/autogen.sh -text
|
/autogen.sh -text
|
||||||
/config.guess -text
|
/config.guess -text
|
||||||
/config.h.in -text
|
|
||||||
/config.sub -text
|
/config.sub -text
|
||||||
/configure-crayxt -text
|
/configure-crayxt -text
|
||||||
/configure.ac -text
|
/configure.ac -text
|
||||||
@@ -19,7 +18,12 @@ doc/Doxyfile -text
|
|||||||
doc/H5X_File_Format.txt -text
|
doc/H5X_File_Format.txt -text
|
||||||
doc/Makefile.am -text
|
doc/Makefile.am -text
|
||||||
doc/doxyfooter -text
|
doc/doxyfooter -text
|
||||||
|
examples/core_vfd.c -text
|
||||||
|
examples/fields.c -text
|
||||||
|
examples/particles.c -text
|
||||||
|
examples/simplef.F90 -text
|
||||||
examples/stridedf.F90 -text
|
examples/stridedf.F90 -text
|
||||||
|
examples/write_setview.c -text
|
||||||
/install-sh -text
|
/install-sh -text
|
||||||
/license.txt -text
|
/license.txt -text
|
||||||
/missing -text
|
/missing -text
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ SUBDIRS = \
|
|||||||
test \
|
test \
|
||||||
tools
|
tools
|
||||||
|
|
||||||
|
EXTRA_DIST = configure-crayxt
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = \
|
MAINTAINERCLEANFILES = \
|
||||||
config.h \
|
config.h \
|
||||||
config.log \
|
config.log \
|
||||||
|
|||||||
@@ -1,3 +1,54 @@
|
|||||||
|
#### H5PART 1.6.2 ############################################################
|
||||||
|
|
||||||
|
Removed H5PartSetViewEmpty
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
An empty view can now be selected with:
|
||||||
|
H5PartSetNumParticles(file, 0);
|
||||||
|
|
||||||
|
Bug Fixes to Attribute Calls in Fortran API
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
Fixed a problem where attribute values were reverting to zero.
|
||||||
|
|
||||||
|
#### H5PART 1.6.1 ############################################################
|
||||||
|
|
||||||
|
Chunking in the H5Part API
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
There is now an H5Part equivalent H5PartSetChunkSize to the existing
|
||||||
|
H5BlockDefine3DChunkDims call. Both of these calls enable the chunking
|
||||||
|
mechanism in the underlying HDF5 layer. Chunking is used in combination
|
||||||
|
with the aligned open calls to pad datasets to alignment multiples
|
||||||
|
on disk.
|
||||||
|
|
||||||
|
All Steps Available on Write
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
Previously, existing steps in a file were only accessible in read-only mode.
|
||||||
|
Now, all steps are available in all modes, including write-truncate and
|
||||||
|
write-append. Thus, it is now possible to overwrite existing data in write
|
||||||
|
mode. To help alert the user to this possibility, a warning is issued every
|
||||||
|
time an existing dataset is written to. Warnings can be printed by setting
|
||||||
|
the verbosity to H5PART_VERB_WARN or higher.
|
||||||
|
|
||||||
|
New Throttling Routine
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Previously, a throttle factor of N meant that for P processors, the total
|
||||||
|
number of P writes were divided into N batches of P/N writes.
|
||||||
|
|
||||||
|
To better accommodate round-robin lustre striping, the new policy is to
|
||||||
|
execute P/N batches of N writes. Thus, matching N to the number of stripes
|
||||||
|
results in the desirable 1-1 matching of writers to stripes.
|
||||||
|
|
||||||
|
Other Fixes
|
||||||
|
-----------
|
||||||
|
|
||||||
|
* The configure script should correctly detect PGI compilers now.
|
||||||
|
* There was a small memory leak in the Fortran file open calls.
|
||||||
|
* There was a compile error with HDF5 1.6.x due to a missing assignment.
|
||||||
|
|
||||||
#### H5PART 1.6 ##############################################################
|
#### H5PART 1.6 ##############################################################
|
||||||
|
|
||||||
Updated Documentation
|
Updated Documentation
|
||||||
@@ -122,7 +173,7 @@ calls.
|
|||||||
Previously, a user could overrun internal buffers for dataset names. Now, a
|
Previously, a user could overrun internal buffers for dataset names. Now, a
|
||||||
fixed limit of 64 chars is imposed. Dataset names that are longer than this are
|
fixed limit of 64 chars is imposed. Dataset names that are longer than this are
|
||||||
truncated and a warning is printed. We expect that most users are using
|
truncated and a warning is printed. We expect that most users are using
|
||||||
short canoncical names like x, px, id, etc.
|
short canonical names like x, px, id, etc.
|
||||||
|
|
||||||
Changes to Existing API
|
Changes to Existing API
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|||||||
-99
@@ -1,99 +0,0 @@
|
|||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#undef HAVE_MEMORY_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* "" */
|
|
||||||
#undef MY_BUILD_CPU
|
|
||||||
|
|
||||||
/* "" */
|
|
||||||
#undef MY_BUILD_OS
|
|
||||||
|
|
||||||
/* "" */
|
|
||||||
#undef MY_BUILD_VENDOR
|
|
||||||
|
|
||||||
/* "" */
|
|
||||||
#undef MY_GNUNAME
|
|
||||||
|
|
||||||
/* "" */
|
|
||||||
#undef MY_UNAME
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Enable extensions on AIX 3, Interix. */
|
|
||||||
#ifndef _ALL_SOURCE
|
|
||||||
# undef _ALL_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable GNU extensions on systems that have them. */
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
# undef _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable threading extensions on Solaris. */
|
|
||||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
# undef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
#endif
|
|
||||||
/* Enable extensions on HP NonStop. */
|
|
||||||
#ifndef _TANDEM_SOURCE
|
|
||||||
# undef _TANDEM_SOURCE
|
|
||||||
#endif
|
|
||||||
/* Enable general extensions on Solaris. */
|
|
||||||
#ifndef __EXTENSIONS__
|
|
||||||
# undef __EXTENSIONS__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
||||||
|
|
||||||
/* Define to 1 if on MINIX. */
|
|
||||||
#undef _MINIX
|
|
||||||
|
|
||||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
|
||||||
this defined. */
|
|
||||||
#undef _POSIX_1_SOURCE
|
|
||||||
|
|
||||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
|
||||||
#undef _POSIX_SOURCE
|
|
||||||
+6
-5
@@ -1,6 +1,6 @@
|
|||||||
# Every configure script must call AC_INIT before doing anything else.
|
# Every configure script must call AC_INIT before doing anything else.
|
||||||
# AC_INIT (package, version, [bug-report], [tarname])
|
# AC_INIT (package, version, [bug-report], [tarname])
|
||||||
AC_INIT([H5Part], [1.6.0], [h5part@lists.psi.ch], H5Part)
|
AC_INIT([H5Part], [1.6.2], [h5part@lists.psi.ch], H5Part)
|
||||||
|
|
||||||
|
|
||||||
# Ensure that a recent enough version of Autoconf is being used.
|
# Ensure that a recent enough version of Autoconf is being used.
|
||||||
@@ -168,7 +168,7 @@ fi
|
|||||||
# If CC is not already set in the environment, check for gcc and cc, then
|
# If CC is not already set in the environment, check for gcc and cc, then
|
||||||
# for other C compilers.
|
# for other C compilers.
|
||||||
# Set output variable CC to the name of the compiler found.
|
# Set output variable CC to the name of the compiler found.
|
||||||
AC_PROG_CC(pathcc icc cc_r gcc cc)
|
AC_PROG_CC(pgcc pathcc icc cc_r gcc cc)
|
||||||
|
|
||||||
# AC_PROG_CC doesn't pick up cc_r in Bassi. The following AC_PATH_PROGS
|
# AC_PROG_CC doesn't pick up cc_r in Bassi. The following AC_PATH_PROGS
|
||||||
# is the fix.
|
# is the fix.
|
||||||
@@ -189,7 +189,7 @@ fi
|
|||||||
# then search for a C++ compiler under the likely names (first g++ and c++
|
# then search for a C++ compiler under the likely names (first g++ and c++
|
||||||
# then other names).
|
# then other names).
|
||||||
# If none of those checks succeed, then as a last resort set CXX to g++.
|
# If none of those checks succeed, then as a last resort set CXX to g++.
|
||||||
AC_PROG_CXX(pathCC icc cc_r g++ gcc cc)
|
AC_PROG_CXX(pgCC pathCC icc cc_r g++ gcc cc)
|
||||||
|
|
||||||
|
|
||||||
# Set output variable INSTALL to the path of a BSD-compatible install program,
|
# Set output variable INSTALL to the path of a BSD-compatible install program,
|
||||||
@@ -248,7 +248,8 @@ AC_MSG_CHECKING([if 64-bit compilation is enabled])
|
|||||||
|
|
||||||
|
|
||||||
# If --enable-64 is set in the configure line
|
# If --enable-64 is set in the configure line
|
||||||
if test "X$USE_64" = "Xyes"; then
|
if test "X$USE_64:/f90
|
||||||
|
" = "Xyes"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
if test $uname = "AIX"; then
|
if test $uname = "AIX"; then
|
||||||
CFLAGS="$CFLAGS -q64"
|
CFLAGS="$CFLAGS -q64"
|
||||||
@@ -269,7 +270,7 @@ AC_MSG_CHECKING([if fortran interface enabled])
|
|||||||
if test "X$USE_FORTRAN" = "Xyes"; then
|
if test "X$USE_FORTRAN" = "Xyes"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
|
|
||||||
AC_PROG_FC(ifort xlf_r pathf90 g95 g90 ftn gfortran)
|
AC_PROG_FC(pgf90 ifort xlf_r pathf90 g95 g90 ftn gfortran)
|
||||||
if test -z "$FC" ; then
|
if test -z "$FC" ; then
|
||||||
AC_MSG_ERROR([Cannot find a fortran compiler!!!])
|
AC_MSG_ERROR([Cannot find a fortran compiler!!!])
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
# Project related configuration options
|
# Project related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
PROJECT_NAME = H5Part
|
PROJECT_NAME = H5Part
|
||||||
PROJECT_NUMBER = 1.6.0
|
PROJECT_NUMBER = 1.6.1
|
||||||
OUTPUT_DIRECTORY = ./ReferencePages
|
OUTPUT_DIRECTORY = ./ReferencePages
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <mpi.h>
|
||||||
|
#include <H5Part.h>
|
||||||
|
|
||||||
|
#define DATASIZE 32
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
int i, rank, nprocs;
|
||||||
|
h5part_int32_t data[DATASIZE];
|
||||||
|
h5part_int64_t stat;
|
||||||
|
H5PartFile *file;
|
||||||
|
|
||||||
|
// initialize MPI
|
||||||
|
MPI_Init (&argc, &argv);
|
||||||
|
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
|
||||||
|
MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
|
||||||
|
|
||||||
|
H5PartSetVerbosityLevel(H5PART_VERB_DEBUG);
|
||||||
|
|
||||||
|
char filename[8];
|
||||||
|
sprintf (filename, "%d.h5", rank);
|
||||||
|
|
||||||
|
file = H5PartOpenFileParallel(
|
||||||
|
filename,
|
||||||
|
H5PART_WRITE | H5PART_VFD_CORE,
|
||||||
|
MPI_COMM_SELF);
|
||||||
|
assert (file != NULL);
|
||||||
|
|
||||||
|
stat = H5PartSetStep(file, 0);
|
||||||
|
assert (stat == H5PART_SUCCESS);
|
||||||
|
|
||||||
|
stat = H5PartSetNumParticles(file, DATASIZE);
|
||||||
|
assert (stat == H5PART_SUCCESS);
|
||||||
|
|
||||||
|
// create fake data
|
||||||
|
for (i=0; i<DATASIZE; i++) {
|
||||||
|
data[i] = i + rank * DATASIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// write the data
|
||||||
|
stat = H5PartWriteDataInt32(file, "data", data);
|
||||||
|
assert (stat == H5PART_SUCCESS);
|
||||||
|
|
||||||
|
H5PartCloseFile(file);
|
||||||
|
|
||||||
|
MPI_Finalize();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <mpi.h>
|
||||||
|
#include <H5Part.h>
|
||||||
|
|
||||||
|
#define XSIZE 8
|
||||||
|
#define YSIZE 8
|
||||||
|
#define ZSIZE 8
|
||||||
|
#define DATASIZE XSIZE*YSIZE*ZSIZE
|
||||||
|
#define H5OpenFileParallel H5PartOpenFileParallel
|
||||||
|
#define H5SetStep H5PartSetStep
|
||||||
|
#define H5Block3dSetLayout H5BlockDefine3DFieldLayout
|
||||||
|
#define H5CloseFile H5PartCloseFile
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
int rank, nprocs;
|
||||||
|
h5part_float64_t ex[DATASIZE];
|
||||||
|
h5part_float64_t ey[DATASIZE];
|
||||||
|
h5part_float64_t ez[DATASIZE];
|
||||||
|
h5part_float64_t q[DATASIZE];
|
||||||
|
h5part_int64_t nparticles = DATASIZE;
|
||||||
|
H5PartFile *file;
|
||||||
|
|
||||||
|
// initialize MPI
|
||||||
|
MPI_Init (&argc, &argv);
|
||||||
|
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
|
||||||
|
MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
|
||||||
|
|
||||||
|
H5PartSetVerbosityLevel(H5PART_VERB_DEBUG);
|
||||||
|
|
||||||
|
file = H5OpenFileParallel("fields.h5", H5PART_WRITE, MPI_COMM_WORLD);
|
||||||
|
H5SetStep(file, 0);
|
||||||
|
H5Block3dSetLayout(file,
|
||||||
|
rank*XSIZE, (rank+1)*XSIZE - 1,
|
||||||
|
0, YSIZE - 1,
|
||||||
|
0, ZSIZE - 1);
|
||||||
|
H5Block3dWriteScalarFieldFloat64(file, "Q", q);
|
||||||
|
H5Block3dWrite3dVectorFieldFloat64(file, "E", ex, ez, ey);
|
||||||
|
H5CloseFile(file);
|
||||||
|
|
||||||
|
MPI_Finalize();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <mpi.h>
|
||||||
|
#include <H5Part.h>
|
||||||
|
|
||||||
|
#define DATASIZE 32
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
int rank, nprocs;
|
||||||
|
h5part_float64_t x[DATASIZE];
|
||||||
|
h5part_float64_t y[DATASIZE];
|
||||||
|
h5part_float64_t z[DATASIZE];
|
||||||
|
h5part_float64_t px[DATASIZE];
|
||||||
|
h5part_float64_t py[DATASIZE];
|
||||||
|
h5part_float64_t pz[DATASIZE];
|
||||||
|
h5part_int64_t nparticles = DATASIZE;
|
||||||
|
H5PartFile *file;
|
||||||
|
|
||||||
|
// initialize MPI
|
||||||
|
MPI_Init (&argc, &argv);
|
||||||
|
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
|
||||||
|
MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
|
||||||
|
|
||||||
|
H5PartSetVerbosityLevel(H5PART_VERB_DEBUG);
|
||||||
|
|
||||||
|
file = H5PartOpenFileParallel("particles.h5", H5PART_WRITE, MPI_COMM_WORLD);
|
||||||
|
H5PartSetStep(file, 0);
|
||||||
|
H5PartSetNumParticles(file, nparticles);
|
||||||
|
H5PartWriteDataFloat64(file, "x", x);
|
||||||
|
H5PartWriteDataFloat64(file, "y", y);
|
||||||
|
H5PartWriteDataFloat64(file, "z", z);
|
||||||
|
H5PartWriteDataFloat64(file, "px", px);
|
||||||
|
H5PartWriteDataFloat64(file, "py", py);
|
||||||
|
H5PartWriteDataFloat64(file, "pz", pz);
|
||||||
|
H5PartCloseFile(file);
|
||||||
|
|
||||||
|
MPI_Finalize();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
program H5PartTest
|
||||||
|
implicit none
|
||||||
|
|
||||||
|
include 'mpif.h'
|
||||||
|
include 'H5PartF.h'
|
||||||
|
|
||||||
|
integer :: comm, rank, ierr
|
||||||
|
integer*8 :: file_id, status, npoints, i
|
||||||
|
real*8, allocatable :: particles(:)
|
||||||
|
integer*8, allocatable :: id(:)
|
||||||
|
real*8 :: r8val
|
||||||
|
integer*8 :: i8val
|
||||||
|
|
||||||
|
comm = MPI_COMM_WORLD
|
||||||
|
call mpi_init(ierr)
|
||||||
|
call mpi_comm_rank(comm, rank, ierr)
|
||||||
|
|
||||||
|
! open the a file for parallel writing
|
||||||
|
file_id = h5pt_set_verbosity_level(5)
|
||||||
|
file_id = h5pt_openw_par('test.h5', comm)
|
||||||
|
|
||||||
|
! in the Fortran API, time steps start at 1
|
||||||
|
status = h5pt_setstep(file_id, 1_8)
|
||||||
|
|
||||||
|
! write an attribute to the file
|
||||||
|
status = h5pt_writefileattrib_string(file_id, 'desc', 'This is a test.')
|
||||||
|
|
||||||
|
r8val = 0.5
|
||||||
|
i8val = 1
|
||||||
|
status = h5pt_writefileattrib_r8(file_id, 'double', r8val, i8val)
|
||||||
|
|
||||||
|
! create fake data
|
||||||
|
npoints = 99
|
||||||
|
allocate(particles(npoints), id(npoints))
|
||||||
|
do i=1,npoints
|
||||||
|
particles(i) = real(i+npoints*rank)
|
||||||
|
id(i) = i+npoints*rank
|
||||||
|
enddo
|
||||||
|
|
||||||
|
! set the size of the 1D array
|
||||||
|
status = h5pt_setnpoints(file_id, npoints)
|
||||||
|
|
||||||
|
! write the particles
|
||||||
|
status = h5pt_writedata_r8(file_id, "x", particles)
|
||||||
|
|
||||||
|
! write the ids
|
||||||
|
status = h5pt_writedata_i8(file_id, "id", id)
|
||||||
|
|
||||||
|
! close the file
|
||||||
|
status = h5pt_close(file_id)
|
||||||
|
|
||||||
|
deallocate(particles, id)
|
||||||
|
|
||||||
|
call mpi_finalize(ierr)
|
||||||
|
|
||||||
|
end program H5PartTest
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <mpi.h>
|
||||||
|
#include <H5Part.h>
|
||||||
|
|
||||||
|
#define DATASIZE 32
|
||||||
|
#define ITERS 4
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
int i, rank, nprocs;
|
||||||
|
h5part_int32_t data[ITERS*DATASIZE];
|
||||||
|
h5part_int64_t stat;
|
||||||
|
h5part_int64_t offset;
|
||||||
|
H5PartFile *file;
|
||||||
|
|
||||||
|
// initialize MPI
|
||||||
|
MPI_Init (&argc, &argv);
|
||||||
|
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
|
||||||
|
MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
|
||||||
|
|
||||||
|
H5PartSetVerbosityLevel(H5PART_VERB_DEBUG);
|
||||||
|
|
||||||
|
file = H5PartOpenFileParallel("test.h5", H5PART_WRITE, MPI_COMM_WORLD);
|
||||||
|
assert (file != NULL);
|
||||||
|
|
||||||
|
stat = H5PartSetStep(file, 0);
|
||||||
|
assert (stat == H5PART_SUCCESS);
|
||||||
|
|
||||||
|
stat = H5PartSetNumParticles(file, ITERS*DATASIZE);
|
||||||
|
assert (stat == H5PART_SUCCESS);
|
||||||
|
|
||||||
|
// create fake data
|
||||||
|
for (i=0; i<ITERS*DATASIZE; i++) {
|
||||||
|
data[i] = i + rank * ITERS * DATASIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
offset = rank * ITERS * DATASIZE;
|
||||||
|
|
||||||
|
// iterate over arrays
|
||||||
|
for (i=0; i<ITERS; i++) {
|
||||||
|
// set the "view" to select a subset of the dataset
|
||||||
|
stat = H5PartSetView(file,
|
||||||
|
offset + i*DATASIZE,
|
||||||
|
offset + (i+1)*DATASIZE - 1);
|
||||||
|
assert (stat == H5PART_SUCCESS);
|
||||||
|
// write the data
|
||||||
|
stat = H5PartWriteDataInt32(file, "data", data + i*DATASIZE);
|
||||||
|
assert (stat == H5PART_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
H5PartCloseFile(file);
|
||||||
|
|
||||||
|
MPI_Finalize();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
+27
-2
@@ -721,8 +721,13 @@ _release_hyperslab (
|
|||||||
/*!
|
/*!
|
||||||
\ingroup h5block_model
|
\ingroup h5block_model
|
||||||
|
|
||||||
Define the field layout given the dense index space at the actual
|
Defines the partition of the field that this processor owns, using
|
||||||
time step.
|
Fortran ordering: the fastest moving index is \c i.
|
||||||
|
|
||||||
|
This routine uses an MPI_Allgather, so at large concurrency it should
|
||||||
|
be called as infrequently as possible. For instance, if several timesteps
|
||||||
|
use the same field dimensions, set the layout only once before the
|
||||||
|
first timestep.
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS on success<br>
|
\return \c H5PART_SUCCESS on success<br>
|
||||||
\c H5PART_ERR_MPI<br>
|
\c H5PART_ERR_MPI<br>
|
||||||
@@ -1186,6 +1191,11 @@ _H5Block_read_data (
|
|||||||
herr = _H5Block_select_hyperslab_for_reading ( f, dataset_id );
|
herr = _H5Block_select_hyperslab_for_reading ( f, dataset_id );
|
||||||
if ( herr < 0 ) return herr;
|
if ( herr < 0 ) return herr;
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
herr = _H5Part_start_throttle ( f );
|
||||||
|
if ( herr < 0 ) return herr;
|
||||||
|
#endif
|
||||||
|
|
||||||
herr = H5Dread (
|
herr = H5Dread (
|
||||||
dataset_id,
|
dataset_id,
|
||||||
type,
|
type,
|
||||||
@@ -1195,6 +1205,11 @@ _H5Block_read_data (
|
|||||||
data );
|
data );
|
||||||
if ( herr < 0 ) return HANDLE_H5D_READ_ERR ( name, f->timestep );
|
if ( herr < 0 ) return HANDLE_H5D_READ_ERR ( name, f->timestep );
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
herr = _H5Part_end_throttle ( f );
|
||||||
|
if ( herr < 0 ) return herr;
|
||||||
|
#endif
|
||||||
|
|
||||||
herr = H5Dclose ( dataset_id );
|
herr = H5Dclose ( dataset_id );
|
||||||
if ( herr < 0 ) return HANDLE_H5D_CLOSE_ERR;
|
if ( herr < 0 ) return HANDLE_H5D_CLOSE_ERR;
|
||||||
|
|
||||||
@@ -1443,6 +1458,11 @@ _H5Block_write_data (
|
|||||||
);
|
);
|
||||||
if ( dataset < 0 ) return HANDLE_H5D_CREATE_ERR ( name, f->timestep );
|
if ( dataset < 0 ) return HANDLE_H5D_CREATE_ERR ( name, f->timestep );
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
herr = _H5Part_start_throttle ( f );
|
||||||
|
if ( herr < 0 ) return herr;
|
||||||
|
#endif
|
||||||
|
|
||||||
herr = H5Dwrite (
|
herr = H5Dwrite (
|
||||||
dataset,
|
dataset,
|
||||||
type,
|
type,
|
||||||
@@ -1452,6 +1472,11 @@ _H5Block_write_data (
|
|||||||
data );
|
data );
|
||||||
if ( herr < 0 ) return HANDLE_H5D_WRITE_ERR ( name, f->timestep );
|
if ( herr < 0 ) return HANDLE_H5D_WRITE_ERR ( name, f->timestep );
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
herr = _H5Part_end_throttle ( f );
|
||||||
|
if ( herr < 0 ) return herr;
|
||||||
|
#endif
|
||||||
|
|
||||||
herr = H5Dclose ( dataset );
|
herr = H5Dclose ( dataset );
|
||||||
if ( herr < 0 ) return HANDLE_H5D_CLOSE_ERR;
|
if ( herr < 0 ) return HANDLE_H5D_CLOSE_ERR;
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,11 @@
|
|||||||
#include "H5MultiBlockErrors.h"
|
#include "H5MultiBlockErrors.h"
|
||||||
#include "H5MultiBlockPrivate.h"
|
#include "H5MultiBlockPrivate.h"
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5multiblock_write
|
\ingroup h5multiblock_data
|
||||||
|
|
||||||
Write a multiblock field \c name from the buffer starting at \c data
|
Write a multiblock field \c name from the buffer starting at \c data
|
||||||
to the current time-step using the defined block decomposition and dimensions.
|
to the current time-step using the defined block decomposition and dimensions.
|
||||||
@@ -39,7 +42,7 @@ H5MultiBlock3dWriteFieldFloat64 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5multiblock_read
|
\ingroup h5multiblock_data
|
||||||
|
|
||||||
Allocate a buffer to hold a block from a multiblock field and place the
|
Allocate a buffer to hold a block from a multiblock field and place the
|
||||||
pointer in \c data, then read the block into the buffer. Uses the block
|
pointer in \c data, then read the block into the buffer. Uses the block
|
||||||
@@ -68,7 +71,7 @@ H5MultiBlock3dReadFieldFloat64 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5multiblock_write
|
\ingroup h5multiblock_data
|
||||||
|
|
||||||
Write a multiblock field \c name from the buffer starting at \c data
|
Write a multiblock field \c name from the buffer starting at \c data
|
||||||
to the current time-step using the defined block decomposition and dimensions.
|
to the current time-step using the defined block decomposition and dimensions.
|
||||||
@@ -96,7 +99,7 @@ H5MultiBlock3dWriteFieldFloat32 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5multiblock_read
|
\ingroup h5multiblock_data
|
||||||
|
|
||||||
Allocate a buffer to hold a block from a multiblock field and place the
|
Allocate a buffer to hold a block from a multiblock field and place the
|
||||||
pointer in \c data, then read the block into the buffer. Uses the block
|
pointer in \c data, then read the block into the buffer. Uses the block
|
||||||
@@ -125,7 +128,7 @@ H5MultiBlock3dReadFieldFloat32 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5multiblock_write
|
\ingroup h5multiblock_data
|
||||||
|
|
||||||
Write a multiblock field \c name from the buffer starting at \c data
|
Write a multiblock field \c name from the buffer starting at \c data
|
||||||
to the current time-step using the defined block decomposition and dimensions.
|
to the current time-step using the defined block decomposition and dimensions.
|
||||||
@@ -153,7 +156,7 @@ H5MultiBlock3dWriteFieldInt64 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5multiblock_read
|
\ingroup h5multiblock_data
|
||||||
|
|
||||||
Allocate a buffer to hold a block from a multiblock field and place the
|
Allocate a buffer to hold a block from a multiblock field and place the
|
||||||
pointer in \c data, then read the block into the buffer. Uses the block
|
pointer in \c data, then read the block into the buffer. Uses the block
|
||||||
@@ -182,7 +185,7 @@ H5MultiBlock3dReadFieldInt64 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5multiblock_write
|
\ingroup h5multiblock_data
|
||||||
|
|
||||||
Write a multiblock field \c name from the buffer starting at \c data
|
Write a multiblock field \c name from the buffer starting at \c data
|
||||||
to the current time-step using the defined block decomposition and dimensions.
|
to the current time-step using the defined block decomposition and dimensions.
|
||||||
@@ -210,7 +213,7 @@ H5MultiBlock3dWriteFieldInt32 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5multiblock_read
|
\ingroup h5multiblock_data
|
||||||
|
|
||||||
Allocate a buffer to hold a block from a multiblock field and place the
|
Allocate a buffer to hold a block from a multiblock field and place the
|
||||||
pointer in \c data, then read the block into the buffer. Uses the block
|
pointer in \c data, then read the block into the buffer. Uses the block
|
||||||
@@ -237,3 +240,5 @@ H5MultiBlock3dReadFieldInt32 (
|
|||||||
|
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // PARALLEL_IO
|
||||||
|
|||||||
+319
-243
@@ -98,6 +98,7 @@ h5part_error_handler _err_handler = H5PartReportErrorHandler;
|
|||||||
|
|
||||||
/********* Private Variable Declarations *************/
|
/********* Private Variable Declarations *************/
|
||||||
|
|
||||||
|
static unsigned _is_root_proc = 0;
|
||||||
static unsigned _debug = H5PART_VERB_ERROR;
|
static unsigned _debug = H5PART_VERB_ERROR;
|
||||||
static h5part_int64_t _h5part_errno = H5PART_SUCCESS;
|
static h5part_int64_t _h5part_errno = H5PART_SUCCESS;
|
||||||
static char *__funcname;
|
static char *__funcname;
|
||||||
@@ -125,6 +126,14 @@ _h5_error_handler (
|
|||||||
void *
|
void *
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vprint (
|
||||||
|
FILE* f,
|
||||||
|
const char *prefix,
|
||||||
|
const char *fmt,
|
||||||
|
va_list ap
|
||||||
|
);
|
||||||
|
|
||||||
/*========== File Opening/Closing ===============*/
|
/*========== File Opening/Closing ===============*/
|
||||||
|
|
||||||
static H5PartFile*
|
static H5PartFile*
|
||||||
@@ -154,7 +163,7 @@ _H5Part_open_file (
|
|||||||
strncpy ( f->groupname_step, H5PART_GROUPNAME_STEP, H5PART_STEPNAME_LEN );
|
strncpy ( f->groupname_step, H5PART_GROUPNAME_STEP, H5PART_STEPNAME_LEN );
|
||||||
f->stepno_width = 0;
|
f->stepno_width = 0;
|
||||||
|
|
||||||
f->xfer_prop = f->create_prop = H5P_DEFAULT;
|
f->xfer_prop = f->dcreate_prop = f->fcreate_prop = H5P_DEFAULT;
|
||||||
|
|
||||||
f->access_prop = H5Pcreate (H5P_FILE_ACCESS);
|
f->access_prop = H5Pcreate (H5P_FILE_ACCESS);
|
||||||
if (f->access_prop < 0) {
|
if (f->access_prop < 0) {
|
||||||
@@ -175,6 +184,9 @@ _H5Part_open_file (
|
|||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( f-> myproc == 0 ) _is_root_proc = 1;
|
||||||
|
else _is_root_proc = 0;
|
||||||
|
|
||||||
f->pnparticles =
|
f->pnparticles =
|
||||||
(h5part_int64_t*) malloc (f->nprocs * sizeof (h5part_int64_t));
|
(h5part_int64_t*) malloc (f->nprocs * sizeof (h5part_int64_t));
|
||||||
if (f->pnparticles == NULL) {
|
if (f->pnparticles == NULL) {
|
||||||
@@ -182,69 +194,38 @@ _H5Part_open_file (
|
|||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* select the HDF5 VFD */
|
/* optional lustre optimizations */
|
||||||
if (flags & H5PART_VFD_MPIPOSIX) {
|
|
||||||
if (f->myproc == 0) {
|
|
||||||
_H5Part_print_info ( "Selecting MPI-POSIX VFD" );
|
|
||||||
}
|
|
||||||
if (H5Pset_fapl_mpiposix ( f->access_prop, comm, 0 ) < 0) {
|
|
||||||
HANDLE_H5P_SET_FAPL_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (f->myproc == 0) {
|
|
||||||
_H5Part_print_info ( "Selecting MPI-IO VFD" );
|
|
||||||
}
|
|
||||||
if (H5Pset_fapl_mpio ( f->access_prop, comm, info ) < 0) {
|
|
||||||
HANDLE_H5P_SET_FAPL_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
if (flags & H5PART_VFD_MPIIO_IND) {
|
|
||||||
if (f->myproc == 0) {
|
|
||||||
_H5Part_print_info ( "Using independent mode" );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (f->myproc == 0) {
|
|
||||||
_H5Part_print_info ( "Using collective mode" );
|
|
||||||
}
|
|
||||||
f->xfer_prop = H5Pcreate (H5P_DATASET_XFER);
|
|
||||||
if (f->xfer_prop < 0) {
|
|
||||||
HANDLE_H5P_CREATE_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
if (H5Pset_dxpl_mpio ( f->xfer_prop, H5FD_MPIO_COLLECTIVE ) < 0) {
|
|
||||||
HANDLE_H5P_SET_DXPL_MPIO_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( flags & H5PART_FS_LUSTRE )
|
if ( flags & H5PART_FS_LUSTRE )
|
||||||
{
|
{
|
||||||
/* extend the btree size so that metadata pieces are
|
/* extend the btree size so that metadata pieces are
|
||||||
* close to the alignment value */
|
* close to the alignment value */
|
||||||
unsigned int btree_ik = (align - 256) / 96;
|
if ( align > 16384 )
|
||||||
unsigned int btree_bytes = 64 + 96*btree_ik;
|
{
|
||||||
if ( btree_bytes > align ) {
|
unsigned int btree_ik = (align - 4096) / 96;
|
||||||
HANDLE_H5PART_INVALID_ERR(
|
unsigned int btree_bytes = 64 + 96*btree_ik;
|
||||||
"btree_ik", btree_ik );
|
if ( btree_bytes > align ) {
|
||||||
goto error_cleanup;
|
HANDLE_H5PART_INVALID_ERR(
|
||||||
}
|
"btree_ik", btree_ik );
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (f->myproc == 0) {
|
|
||||||
_H5Part_print_info (
|
_H5Part_print_info (
|
||||||
"Setting HDF5 btree parameter to %u",
|
"Setting HDF5 btree parameter to %u",
|
||||||
btree_ik );
|
btree_ik );
|
||||||
_H5Part_print_info (
|
_H5Part_print_info (
|
||||||
"Extending HDF5 btree size to %u bytes at rank 3",
|
"Extending HDF5 btree size to %u "
|
||||||
btree_bytes );
|
"bytes at rank 3", btree_bytes );
|
||||||
|
|
||||||
|
f->fcreate_prop = H5Pcreate(H5P_FILE_CREATE);
|
||||||
|
if ( f->fcreate_prop < 0 ) {
|
||||||
|
HANDLE_H5P_CREATE_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
H5Pset_istore_k (f->fcreate_prop, btree_ik);
|
||||||
}
|
}
|
||||||
|
|
||||||
f->create_prop = H5Pcreate(H5P_FILE_CREATE);
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
H5Pset_istore_k (f->create_prop, H5PART_BTREE_IK);
|
|
||||||
|
|
||||||
#ifndef H5_USE_16_API
|
|
||||||
/* defer metadata cache flushing until file close */
|
/* defer metadata cache flushing until file close */
|
||||||
H5AC_cache_config_t cache_config;
|
H5AC_cache_config_t cache_config;
|
||||||
cache_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
|
cache_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
|
||||||
@@ -257,14 +238,50 @@ _H5Part_open_file (
|
|||||||
cache_config.decr_mode = H5C_decr__off;
|
cache_config.decr_mode = H5C_decr__off;
|
||||||
H5Pset_mdc_config (f->access_prop, &cache_config);
|
H5Pset_mdc_config (f->access_prop, &cache_config);
|
||||||
#else // H5_USE_16_API
|
#else // H5_USE_16_API
|
||||||
_H5Part_print_info (
|
_H5Part_print_warn (
|
||||||
"Unable to defer metadata write: need HDF5 1.8");
|
"Unable to defer metadata write: need HDF5 1.8");
|
||||||
#endif // H5_USE_16_API
|
#endif // H5_USE_16_API
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* select the HDF5 VFD */
|
||||||
|
if (flags & H5PART_VFD_MPIPOSIX) {
|
||||||
|
_H5Part_print_info ( "Selecting MPI-POSIX VFD" );
|
||||||
|
if (H5Pset_fapl_mpiposix ( f->access_prop, comm, 0 ) < 0) {
|
||||||
|
HANDLE_H5P_SET_FAPL_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
} else if (flags & H5PART_VFD_CORE) {
|
||||||
|
_H5Part_print_info ( "Selecting CORE VFD" );
|
||||||
|
if (H5Pset_fapl_core ( f->access_prop, align, 1 ) < 0) {
|
||||||
|
HANDLE_H5P_SET_FAPL_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_H5Part_print_info ( "Selecting MPI-IO VFD" );
|
||||||
|
if (H5Pset_fapl_mpio ( f->access_prop, comm, info ) < 0) {
|
||||||
|
HANDLE_H5P_SET_FAPL_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
if (flags & H5PART_VFD_MPIIO_IND) {
|
||||||
|
_H5Part_print_info ( "Using independent mode" );
|
||||||
|
} else {
|
||||||
|
_H5Part_print_info ( "Using collective mode" );
|
||||||
|
f->xfer_prop = H5Pcreate (H5P_DATASET_XFER);
|
||||||
|
if (f->xfer_prop < 0) {
|
||||||
|
HANDLE_H5P_CREATE_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
if (H5Pset_dxpl_mpio ( f->xfer_prop, H5FD_MPIO_COLLECTIVE ) < 0) {
|
||||||
|
HANDLE_H5P_SET_DXPL_MPIO_ERR;
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
f->comm = comm;
|
f->comm = comm;
|
||||||
#endif // PARALLEL_IO
|
#endif // PARALLEL_IO
|
||||||
} else {
|
} else {
|
||||||
|
_is_root_proc = 1;
|
||||||
f->comm = 0;
|
f->comm = 0;
|
||||||
f->nprocs = 1;
|
f->nprocs = 1;
|
||||||
f->myproc = 0;
|
f->myproc = 0;
|
||||||
@@ -273,34 +290,27 @@ _H5Part_open_file (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( align != 0 ) {
|
if ( align != 0 ) {
|
||||||
if (f->myproc == 0) {
|
_H5Part_print_info (
|
||||||
_H5Part_print_info ( "Setting HDF5 alignment to %ld bytes", align );
|
"Setting HDF5 alignment to %ld bytes",
|
||||||
}
|
align );
|
||||||
if (H5Pset_alignment ( f->access_prop, 0, align ) < 0) {
|
if (H5Pset_alignment ( f->access_prop, 0, align ) < 0) {
|
||||||
HANDLE_H5P_SET_FAPL_ERR;
|
HANDLE_H5P_SET_FAPL_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
if (f->myproc == 0) {
|
_H5Part_print_info (
|
||||||
_H5Part_print_info ( "Setting HDF5 meta block to %ld bytes", align );
|
"Setting HDF5 meta block to %ld bytes",
|
||||||
}
|
align );
|
||||||
if (H5Pset_meta_block_size ( f->access_prop, align ) < 0) {
|
if (H5Pset_meta_block_size ( f->access_prop, align ) < 0) {
|
||||||
HANDLE_H5P_SET_FAPL_ERR;
|
HANDLE_H5P_SET_FAPL_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
/*if (f->myproc == 0) {
|
|
||||||
_H5Part_print_info ( "Setting HDF5 sieve buffer to %ld bytes", align );
|
|
||||||
}
|
|
||||||
if (H5Pset_sieve_buf_size ( f->access_prop, align ) < 0) {
|
|
||||||
HANDLE_H5P_SET_FAPL_ERR;
|
|
||||||
goto error_cleanup;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( flags & H5PART_READ ) {
|
if ( flags & H5PART_READ ) {
|
||||||
f->file = H5Fopen(filename, H5F_ACC_RDONLY, f->access_prop);
|
f->file = H5Fopen(filename, H5F_ACC_RDONLY, f->access_prop);
|
||||||
}
|
}
|
||||||
else if ( flags & H5PART_WRITE ){
|
else if ( flags & H5PART_WRITE ){
|
||||||
f->file = H5Fcreate (filename, H5F_ACC_TRUNC, f->create_prop,
|
f->file = H5Fcreate (filename, H5F_ACC_TRUNC, f->fcreate_prop,
|
||||||
f->access_prop);
|
f->access_prop);
|
||||||
f->empty = 1;
|
f->empty = 1;
|
||||||
}
|
}
|
||||||
@@ -308,7 +318,7 @@ _H5Part_open_file (
|
|||||||
int fd = open(filename, O_RDONLY, 0);
|
int fd = open(filename, O_RDONLY, 0);
|
||||||
if ( (fd == -1) && (errno == ENOENT) ) {
|
if ( (fd == -1) && (errno == ENOENT) ) {
|
||||||
f->file = H5Fcreate(filename, H5F_ACC_TRUNC,
|
f->file = H5Fcreate(filename, H5F_ACC_TRUNC,
|
||||||
f->create_prop, f->access_prop);
|
f->fcreate_prop, f->access_prop);
|
||||||
f->empty = 1;
|
f->empty = 1;
|
||||||
}
|
}
|
||||||
else if (fd != -1) {
|
else if (fd != -1) {
|
||||||
@@ -367,13 +377,17 @@ _H5Part_open_file (
|
|||||||
|
|
||||||
Opens file with specified filename.
|
Opens file with specified filename.
|
||||||
|
|
||||||
If you open with flag \c H5PART_WRITE, it will truncate any
|
Flags are bit values that can be combined with the bit operator \c |
|
||||||
file with the specified filename and start writing to it. If
|
and include:
|
||||||
you open with \c H5PART_APPEND, then you can append new timesteps.
|
|
||||||
If you open with \c H5PART_READ, then it will open the file
|
|
||||||
readonly.
|
|
||||||
|
|
||||||
The typical extension for these files is \c .h5.
|
- \c H5PART_WRITE - truncate file and open for writing
|
||||||
|
- \c H5PART_APPEND - open file for writing without truncating
|
||||||
|
- \c H5PART_READ - open file read-only
|
||||||
|
- \c H5PART_FS_LUSTRE - enable optimizations for the Lustre file system
|
||||||
|
- \c H5PART_VFD_MPIPOSIX - use the HDF5 MPI-POSIX virtual file driver
|
||||||
|
- \c H5PART_VFD_MPIO_IND - use MPI-IO in indepedent mode
|
||||||
|
|
||||||
|
The typical file extension is \c .h5.
|
||||||
|
|
||||||
H5PartFile should be treated as an essentially opaque
|
H5PartFile should be treated as an essentially opaque
|
||||||
datastructure. It acts as the file handle, but internally
|
datastructure. It acts as the file handle, but internally
|
||||||
@@ -403,6 +417,23 @@ H5PartOpenFileParallel (
|
|||||||
Opens file with specified filename, and also specifices an alignment
|
Opens file with specified filename, and also specifices an alignment
|
||||||
value used for HDF5 tuning parameters.
|
value used for HDF5 tuning parameters.
|
||||||
|
|
||||||
|
Flags are bit values that can be combined with the bit operator \c |
|
||||||
|
and include:
|
||||||
|
|
||||||
|
- \c H5PART_WRITE - truncate file and open for writing
|
||||||
|
- \c H5PART_APPEND - open file for writing without truncating
|
||||||
|
- \c H5PART_READ - open file read-only
|
||||||
|
- \c H5PART_FS_LUSTRE - enable optimizations for the Lustre file system
|
||||||
|
- \c H5PART_VFD_MPIPOSIX - use the HDF5 MPI-POSIX virtual file driver
|
||||||
|
- \c H5PART_VFD_MPIO_IND - use MPI-IO in indepedent mode
|
||||||
|
|
||||||
|
The typical file extension is \c .h5.
|
||||||
|
|
||||||
|
H5PartFile should be treated as an essentially opaque
|
||||||
|
datastructure. It acts as the file handle, but internally
|
||||||
|
it maintains several key state variables associated with
|
||||||
|
the file.
|
||||||
|
|
||||||
\return File handle or \c NULL
|
\return File handle or \c NULL
|
||||||
*/
|
*/
|
||||||
H5PartFile*
|
H5PartFile*
|
||||||
@@ -426,13 +457,14 @@ H5PartOpenFileParallelAlign (
|
|||||||
|
|
||||||
Opens file with specified filename.
|
Opens file with specified filename.
|
||||||
|
|
||||||
If you open with flag \c H5PART_WRITE, it will truncate any
|
Flags are bit values that can be combined with the bit operator \c |
|
||||||
file with the specified filename and start writing to it. If
|
and include:
|
||||||
you open with \c H5PART_APPEND, then you can append new timesteps.
|
|
||||||
If you open with \c H5PART_READ, then it will open the file
|
|
||||||
readonly.
|
|
||||||
|
|
||||||
The typical extension for these files is \c .h5.
|
- \c H5PART_WRITE - truncate file and open for writing
|
||||||
|
- \c H5PART_APPEND - open file for writing without truncating
|
||||||
|
- \c H5PART_READ - open file read-only
|
||||||
|
|
||||||
|
The typical file extension is \c .h5.
|
||||||
|
|
||||||
H5PartFile should be treated as an essentially opaque
|
H5PartFile should be treated as an essentially opaque
|
||||||
datastructure. It acts as the file handle, but internally
|
datastructure. It acts as the file handle, but internally
|
||||||
@@ -462,6 +494,20 @@ H5PartOpenFile (
|
|||||||
Opens file with specified filename, and also specifices an alignment
|
Opens file with specified filename, and also specifices an alignment
|
||||||
value used for HDF5 tuning parameters.
|
value used for HDF5 tuning parameters.
|
||||||
|
|
||||||
|
Flags are bit values that can be combined with the bit operator \c |
|
||||||
|
and include:
|
||||||
|
|
||||||
|
- \c H5PART_WRITE - truncate file and open for writing
|
||||||
|
- \c H5PART_APPEND - open file for writing without truncating
|
||||||
|
- \c H5PART_READ - open file read-only
|
||||||
|
|
||||||
|
The typical file extension is \c .h5.
|
||||||
|
|
||||||
|
H5PartFile should be treated as an essentially opaque
|
||||||
|
datastructure. It acts as the file handle, but internally
|
||||||
|
it maintains several key state variables associated with
|
||||||
|
the file.
|
||||||
|
|
||||||
\return File handle or \c NULL
|
\return File handle or \c NULL
|
||||||
*/
|
*/
|
||||||
H5PartFile*
|
H5PartFile*
|
||||||
@@ -497,12 +543,23 @@ _H5Part_file_is_valid (
|
|||||||
return H5PART_ERR_BADFD;
|
return H5PART_ERR_BADFD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5part_open
|
||||||
|
|
||||||
|
Closes an open file.
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
_H5Part_close_hdf_ids (
|
H5PartCloseFile (
|
||||||
H5PartFile *f /*!< [in] filehandle of the file to close */
|
H5PartFile *f /*!< [in] filehandle of the file to close */
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5PartCloseFile" );
|
||||||
herr_t r = 0;
|
herr_t r = 0;
|
||||||
|
_h5part_errno = H5PART_SUCCESS;
|
||||||
|
|
||||||
|
CHECK_FILEHANDLE ( f );
|
||||||
|
|
||||||
if ( f->block && f->close_block ) {
|
if ( f->block && f->close_block ) {
|
||||||
(*f->close_block) ( f );
|
(*f->close_block) ( f );
|
||||||
@@ -543,46 +600,28 @@ _H5Part_close_hdf_ids (
|
|||||||
if ( r < 0 ) HANDLE_H5P_CLOSE_ERR ( "f->xfer_prop" );
|
if ( r < 0 ) HANDLE_H5P_CLOSE_ERR ( "f->xfer_prop" );
|
||||||
f->xfer_prop = H5P_DEFAULT;
|
f->xfer_prop = H5P_DEFAULT;
|
||||||
}
|
}
|
||||||
if( f->access_prop != H5P_DEFAULT ) {
|
if( f->dcreate_prop != H5P_DEFAULT ) {
|
||||||
r = H5Pclose( f->access_prop );
|
r = H5Pclose( f->dcreate_prop );
|
||||||
if ( r < 0 ) HANDLE_H5P_CLOSE_ERR ( "f->access_prop" );
|
if ( r < 0 ) HANDLE_H5P_CLOSE_ERR ( "f->dcreate_prop" );
|
||||||
f->access_prop = H5P_DEFAULT;
|
f->dcreate_prop = H5P_DEFAULT;
|
||||||
}
|
|
||||||
if( f->create_prop != H5P_DEFAULT ) {
|
|
||||||
r = H5Pclose( f->create_prop );
|
|
||||||
if ( r < 0 ) HANDLE_H5P_CLOSE_ERR ( "f->create_prop" );
|
|
||||||
f->create_prop = H5P_DEFAULT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return H5PART_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\ingroup h5part_open
|
|
||||||
|
|
||||||
Closes an open file.
|
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5PartCloseFile (
|
|
||||||
H5PartFile *f /*!< [in] filehandle of the file to close */
|
|
||||||
) {
|
|
||||||
|
|
||||||
SET_FNAME ( "H5PartCloseFile" );
|
|
||||||
herr_t r = 0;
|
|
||||||
_h5part_errno = H5PART_SUCCESS;
|
|
||||||
|
|
||||||
CHECK_FILEHANDLE ( f );
|
|
||||||
|
|
||||||
r = _H5Part_close_hdf_ids ( f );
|
|
||||||
if ( r < 0 ) return r;
|
|
||||||
|
|
||||||
if ( f->file ) {
|
if ( f->file ) {
|
||||||
r = H5Fclose( f->file );
|
r = H5Fclose( f->file );
|
||||||
if ( r < 0 ) HANDLE_H5F_CLOSE_ERR;
|
if ( r < 0 ) HANDLE_H5F_CLOSE_ERR;
|
||||||
f->file = 0;
|
f->file = 0;
|
||||||
}
|
}
|
||||||
|
if( f->access_prop != H5P_DEFAULT ) {
|
||||||
|
r = H5Pclose( f->access_prop );
|
||||||
|
if ( r < 0 ) HANDLE_H5P_CLOSE_ERR ( "f->access_prop" );
|
||||||
|
f->access_prop = H5P_DEFAULT;
|
||||||
|
}
|
||||||
|
if( f->fcreate_prop != H5P_DEFAULT ) {
|
||||||
|
r = H5Pclose( f->fcreate_prop );
|
||||||
|
if ( r < 0 ) HANDLE_H5P_CLOSE_ERR ( "f->fcreate_prop" );
|
||||||
|
f->fcreate_prop = H5P_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
/* free memory from H5PartFile struct */
|
/* free memory from H5PartFile struct */
|
||||||
if( f->pnparticles ) {
|
if( f->pnparticles ) {
|
||||||
@@ -674,7 +713,11 @@ _set_num_particles (
|
|||||||
register int i;
|
register int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
if ( nparticles < 0 )
|
||||||
|
#else
|
||||||
if ( nparticles <= 0 )
|
if ( nparticles <= 0 )
|
||||||
|
#endif
|
||||||
return HANDLE_H5PART_INVALID_ERR ( "nparticles", nparticles );
|
return HANDLE_H5PART_INVALID_ERR ( "nparticles", nparticles );
|
||||||
|
|
||||||
/* prevent invalid stride value */
|
/* prevent invalid stride value */
|
||||||
@@ -687,6 +730,8 @@ _set_num_particles (
|
|||||||
stride = (hsize_t) _stride;
|
stride = (hsize_t) _stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( nparticles == 0 ) stride = 1;
|
||||||
|
|
||||||
#ifndef PARALLEL_IO
|
#ifndef PARALLEL_IO
|
||||||
/*
|
/*
|
||||||
if we are not using parallel-IO, there is enough information
|
if we are not using parallel-IO, there is enough information
|
||||||
@@ -712,11 +757,14 @@ _set_num_particles (
|
|||||||
|
|
||||||
f->nparticles = (hsize_t) nparticles;
|
f->nparticles = (hsize_t) nparticles;
|
||||||
|
|
||||||
/* declare local memory datasize with striding */
|
if ( f->nparticles > 0 )
|
||||||
count = f->nparticles * stride;
|
{
|
||||||
f->memshape = H5Screate_simple ( 1, &count, &dmax );
|
/* declare local memory datasize with striding */
|
||||||
if ( f->memshape < 0 )
|
count = f->nparticles * stride;
|
||||||
return HANDLE_H5S_CREATE_SIMPLE_ERR ( f->nparticles );
|
f->memshape = H5Screate_simple ( 1, &count, &dmax );
|
||||||
|
if ( f->memshape < 0 )
|
||||||
|
return HANDLE_H5S_CREATE_SIMPLE_ERR ( f->nparticles );
|
||||||
|
}
|
||||||
|
|
||||||
/* we need a hyperslab selection if there is striding
|
/* we need a hyperslab selection if there is striding
|
||||||
* (otherwise, the default H5S_ALL selection is ok)
|
* (otherwise, the default H5S_ALL selection is ok)
|
||||||
@@ -757,16 +805,16 @@ _set_num_particles (
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
ret = MPI_Allgather (
|
ret = MPI_Allgather (
|
||||||
&nparticles, 1, MPI_LONG_LONG,
|
(void*)&nparticles, 1, MPI_LONG_LONG,
|
||||||
f->pnparticles, 1, MPI_LONG_LONG,
|
f->pnparticles, 1, MPI_LONG_LONG,
|
||||||
f->comm );
|
f->comm );
|
||||||
if ( ret != MPI_SUCCESS) return HANDLE_MPI_ALLGATHER_ERR;
|
if ( ret != MPI_SUCCESS) return HANDLE_MPI_ALLGATHER_ERR;
|
||||||
|
|
||||||
if ( f->myproc == 0 ) {
|
if ( f->myproc == 0 ) {
|
||||||
_H5Part_print_debug ( "Particle offsets:" );
|
|
||||||
for ( i=0; i<f->nprocs; i++ )
|
for ( i=0; i<f->nprocs; i++ )
|
||||||
_H5Part_print_debug ( "\t[%d] np=%lld", i,
|
_H5Part_print_debug_detail (
|
||||||
(long long) f->pnparticles[i] );
|
"[%d] np=%lld",
|
||||||
|
i, (long long) f->pnparticles[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* compute start offsets */
|
/* compute start offsets */
|
||||||
@@ -794,12 +842,16 @@ _set_num_particles (
|
|||||||
|
|
||||||
count = nparticles;
|
count = nparticles;
|
||||||
stride = 1;
|
stride = 1;
|
||||||
herr = H5Sselect_hyperslab (
|
if ( count > 0 ) {
|
||||||
f->diskshape,
|
herr = H5Sselect_hyperslab (
|
||||||
H5S_SELECT_SET,
|
f->diskshape,
|
||||||
&start,
|
H5S_SELECT_SET,
|
||||||
&stride,
|
&start,
|
||||||
&count, NULL );
|
&stride,
|
||||||
|
&count, NULL );
|
||||||
|
} else {
|
||||||
|
herr = H5Sselect_none ( f->diskshape );
|
||||||
|
}
|
||||||
if ( herr < 0 ) return HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
if ( herr < 0 ) return HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -896,6 +948,47 @@ H5PartSetNumParticlesStrided (
|
|||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5part_model
|
||||||
|
|
||||||
|
Define the chunk \c size and enables chunking in the underlying
|
||||||
|
HDF5 layer. When combined with the \c align value in the
|
||||||
|
\ref H5PartOpenFileAlign or \ref H5PartOpenFileParallelAlign
|
||||||
|
function, this causes each group of \c size particles to be
|
||||||
|
padded on disk out to the nearest multiple of \c align bytes.
|
||||||
|
|
||||||
|
Note that this policy wastes disk space, but can improve write
|
||||||
|
bandwidth on parallel filesystems that are sensitive to alignment
|
||||||
|
to stripe boundaries (e.g. lustre).
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartSetChunkSize (
|
||||||
|
H5PartFile *f,
|
||||||
|
const h5part_int64_t size
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5PartSetChunkSize" );
|
||||||
|
CHECK_FILEHANDLE( f );
|
||||||
|
|
||||||
|
_H5Part_print_info (
|
||||||
|
"Setting chunk size to %lld elements",
|
||||||
|
(long long)size );
|
||||||
|
|
||||||
|
if ( f->dcreate_prop == H5P_DEFAULT ) {
|
||||||
|
f->dcreate_prop = H5Pcreate (H5P_DATASET_CREATE);
|
||||||
|
if ( f->dcreate_prop < 0 ) return HANDLE_H5P_CREATE_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
hsize_t hsize = (hsize_t)size;
|
||||||
|
|
||||||
|
herr_t herr = H5Pset_chunk ( f->dcreate_prop, 1, &hsize );
|
||||||
|
if ( herr < 0 ) return HANDLE_H5P_SET_CHUNK_ERR;
|
||||||
|
|
||||||
|
return H5PART_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_normalize_dataset_name (
|
_normalize_dataset_name (
|
||||||
const char *name,
|
const char *name,
|
||||||
@@ -953,23 +1046,19 @@ _write_data (
|
|||||||
"Dataset[%s] at timestep %lld "
|
"Dataset[%s] at timestep %lld "
|
||||||
"already exists", name2, (long long)f->timestep );
|
"already exists", name2, (long long)f->timestep );
|
||||||
} else {
|
} else {
|
||||||
#ifndef H5_USE_16_API
|
|
||||||
dataset_id = H5Dcreate2 (
|
|
||||||
f->timegroup,
|
|
||||||
name2,
|
|
||||||
type,
|
|
||||||
f->shape,
|
|
||||||
H5P_DEFAULT,
|
|
||||||
H5P_DEFAULT,
|
|
||||||
H5P_DEFAULT );
|
|
||||||
#else
|
|
||||||
dataset_id = H5Dcreate (
|
dataset_id = H5Dcreate (
|
||||||
f->timegroup,
|
f->timegroup,
|
||||||
name2,
|
name2,
|
||||||
type,
|
type,
|
||||||
f->shape,
|
f->shape,
|
||||||
H5P_DEFAULT );
|
#ifndef H5_USE_16_API
|
||||||
|
H5P_DEFAULT,
|
||||||
|
f->dcreate_prop,
|
||||||
|
H5P_DEFAULT
|
||||||
|
#else
|
||||||
|
f->dcreate_prop
|
||||||
#endif
|
#endif
|
||||||
|
);
|
||||||
if ( dataset_id < 0 )
|
if ( dataset_id < 0 )
|
||||||
return HANDLE_H5D_CREATE_ERR ( name2, f->timestep );
|
return HANDLE_H5D_CREATE_ERR ( name2, f->timestep );
|
||||||
}
|
}
|
||||||
@@ -1259,7 +1348,7 @@ _H5Part_read_attrib (
|
|||||||
hid_t space_id;
|
hid_t space_id;
|
||||||
hid_t type_id;
|
hid_t type_id;
|
||||||
|
|
||||||
#ifndef H5_USE_16_API
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
if (! H5Aexists ( id, attrib_name )) {
|
if (! H5Aexists ( id, attrib_name )) {
|
||||||
_H5Part_print_warn ( "Attribute '%s' does not exist!", attrib_name );
|
_H5Part_print_warn ( "Attribute '%s' does not exist!", attrib_name );
|
||||||
}
|
}
|
||||||
@@ -1558,9 +1647,9 @@ H5PartWriteStepAttrib (
|
|||||||
h5part_int64_t herr = _H5Part_write_step_attrib (
|
h5part_int64_t herr = _H5Part_write_step_attrib (
|
||||||
f,
|
f,
|
||||||
name,
|
name,
|
||||||
(const hid_t)type,
|
(hid_t)type,
|
||||||
data,
|
data,
|
||||||
nelem );
|
(hsize_t)nelem );
|
||||||
if ( herr < 0 ) return herr;
|
if ( herr < 0 ) return herr;
|
||||||
|
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
@@ -1602,9 +1691,9 @@ H5PartWriteFileAttrib (
|
|||||||
h5part_int64_t herr = _H5Part_write_file_attrib (
|
h5part_int64_t herr = _H5Part_write_file_attrib (
|
||||||
f,
|
f,
|
||||||
name,
|
name,
|
||||||
(const hid_t)type,
|
(hid_t)type,
|
||||||
data,
|
data,
|
||||||
nelem );
|
(hsize_t)nelem );
|
||||||
if ( herr < 0 ) return herr;
|
if ( herr < 0 ) return herr;
|
||||||
|
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
@@ -1851,9 +1940,11 @@ _H5Part_set_step (
|
|||||||
char stepname[H5PART_STEPNAME_LEN];
|
char stepname[H5PART_STEPNAME_LEN];
|
||||||
_H5Part_get_step_name(f, step, stepname);
|
_H5Part_get_step_name(f, step, stepname);
|
||||||
|
|
||||||
|
#if H5PART_SET_STEP_READ_ONLY
|
||||||
if ( (!(f->flags & H5PART_READ)) && _H5Part_have_group ( f->file, stepname ) ) {
|
if ( (!(f->flags & H5PART_READ)) && _H5Part_have_group ( f->file, stepname ) ) {
|
||||||
return HANDLE_H5PART_STEP_EXISTS_ERR ( step );
|
return HANDLE_H5PART_STEP_EXISTS_ERR ( step );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( f->timegroup >= 0 ) {
|
if ( f->timegroup >= 0 ) {
|
||||||
herr_t herr = H5Gclose ( f->timegroup );
|
herr_t herr = H5Gclose ( f->timegroup );
|
||||||
@@ -1862,6 +1953,9 @@ _H5Part_set_step (
|
|||||||
f->timegroup = -1;
|
f->timegroup = -1;
|
||||||
f->timestep = step;
|
f->timestep = step;
|
||||||
|
|
||||||
|
#if H5PART_SET_STEP_READ_ONLY
|
||||||
|
// in this mode, existing steps can be selecting only
|
||||||
|
// for a READ file handle
|
||||||
if ( f->flags & H5PART_READ ) {
|
if ( f->flags & H5PART_READ ) {
|
||||||
_H5Part_print_debug (
|
_H5Part_print_debug (
|
||||||
"Proc[%d]: Set step to #%lld for file %lld",
|
"Proc[%d]: Set step to #%lld for file %lld",
|
||||||
@@ -1893,6 +1987,33 @@ _H5Part_set_step (
|
|||||||
return HANDLE_H5G_CREATE_ERR ( stepname );
|
return HANDLE_H5G_CREATE_ERR ( stepname );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else // H5PART_SET_STEP_READ_ONLY
|
||||||
|
|
||||||
|
// in this mode, existing steps can be selected for all file
|
||||||
|
// handles: first try to open the step, and create it if it
|
||||||
|
// doesn't exist
|
||||||
|
H5E_BEGIN_TRY
|
||||||
|
f->timegroup = H5Gopen ( f->file, stepname
|
||||||
|
#ifndef H5_USE_16_API
|
||||||
|
, H5P_DEFAULT
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
H5E_END_TRY
|
||||||
|
|
||||||
|
|
||||||
|
if ( f->timegroup < 0 )
|
||||||
|
{
|
||||||
|
f->timegroup = H5Gcreate( f->file, stepname, 0
|
||||||
|
#ifndef H5_USE_16_API
|
||||||
|
, H5P_DEFAULT, H5P_DEFAULT
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
if ( f->timegroup < 0 )
|
||||||
|
return HANDLE_H5G_CREATE_ERR ( stepname );
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // H5PART_SET_STEP_READ_ONLY
|
||||||
|
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1937,11 +2058,12 @@ _H5Part_have_group (
|
|||||||
const hid_t id,
|
const hid_t id,
|
||||||
const char *name
|
const char *name
|
||||||
) {
|
) {
|
||||||
#ifndef H5_USE_16_API
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
return (H5Lexists( id, name, H5P_DEFAULT ) ? 1 : 0);
|
return (H5Lexists( id, name, H5P_DEFAULT ) ? 1 : 0);
|
||||||
#else
|
#else
|
||||||
|
herr_t exists = 0;
|
||||||
H5E_BEGIN_TRY
|
H5E_BEGIN_TRY
|
||||||
herr_t exists = H5Gget_objinfo( id, name, 1, NULL );
|
exists = H5Gget_objinfo( id, name, 1, NULL );
|
||||||
H5E_END_TRY
|
H5E_END_TRY
|
||||||
return (exists >= 0 ? 1 : 0);
|
return (exists >= 0 ? 1 : 0);
|
||||||
#endif
|
#endif
|
||||||
@@ -1955,7 +2077,7 @@ _H5Part_have_group (
|
|||||||
|
|
||||||
Iterator for \c H5Giterate().
|
Iterator for \c H5Giterate().
|
||||||
*/
|
*/
|
||||||
#ifndef H5_USE_16_API
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
herr_t
|
herr_t
|
||||||
_H5Part_iteration_operator2 (
|
_H5Part_iteration_operator2 (
|
||||||
hid_t group_id, /*!< [in] parent object id */
|
hid_t group_id, /*!< [in] parent object id */
|
||||||
@@ -2079,7 +2201,7 @@ _H5Part_iteration_operator (
|
|||||||
|
|
||||||
if ( data->type != H5G_UNKNOWN )
|
if ( data->type != H5G_UNKNOWN )
|
||||||
{
|
{
|
||||||
#ifndef H5_USE_16_API
|
#ifdef H5PART_HAVE_HDF6_18
|
||||||
H5O_info_t objinfo;
|
H5O_info_t objinfo;
|
||||||
|
|
||||||
hid_t obj_id = H5Oopen(group_id, member_name, H5P_DEFAULT);
|
hid_t obj_id = H5Oopen(group_id, member_name, H5P_DEFAULT);
|
||||||
@@ -2159,8 +2281,13 @@ _H5Part_get_num_objects_matching_pattern (
|
|||||||
data.type = type;
|
data.type = type;
|
||||||
data.pattern = pattern;
|
data.pattern = pattern;
|
||||||
|
|
||||||
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
|
hid_t child_id = H5Gopen( group_id, group_name
|
||||||
#ifndef H5_USE_16_API
|
#ifndef H5_USE_16_API
|
||||||
hid_t child_id = H5Gopen( group_id, group_name, H5P_DEFAULT );
|
, H5P_DEFAULT
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if ( child_id < 0 ) return child_id;
|
if ( child_id < 0 ) return child_id;
|
||||||
herr = H5Literate( child_id, H5_INDEX_NAME, H5_ITER_INC, 0,
|
herr = H5Literate( child_id, H5_INDEX_NAME, H5_ITER_INC, 0,
|
||||||
_H5Part_iteration_operator2, &data );
|
_H5Part_iteration_operator2, &data );
|
||||||
@@ -2170,7 +2297,7 @@ _H5Part_get_num_objects_matching_pattern (
|
|||||||
#endif
|
#endif
|
||||||
if ( herr < 0 ) return herr;
|
if ( herr < 0 ) return herr;
|
||||||
|
|
||||||
#ifndef H5_USE_16_API
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
herr = H5Gclose ( child_id );
|
herr = H5Gclose ( child_id );
|
||||||
if ( herr < 0 ) return HANDLE_H5G_CLOSE_ERR;
|
if ( herr < 0 ) return HANDLE_H5G_CLOSE_ERR;
|
||||||
#endif
|
#endif
|
||||||
@@ -2204,7 +2331,7 @@ _H5Part_get_object_name (
|
|||||||
data.name = obj_name;
|
data.name = obj_name;
|
||||||
data.len = (size_t)len_obj_name;
|
data.len = (size_t)len_obj_name;
|
||||||
|
|
||||||
#ifndef H5_USE_16_API
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
hid_t child_id = H5Gopen ( group_id, group_name, H5P_DEFAULT );
|
hid_t child_id = H5Gopen ( group_id, group_name, H5P_DEFAULT );
|
||||||
if ( child_id < 0 ) return child_id;
|
if ( child_id < 0 ) return child_id;
|
||||||
herr = H5Literate ( child_id, H5_INDEX_NAME, H5_ITER_INC, 0,
|
herr = H5Literate ( child_id, H5_INDEX_NAME, H5_ITER_INC, 0,
|
||||||
@@ -2217,7 +2344,7 @@ _H5Part_get_object_name (
|
|||||||
return HANDLE_H5L_ITERATE_ERR;
|
return HANDLE_H5L_ITERATE_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef H5_USE_16_API
|
#ifdef H5PART_HAVE_HDF5_18
|
||||||
herr_t herr2 = H5Gclose ( child_id );
|
herr_t herr2 = H5Gclose ( child_id );
|
||||||
if ( herr2 < 0 ) return HANDLE_H5G_CLOSE_ERR;
|
if ( herr2 < 0 ) return HANDLE_H5G_CLOSE_ERR;
|
||||||
#endif
|
#endif
|
||||||
@@ -2663,10 +2790,7 @@ _set_view (
|
|||||||
end==-1 to mean end of file
|
end==-1 to mean end of file
|
||||||
*/
|
*/
|
||||||
total = (hsize_t) _H5Part_get_num_particles ( f );
|
total = (hsize_t) _H5Part_get_num_particles ( f );
|
||||||
if ( total < 0 ) {
|
if ( total == 0 ) {
|
||||||
return HANDLE_H5PART_GET_NUM_PARTICLES_ERR ( total );
|
|
||||||
}
|
|
||||||
else if ( total == 0 ) {
|
|
||||||
/* No datasets have been created yet and no veiws are set.
|
/* No datasets have been created yet and no veiws are set.
|
||||||
* We have to leave the view empty because we don't know how
|
* We have to leave the view empty because we don't know how
|
||||||
* many particles there should be! */
|
* many particles there should be! */
|
||||||
@@ -2745,10 +2869,7 @@ _set_view_indices (
|
|||||||
end==-1 to mean end of file
|
end==-1 to mean end of file
|
||||||
*/
|
*/
|
||||||
total = (hsize_t) _H5Part_get_num_particles ( f );
|
total = (hsize_t) _H5Part_get_num_particles ( f );
|
||||||
if ( total < 0 ) {
|
if ( total == 0 ) {
|
||||||
return HANDLE_H5PART_GET_NUM_PARTICLES_ERR ( total );
|
|
||||||
}
|
|
||||||
else if ( total == 0 ) {
|
|
||||||
/* No datasets have been created yet and no veiws are set.
|
/* No datasets have been created yet and no veiws are set.
|
||||||
* We have to leave the view empty because we don't know how
|
* We have to leave the view empty because we don't know how
|
||||||
* many particles there should be! */
|
* many particles there should be! */
|
||||||
@@ -3020,7 +3141,7 @@ _read_data (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
h5part_int64_t herr;
|
h5part_int64_t herr;
|
||||||
hsize_t ndisk, nread, nmem;
|
hssize_t ndisk, nread, nmem;
|
||||||
hid_t dataset_id;
|
hid_t dataset_id;
|
||||||
hid_t space_id;
|
hid_t space_id;
|
||||||
hid_t memspace_id;
|
hid_t memspace_id;
|
||||||
@@ -3343,7 +3464,7 @@ H5PartSetThrottle (
|
|||||||
if ( f->flags & H5PART_VFD_MPIIO_IND || f->flags & H5PART_VFD_MPIPOSIX ) {
|
if ( f->flags & H5PART_VFD_MPIIO_IND || f->flags & H5PART_VFD_MPIPOSIX ) {
|
||||||
f->throttle = factor;
|
f->throttle = factor;
|
||||||
_H5Part_print_info (
|
_H5Part_print_info (
|
||||||
"Throttling set with factor '%d'", f->throttle );
|
"Throttling set with factor = %d", f->throttle );
|
||||||
} else {
|
} else {
|
||||||
_H5Part_print_warn (
|
_H5Part_print_warn (
|
||||||
"Throttling is only permitted with the MPI-POSIX "
|
"Throttling is only permitted with the MPI-POSIX "
|
||||||
@@ -3361,25 +3482,26 @@ _H5Part_start_throttle (
|
|||||||
if (f->throttle > 0) {
|
if (f->throttle > 0) {
|
||||||
int ret;
|
int ret;
|
||||||
int token = 1;
|
int token = 1;
|
||||||
if (f->myproc == 0) {
|
_H5Part_print_info (
|
||||||
_H5Part_print_info ("Throttling with factor = %d",
|
"Throttling with factor = %d",
|
||||||
f->throttle);
|
f->throttle);
|
||||||
}
|
if (f->myproc / f->throttle > 0) {
|
||||||
if (f->myproc % f->throttle > 0) {
|
|
||||||
_H5Part_print_debug_detail (
|
_H5Part_print_debug_detail (
|
||||||
"[%d] throttle: waiting on token from %d",
|
"[%d] throttle: waiting on token from %d",
|
||||||
f->myproc, f->myproc - 1);
|
f->myproc, f->myproc - f->throttle);
|
||||||
// wait to receive token before continuing with read
|
// wait to receive token before continuing with read
|
||||||
ret = MPI_Recv(
|
ret = MPI_Recv(
|
||||||
&token, 1, MPI_INT,
|
&token, 1, MPI_INT,
|
||||||
f->myproc - 1, // receive from previous proc
|
f->myproc - f->throttle, // receive from previous proc
|
||||||
f->myproc, // use this proc id as message tag
|
f->myproc, // use this proc id as message tag
|
||||||
f->comm,
|
f->comm,
|
||||||
MPI_STATUS_IGNORE
|
MPI_STATUS_IGNORE
|
||||||
);
|
);
|
||||||
if ( ret != MPI_SUCCESS ) return HANDLE_MPI_SENDRECV_ERR;
|
if ( ret != MPI_SUCCESS ) return HANDLE_MPI_SENDRECV_ERR;
|
||||||
}
|
}
|
||||||
_H5Part_print_debug_detail ("[%d] throttle: received token", f->myproc);
|
_H5Part_print_debug_detail (
|
||||||
|
"[%d] throttle: received token",
|
||||||
|
f->myproc);
|
||||||
}
|
}
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -3392,19 +3514,17 @@ _H5Part_end_throttle (
|
|||||||
if (f->throttle > 0) {
|
if (f->throttle > 0) {
|
||||||
int ret;
|
int ret;
|
||||||
int token;
|
int token;
|
||||||
if (f->myproc % f->throttle < f->throttle - 1) {
|
if (f->myproc + f->throttle < f->nprocs) {
|
||||||
// pass token to next proc
|
// pass token to next proc
|
||||||
if (f->myproc + 1 < f->nprocs) {
|
_H5Part_print_debug_detail (
|
||||||
_H5Part_print_debug_detail (
|
"[%d] throttle: passing token to %d",
|
||||||
"[%d] throttle: passing token to %d",
|
f->myproc, f->myproc + f->throttle);
|
||||||
f->myproc, f->myproc + 1);
|
ret = MPI_Send(
|
||||||
ret = MPI_Send(
|
&token, 1, MPI_INT,
|
||||||
&token, 1, MPI_INT,
|
f->myproc + f->throttle, // send to next proc
|
||||||
f->myproc + 1, // send to next proc
|
f->myproc + f->throttle, // use the id of the target as tag
|
||||||
f->myproc + 1, // use the id of the target as tag
|
f->comm
|
||||||
f->comm
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
if ( ret != MPI_SUCCESS ) return HANDLE_MPI_SENDRECV_ERR;
|
if ( ret != MPI_SUCCESS ) return HANDLE_MPI_SENDRECV_ERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3488,10 +3608,10 @@ H5PartReportErrorHandler (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
_h5part_errno = eno;
|
_h5part_errno = eno;
|
||||||
if ( _debug > 0 ) {
|
if ( _debug > 0 && _is_root_proc ) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
_H5Part_vprint_error ( fmt, ap );
|
_vprint ( stderr, "E", fmt, ap );
|
||||||
va_end ( ap );
|
va_end ( ap );
|
||||||
}
|
}
|
||||||
return _h5part_errno;
|
return _h5part_errno;
|
||||||
@@ -3512,7 +3632,7 @@ H5PartAbortErrorHandler (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
_h5part_errno = eno;
|
_h5part_errno = eno;
|
||||||
if ( _debug > 0 ) {
|
if ( _debug > 0 && _is_root_proc ) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
fprintf ( stderr, "%s: ", funcname );
|
fprintf ( stderr, "%s: ", funcname );
|
||||||
@@ -3575,113 +3695,68 @@ _vprint (
|
|||||||
free ( fmt2 );
|
free ( fmt2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_error (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
) {
|
|
||||||
|
|
||||||
if ( _debug < 1 ) return;
|
|
||||||
_vprint ( stderr, "E", fmt, ap );
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_error (
|
_H5Part_print_error (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
...
|
...
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
if ( _debug < 1 || !_is_root_proc) return;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
_H5Part_vprint_error ( fmt, ap );
|
_vprint ( stderr, "E", fmt, ap );
|
||||||
va_end ( ap );
|
va_end ( ap );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_warn (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
) {
|
|
||||||
|
|
||||||
if ( _debug < 2 ) return;
|
|
||||||
_vprint ( stderr, "W", fmt, ap );
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_warn (
|
_H5Part_print_warn (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
...
|
...
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
if ( _debug < 2 || !_is_root_proc ) return;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
_H5Part_vprint_warn ( fmt, ap );
|
_vprint ( stderr, "W", fmt, ap );
|
||||||
va_end ( ap );
|
va_end ( ap );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_info (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
) {
|
|
||||||
|
|
||||||
if ( _debug < 3 ) return;
|
|
||||||
_vprint ( stdout, "I", fmt, ap );
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_info (
|
_H5Part_print_info (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
...
|
...
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
if ( _debug < 3 || !_is_root_proc ) return;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
_H5Part_vprint_info ( fmt, ap );
|
_vprint ( stdout, "I", fmt, ap );
|
||||||
va_end ( ap );
|
va_end ( ap );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_debug (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
) {
|
|
||||||
|
|
||||||
if ( _debug < 4 ) return;
|
|
||||||
_vprint ( stdout, "D", fmt, ap );
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_debug (
|
_H5Part_print_debug (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
...
|
...
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
if ( _debug < 4 || !_is_root_proc ) return;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
_H5Part_vprint_debug ( fmt, ap );
|
_vprint ( stdout, "D", fmt, ap );
|
||||||
va_end ( ap );
|
va_end ( ap );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_debug_detail (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
) {
|
|
||||||
|
|
||||||
if ( _debug < 5 ) return;
|
|
||||||
_vprint ( stdout, "DD", fmt, ap );
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_debug_detail (
|
_H5Part_print_debug_detail (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
...
|
...
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
if ( _debug < 5 ) return;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
_H5Part_vprint_debug_detail ( fmt, ap );
|
_vprint ( stdout, "DD", fmt, ap );
|
||||||
va_end ( ap );
|
va_end ( ap );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3690,6 +3765,7 @@ _H5Part_set_funcname (
|
|||||||
char *fname
|
char *fname
|
||||||
) {
|
) {
|
||||||
__funcname = fname;
|
__funcname = fname;
|
||||||
|
_H5Part_print_debug ("(entered function)");
|
||||||
}
|
}
|
||||||
|
|
||||||
char*
|
char*
|
||||||
|
|||||||
@@ -108,17 +108,32 @@ END FUNCTION
|
|||||||
!> \ingroup h5partf_open
|
!> \ingroup h5partf_open
|
||||||
!! Opens a parallel file for reading and specifies an HDF5 alignment.
|
!! Opens a parallel file for reading and specifies an HDF5 alignment.
|
||||||
!! See \ref H5PartOpenFileParallelAlign
|
!! See \ref H5PartOpenFileParallelAlign
|
||||||
|
!!
|
||||||
|
!! Flags are specified as a comma separated string that can include:
|
||||||
|
!!
|
||||||
|
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||||
|
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||||
|
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||||
|
!!
|
||||||
!! \return 0 on success or error code
|
!! \return 0 on success or error code
|
||||||
!<
|
!<
|
||||||
INTEGER*8 FUNCTION h5pt_openr_par_align ( filename, mpi_communicator, align )
|
INTEGER*8 FUNCTION h5pt_openr_par_align ( filename, mpi_communicator, align )
|
||||||
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
CHARACTER(LEN=*), INTENT(IN) :: filename !< the filename to open for reading
|
||||||
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
INTEGER, INTENT(IN) :: mpi_communicator !< the MPI_Communicator used by the program
|
||||||
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
INTEGER*8, INTENT(IN) :: align !< alignment value in bytes
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: flags !< additional flags
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
!> \ingroup h5partf_open
|
!> \ingroup h5partf_open
|
||||||
!! Opens a parallel file for writing in truncate mode and specifies
|
!! Opens a parallel file for writing in truncate mode and specifies
|
||||||
!! an HDF5 alignment.
|
!! an HDF5 alignment.
|
||||||
|
!!
|
||||||
|
!! Flags are specified as a comma separated string that can include:
|
||||||
|
!!
|
||||||
|
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||||
|
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||||
|
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||||
|
!!
|
||||||
!! See \ref H5PartOpenFileParallelAlign
|
!! See \ref H5PartOpenFileParallelAlign
|
||||||
!! \return 0 on success or error code
|
!! \return 0 on success or error code
|
||||||
!<
|
!<
|
||||||
@@ -132,6 +147,13 @@ END FUNCTION
|
|||||||
!> \ingroup h5partf_open
|
!> \ingroup h5partf_open
|
||||||
!! Opens a parallel file for writing in append mode and specifies
|
!! Opens a parallel file for writing in append mode and specifies
|
||||||
!! an HDF5 alignment.
|
!! an HDF5 alignment.
|
||||||
|
!!
|
||||||
|
!! Flags are specified as a comma separated string that can include:
|
||||||
|
!!
|
||||||
|
!! - \c fs_lustre - enable optimizations for the Lustre file system
|
||||||
|
!! - \c vfd_mpiposix - use the HDF5 MPI-POSIX virtual file driver
|
||||||
|
!! - \c vfd_mpio_ind - use MPI-IO in indepedent mode
|
||||||
|
!!
|
||||||
!! See \ref H5PartOpenFileParallelAlign
|
!! See \ref H5PartOpenFileParallelAlign
|
||||||
!! \return 0 on success or error code
|
!! \return 0 on success or error code
|
||||||
!<
|
!<
|
||||||
|
|||||||
+13
-2
@@ -16,10 +16,10 @@ extern "C" {
|
|||||||
#include "H5MultiBlock.h"
|
#include "H5MultiBlock.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define H5PART_VER_STRING "1.6.0"
|
#define H5PART_VER_STRING "1.6.2"
|
||||||
#define H5PART_VER_MAJOR 1
|
#define H5PART_VER_MAJOR 1
|
||||||
#define H5PART_VER_MINOR 6
|
#define H5PART_VER_MINOR 6
|
||||||
#define H5PART_VER_RELEASE 0
|
#define H5PART_VER_RELEASE 2
|
||||||
|
|
||||||
/* error values */
|
/* error values */
|
||||||
#define H5PART_SUCCESS 0
|
#define H5PART_SUCCESS 0
|
||||||
@@ -42,6 +42,7 @@ extern "C" {
|
|||||||
#define H5PART_VFD_MPIPOSIX 0x08
|
#define H5PART_VFD_MPIPOSIX 0x08
|
||||||
#define H5PART_FS_LUSTRE 0x10
|
#define H5PART_FS_LUSTRE 0x10
|
||||||
#define H5PART_VFD_MPIIO_IND 0x20
|
#define H5PART_VFD_MPIIO_IND 0x20
|
||||||
|
#define H5PART_VFD_CORE 0x40
|
||||||
|
|
||||||
/* verbosity level flags */
|
/* verbosity level flags */
|
||||||
#define H5PART_VERB_NONE 0
|
#define H5PART_VERB_NONE 0
|
||||||
@@ -99,6 +100,10 @@ H5PartCloseFile (
|
|||||||
H5PartFile *f
|
H5PartFile *f
|
||||||
);
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartFileIsValid (
|
||||||
|
H5PartFile *f
|
||||||
|
);
|
||||||
|
|
||||||
/*============== File Writing Functions ==================== */
|
/*============== File Writing Functions ==================== */
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -121,6 +126,12 @@ H5PartSetNumParticlesStrided (
|
|||||||
const h5part_int64_t stride /*!< [in] Stride (e.g. number of fields in the particle array) */
|
const h5part_int64_t stride /*!< [in] Stride (e.g. number of fields in the particle array) */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartSetChunkSize (
|
||||||
|
H5PartFile *f,
|
||||||
|
const h5part_int64_t size
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5PartWriteDataFloat64 (
|
H5PartWriteDataFloat64 (
|
||||||
H5PartFile *f,
|
H5PartFile *f,
|
||||||
|
|||||||
+30
-30
@@ -23,7 +23,7 @@ h5pt_writefileattrib_r8 (
|
|||||||
h5part_int64_t *f,
|
h5part_int64_t *f,
|
||||||
const char *name,
|
const char *name,
|
||||||
const h5part_float64_t *data,
|
const h5part_float64_t *data,
|
||||||
const h5part_float64_t *nelem,
|
const h5part_int64_t *nelem,
|
||||||
const int l_name
|
const int l_name
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -39,9 +39,9 @@ h5pt_writefileattrib_r8 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_writefileattrib_r8 F77NAME ( \
|
#define h5pt_readfileattrib_r8 F77NAME ( \
|
||||||
h5pt_writefileattrib_r8_, \
|
h5pt_readfileattrib_r8_, \
|
||||||
H5PT_WRITEFILEATTRIB_R8 )
|
H5PT_READFILEATTRIB_R8 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -74,7 +74,7 @@ h5pt_writefileattrib_r4 (
|
|||||||
h5part_int64_t *f,
|
h5part_int64_t *f,
|
||||||
const char *name,
|
const char *name,
|
||||||
const h5part_float32_t *data,
|
const h5part_float32_t *data,
|
||||||
const h5part_float32_t *nelem,
|
const h5part_int64_t *nelem,
|
||||||
const int l_name
|
const int l_name
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -90,9 +90,9 @@ h5pt_writefileattrib_r4 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_writefileattrib_r4 F77NAME ( \
|
#define h5pt_readfileattrib_r4 F77NAME ( \
|
||||||
h5pt_writefileattrib_r4_, \
|
h5pt_readfileattrib_r4_, \
|
||||||
H5PT_WRITEFILEATTRIB_R4 )
|
H5PT_READFILEATTRIB_R4 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -141,9 +141,9 @@ h5pt_writefileattrib_i8 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_writefileattrib_i8 F77NAME ( \
|
#define h5pt_readfileattrib_i8 F77NAME ( \
|
||||||
h5pt_writefileattrib_i8_, \
|
h5pt_readfileattrib_i8_, \
|
||||||
H5PT_WRITEFILEATTRIB_I8 )
|
H5PT_READFILEATTRIB_I8 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -176,7 +176,7 @@ h5pt_writefileattrib_i4 (
|
|||||||
h5part_int64_t *f,
|
h5part_int64_t *f,
|
||||||
const char *name,
|
const char *name,
|
||||||
const h5part_int32_t *data,
|
const h5part_int32_t *data,
|
||||||
const h5part_int32_t *nelem,
|
const h5part_int64_t *nelem,
|
||||||
const int l_name
|
const int l_name
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -192,9 +192,9 @@ h5pt_writefileattrib_i4 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_writefileattrib_i4 F77NAME ( \
|
#define h5pt_readfileattrib_i4 F77NAME ( \
|
||||||
h5pt_writefileattrib_i4_, \
|
h5pt_readfileattrib_i4_, \
|
||||||
H5PT_WRITEFILEATTRIB_I4 )
|
H5PT_READFILEATTRIB_I4 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -227,7 +227,7 @@ h5pt_writestepattrib_r8 (
|
|||||||
h5part_int64_t *f,
|
h5part_int64_t *f,
|
||||||
const char *name,
|
const char *name,
|
||||||
const h5part_float64_t *data,
|
const h5part_float64_t *data,
|
||||||
const h5part_float64_t *nelem,
|
const h5part_int64_t *nelem,
|
||||||
const int l_name
|
const int l_name
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -243,9 +243,9 @@ h5pt_writestepattrib_r8 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_writestepattrib_r8 F77NAME ( \
|
#define h5pt_readstepattrib_r8 F77NAME ( \
|
||||||
h5pt_writestepattrib_r8_, \
|
h5pt_readstepattrib_r8_, \
|
||||||
H5PT_WRITESTEPATTRIB_R8 )
|
H5PT_READSTEPATTRIB_R8 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -278,7 +278,7 @@ h5pt_writestepattrib_r4 (
|
|||||||
h5part_int64_t *f,
|
h5part_int64_t *f,
|
||||||
const char *name,
|
const char *name,
|
||||||
const h5part_float32_t *data,
|
const h5part_float32_t *data,
|
||||||
const h5part_float32_t *nelem,
|
const h5part_int64_t *nelem,
|
||||||
const int l_name
|
const int l_name
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -294,9 +294,9 @@ h5pt_writestepattrib_r4 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_writestepattrib_r4 F77NAME ( \
|
#define h5pt_readstepattrib_r4 F77NAME ( \
|
||||||
h5pt_writestepattrib_r4_, \
|
h5pt_readstepattrib_r4_, \
|
||||||
H5PT_WRITESTEPATTRIB_R4 )
|
H5PT_READSTEPATTRIB_R4 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -345,9 +345,9 @@ h5pt_writestepattrib_i8 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_writestepattrib_i8 F77NAME ( \
|
#define h5pt_readstepattrib_i8 F77NAME ( \
|
||||||
h5pt_writestepattrib_i8_, \
|
h5pt_readstepattrib_i8_, \
|
||||||
H5PT_WRITESTEPATTRIB_I8 )
|
H5PT_READSTEPATTRIB_I8 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -380,7 +380,7 @@ h5pt_writestepattrib_i4 (
|
|||||||
h5part_int64_t *f,
|
h5part_int64_t *f,
|
||||||
const char *name,
|
const char *name,
|
||||||
const h5part_int32_t *data,
|
const h5part_int32_t *data,
|
||||||
const h5part_int32_t *nelem,
|
const h5part_int64_t *nelem,
|
||||||
const int l_name
|
const int l_name
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -396,9 +396,9 @@ h5pt_writestepattrib_i4 (
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_writestepattrib_i4 F77NAME ( \
|
#define h5pt_readstepattrib_i4 F77NAME ( \
|
||||||
h5pt_writestepattrib_i4_, \
|
h5pt_readstepattrib_i4_, \
|
||||||
H5PT_WRITESTEPATTRIB_I4 )
|
H5PT_READSTEPATTRIB_I4 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
|
|||||||
+14
-2
@@ -197,6 +197,10 @@ _H5Part_flagsfor2c (
|
|||||||
while ( flags != NULL ) {
|
while ( flags != NULL ) {
|
||||||
if ( strcmp ( flags, "vfd_mpiposix" ) == 0 )
|
if ( strcmp ( flags, "vfd_mpiposix" ) == 0 )
|
||||||
fbits |= H5PART_VFD_MPIPOSIX;
|
fbits |= H5PART_VFD_MPIPOSIX;
|
||||||
|
else if ( strcmp ( flags, "vfd_core" ) == 0 )
|
||||||
|
fbits |= H5PART_VFD_CORE;
|
||||||
|
else if ( strcmp ( flags, "vfd_mpio_ind" ) == 0 )
|
||||||
|
fbits |= H5PART_VFD_MPIIO_IND;
|
||||||
else if ( strcmp ( flags, "fs_lustre" ) == 0 )
|
else if ( strcmp ( flags, "fs_lustre" ) == 0 )
|
||||||
fbits |= H5PART_FS_LUSTRE;
|
fbits |= H5PART_FS_LUSTRE;
|
||||||
flags = strtok ( NULL, "," );
|
flags = strtok ( NULL, "," );
|
||||||
@@ -351,16 +355,22 @@ h5pt_openr_par_align (
|
|||||||
const char *file_name,
|
const char *file_name,
|
||||||
MPI_Fint *fcomm,
|
MPI_Fint *fcomm,
|
||||||
const h5part_int64_t *align,
|
const h5part_int64_t *align,
|
||||||
const int l_file_name
|
const char *flags,
|
||||||
|
const int l_file_name,
|
||||||
|
const int l_flags
|
||||||
) {
|
) {
|
||||||
|
|
||||||
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
MPI_Comm ccomm = MPI_Comm_f2c (*fcomm);
|
||||||
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||||
|
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
|
||||||
|
|
||||||
|
char fbits = H5PART_READ | _H5Part_flagsfor2c ( flags2 );
|
||||||
|
|
||||||
H5PartFile* f = H5PartOpenFileParallelAlign (
|
H5PartFile* f = H5PartOpenFileParallelAlign (
|
||||||
file_name2, H5PART_READ, ccomm, *align );
|
file_name2, fbits, ccomm, *align );
|
||||||
|
|
||||||
free ( file_name2 );
|
free ( file_name2 );
|
||||||
|
free ( flags2 );
|
||||||
return (h5part_int64_t)(size_t)f;
|
return (h5part_int64_t)(size_t)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,6 +394,7 @@ h5pt_openw_par_align (
|
|||||||
file_name2, fbits, ccomm, *align );
|
file_name2, fbits, ccomm, *align );
|
||||||
|
|
||||||
free ( file_name2 );
|
free ( file_name2 );
|
||||||
|
free ( flags2 );
|
||||||
return (h5part_int64_t)(size_t)f;
|
return (h5part_int64_t)(size_t)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,6 +418,7 @@ h5pt_opena_par_align (
|
|||||||
file_name2, fbits, ccomm, *align );
|
file_name2, fbits, ccomm, *align );
|
||||||
|
|
||||||
free ( file_name2 );
|
free ( file_name2 );
|
||||||
|
free ( flags2 );
|
||||||
return (h5part_int64_t)(size_t)f;
|
return (h5part_int64_t)(size_t)f;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+6
-31
@@ -2,12 +2,17 @@
|
|||||||
#define __H5PART_PRIVATE_H
|
#define __H5PART_PRIVATE_H
|
||||||
|
|
||||||
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 6
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 6
|
||||||
|
#define H5PART_USE_HDF5_16
|
||||||
#define H5_USE_16_API
|
#define H5_USE_16_API
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR >= 8
|
||||||
|
#define H5PART_HAVE_HDF5_18
|
||||||
|
#endif
|
||||||
|
|
||||||
#define H5PART_GROUPNAME_STEP "Step"
|
#define H5PART_GROUPNAME_STEP "Step"
|
||||||
|
|
||||||
#define H5PART_BTREE_IK 10000
|
#define H5PART_SET_STEP_READ_ONLY 0
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
_H5Part_file_is_valid (
|
_H5Part_file_is_valid (
|
||||||
@@ -167,12 +172,6 @@ _H5Part_get_err_handle (
|
|||||||
void
|
void
|
||||||
);
|
);
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_error (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_error (
|
_H5Part_print_error (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
@@ -182,12 +181,6 @@ __attribute__ ((format (printf, 1, 2)))
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_warn (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_warn (
|
_H5Part_print_warn (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
@@ -198,12 +191,6 @@ __attribute__ ((format (printf, 1, 2)))
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_info (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_info (
|
_H5Part_print_info (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
@@ -214,12 +201,6 @@ __attribute__ ((format (printf, 1, 2)))
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_debug (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_debug (
|
_H5Part_print_debug (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
@@ -230,12 +211,6 @@ __attribute__ ((format (printf, 1, 2)))
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
void
|
|
||||||
_H5Part_vprint_debug_detail (
|
|
||||||
const char *fmt,
|
|
||||||
va_list ap
|
|
||||||
);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_print_debug_detail (
|
_H5Part_print_debug_detail (
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
|
|||||||
+3
-2
@@ -19,7 +19,7 @@ __attribute__ ((format (printf, 3, 4)))
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
#ifndef MPI_INCLUDED
|
#ifndef PARALLEL_IO
|
||||||
typedef unsigned long MPI_Comm;
|
typedef unsigned long MPI_Comm;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -50,8 +50,9 @@ struct H5PartFile {
|
|||||||
hid_t timegroup;
|
hid_t timegroup;
|
||||||
hid_t shape;
|
hid_t shape;
|
||||||
hid_t xfer_prop;
|
hid_t xfer_prop;
|
||||||
hid_t create_prop;
|
|
||||||
hid_t access_prop;
|
hid_t access_prop;
|
||||||
|
hid_t dcreate_prop;
|
||||||
|
hid_t fcreate_prop;
|
||||||
|
|
||||||
/* the dataspace on disk for the current view */
|
/* the dataspace on disk for the current view */
|
||||||
hid_t diskshape;
|
hid_t diskshape;
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ h5pt_write#LEVELLC#attrib_#TYPE_F90_ABV# (
|
|||||||
h5part_int64_t *f,
|
h5part_int64_t *f,
|
||||||
const char *name,
|
const char *name,
|
||||||
const h5part_#TYPE_H5P#_t *data,
|
const h5part_#TYPE_H5P#_t *data,
|
||||||
const h5part_#TYPE_H5P#_t *nelem,
|
const h5part_int64_t *nelem,
|
||||||
const int l_name
|
const int l_name
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -143,9 +143,9 @@ END FUNCTION
|
|||||||
|
|
||||||
read_attr_fc = """
|
read_attr_fc = """
|
||||||
#if ! defined(F77_NO_UNDERSCORE)
|
#if ! defined(F77_NO_UNDERSCORE)
|
||||||
#define h5pt_write#LEVELLC#attrib_#TYPE_F90_ABV# F77NAME ( \\
|
#define h5pt_read#LEVELLC#attrib_#TYPE_F90_ABV# F77NAME ( \\
|
||||||
h5pt_write#LEVELLC#attrib_#TYPE_F90_ABV#_, \\
|
h5pt_read#LEVELLC#attrib_#TYPE_F90_ABV#_, \\
|
||||||
H5PT_WRITE#LEVELUC#ATTRIB_#TYPE_F90_ABVC# )
|
H5PT_READ#LEVELUC#ATTRIB_#TYPE_F90_ABVC# )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ c_head = """
|
|||||||
|
|
||||||
#include "H5MultiBlockErrors.h"
|
#include "H5MultiBlockErrors.h"
|
||||||
#include "H5MultiBlockPrivate.h"
|
#include "H5MultiBlockPrivate.h"
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
c_tail = """
|
||||||
|
#endif // PARALLEL_IO
|
||||||
"""
|
"""
|
||||||
|
|
||||||
h_head = """
|
h_head = """
|
||||||
@@ -237,6 +244,7 @@ def write_calls():
|
|||||||
# fcfile.write(create_call(read_fc,type,dim));
|
# fcfile.write(create_call(read_fc,type,dim));
|
||||||
# fifile.write(create_call(write_fi,type,dim));
|
# fifile.write(create_call(write_fi,type,dim));
|
||||||
# fifile.write(create_call(read_fi,type,dim));
|
# fifile.write(create_call(read_fi,type,dim));
|
||||||
|
cfile.write(c_tail)
|
||||||
cfile.close()
|
cfile.close()
|
||||||
hfile.write(h_tail)
|
hfile.write(h_tail)
|
||||||
hfile.close()
|
hfile.close()
|
||||||
|
|||||||
+1
-1
@@ -509,7 +509,7 @@ void test_read4(void)
|
|||||||
status = H5PartSetStep(file2, NTIMESTEPS);
|
status = H5PartSetStep(file2, NTIMESTEPS);
|
||||||
RETURN(status, H5PART_SUCCESS, "H5PartSetStep");
|
RETURN(status, H5PART_SUCCESS, "H5PartSetStep");
|
||||||
|
|
||||||
test_read_data64(file2, NPARTICLES, NTIMESTEPS);
|
test_read_data64(file2, NPARTICLES, NTIMESTEPS-2);
|
||||||
|
|
||||||
status = H5PartCloseFile(file1);
|
status = H5PartCloseFile(file1);
|
||||||
RETURN(status, H5PART_SUCCESS, "H5PartCloseFile");
|
RETURN(status, H5PART_SUCCESS, "H5PartCloseFile");
|
||||||
|
|||||||
+7
-5
@@ -23,9 +23,10 @@ int main(int argc, char **argv)
|
|||||||
int procs;
|
int procs;
|
||||||
MPI_Comm_size(MPI_COMM_WORLD, &procs);
|
MPI_Comm_size(MPI_COMM_WORLD, &procs);
|
||||||
if (procs > MAX_MPI_TASKS) {
|
if (procs > MAX_MPI_TASKS) {
|
||||||
fprintf(stderr, "ERROR: please use <= %d MPI tasks for the test.",
|
fprintf(stderr,
|
||||||
|
"ERROR: please use <= %d MPI tasks for the test.\n",
|
||||||
MAX_MPI_TASKS);
|
MAX_MPI_TASKS);
|
||||||
MPI_Abort(MPI_COMM_WORLD, -1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -62,9 +63,10 @@ int main(int argc, char **argv)
|
|||||||
// TestCleanup();
|
// TestCleanup();
|
||||||
|
|
||||||
#ifdef PARALLEL_IO
|
#ifdef PARALLEL_IO
|
||||||
return MPI_Finalize();
|
TestPrintf ("reached end\n");
|
||||||
#else
|
fflush(stdout);
|
||||||
return GetTestNumErrs();
|
MPI_Finalize();
|
||||||
#endif
|
#endif
|
||||||
|
return GetTestNumErrs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <H5Part.h>
|
#include <H5Part.h>
|
||||||
#include "testframe.h"
|
#include "testframe.h"
|
||||||
|
#include "../src/H5PartPrivate.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definitions for the testing structure.
|
* Definitions for the testing structure.
|
||||||
@@ -652,6 +653,7 @@ test_is_valid(H5PartFile *file)
|
|||||||
void
|
void
|
||||||
test_open_objects(H5PartFile *file, int max_objects)
|
test_open_objects(H5PartFile *file, int max_objects)
|
||||||
{
|
{
|
||||||
|
#ifndef H5_USE_16_API
|
||||||
ssize_t nopen = H5Fget_obj_count(file->file, H5F_OBJ_ALL);
|
ssize_t nopen = H5Fget_obj_count(file->file, H5F_OBJ_ALL);
|
||||||
if (nopen > max_objects)
|
if (nopen > max_objects)
|
||||||
{
|
{
|
||||||
@@ -682,5 +684,6 @@ test_open_objects(H5PartFile *file, int max_objects)
|
|||||||
}
|
}
|
||||||
free(list);
|
free(list);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-13
@@ -65,7 +65,7 @@ static void
|
|||||||
test_write_data64(H5PartFile *file, int nparticles, int step)
|
test_write_data64(H5PartFile *file, int nparticles, int step)
|
||||||
{
|
{
|
||||||
int i,t;
|
int i,t;
|
||||||
h5part_int64_t status;
|
h5part_int64_t status, val;
|
||||||
|
|
||||||
double *x,*y,*z;
|
double *x,*y,*z;
|
||||||
double *px,*py,*pz;
|
double *px,*py,*pz;
|
||||||
@@ -108,10 +108,12 @@ test_write_data64(H5PartFile *file, int nparticles, int step)
|
|||||||
id[i] = i + nparticles*t;
|
id[i] = i + nparticles*t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val = H5PartHasStep(file, t);
|
||||||
|
|
||||||
status = H5PartSetStep(file, t);
|
status = H5PartSetStep(file, t);
|
||||||
RETURN(status, H5PART_SUCCESS, "H5PartSetStep");
|
RETURN(status, H5PART_SUCCESS, "H5PartSetStep");
|
||||||
|
|
||||||
test_write_step_attribs(file, t);
|
if (val == 0) test_write_step_attribs(file, t);
|
||||||
|
|
||||||
status = H5PartSetNumParticles(file, nparticles);
|
status = H5PartSetNumParticles(file, nparticles);
|
||||||
RETURN(status, H5PART_SUCCESS, "H5PartSetNumParticles");
|
RETURN(status, H5PART_SUCCESS, "H5PartSetNumParticles");
|
||||||
@@ -198,7 +200,7 @@ static void
|
|||||||
test_write_data32(H5PartFile *file, int nparticles, int step)
|
test_write_data32(H5PartFile *file, int nparticles, int step)
|
||||||
{
|
{
|
||||||
int i,t;
|
int i,t;
|
||||||
h5part_int32_t status;
|
h5part_int32_t status, val;
|
||||||
int rank, nprocs;
|
int rank, nprocs;
|
||||||
|
|
||||||
float *x,*y,*z;
|
float *x,*y,*z;
|
||||||
@@ -244,8 +246,11 @@ test_write_data32(H5PartFile *file, int nparticles, int step)
|
|||||||
id[i] = i + nparticles*t;
|
id[i] = i + nparticles*t;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = H5PartSetStep(file, t);
|
val = H5PartHasStep(file, t);
|
||||||
RETURN(status, H5PART_SUCCESS, "H5PartSetStep");
|
if (val == 0) {
|
||||||
|
status = H5PartSetStep(file, t);
|
||||||
|
RETURN(status, H5PART_SUCCESS, "H5PartSetStep");
|
||||||
|
}
|
||||||
|
|
||||||
/* test a two-part write using views */
|
/* test a two-part write using views */
|
||||||
status = H5PartSetView(file,
|
status = H5PartSetView(file,
|
||||||
@@ -370,8 +375,6 @@ void test_write1(void)
|
|||||||
test_write_data32(file1, NPARTICLES, 1);
|
test_write_data32(file1, NPARTICLES, 1);
|
||||||
test_write_file_attribs(file1, 0);
|
test_write_file_attribs(file1, 0);
|
||||||
|
|
||||||
_H5Part_close_hdf_ids(file1);
|
|
||||||
test_open_objects(file1, 1);
|
|
||||||
status = H5PartCloseFile(file1);
|
status = H5PartCloseFile(file1);
|
||||||
RETURN(status, H5PART_SUCCESS, "H5PartCloseFile");
|
RETURN(status, H5PART_SUCCESS, "H5PartCloseFile");
|
||||||
}
|
}
|
||||||
@@ -405,10 +408,10 @@ void test_write3(void)
|
|||||||
h5part_int64_t status;
|
h5part_int64_t status;
|
||||||
|
|
||||||
TEST( "Opening file once, write-truncate, lustre filesyste, "
|
TEST( "Opening file once, write-truncate, lustre filesyste, "
|
||||||
"MPI-POSIX VFD, 64KB alignment");
|
"MPI-POSIX VFD, 1KB alignment");
|
||||||
file1 = OPENALIGN(FILENAME,
|
file1 = OPENALIGN(FILENAME,
|
||||||
H5PART_WRITE | H5PART_VFD_MPIPOSIX | H5PART_FS_LUSTRE,
|
H5PART_WRITE | H5PART_VFD_MPIPOSIX | H5PART_FS_LUSTRE,
|
||||||
65536);
|
1024);
|
||||||
test_is_valid(file1);
|
test_is_valid(file1);
|
||||||
|
|
||||||
TEST("Redefining step name");
|
TEST("Redefining step name");
|
||||||
@@ -430,14 +433,14 @@ void test_write4(void)
|
|||||||
h5part_int64_t status;
|
h5part_int64_t status;
|
||||||
|
|
||||||
TEST( "Opening file twice, write-append + read-only, "
|
TEST( "Opening file twice, write-append + read-only, "
|
||||||
"lustre filesystem, MPI-IO Independent VFD, 64K alignment");
|
"lustre filesystem, MPI-IO Independent VFD, 1K alignment");
|
||||||
file1 = OPENALIGN(FILENAME,
|
file1 = OPENALIGN(FILENAME,
|
||||||
H5PART_APPEND | H5PART_VFD_MPIIO_IND | H5PART_FS_LUSTRE,
|
H5PART_APPEND | H5PART_VFD_MPIIO_IND | H5PART_FS_LUSTRE,
|
||||||
65536);
|
1024);
|
||||||
test_is_valid(file1);
|
test_is_valid(file1);
|
||||||
file2 = OPENALIGN(FILENAME,
|
file2 = OPENALIGN(FILENAME,
|
||||||
H5PART_READ | H5PART_VFD_MPIIO_IND | H5PART_FS_LUSTRE,
|
H5PART_READ | H5PART_VFD_MPIIO_IND | H5PART_FS_LUSTRE,
|
||||||
65536);
|
1024);
|
||||||
test_is_valid(file2);
|
test_is_valid(file2);
|
||||||
|
|
||||||
TEST("Redefining step name");
|
TEST("Redefining step name");
|
||||||
@@ -447,7 +450,10 @@ void test_write4(void)
|
|||||||
status = H5PartDefineStepName(file2, LONGNAME, 16);
|
status = H5PartDefineStepName(file2, LONGNAME, 16);
|
||||||
RETURN(status, H5PART_SUCCESS, "H5PartDefineStepName");
|
RETURN(status, H5PART_SUCCESS, "H5PartDefineStepName");
|
||||||
|
|
||||||
test_write_data64(file1, NPARTICLES, NTIMESTEPS);
|
status = H5PartSetChunkSize(file1, NPARTICLES);
|
||||||
|
RETURN(status, H5PART_SUCCESS, "H5PartSetChunkSize");
|
||||||
|
|
||||||
|
test_write_data64(file1, NPARTICLES, NTIMESTEPS-2);
|
||||||
test_write_file_attribs(file1, 1);
|
test_write_file_attribs(file1, 1);
|
||||||
|
|
||||||
status = H5PartCloseFile(file1);
|
status = H5PartCloseFile(file1);
|
||||||
|
|||||||
Reference in New Issue
Block a user