Compare commits
78 Commits
H5Part-1.3.2
..
1.4
| Author | SHA1 | Date | |
|---|---|---|---|
| f40c99b10c | |||
| f816f1d9ff | |||
| ccdaca55c5 | |||
| 35db555dce | |||
| 5333ff810f | |||
| 4e988bd0d6 | |||
| 72ebca84e0 | |||
| 02eae3a724 | |||
| 6fc16f9e3e | |||
| 9b0c18cd40 | |||
| 9d299def98 | |||
| 491c0a0fb1 | |||
| d0e6cc3a63 | |||
| ed4d8af66e | |||
| e3f2584c8c | |||
| 6633dace44 | |||
| 11bc7db824 | |||
| 34eea1e11a | |||
| e72d5f351f | |||
| 72fe466514 | |||
| da4a5e9080 | |||
| 06da58b100 | |||
| d41a59f991 | |||
| a927ae4d67 | |||
| 249117c89e | |||
| 463ef08da9 | |||
| 607d1e86ab | |||
| 3ebc9de7a9 | |||
| d8ce890902 | |||
| b191ac7a6a | |||
| 356f7149c5 | |||
| a0dd21b79e | |||
| 08ce0ee46a | |||
| 7085e22448 | |||
| 74a31f9b8f | |||
| a38a56865f | |||
| 1a20e25a84 | |||
| 43ff5d2ca0 | |||
| 8080f5e2e5 | |||
| 4f870ccbf7 | |||
| e6364c637d | |||
| 28c0ac78ad | |||
| a642074d85 | |||
| e962caf1b9 | |||
| 8cad5e3aea | |||
| a2dfad7b69 | |||
| 15c2e1260a | |||
| 655511a02a | |||
| 0231ece31b | |||
| b64ddd03d1 | |||
| 853837477e | |||
| 4956504d17 | |||
| e4c8f743ae | |||
| df627138dc | |||
| a4e77a138a | |||
| 9a09f11631 | |||
| 783a1ce2b5 | |||
| c43f785ab0 | |||
| e1a18b62e2 | |||
| 3ae60f8e46 | |||
| 949505517c | |||
| ae9fd98dac | |||
| 70bc6af59f | |||
| 825322c576 | |||
| 58bd753fad | |||
| 904e609377 | |||
| d1b594a788 | |||
| 3bafbc6029 | |||
| 8d760dc264 | |||
| 4546846f06 | |||
| 62c46dc8bf | |||
| 9516e493bc | |||
| 9df1d56714 | |||
| 98e1055b7b | |||
| 436cce16c7 | |||
| ec6f30bbd8 | |||
| d356142bc4 | |||
| 00c9b0804b |
@@ -1,44 +1,22 @@
|
|||||||
* text=auto !eol
|
* text=auto !eol
|
||||||
/AUTHORS -text
|
/AUTHORS -text
|
||||||
/COPYRIGHT -text
|
/COPYING -text
|
||||||
/ChangeLog -text
|
/ChangeLog -text
|
||||||
/GNUmakefile.orig -text
|
/GNUmakefile.orig -text
|
||||||
|
/INSTALL -text
|
||||||
/Makefile.am -text
|
/Makefile.am -text
|
||||||
/Makefile.orig -text
|
/Makefile.orig -text
|
||||||
/NEWS -text
|
/NEWS -text
|
||||||
/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.ac -text
|
/configure.ac -text
|
||||||
/depcomp -text
|
/depcomp -text
|
||||||
doc/Building.html -text
|
|
||||||
doc/BuildingHDF5.html -text
|
|
||||||
doc/Downloading.html -text
|
|
||||||
doc/Doxyfile -text
|
doc/Doxyfile -text
|
||||||
doc/H5PartExpress.html -text
|
doc/H5X_File_Format.txt -text
|
||||||
doc/H5PartIDL.html -text
|
|
||||||
doc/H5PartParaview.html -text
|
|
||||||
doc/H5PartTools.html -text
|
|
||||||
doc/H5PartVisIt.html -text
|
|
||||||
doc/H5PartVisIt/cloud_visit.png -text
|
|
||||||
doc/H5PartVisIt/cloud_visit.s.png -text
|
|
||||||
doc/H5PartVisIt/cloud_visit_2D.png -text
|
|
||||||
doc/H5PartVisIt/cloud_visit_2D.s.png -text
|
|
||||||
doc/H5PartVisIt/visit_query1.png -text
|
|
||||||
doc/H5PartVisIt/visit_query1.s.png -text
|
|
||||||
doc/H5tools/H5tools.html -text
|
|
||||||
doc/H5tools/H5tools_files/snapshot1.jpg -text
|
|
||||||
doc/InternalLayout.html -text
|
|
||||||
doc/Makefile.am -text
|
doc/Makefile.am -text
|
||||||
doc/UsingC.html -text
|
|
||||||
doc/UsingF.html -text
|
|
||||||
doc/collision_6.png -text
|
|
||||||
doc/collision_6.s.png -text
|
|
||||||
doc/doxyfooter -text
|
doc/doxyfooter -text
|
||||||
doc/h5part.html -text
|
|
||||||
doc/layout.png -text
|
|
||||||
/install-sh -text
|
/install-sh -text
|
||||||
/license.txt -text
|
/license.txt -text
|
||||||
/missing -text
|
/missing -text
|
||||||
@@ -78,6 +56,7 @@ test/H5testFpar.f90 -text
|
|||||||
test/Makefile.am -text
|
test/Makefile.am -text
|
||||||
tools/Makefile.am -text
|
tools/Makefile.am -text
|
||||||
tools/README -text
|
tools/README -text
|
||||||
|
tools/h5ToVtk.cc -text
|
||||||
tools/h5pAttrib.cc -text
|
tools/h5pAttrib.cc -text
|
||||||
tools/h5pToGNUplot.cc -text
|
tools/h5pToGNUplot.cc -text
|
||||||
tools/homdynToH5p.cc -text
|
tools/homdynToH5p.cc -text
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ Benedikt Oswald (PSI)
|
|||||||
Wes Bethel (NERSC/LBNL)
|
Wes Bethel (NERSC/LBNL)
|
||||||
John Shalf (NERSC/LBNL)
|
John Shalf (NERSC/LBNL)
|
||||||
Cristina Siegerist (NERSC/LBNL)
|
Cristina Siegerist (NERSC/LBNL)
|
||||||
|
Mark Howison (NERSC/LBNL)
|
||||||
|
|
||||||
Please use h5part@lists.psi.ch for communicaion.
|
Please use h5part@lists.psi.ch for communicaion.
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
*** Copyright Notice ***
|
||||||
|
|
||||||
|
H5Part Copyright (c) 2006-2009, The Regents of the University of California,
|
||||||
|
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||||
|
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||||
|
Institut (Switzerland). All rights reserved.
|
||||||
|
|
||||||
|
If you have questions about your rights to use or distribute this
|
||||||
|
software, please contact Berkeley Lab's Technology Transfer Department
|
||||||
|
at TTD@lbl.gov referring to "H5Part (LBNL Ref CR-2255)"
|
||||||
|
|
||||||
|
NOTICE. This software was developed under partial funding from the U.S.
|
||||||
|
Department of Energy. As such, the U.S. Government has been granted for
|
||||||
|
itself and others acting on its behalf a paid-up, nonexclusive,
|
||||||
|
irrevocable, worldwide license in the Software to reproduce, prepare
|
||||||
|
derivative works, and perform publicly and display publicly. Beginning
|
||||||
|
five (5) years after the date permission to assert copyright is obtained
|
||||||
|
from the U.S. Department of Energy, and subject to any subsequent five
|
||||||
|
(5) year renewals, the U.S. Government is granted for itself and others
|
||||||
|
acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide
|
||||||
|
license in the Software to reproduce, prepare derivative works,
|
||||||
|
distribute copies to the public, perform publicly and display publicly,
|
||||||
|
and to permit others to do so.
|
||||||
|
|
||||||
|
|
||||||
|
*** License agreement ***
|
||||||
|
|
||||||
|
H5Part Copyright (c) 2006-2009, The Regents of the University of California,
|
||||||
|
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||||
|
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||||
|
Institut (Switzerland). All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
(1) Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
(2) Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
(3) Neither the name of the University of California, Lawrence Berkeley
|
||||||
|
National Laboratory, U.S. Dept. of Energy, Paul Scherrer Institut
|
||||||
|
(Switzerland) nor the names of its contributors may be used to endorse
|
||||||
|
or promote products derived from this software without specific prior
|
||||||
|
written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||||
|
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
You are under no obligation whatsoever to provide any bug fixes,
|
||||||
|
patches, or upgrades to the features, functionality or performance of
|
||||||
|
the source code ("Enhancements") to anyone; however, if you choose to
|
||||||
|
make your Enhancements available either publicly, or directly to
|
||||||
|
Lawrence Berkeley National Laboratory, without imposing a separate
|
||||||
|
written license agreement for such Enhancements, then you hereby grant
|
||||||
|
the following license: a non-exclusive, royalty-free perpetual license
|
||||||
|
to install, use, modify, prepare derivative works, incorporate into
|
||||||
|
other computer software, distribute, and sublicense such enhancements or
|
||||||
|
derivative works thereof, in binary and source code form.
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
*** Copyright Notice ***
|
|
||||||
|
|
||||||
H5Part Copyright (c) 2006, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) and the Paul Scherrer Institut (Switzerland). All rights reserved.
|
|
||||||
|
|
||||||
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Technology Transfer Department at TTD@lbl.gov referring to "H5Part (LBNL Ref CR-2255)"
|
|
||||||
|
|
||||||
NOTICE. This software was developed under partial funding from the U.S. Department of Energy. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright is obtained from the U.S. Department of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
2008-12-19 Mark Howison <mhowison@lbl.gov>
|
||||||
|
|
||||||
|
* Added support for HDF 1.8.1.
|
||||||
|
|
||||||
|
* Added float32 and int64 versions of the H5Block scalar field
|
||||||
|
read/write functions, using a new naming convention:
|
||||||
|
|
||||||
|
H5Block3dWriteScalarFieldFloat64() (was H5Block3dWriteScalarField())
|
||||||
|
H5Block3dWriteScalarFieldFloat32() (new)
|
||||||
|
H5Block3dWriteScalarFieldInt64() (new)
|
||||||
|
|
||||||
|
* Modified _write_data() in H5Block to write arbitrary data types.
|
||||||
|
|
||||||
|
* Fixed a bug in the configure script which was preventing
|
||||||
|
compilation of the FORTRAN library on Cray XT4 architectures.
|
||||||
|
|
||||||
|
* Added the "--with-mpiposix" option to the configure script to enable
|
||||||
|
the MPI-POSIX VFD in the HDF5 layer.
|
||||||
|
|
||||||
|
2008-11-20 Andreas Adelmann <andreas.adelmann@psi.ch>
|
||||||
|
|
||||||
|
* Fixed a bug in ./test/H5BlockTestAttributes.c
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,437 @@
|
|||||||
|
==============================================================================
|
||||||
|
README file for H5Part configure
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
+ 0. HDF5 library
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Make sure you have a working version of the HDF5 library installed. If you plan
|
||||||
|
to use parallel I/O you need to use a parallel HDF5 version. Source files and
|
||||||
|
installation instructions are available from the HDF5 website:
|
||||||
|
|
||||||
|
http://www.hdfgroup.org/HDF5/
|
||||||
|
|
||||||
|
|
||||||
|
+ 1. Quick start (If you feel lucky...)
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
For many platforms, where compilers are installed in the "default" location
|
||||||
|
and all the environment variables are set correctly, it should be sufficient
|
||||||
|
to type:
|
||||||
|
|
||||||
|
./configure [OPTIONS] && make [install]
|
||||||
|
|
||||||
|
to have the libraries and test program compiled.
|
||||||
|
|
||||||
|
|
||||||
|
+ 2. Configure line options
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
To view a full list of configure option, use:
|
||||||
|
|
||||||
|
./configure --help
|
||||||
|
|
||||||
|
(1) Enable options
|
||||||
|
--enable-fortran
|
||||||
|
--enable-parallel
|
||||||
|
--enable-tools
|
||||||
|
--enable-python
|
||||||
|
--enable-64 (only for AIX and Irix)
|
||||||
|
|
||||||
|
(2) Setting compilers related variables manually
|
||||||
|
To assign environment variables (e.g., CC, CFLAGS...), specify them as
|
||||||
|
VAR=VALUE before running configure. For example, if you are using the bash
|
||||||
|
shell, you might type:
|
||||||
|
|
||||||
|
export CC=gcc
|
||||||
|
|
||||||
|
to set the default C compiler. See below for descriptions of some useful
|
||||||
|
variables.
|
||||||
|
|
||||||
|
Compiler environment variables:
|
||||||
|
CC C compiler command
|
||||||
|
CXX C++ compiler command
|
||||||
|
FC Fortran compiler command
|
||||||
|
MPICC MPI-enabled C compiler command
|
||||||
|
MPICXX MPI-enabled C++ compiler command
|
||||||
|
MPIFC MPI-enabled Fortran compiler command
|
||||||
|
CFLAGS flags to append when invoking the C compiler
|
||||||
|
|
||||||
|
Library environment variables:
|
||||||
|
LDFLAGS flags to append when invoking the linker
|
||||||
|
|
||||||
|
(3) Setting prefix for installation manually (by default, the package will
|
||||||
|
install itself in the 'build' subdirectory of your source directory)
|
||||||
|
--prefix=PREFIX install files in PREFIX
|
||||||
|
|
||||||
|
|
||||||
|
+ 3. Platform specific settings for compiling libraries & test programs
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Building
|
||||||
|
make : builds the libraries and test programs
|
||||||
|
make install: builds and installs
|
||||||
|
make clean : removes extraneous object files
|
||||||
|
make distclean : returns configuration to unconfigured state
|
||||||
|
|
||||||
|
As tested on hosts:
|
||||||
|
|
||||||
|
(0) Franklin <franklin.nersc.gov> (CNL - Cray XT4)
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
module add hdf5_par
|
||||||
|
module add zlib
|
||||||
|
module add szip
|
||||||
|
export CC=cc CXX=CC FC=ftn MPICC=cc MPICXX=CC MPIFC=ftn
|
||||||
|
export LDFLAGS=$HDF5
|
||||||
|
./configure --enable-fortran --enable-parallel --with-hdf5path=$HDF5_PAR_DIR --with-mpiposix
|
||||||
|
make install
|
||||||
|
|
||||||
|
|
||||||
|
(1) Davinci <davinci.nersc.gov> (Linux"SUSE"-ia64)
|
||||||
|
---------------------------------------------------
|
||||||
|
FIRST THING FIRST!! Type:
|
||||||
|
|
||||||
|
module load intel
|
||||||
|
to have the proper compilers set up for use.
|
||||||
|
|
||||||
|
module load hdf5_par
|
||||||
|
|
||||||
|
[NOTE: module load hdf5 does not work at this moment.
|
||||||
|
Possible installation error of HDF5 on Davinci.]
|
||||||
|
|
||||||
|
|
||||||
|
Brief profile:
|
||||||
|
CC = icc
|
||||||
|
CXX = icc
|
||||||
|
FC = ifort
|
||||||
|
MPICC = icc
|
||||||
|
MPICXX = icc
|
||||||
|
MPIFC = ifort
|
||||||
|
|
||||||
|
If default doesn't work, try:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort ./configure && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort ./configure && make install
|
||||||
|
|
||||||
|
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
||||||
|
|
||||||
|
|
||||||
|
On this host, executing:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort ./configure --enable-fortran --enable-parallel && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort ./configure --enable-fortran --enable-parallel && make install
|
||||||
|
|
||||||
|
has functioned correctly.
|
||||||
|
|
||||||
|
|
||||||
|
To run test program, go to test directory:
|
||||||
|
|
||||||
|
(i) Serial test
|
||||||
|
run:
|
||||||
|
./H5testF
|
||||||
|
./H5PartTest
|
||||||
|
|
||||||
|
(ii) Parallel test
|
||||||
|
run:
|
||||||
|
mpirun 2 H5testFpar
|
||||||
|
mpirun 2 H5PartTestP
|
||||||
|
|
||||||
|
NOTE: Number 2 above is a arbitrary number that indicates the number of processes.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(2) Jacquard <jacquard.nersc.gov> (Linux"SUSE"-x86_64)
|
||||||
|
-------------------------------------------------------
|
||||||
|
Brief profile:
|
||||||
|
CC = pathcc
|
||||||
|
CXX = pathCC
|
||||||
|
FC = pathf90
|
||||||
|
MPICC = mpicc
|
||||||
|
MPICXX = mpicxx
|
||||||
|
MPIFC = mpif90
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If default doesn't work, try:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90 ./configure && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90 ./configure && make install
|
||||||
|
|
||||||
|
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
On this host, executing:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90 ./configure --enable-fortran --enable-parallel && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90 ./configure --enable-fortran --enable-parallel && make install
|
||||||
|
|
||||||
|
has functioned correctly.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To run test program, go to test directory:
|
||||||
|
|
||||||
|
(i) Serial test
|
||||||
|
run:
|
||||||
|
./H5testF
|
||||||
|
./H5PartTest
|
||||||
|
|
||||||
|
(ii) Parallel test
|
||||||
|
In Jacquard, we need a script to run parallel programs, since Jacquard does not support interactive parallel processing. Instead, we need to submit the task to a queue. A sample script (run_H5testFpar.scr) may look like below:
|
||||||
|
|
||||||
|
+++++++++++++++++++++++++++++++++++++++
|
||||||
|
#!/bin/csh
|
||||||
|
#PBS -l nodes=1:ppn=2,walltime=00:05:00
|
||||||
|
#PBS -N H5testFpar
|
||||||
|
#PBS -o H5testFpar.out
|
||||||
|
#PBS -e H5testFpar.err
|
||||||
|
#PBS -q debug
|
||||||
|
#PBS -A mpccc
|
||||||
|
#PBS -V
|
||||||
|
|
||||||
|
setenv PBS_OWORKDIR /home/H5Part/test
|
||||||
|
|
||||||
|
cd $PBS_O_WORKDIR
|
||||||
|
mpirun -np 2 ./H5testFpar
|
||||||
|
+++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
Then, we need to submit the task to a queue by running:
|
||||||
|
|
||||||
|
qsub run_H5testFpar.scr
|
||||||
|
|
||||||
|
After processed, the result will appear in H5testFpar.out, and error messages will appear in H5testFpar.err.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(3) Bassi <bassi.nersc.ogv> (AIX5.3.0.0-Power 3)
|
||||||
|
-------------------------------------------------
|
||||||
|
FIRST THING FIRST!! Type:
|
||||||
|
|
||||||
|
module load gcc
|
||||||
|
|
||||||
|
to have the proper compilers set up for use.
|
||||||
|
|
||||||
|
Brief profile:
|
||||||
|
CC = cc_r
|
||||||
|
CXX = cc_r
|
||||||
|
FC = xlf_r
|
||||||
|
MPICC = mpcc_r
|
||||||
|
MPICXX = mpcc_r
|
||||||
|
MPIFC = mpxlf_r
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If default doesn't work, try:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r ./configure && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r ./configure && make install
|
||||||
|
|
||||||
|
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
On this host, executing:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r ./configure --enable-fortran --enable-parallel && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r ./configure --enable-fortran --enable-parallel && make install
|
||||||
|
|
||||||
|
has functioned correctly.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To run test program, go to test directory:
|
||||||
|
|
||||||
|
(i) Serial test
|
||||||
|
run:
|
||||||
|
./H5testF
|
||||||
|
./H5PartTest
|
||||||
|
|
||||||
|
(ii) Parallel test
|
||||||
|
run:
|
||||||
|
unsetenv MP_SINGLE_THREAD
|
||||||
|
poe ./H5PartTestP -procs 2 -nodes 1
|
||||||
|
poe ./H5testFpar -procs 2 -nodes 1
|
||||||
|
|
||||||
|
For more details on how to run parallel programs on Bassi, go to:
|
||||||
|
|
||||||
|
http://www.nersc.gov/nusers/resources/bassi/running_jobs/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(4) Starsky <starsky.lbl.gov> (Darwin8.5.0-PowerPC)
|
||||||
|
----------------------------------------------------
|
||||||
|
FIRST THING FIRST!! Set environment variables: (in tcsh)
|
||||||
|
|
||||||
|
setenv LD_LIBRARY_PATH /usr/local/g95/lib/gcc-lib/powerpc-apple-darwin8.5.0/4.0.3/
|
||||||
|
setenv PATH ${PATH}:/usr/local/g95/bin
|
||||||
|
|
||||||
|
NOTE: This environment variable setting is specifit to Starsky. It is to make configure find the fortran compiler.
|
||||||
|
|
||||||
|
Brief profile:
|
||||||
|
CC = gcc
|
||||||
|
CXX = g++
|
||||||
|
FC = g95
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If default doesn't work, try:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=gcc CXX=g++ FC=g95 ./configure && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=gcc CXX=g++ FC=g95 ./configure && make install
|
||||||
|
|
||||||
|
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
On this host, executing:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=gcc CXX=g++ FC=g95 ./configure --enable-fortran && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=gcc CXX=g++ FC=g95 ./configure --enable-fortran && make install
|
||||||
|
|
||||||
|
has functioned correctly.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To run test program, go to test directory:
|
||||||
|
|
||||||
|
(i) Serial test
|
||||||
|
run:
|
||||||
|
./H5testF
|
||||||
|
./H5PartTest
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(5) Linux AMD64 Visualization group workstations (Linux"SUSE"-x86_64)
|
||||||
|
---------------------------------------------------------
|
||||||
|
Brief profile:
|
||||||
|
CC = gcc
|
||||||
|
CXX = g++
|
||||||
|
FC = g95
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If default doesn't work, try:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=gcc CXX=g++ FC=g95 ./configure && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=gcc CXX=g++ FC=g95 ./configure && make install
|
||||||
|
|
||||||
|
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
On this host, executing:
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
env CC=gcc CXX=g++ FC=g95 ./configure --enable-fortran && make install
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
CC=gcc CXX=g++ FC=g95 ./configure --enable-fortran && make install
|
||||||
|
|
||||||
|
has functioned correctly.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To run test program, go to test directory:
|
||||||
|
|
||||||
|
(i) Serial test
|
||||||
|
run:
|
||||||
|
./H5testF
|
||||||
|
./H5PartTest
|
||||||
|
|
||||||
|
|
||||||
|
(6) Cray XT3 @ CSCS gele
|
||||||
|
|
||||||
|
1) modules/3.1.6 9) PrgEnv-pgi/1.4.26 17) xt-lustre-ss/1.4.26
|
||||||
|
2) MySQL/4.0.26 10) xt-pbs/5.3.4 18) Base-opts/1.4.26
|
||||||
|
3) acml/3.0 11) xt-service/1.4.26 19) subversion/1.3.2
|
||||||
|
4) pgi/6.1.4 12) xt-libc/1.4.26 20) zlib/1.2.3
|
||||||
|
5) totalview/7.2.0 13) xt-os/1.4.26 21) szip/2.0
|
||||||
|
6) xt-libsci/1.4.26 14) xt-catamount/1.4.26 22) hdf5/1.6.5
|
||||||
|
7) xt-mpt/1.4.26 15) xt-boot/1.4.26
|
||||||
|
8) xt-pe/1.4.26 16) xt-crms/1.4.26
|
||||||
|
|
||||||
|
|
||||||
|
CFLAGS="-I$H5HOME/include -DF77_SINGLE_UNDERSCORE" LDFLAGS="-L$H5HOME/lib -L$ZHOME/lib" ./configure --enable-parallel --enable-fortran
|
||||||
|
|
||||||
|
|
||||||
|
(7) merlin00 / merlin3
|
||||||
|
|
||||||
|
Currently Loaded Modulefiles:
|
||||||
|
1) hdf5/hdf5-1.6.5 2) root/root-5.10.00 3) mpi/mpich2-1.0.3-pgi-6.1 4) pgi/pgi_64-6.1
|
||||||
|
|
||||||
|
FC=mpif90 ./configure --enable-parallel --enable-fortran
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
+ 4. Trouble shooting (Things to check for...)
|
||||||
|
--------------------------------------------
|
||||||
|
(0) Have you set the LD_LIBRARY_PATH?
|
||||||
|
---Some systems require the user to manually set the environment variable, LD_LIBRARY_PATH. To do so:
|
||||||
|
|
||||||
|
set the environment variable HDF5ROOT or PHDF5ROOT to point to your installation of HDF5 (serial and/or parallel respectively).
|
||||||
|
|
||||||
|
For Korn or Bourne shell:
|
||||||
|
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HDF5ROOT}/lib;export LD_LIBRARY_PATH
|
||||||
|
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:{PHDF5ROOT}/lib;export LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
For C shell:
|
||||||
|
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${HDF5ROOT}/lib
|
||||||
|
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${PHDF5ROOT}/lib
|
||||||
|
|
||||||
|
Note that the values of HDF5ROOT & PHDF5ROOT will be in the "summary" section when you run configure.
|
||||||
|
|
||||||
|
Not properly set LD_LIBRARY_PATH value may result in a runtime error:
|
||||||
|
|
||||||
|
./H5PartTest: error while loading shared libraries: libhdf5.so.0: cannot open shared object file: No such file or directory
|
||||||
|
|
||||||
|
(1) Are the compilers set correctly?
|
||||||
|
---Check with: which COMPILER
|
||||||
|
|
||||||
|
(2) Have you installed HDF5?
|
||||||
|
---You can get it at: http://vis.lbl.gov/Research/AcceleratorSAPP/index.html
|
||||||
|
|
||||||
|
(3) Have you loaded the proper modules?
|
||||||
|
---It is necessary in Davinci & Bassi, and configure && make install may not work without it.
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +1,21 @@
|
|||||||
|
VERSION 1.4.1
|
||||||
|
*************
|
||||||
|
|
||||||
|
* Added support for HDF 1.8.1.
|
||||||
|
|
||||||
|
* Added float32 and int64 versions of the H5Block scalar field
|
||||||
|
read/write functions, using a new naming convention:
|
||||||
|
|
||||||
|
H5Block3dWriteScalarFieldFloat64() (was H5Block3dWriteScalarField())
|
||||||
|
H5Block3dWriteScalarFieldFloat32() (new)
|
||||||
|
H5Block3dWriteScalarFieldInt64() (new)
|
||||||
|
|
||||||
|
The old functions still exist, but may be removed in the future.
|
||||||
|
|
||||||
|
|
||||||
|
VERSION 1.4.0
|
||||||
|
*************
|
||||||
|
|
||||||
Error Handling
|
Error Handling
|
||||||
--------------
|
--------------
|
||||||
Now all functions, in which an error could occure, are returning a
|
Now all functions, in which an error could occure, are returning a
|
||||||
|
|||||||
@@ -1,418 +1,57 @@
|
|||||||
==============================================================================
|
For more information on using the H5Part API, see the H5Part website:
|
||||||
README file for H5Part configure
|
|
||||||
==============================================================================
|
http://www-vis.lbl.gov/Research/AcceleratorSAPP/
|
||||||
|
|
||||||
+ 0. HDF5 library
|
|
||||||
-----------------
|
Motivation
|
||||||
|
----------
|
||||||
Make sure you have a working version of the HDF5 library in your computer. If you plan
|
|
||||||
to use parallel I/O you need to use a parallel HDF5 version. If you don't have the
|
Particle based simulations of accelerator beam-lines, especially in six
|
||||||
library download the sources from http://hdf.ncsa.uiuc.edu/HDF5/
|
dimensional phase space, generate vast amounts of data. Even though a subset
|
||||||
|
of statistical information regarding phase space or analysis needs to be
|
||||||
+ 1. Quick start (If you feel lucky...)
|
preserved, reading and writing such enormous restart files on massively
|
||||||
----------------------------------------
|
parallel supercomputing systems remains challenging.
|
||||||
|
|
||||||
For many platforms, where compilers are installed in the "default" location
|
H5Part is a very simple data storage schema and provides an API that
|
||||||
and all the environment variables are set correctly, it should be sufficient
|
simplifies the reading/writing of the data to the HDF5 file format. An
|
||||||
to type:
|
important foundation for a stable visualization and data analysis environment
|
||||||
|
is a stable and portable file storage format and its associated APIs. The
|
||||||
./configure [OPTIONS] && make [install]
|
presence of a "common file storage format," including associated APIs, will
|
||||||
|
help foster a fundamental level of interoperability across the project's
|
||||||
to have the libraries and test program compiled.
|
software infrastructure. It will also help ensure that key data analysis
|
||||||
|
capabilities are present during the earliest phases of the software development
|
||||||
|
effort.
|
||||||
==============================================================================
|
|
||||||
|
H5Part is built on top of the HDF5 (Hierarchical Data Format) library. HDF5
|
||||||
|
offers a self-describing machine-independent binary file format that supports
|
||||||
+ 2. configure line options
|
scalable parallel I/O performance for MPI codes on a variety of supercomputing
|
||||||
----------------------------
|
systems, and works equally well on laptop computers. The API is available for
|
||||||
|
C, C++, and Fortran codes. The H5Part file format and APIs enable disparate
|
||||||
(1) Enable options
|
research groups with different simulation implementations to transparently
|
||||||
--enable-fortran
|
share datasets and data analysis tools. For instance, the common file format
|
||||||
--enable-parallel
|
will enable groups that depend on completely different simulation
|
||||||
--enable-tools
|
implementations to share data analysis tools.
|
||||||
--enable-python
|
|
||||||
--enable-64 (only for AIX and Irix)
|
|
||||||
|
File Organization and API
|
||||||
(2) Setting compilers related variables manually
|
-------------------------
|
||||||
To assign environment variables (e.g., CC, CFLAGS...), specify them as
|
|
||||||
VAR=VALUE. See below for descriptions of some of the useful variables.
|
The proposed file storage format uses HDF5 for the lowlevel file storage and a
|
||||||
|
simple API to provide a high-level interface to that file format. A programmer
|
||||||
Compiler environment variables:
|
can either use the H5Part API to access the data files or write directly to the
|
||||||
CC C compiler command
|
file format using some simple conventions for organizing and naming the objects
|
||||||
CXX C++ compiler command
|
stored in the file.
|
||||||
FC Fortran compiler command
|
|
||||||
|
In order to store Particle Data in the HDF5 file format, we have formalized the
|
||||||
(3) Setting prefix for installation manually
|
hierarchical arrangement of the datasets and naming conventions for the groups
|
||||||
--prefix=PREFIX install files in PREFIX
|
and associated datasets. The sample H5Part API formally encodes these
|
||||||
|
conventions in order to provide a simple and uniform way to access these files
|
||||||
|
from C, C++, and Fortran codes. The API makes it easier to write very portable
|
||||||
For more information, type:
|
data adaptors for visualization tools in order to expand the number of tools
|
||||||
|
available to access the data. Even so, anyone can use the HDF5 h5ls utility to
|
||||||
./configure --help
|
examine the organization of the H5Part files and even write their own
|
||||||
|
HDF5-based interface for reading and writing the file format. The standards
|
||||||
|
offered by the sample API are completely independent of the standard for
|
||||||
==============================================================================
|
organizing data within the file.The file format supports the storage of
|
||||||
|
multiple timesteps of datasets that contain multiple fields.
|
||||||
|
|
||||||
+ 3. Platform specific settings for compiling libraries & test programs
|
|
||||||
------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Building
|
|
||||||
make : builds the libraries and test programs
|
|
||||||
make install: builds and installs
|
|
||||||
make clean : removes extraneous object files
|
|
||||||
make distclean : returns configuration to unconfigured state
|
|
||||||
|
|
||||||
As tested on hosts:
|
|
||||||
|
|
||||||
(1) Davinci <davinci.nersc.gov> (Linux"SUSE"-ia64)
|
|
||||||
---------------------------------------------------
|
|
||||||
FIRST THING FIRST!! Type:
|
|
||||||
|
|
||||||
module load intel
|
|
||||||
to have the proper compilers set up for use.
|
|
||||||
|
|
||||||
module load hdf5_par
|
|
||||||
|
|
||||||
[NOTE: module load hdf5 does not work at this moment.
|
|
||||||
Possible installation error of HDF5 on Davinci.]
|
|
||||||
|
|
||||||
|
|
||||||
Brief profile:
|
|
||||||
CC = icc
|
|
||||||
CXX = icc
|
|
||||||
FC = ifort
|
|
||||||
MPICC = icc
|
|
||||||
MPICXX = icc
|
|
||||||
MPIFC = ifort
|
|
||||||
|
|
||||||
If default doesn't work, try:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort ./configure && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort ./configure && make install
|
|
||||||
|
|
||||||
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
|
||||||
|
|
||||||
|
|
||||||
On this host, executing:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort ./configure --enable-fortran --enable-parallel && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort ./configure --enable-fortran --enable-parallel && make install
|
|
||||||
|
|
||||||
has functioned correctly.
|
|
||||||
|
|
||||||
|
|
||||||
To run test program, go to test directory:
|
|
||||||
|
|
||||||
(i) Serial test
|
|
||||||
run:
|
|
||||||
./H5testF
|
|
||||||
./H5PartTest
|
|
||||||
|
|
||||||
(ii) Parallel test
|
|
||||||
run:
|
|
||||||
mpirun 2 H5testFpar
|
|
||||||
mpirun 2 H5PartTestP
|
|
||||||
|
|
||||||
NOTE: Number 2 above is a arbitrary number that indicates the number of processes.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(2) Jacquard <jacquard.nersc.gov> (Linux"SUSE"-x86_64)
|
|
||||||
-------------------------------------------------------
|
|
||||||
Brief profile:
|
|
||||||
CC = pathcc
|
|
||||||
CXX = pathCC
|
|
||||||
FC = pathf90
|
|
||||||
MPICC = mpicc
|
|
||||||
MPICXX = mpicxx
|
|
||||||
MPIFC = mpif90
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If default doesn't work, try:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90 ./configure && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90 ./configure && make install
|
|
||||||
|
|
||||||
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
On this host, executing:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90 ./configure --enable-fortran --enable-parallel && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90 ./configure --enable-fortran --enable-parallel && make install
|
|
||||||
|
|
||||||
has functioned correctly.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
To run test program, go to test directory:
|
|
||||||
|
|
||||||
(i) Serial test
|
|
||||||
run:
|
|
||||||
./H5testF
|
|
||||||
./H5PartTest
|
|
||||||
|
|
||||||
(ii) Parallel test
|
|
||||||
In Jacquard, we need a script to run parallel programs, since Jacquard does not support interactive parallel processing. Instead, we need to submit the task to a queue. A sample script (run_H5testFpar.scr) may look like below:
|
|
||||||
|
|
||||||
+++++++++++++++++++++++++++++++++++++++
|
|
||||||
#!/bin/csh
|
|
||||||
#PBS -l nodes=1:ppn=2,walltime=00:05:00
|
|
||||||
#PBS -N H5testFpar
|
|
||||||
#PBS -o H5testFpar.out
|
|
||||||
#PBS -e H5testFpar.err
|
|
||||||
#PBS -q debug
|
|
||||||
#PBS -A mpccc
|
|
||||||
#PBS -V
|
|
||||||
|
|
||||||
setenv PBS_OWORKDIR /home/H5Part/test
|
|
||||||
|
|
||||||
cd $PBS_O_WORKDIR
|
|
||||||
mpirun -np 2 ./H5testFpar
|
|
||||||
+++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
Then, we need to submit the task to a queue by running:
|
|
||||||
|
|
||||||
qsub run_H5testFpar.scr
|
|
||||||
|
|
||||||
After processed, the result will appear in H5testFpar.out, and error messages will appear in H5testFpar.err.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(3) Bassi <bassi.nersc.ogv> (AIX5.3.0.0-Power 3)
|
|
||||||
-------------------------------------------------
|
|
||||||
FIRST THING FIRST!! Type:
|
|
||||||
|
|
||||||
module load gcc
|
|
||||||
|
|
||||||
to have the proper compilers set up for use.
|
|
||||||
|
|
||||||
Brief profile:
|
|
||||||
CC = cc_r
|
|
||||||
CXX = cc_r
|
|
||||||
FC = xlf_r
|
|
||||||
MPICC = mpcc_r
|
|
||||||
MPICXX = mpcc_r
|
|
||||||
MPIFC = mpxlf_r
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If default doesn't work, try:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r ./configure && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r ./configure && make install
|
|
||||||
|
|
||||||
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
On this host, executing:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r ./configure --enable-fortran --enable-parallel && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r ./configure --enable-fortran --enable-parallel && make install
|
|
||||||
|
|
||||||
has functioned correctly.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
To run test program, go to test directory:
|
|
||||||
|
|
||||||
(i) Serial test
|
|
||||||
run:
|
|
||||||
./H5testF
|
|
||||||
./H5PartTest
|
|
||||||
|
|
||||||
(ii) Parallel test
|
|
||||||
run:
|
|
||||||
unsetenv MP_SINGLE_THREAD
|
|
||||||
poe ./H5PartTestP -procs 2 -nodes 1
|
|
||||||
poe ./H5testFpar -procs 2 -nodes 1
|
|
||||||
|
|
||||||
For more details on how to run parallel programs on Bassi, go to:
|
|
||||||
|
|
||||||
http://www.nersc.gov/nusers/resources/bassi/running_jobs/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(4) Starsky <starsky.lbl.gov> (Darwin8.5.0-PowerPC)
|
|
||||||
----------------------------------------------------
|
|
||||||
FIRST THING FIRST!! Set environment variables: (in tcsh)
|
|
||||||
|
|
||||||
setenv LD_LIBRARY_PATH /usr/local/g95/lib/gcc-lib/powerpc-apple-darwin8.5.0/4.0.3/
|
|
||||||
setenv PATH ${PATH}:/usr/local/g95/bin
|
|
||||||
|
|
||||||
NOTE: This environment variable setting is specifit to Starsky. It is to make configure find the fortran compiler.
|
|
||||||
|
|
||||||
Brief profile:
|
|
||||||
CC = gcc
|
|
||||||
CXX = g++
|
|
||||||
FC = g95
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If default doesn't work, try:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=gcc CXX=g++ FC=g95 ./configure && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=gcc CXX=g++ FC=g95 ./configure && make install
|
|
||||||
|
|
||||||
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
On this host, executing:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=gcc CXX=g++ FC=g95 ./configure --enable-fortran && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=gcc CXX=g++ FC=g95 ./configure --enable-fortran && make install
|
|
||||||
|
|
||||||
has functioned correctly.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
To run test program, go to test directory:
|
|
||||||
|
|
||||||
(i) Serial test
|
|
||||||
run:
|
|
||||||
./H5testF
|
|
||||||
./H5PartTest
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(5) Linux AMD64 Visualization group workstations (Linux"SUSE"-x86_64)
|
|
||||||
---------------------------------------------------------
|
|
||||||
Brief profile:
|
|
||||||
CC = gcc
|
|
||||||
CXX = g++
|
|
||||||
FC = g95
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If default doesn't work, try:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=gcc CXX=g++ FC=g95 ./configure && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=gcc CXX=g++ FC=g95 ./configure && make install
|
|
||||||
|
|
||||||
And, of course, you should add configure options, such as --enable-fortran --enable-parallel.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
On this host, executing:
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
env CC=gcc CXX=g++ FC=g95 ./configure --enable-fortran && make install
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
CC=gcc CXX=g++ FC=g95 ./configure --enable-fortran && make install
|
|
||||||
|
|
||||||
has functioned correctly.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
To run test program, go to test directory:
|
|
||||||
|
|
||||||
(i) Serial test
|
|
||||||
run:
|
|
||||||
./H5testF
|
|
||||||
./H5PartTest
|
|
||||||
|
|
||||||
|
|
||||||
(6) Cray XT3 @ CSCS gele
|
|
||||||
|
|
||||||
1) modules/3.1.6 9) PrgEnv-pgi/1.4.26 17) xt-lustre-ss/1.4.26
|
|
||||||
2) MySQL/4.0.26 10) xt-pbs/5.3.4 18) Base-opts/1.4.26
|
|
||||||
3) acml/3.0 11) xt-service/1.4.26 19) subversion/1.3.2
|
|
||||||
4) pgi/6.1.4 12) xt-libc/1.4.26 20) zlib/1.2.3
|
|
||||||
5) totalview/7.2.0 13) xt-os/1.4.26 21) szip/2.0
|
|
||||||
6) xt-libsci/1.4.26 14) xt-catamount/1.4.26 22) hdf5/1.6.5
|
|
||||||
7) xt-mpt/1.4.26 15) xt-boot/1.4.26
|
|
||||||
8) xt-pe/1.4.26 16) xt-crms/1.4.26
|
|
||||||
|
|
||||||
|
|
||||||
CFLAGS="-I$H5HOME/include -DF77_SINGLE_UNDERSCORE" LDFLAGS="-L$H5HOME/lib -L$ZHOME/lib" ./configure --enable-parallel --enable-fortran
|
|
||||||
|
|
||||||
|
|
||||||
(7) merlin00 / merlin3
|
|
||||||
|
|
||||||
Currently Loaded Modulefiles:
|
|
||||||
1) hdf5/hdf5-1.6.5 2) root/root-5.10.00 3) mpi/mpich2-1.0.3-pgi-6.1 4) pgi/pgi_64-6.1
|
|
||||||
|
|
||||||
FC=mpif90 ./configure --enable-parallel --enable-fortran
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
+ 4. Trouble shooting (Things to check for...)
|
|
||||||
--------------------------------------------
|
|
||||||
(0) Have you set the LD_LIBRARY_PATH?
|
|
||||||
---Some systems require the user to manually set the environment variable, LD_LIBRARY_PATH. To do so:
|
|
||||||
|
|
||||||
set the environment variable HDF5ROOT or PHDF5ROOT to point to your installation of HDF5 (serial and/or parallel respectively).
|
|
||||||
|
|
||||||
For Korn or Bourne shell:
|
|
||||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HDF5ROOT}/lib;export LD_LIBRARY_PATH
|
|
||||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:{PHDF5ROOT}/lib;export LD_LIBRARY_PATH
|
|
||||||
|
|
||||||
For C shell:
|
|
||||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${HDF5ROOT}/lib
|
|
||||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${PHDF5ROOT}/lib
|
|
||||||
|
|
||||||
Note that the values of HDF5ROOT & PHDF5ROOT will be in the "summary" section when you run configure.
|
|
||||||
|
|
||||||
Not properly set LD_LIBRARY_PATH value may result in a runtime error:
|
|
||||||
|
|
||||||
./H5PartTest: error while loading shared libraries: libhdf5.so.0: cannot open shared object file: No such file or directory
|
|
||||||
|
|
||||||
(1) Are the compilers set correctly?
|
|
||||||
---Check with: which COMPILER
|
|
||||||
|
|
||||||
(2) Have you installed HDF5?
|
|
||||||
---You can get it at: http://vis.lbl.gov/Research/AcceleratorSAPP/index.html
|
|
||||||
|
|
||||||
(3) Have you loaded the proper modules?
|
|
||||||
---It is necessary in Davinci & Bassi, and configure && make install may not work without it.
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* "" */
|
|
||||||
#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
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
||||||
|
|
||||||
/* Define to 1 if on AIX 3.
|
|
||||||
System headers sometimes define this.
|
|
||||||
We just want to avoid a redefinition error message. */
|
|
||||||
#ifndef _ALL_SOURCE
|
|
||||||
# undef _ALL_SOURCE
|
|
||||||
#endif
|
|
||||||
@@ -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.3.2], [vis@hpcrdm.lbl.gov], H5Part)
|
AC_INIT([H5Part], [1.4.1], [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.
|
||||||
@@ -54,6 +54,13 @@ AC_ARG_WITH(
|
|||||||
[path to HDF5 installation [default=""]])],
|
[path to HDF5 installation [default=""]])],
|
||||||
[HDF5PATH=$withval], [HDF5PATH=""])
|
[HDF5PATH=$withval], [HDF5PATH=""])
|
||||||
|
|
||||||
|
AC_ARG_WITH(
|
||||||
|
[mpiposix],
|
||||||
|
[AC_HELP_STRING([--with-mpiposix],
|
||||||
|
[enable MPI-POSIX VFD in HDF5 [default=no]])],
|
||||||
|
[USE_MPIPOSIX=$enableval])
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
################# A SIMPLE WORK AROUND TO USE ENV. VARS #######################
|
################# A SIMPLE WORK AROUND TO USE ENV. VARS #######################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -85,35 +92,26 @@ SAVE_LDFLAGS=$LDFLAGS
|
|||||||
# @enddesc
|
# @enddesc
|
||||||
#@@*/
|
#@@*/
|
||||||
|
|
||||||
PATH_Search()
|
PATH_Search() {
|
||||||
{
|
|
||||||
eval $1=""
|
eval $1=""
|
||||||
if test $# -lt 4 ; then
|
if test $# -lt 4 ; then
|
||||||
h5part_basedir=""
|
h5part_basedir=""
|
||||||
else
|
else
|
||||||
h5part_basedir="$4/"
|
h5part_basedir="$4/"
|
||||||
fi
|
fi
|
||||||
for h5part_place in $2
|
for h5part_place in $2; do
|
||||||
do
|
AC_MSG_CHECKING([looking in $h5part_place ... ])
|
||||||
echo -n "looking in $h5part_place ... $ac_c" #1>&6
|
|
||||||
if test -r "$h5part_basedir$h5part_place/$3" ; then
|
if test -r "$h5part_basedir$h5part_place/$3" ; then
|
||||||
echo "$ac_t"" found" #1>&6
|
AC_MSG_RESULT([found])
|
||||||
eval $1="$h5part_place"
|
eval $1="$h5part_place"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if test -d "$h5part_basedir$h5part_place/$3" ; then
|
AC_MSG_RESULT([no])
|
||||||
echo "$ac_t"" found" #1>&6
|
|
||||||
eval $1="$h5part_place"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
echo "$ac_t"" no" #1>&6
|
|
||||||
done
|
done
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
############# MISC SETTINGS INCLUDING C & C++ COMPILER SETTING ################
|
############# MISC SETTINGS INCLUDING C & C++ COMPILER SETTING ################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -133,26 +131,6 @@ if test $uname = "AIX"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# DAVINCI SPECIFIC!!!
|
|
||||||
if test `uname -n` = "davinci"; then
|
|
||||||
echo "DAVINCI SPECIFIC TESTING FOR STDC++ LIBRARY!"
|
|
||||||
PATH_Search STDCXX_CHECK '/usr/lib64 /usr/lib' libstdc++.a
|
|
||||||
|
|
||||||
# if STDCXX_CHECK is set...
|
|
||||||
if test "$STDCXX_CHECK" = "/usr/lib64"; then
|
|
||||||
echo "STDCXX setting ..."
|
|
||||||
echo "STDCXX_CHECK = $STDCXX_CHECK ..."
|
|
||||||
STDCXX="-L/usr/lib64 -lstdc++"
|
|
||||||
echo "STDCXX = $STDCXX ..."
|
|
||||||
elif test "$STDCXX_CHECK" = "/usr/lib"; then
|
|
||||||
echo "STDCXX setting ..."
|
|
||||||
echo "STDCXX_CHECK = $STDCXX_CHECK ..."
|
|
||||||
STDCXX="-L/usr/lib -lstdc++"
|
|
||||||
echo "STDCXX = $STDCXX ..."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Determine a C compiler to use.
|
# Determine a C compiler to use.
|
||||||
# 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.
|
||||||
@@ -165,9 +143,9 @@ AC_PATH_PROGS([BAS_CC], [cc_r], [], [$PATH])
|
|||||||
|
|
||||||
# if BAS_CC not empty
|
# if BAS_CC not empty
|
||||||
if test -n "$BAS_CC"; then
|
if test -n "$BAS_CC"; then
|
||||||
echo "CC setting for Bassi ..."
|
AC_MSG_CHECKING([CC setting for Bassi])
|
||||||
CC=$BAS_CC
|
CC=$BAS_CC
|
||||||
echo "CC = $CC ..."
|
AC_MSG_RESULT([CC = $CC])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -181,6 +159,16 @@ fi
|
|||||||
AC_PROG_CXX(pathCC icc cc_r g++ gcc cc)
|
AC_PROG_CXX(pathCC icc cc_r g++ gcc cc)
|
||||||
|
|
||||||
|
|
||||||
|
# DAVINCI SPECIFIC!!!
|
||||||
|
AC_MSG_CHECKING([for icc linker -lstdc++ flag])
|
||||||
|
if test ${CXX} = "icc"; then
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
STDCXX="-lstdc++"
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# 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,
|
||||||
# if one is found in the current PATH.
|
# if one is found in the current PATH.
|
||||||
# Otherwise, set INSTALL to `dir/install-sh -c`
|
# Otherwise, set INSTALL to `dir/install-sh -c`
|
||||||
@@ -245,14 +233,23 @@ if test "X$USE_FORTRAN" = "Xyes"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test ! $uname = "AIX"; then
|
if test ! $uname = "AIX"; then
|
||||||
FFLAGS="${FFLAGS} -fPIC -fno-second-underscore"
|
FFLAGS="${FFLAGS} -fPIC"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $FC = "g90"; then
|
||||||
|
FFLAGS="${FFLAGS} -fno-second-underscore"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $FC = "g95"; then
|
||||||
|
FFLAGS="${FFLAGS} -fno-second-underscore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([symbol convention in object files])
|
AC_MSG_CHECKING([symbol convention in object files])
|
||||||
`cd src && rm -f TestUnderscore.o TestUnderscoreC.o TestUnderscore`
|
`cd src && rm -f TestUnderscore.o TestUnderscoreC.o TestUnderscore`
|
||||||
`cd src && ${FC} ${FFLAGS} -c TestUnderscore.f`
|
`cd src && ${FC} ${FFLAGS} -c TestUnderscore.f`
|
||||||
`cd src && ${CC} ${CFLAGS} -c TestUnderscoreC.c`
|
`cd src && ${CC} ${CFLAGS} -c TestUnderscoreC.c`
|
||||||
`cd src && ${FC} ${FFLAGS} -o TestUnderscore TestUnderscore.o TestUnderscoreC.o -lc`
|
# `cd src && ${FC} ${FFLAGS} -o TestUnderscore TestUnderscore.o TestUnderscoreC.o -lc`
|
||||||
|
`cd src && ${FC} ${FFLAGS} -o TestUnderscore TestUnderscore.o TestUnderscoreC.o`
|
||||||
|
|
||||||
if test -f src/TestUnderscore ; then
|
if test -f src/TestUnderscore ; then
|
||||||
UNDERSCORE_H=Underscore.h
|
UNDERSCORE_H=Underscore.h
|
||||||
@@ -280,7 +277,11 @@ if test "X$USE_PARALLEL" = "Xyes"; then
|
|||||||
MPI_Comm comm;
|
MPI_Comm comm;
|
||||||
int n;
|
int n;
|
||||||
MPI_Comm_size( comm, &n ); ],
|
MPI_Comm_size( comm, &n ); ],
|
||||||
[echo 'yes'; r='yes'], [echo "no"; r='no'] )
|
[AC_MSG_RESULT([yes]); r='yes'], [AC_MSG_RESULT([no]); r='no'] )
|
||||||
|
|
||||||
|
if test "X$USE_MPIPOSIX" = "Xyes"; then
|
||||||
|
CFLAGS="${CFLAGS} -DH5PART_MPIPOSIX"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "X$r" = "Xno"; then
|
if test "X$r" = "Xno"; then
|
||||||
AC_PATH_PROGS([MPICC], [mpicc mpcc_r], [], [$PATH])
|
AC_PATH_PROGS([MPICC], [mpicc mpcc_r], [], [$PATH])
|
||||||
@@ -366,7 +367,7 @@ if test "X$USE_PARALLEL" = "Xyes"; then
|
|||||||
if test ! -n "$MPIFC"; then
|
if test ! -n "$MPIFC"; then
|
||||||
AC_MSG_CHECKING([ No MPIFC detected. Setting MPIFC to FC.])
|
AC_MSG_CHECKING([ No MPIFC detected. Setting MPIFC to FC.])
|
||||||
MPIFC=$FC
|
MPIFC=$FC
|
||||||
echo "MPIFC = $MPIFC ..."
|
AC_MSG_RESULT([MPIFC = $MPIFC])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$MPIFC"; then
|
if test -n "$MPIFC"; then
|
||||||
@@ -395,7 +396,7 @@ fi
|
|||||||
AC_MSG_CHECKING([wheter tools are enabled])
|
AC_MSG_CHECKING([wheter tools are enabled])
|
||||||
if test "X$USE_TOOLS" = "Xyes"; then
|
if test "X$USE_TOOLS" = "Xyes"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
BUILD_TOOLS="h5pAttrib h5pToGNUplot # homdynToH5p"
|
BUILD_TOOLS="h5pAttrib h5pToGNUplot h5ToVtk# homdynToH5p"
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
@@ -455,7 +456,7 @@ if test -n "$HDF5ROOT"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([for static zlib root ])
|
AC_MSG_CHECKING([for static zlib root ])
|
||||||
echo
|
AC_MSG_RESULT([ ])
|
||||||
PATH_Search ZLIBROOT '/apps/zlib' lib/libz.a
|
PATH_Search ZLIBROOT '/apps/zlib' lib/libz.a
|
||||||
if test -n "$ZLIBROOT"; then
|
if test -n "$ZLIBROOT"; then
|
||||||
LDFLAGS="$LDFLAGS -L$ZLIBROOT/lib"
|
LDFLAGS="$LDFLAGS -L$ZLIBROOT/lib"
|
||||||
@@ -581,27 +582,26 @@ AC_OUTPUT
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
########################## PRINTING SUMMARY ###################################
|
########################## PRINTING SUMMARY ###################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
echo
|
AC_MSG_RESULT([ ])
|
||||||
echo
|
AC_MSG_RESULT([Summary:])
|
||||||
echo "Summary for `(hostname || uname -n) 2>/dev/null | sed 1q`:"
|
AC_MSG_RESULT([ ])
|
||||||
echo
|
AC_MSG_RESULT([Host OS: $host_os])
|
||||||
echo "Host OS: $host_os"
|
AC_MSG_RESULT([Host CPU: $host_cpu])
|
||||||
echo "Host CPU: $host_cpu"
|
AC_MSG_RESULT([Host vendor: $host_vendor])
|
||||||
echo "Host vendor: $host_vendor"
|
AC_MSG_RESULT([Build libraries: $MTARGET])
|
||||||
echo "Build libraries: $MTARGET"
|
AC_MSG_RESULT([Build test programs: $TTARGET])
|
||||||
echo "Build test programs: $TTARGET"
|
AC_MSG_RESULT([Build tools: $BUILD_TOOLS])
|
||||||
echo "Build tools: $BUILD_TOOLS"
|
AC_MSG_RESULT([CC = $CC])
|
||||||
echo "CC = $CC"
|
AC_MSG_RESULT([CXX = $CXX])
|
||||||
echo "CXX = $CXX"
|
AC_MSG_RESULT([FC = $FC])
|
||||||
echo "FC = $FC"
|
AC_MSG_RESULT([MPICC = $MPICC])
|
||||||
echo "MPICC = $MPICC"
|
AC_MSG_RESULT([MPICXX = $MPICXX])
|
||||||
echo "MPICXX = $MPICXX"
|
AC_MSG_RESULT([MPIFC = $MPIFC])
|
||||||
echo "MPIFC = $MPIFC"
|
AC_MSG_RESULT([CFLAGS = $CFLAGS])
|
||||||
echo "CFLAGS = $CFLAGS"
|
AC_MSG_RESULT([FFLAGS = $FFLAGS])
|
||||||
echo "FFLAGS = $FFLAGS"
|
AC_MSG_RESULT([MPILIB = $MPILIB])
|
||||||
echo "MPILIB = $MPILIB"
|
AC_MSG_RESULT([MPIINC = $MPIINC])
|
||||||
echo "MPIINC = $MPIINC"
|
AC_MSG_RESULT([MPIROOT = $MPIROOT])
|
||||||
echo "MPIROOT = $MPIROOT"
|
AC_MSG_RESULT([HDF5ROOT = $HDF5ROOT])
|
||||||
echo "HDF5ROOT = $HDF5ROOT"
|
AC_MSG_RESULT([LDFLAGS = $LDFLAGS])
|
||||||
echo "LDFLAGS = $LDFLAGS"
|
AC_MSG_RESULT([ ])
|
||||||
echo
|
|
||||||
@@ -1,262 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Put your title here!!</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<title>Building H5Part</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body bgcolor="#F0F0F0">
|
|
||||||
<font face="arial,helvetica" size="+2" color="#555588"><h2>Building H5Part</h2></font>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="#Quickstart">Quickstart guide for the impatient.</a>
|
|
||||||
<LI><a href="#Details">Details of the Configuration Script</a>
|
|
||||||
<!-- <LI><a href="UsingC++.html">Using the C++ interface</a> -->
|
|
||||||
<LI><a href="#ConfigOptions">Important Configure Options</a>
|
|
||||||
<LI><a href="#EnvVariables">Important Environment Variables</a>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<a name="Quickstart">
|
|
||||||
<h2>Quickstart <i>for the impatient</i></h2>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<OL>
|
|
||||||
|
|
||||||
<LI><b>Configure</b>:<br>
|
|
||||||
For the serial implementation
|
|
||||||
<pre>
|
|
||||||
./configure
|
|
||||||
</pre>
|
|
||||||
For the parallel implementation configure with
|
|
||||||
<pre>
|
|
||||||
./configure --enable-parallel
|
|
||||||
</pre>
|
|
||||||
If you also want to build fortran bindings, add the
|
|
||||||
<code>--enable-fortran</code> flag to the configure line.
|
|
||||||
</LI><p>
|
|
||||||
|
|
||||||
<LI><b>Make the Library</b>:<br>
|
|
||||||
Type <code>make</code> to build the library. The libraries are
|
|
||||||
named accordingly.
|
|
||||||
<UL>
|
|
||||||
<LI>libH5Part.a: Serial C/C++ Library.</LI>
|
|
||||||
<LI>libpH5Part.a: Parallel C/C++ library.</LI>
|
|
||||||
<LI>libH5PartF.a: Serial F77/F90 library.</LI>
|
|
||||||
<LI>libpH5PartF.a: Parallel F77/F90 library.</LI>
|
|
||||||
</UL>
|
|
||||||
</LI><p>
|
|
||||||
|
|
||||||
<LI><b>Make Regression Tests and Examples</b>:<br>
|
|
||||||
Just type <code>make tests</code> to build regression tests
|
|
||||||
and/or example programs for H5Part. These tests are
|
|
||||||
<UL>
|
|
||||||
<LI>H5PartF: Fortran example (only build if --enable-fortran
|
|
||||||
is specified).</LI>
|
|
||||||
<LI>H5PartFpar: Parallel Fortran example (only built if both
|
|
||||||
--enable-fortran and --enable-parallel are specified).</LI>
|
|
||||||
<LI>H5PartTest: Serial C example. This test writes a sample
|
|
||||||
datafile and then reopens it for reading. It demonstrates
|
|
||||||
the most basic reading/writing capabilities.</LI>
|
|
||||||
<LI>H5PartTestP: Parallel C example (only built if
|
|
||||||
--enable-parallel is specified). This program only works
|
|
||||||
as an MPI/parallel program.</LI>
|
|
||||||
<LI>Bench: This program will only be built if
|
|
||||||
--enable-parallel is specified. It compares the
|
|
||||||
performance of raw binary
|
|
||||||
I/O (one file per processor), raw binary MPI-IO based
|
|
||||||
parallel I/O to a single file, and the parallel H5Part/HDF5 to
|
|
||||||
a single file. Generally, H5Part should be very close to the
|
|
||||||
MPI-IO implementation in terms of performance, but slower
|
|
||||||
than one-file-per-processor. If HDF5 is slower the
|
|
||||||
MPI-IO, it would indicate that some performance tuning
|
|
||||||
will be required for your platform (contact us, and we will
|
|
||||||
see what we can do!).</LI>
|
|
||||||
</UL>
|
|
||||||
</LI><p>
|
|
||||||
<LI><b>Building Your Own Programs</b>:<br>
|
|
||||||
There are many different subtleties to linking on various
|
|
||||||
computer platforms, but typically one does the following.
|
|
||||||
<UL>
|
|
||||||
<LI>C/C++ Serial:
|
|
||||||
<br><code>#include
|
|
||||||
< H5Part.h > </code> into your
|
|
||||||
source file.
|
|
||||||
<br><code>$CC -I<i>path_to_H5Part.h</i>
|
|
||||||
-I<i>path_to_hdf5.h</i> -o outfile
|
|
||||||
MyFile.cc -L<i>path_to_libH5Part.a</i> -lH5Part
|
|
||||||
-L<i>path_to_libhdf5</i> -lhdf5 -lz <i>-lsz</i></code>
|
|
||||||
</LI>
|
|
||||||
<LI>C/C++ Parallel:
|
|
||||||
<br><code>#include
|
|
||||||
< H5Part.h > </code> into your
|
|
||||||
source file.
|
|
||||||
<br><code>$MPICC -I<i>path_to_H5Part.h</i>
|
|
||||||
-I<i>path_to_hdf5.h</i> -DPARALLEL_IO
|
|
||||||
-DH5_HAVE_PARALLEL -o outfile
|
|
||||||
MyFile.cc -L<i>path_to_libH5Part.a</i> -lH5Part
|
|
||||||
-L<i>path_to_libhdf5</i> -lhdf5 -lz <i>-lsz</i></code>
|
|
||||||
</LI>
|
|
||||||
|
|
||||||
<LI>Fortran Serial:
|
|
||||||
<br><code>include
|
|
||||||
'H5Part.inc'</code> into your
|
|
||||||
source file.
|
|
||||||
<br><code>$FC -I<i>path_to_H5Part.h</i>
|
|
||||||
-I<i>path_to_hdf5.h</i> -o outfile
|
|
||||||
MyFile.cc -L<i>path_to_libH5PartF.a</i> -lH5PartF
|
|
||||||
-L<i>path_to_libhdf5</i> -lhdf5 -lz <i>-lsz</i> -lc</code>
|
|
||||||
</LI>
|
|
||||||
<LI>Fortran Parallel:
|
|
||||||
<br><code>include
|
|
||||||
'H5Part.inc'</code> into your
|
|
||||||
source file.
|
|
||||||
<br><code>$MPIF90 -I<i>path_to_H5Part.h</i>
|
|
||||||
-o outfile
|
|
||||||
MyFile.cc -L<i>path_to_libpH5PartF.a</i> -lpH5PartF
|
|
||||||
-L<i>path_to_libhdf5</i> -lhdf5 -lz <i>-lsz</i> -lc</code>
|
|
||||||
</LI><p>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
</OL>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="Details">
|
|
||||||
<h1>Details for H5Part Configure and Build</h1>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<a name="ConfigOptions">
|
|
||||||
<h2>Configure Options</h2>
|
|
||||||
</a>
|
|
||||||
H5Part uses GNU Autoconf to generate a Makefile from the makefile
|
|
||||||
template called <code>Makefile.in</code>.
|
|
||||||
The configure script pays attention to the following
|
|
||||||
configure options;<p>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI><b>--prefix=PREFIX</b> Install files in PREFIX</LI>
|
|
||||||
<LI><b>--enable-fortran</b> By default H5part will make no attempt to
|
|
||||||
build Fortran bindings. If you add the
|
|
||||||
<code>--enable-fortran</code> flag to the ./configure line, it
|
|
||||||
will create a small test program to determine how to generate
|
|
||||||
the fortran bindings and then create a library that includes
|
|
||||||
those bindings. You may need to set the fortran compiler by
|
|
||||||
setting the <code>FC</code> environment variable in your shell.</LI>
|
|
||||||
<LI><b>--enable-parallel</b> The version of HDF5 that you build for
|
|
||||||
Parallel I/O differs from the library you would build for
|
|
||||||
serial I/O. Consequently, the H5Part libraries must be built
|
|
||||||
specifically for the kind of I/O you have in mind (parallel or
|
|
||||||
serial). The configure script will attempt to find an
|
|
||||||
<code>mpicc</code> if it is available. If no
|
|
||||||
<code>mpicc</code> is available it will use the regular
|
|
||||||
C-compiler and will try to locate the location of the MPI
|
|
||||||
include files and libraries. You can assist the configure
|
|
||||||
program in its search by setting the <code>MPIROOT</code>
|
|
||||||
environment variable.</LI>
|
|
||||||
<LI><b>--enable-tools</b> Builds the currently available tools
|
|
||||||
<br>
|
|
||||||
<b>h5pAttrib</b>, an inspection tool that prints the number of timesteps in a file
|
|
||||||
the file attributes, the step attributes, the dataset names and their values.
|
|
||||||
<br>
|
|
||||||
<b>h5pToGNUplot</b>, a converter to two column ASCII format to load in GNUplot.
|
|
||||||
</LI>
|
|
||||||
<LI><b>--enable-python</b><font color=red> Under construction</font> Option to build python bindings. It has not been tested.
|
|
||||||
</LI>
|
|
||||||
<LI><b>--help</b> Prints configure options.
|
|
||||||
</LI>
|
|
||||||
</UL>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<a name="MakeOptions">
|
|
||||||
<h2>Make Options</h2>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI>make</LI>builds the libraries and test programs
|
|
||||||
<LI>make install</LI>builds and installs
|
|
||||||
<LI>make clean</LI>removes extraneous object files
|
|
||||||
<LI>make distclean</LI>returns configuration to unconfigured state
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<a name="EnvVariables">
|
|
||||||
<h2>Environment Variables for Configure</h2>
|
|
||||||
</a>
|
|
||||||
The
|
|
||||||
configuration script is of limited intelligence. Sometimes, you
|
|
||||||
have to define the following environment variables in order to
|
|
||||||
help it on its way. You will often only need to tell it where to
|
|
||||||
find the HDF5 libraries (<code>H5ROOT</code> for serial or
|
|
||||||
<code>PHDF5ROOT</code> for parallel builds). All of these
|
|
||||||
environment variables can also be overidden in the Makefile that
|
|
||||||
is generated by the autoconfigure script.
|
|
||||||
The configure script pays attention to the following
|
|
||||||
environment variables;
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<LI><b>CC</b>: Use the <code>CC</code> environment variable to tell the
|
|
||||||
configure script where to find the C compiler. You can
|
|
||||||
also directly modify this variable in the
|
|
||||||
<code>Makefile</code> that is generated by the autoconfigure</LI>
|
|
||||||
<LI><b>CXX</b>: Use the <code>CXX</code> environment variable to tell the
|
|
||||||
configure script where to find the C++ compiler. You can
|
|
||||||
also directly modify this variable in the
|
|
||||||
<code>Makefile</code> that is generated by the autoconfigure</LI>
|
|
||||||
<LI><b>FC</b>: Use the <code>FC</code> environment variable to tell the
|
|
||||||
configure script where to find the fortran compiler. You can
|
|
||||||
also directly modify this variable in the
|
|
||||||
<code>Makefile</code> that is generated by the autoconfigure</LI>
|
|
||||||
<LI><b>MPICC</b>: If you are building for parallel C I/O, then it is
|
|
||||||
useful to tell the configure script where to find the
|
|
||||||
<code>mpicc</code> script. Normally, <code>mpicc</code> is
|
|
||||||
merely a wrapper script for a build using a regular C-compiler.
|
|
||||||
If no <code>mpicc</code> is available, then the
|
|
||||||
<code>configure</code> script will attempt to locate the mpi
|
|
||||||
header files and libraries. In that case, it may be useful to
|
|
||||||
define the <code>MPI_HOME</code> environment variable.</LI>
|
|
||||||
<LI><b>MPICXX</b>If you are building for parallel C++</LI>
|
|
||||||
<LI><b>MPIFC</b>: If you are building for parallel Fortran I/O, then it is
|
|
||||||
useful to tell the configure script where to find the parallel fortran compiler.
|
|
||||||
<LI><b>MPIROOT</b>: Set this environment variable to help the
|
|
||||||
configure script to locate the MPI libraries that should be
|
|
||||||
used to build the parallel version of the libraries. This
|
|
||||||
variable will be ignored if configured only to build the
|
|
||||||
serial implementation of the library.</LI>
|
|
||||||
<LI><b>HDF5ROOT</b>: Find the path to your serial HDF5 installation. If you
|
|
||||||
are building the serial version of H5part, then you should set
|
|
||||||
the <code>PHDF5ROOT</code> environment variable.</LI>
|
|
||||||
</UL><p>
|
|
||||||
|
|
||||||
<h3>Common compiler environemt variables for NERSC platforms</h3>
|
|
||||||
<UL>
|
|
||||||
<LI><b>DaVinci</b>: Linux ia64 </LI>
|
|
||||||
CC=icc CXX=icc F90=ifort MPICC=icc MPIFC=ifort MPILIB=-L/usr/lib/ -lmpi MPIINC=-I/usr/include
|
|
||||||
<LI><b>Bassi</b>: AIX</LI>
|
|
||||||
CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r
|
|
||||||
<LI><b>Jacquard</b>: Linux x86_64</LI>
|
|
||||||
CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90
|
|
||||||
<LI><b>Starsky.lbl.gov:</b> (Darwin) PowerPC</LI>
|
|
||||||
CC=gcc CXX=g++ FC=g95
|
|
||||||
</UL>
|
|
||||||
<br>
|
|
||||||
NOTE: You might need to set the MPI library path (MPILIB) and MPI includes (MPIIINC) if they are in non standard places. For example: <br>
|
|
||||||
MPILIB=-L/usr/lpp/ppe.poe/lib -lmpi_r MPIINC=-I/usr/lpp/ppe.poe/include/thread
|
|
||||||
<h3>How to set the variables for configure:</h3>
|
|
||||||
It is very simple just call env with the variables together with configure. Notice the quotes in MPILIB.
|
|
||||||
<pre>
|
|
||||||
% env CC=icc CXX=icc F90=ifort MPICC=icc MPILIB=-L/usr/lib/ -lmpi MPIINC=-I/usr/include ./configure (configure options follow here)
|
|
||||||
</pre>
|
|
||||||
In the worst case, you can edit the <code>src/Makefile.am</code> and <code>test/Makefile.am</code> as
|
|
||||||
needed to perform the proper build.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Put your title here!!</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<title>Building HDF5</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body bgcolor="#F0F0F0">
|
|
||||||
<font face="arial,helvetica" size="+2" color="#555588"><h2>Building H5Part</h2></font>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="#ConfigOptions">Configure Options</a>
|
|
||||||
<LI><a href="#EnvVariables">Important Environment Variables</a>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<a name="ConfigOptions">
|
|
||||||
<h2>Configure options</h2></a>
|
|
||||||
</a>
|
|
||||||
To set the installation path configure with
|
|
||||||
<pre>
|
|
||||||
./configure --prefix=your hdf5 installation full path, e.g.--prefix=/usr/local/hdf5
|
|
||||||
</pre>
|
|
||||||
For the serial implementation configure with
|
|
||||||
<pre>
|
|
||||||
./configure
|
|
||||||
</pre>
|
|
||||||
For the parallel implementation configure with
|
|
||||||
<pre>
|
|
||||||
./configure --enable-parallel
|
|
||||||
</pre>
|
|
||||||
To enable shared objects configure with
|
|
||||||
<pre>
|
|
||||||
./configure --enable-shared
|
|
||||||
</pre>
|
|
||||||
<a name="EnvVariables">
|
|
||||||
<h2>Environment Variables</h2></a>
|
|
||||||
</a>
|
|
||||||
To add HDF5 to your PATH and LD_LIBRARY_PATH edit your
|
|
||||||
.tcshr, or .cshrc depending on the shell you are using and add
|
|
||||||
<pre>
|
|
||||||
setenv HDF5 "your hdf5 installation full path"
|
|
||||||
setenv PATH ${PATH}:${HDF5}/bin
|
|
||||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${HDF5}/lib
|
|
||||||
</pre>
|
|
||||||
if you are using bash, add to your .bashrc
|
|
||||||
<pre>
|
|
||||||
export HDF5="your hdf5 installation full path"
|
|
||||||
export PATH=$PATH:${HDF5}/bin
|
|
||||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HDF5}/lib
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
Open a new terminal or do a
|
|
||||||
source .tcshr (.cshrc, .bashrc) in the one that you are using.
|
|
||||||
|
|
||||||
You can <a href="http://vis.lbl.gov/Research/AcceleratorSAPP/Downloading.html">continue <a/>downloading and installing H5Part.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Downloading HDF5 and H5Part</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
<head>
|
|
||||||
<title>Downloading HDF5 and H5Part</title>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body bgcolor="#F0F0F0">
|
|
||||||
<font face="arial,helvetica" size="+2" color="#555588"><h2>Downloading H5Part</h2></font>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="#hdf5">Downloading HDF5</a>
|
|
||||||
<LI><a href="#h5part">Downloading H5Part</a>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<a name="hdf5">
|
|
||||||
<h2>Downloading HDF5</h2></a>
|
|
||||||
You will need to download and install the hdf5 library and link H5Part with it.
|
|
||||||
<pre>
|
|
||||||
ftp ftp.ncsa.uiuc.edu
|
|
||||||
username: anonymous
|
|
||||||
password: your email
|
|
||||||
cd HDF/HDF5/current/src
|
|
||||||
ls
|
|
||||||
get hdf5-1.6.5.tar.gz (get the current version, this as the one on April 20th, 2006)
|
|
||||||
cd szip/src
|
|
||||||
ls
|
|
||||||
get szip-2.0.tar.gz (get the current version, this as the one on April 20th, 2006)
|
|
||||||
cd ../../
|
|
||||||
cd zlib/1.2/src
|
|
||||||
ls
|
|
||||||
get zlib-1.2.1.tar.gz (get the current version, this as the one on April 20th, 2006)
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
Note: you might already have libz in your system and you will not need libsz unless you build hdf5 with support for it.
|
|
||||||
</P>
|
|
||||||
|
|
||||||
<h4>Building Parallel HDF5</h4>
|
|
||||||
<P>
|
|
||||||
When you build HDF5, you will need to build an version with parallel I/O
|
|
||||||
enabled. Here is a set of configure options that worked for us on a
|
|
||||||
Linux workstation running SuSE 10.1 with MPICH installed in /usr/local/mpich.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
./configure --prefix=/usr/local/hdf5-mpich --enable-parallel CC=mpicc CXX=mpicxx --disable-shared --enable-static --enable-stream-vfd
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<UL>
|
|
||||||
<li> --prefix=/usr/local/hdf5-mpich : the location where the HDF5 libs and
|
|
||||||
binaries will be installed.</LI>
|
|
||||||
<li> --enable-parallel : contrary to the HDF5 documentation, which says that
|
|
||||||
"--enable-parallel" is optional for building the parallel version of
|
|
||||||
HDF5, you <b>must</b> have --enable-parallel to get the parallel-enabled
|
|
||||||
build. See <a href="ftp://ftp.hdfgroup.org/HDF5/current/src/unpacked/release_docs/INSTALL_parallel">these notes from HDF5</a> where they claim that
|
|
||||||
--enable-parallel is optional.</LI>
|
|
||||||
<li> CC=mpicc CXX=mpicxx : contrary to the output from configure --help, the
|
|
||||||
configure script seems to ignore the CC and CXX environment variables.
|
|
||||||
We tried setting these environment variables to mpicc and mpicxx,
|
|
||||||
respectively, and then ran configure with --enable-parallel. The configure
|
|
||||||
script would faile with this error message:
|
|
||||||
<pre>
|
|
||||||
checking whether a simple MPI-IO program can be linked... no
|
|
||||||
configure: error: unable to link a simple MPI-IO application
|
|
||||||
</pre>
|
|
||||||
</LI>
|
|
||||||
<LI> --disable-shared and --enable-static: the HDF5 build failed for us
|
|
||||||
w/o these options when attempting to read symbols from libmpich.a. The
|
|
||||||
result of these options is that your parallel-enabled HDF5 libaries
|
|
||||||
will be static rather than dynamic.
|
|
||||||
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
|
|
||||||
<h2 id="h5part">Downloading H5Part</h2>
|
|
||||||
H5Part is available for download from Berkeley Labs Codeforge system <a href="https://codeforge.lbl.gov/projects/h5part/">https://codeforge.lbl.gov/projects/h5part</a>.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
# Project related configuration options
|
# Project related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
PROJECT_NAME = H5Part
|
PROJECT_NAME = H5Part
|
||||||
PROJECT_NUMBER = 1.3.1
|
PROJECT_NUMBER = 1.3.3
|
||||||
OUTPUT_DIRECTORY = ./ReferencePages
|
OUTPUT_DIRECTORY = ./ReferencePages
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Put your title here!!</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
|
|
||||||
Under construction, will be here soon.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Put your title here!!</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
|
|
||||||
Under construction, will be here soon.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Put your title here!!</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
|
|
||||||
Under construction, will be here soon.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Put your title here!!</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<title>H5Part Utility Tools</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body bgcolor="#F0F0F0">
|
|
||||||
<font face="arial,helvetica" size="+2" color="#555588"><h2>H5Part Utility Tools</h2></font>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="h5pAttrib">h5pAttrib</a>
|
|
||||||
<LI><a href="h5pToGNUplot">h5pToGNUplot</a>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="h5pAttrib">
|
|
||||||
<h2>h5pAttrib</h2>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<b>h5pAttrib</b> is an inspection tool that prints to stdout the number of timesteps in a file
|
|
||||||
the file attributes, the step attributes, the dataset names and their values. It's simpler to use than h5dump.
|
|
||||||
Usage options are given by typing:
|
|
||||||
<br><br>
|
|
||||||
<PRE>
|
|
||||||
% ./h5pAttrib -h
|
|
||||||
usage: h5pAttrib [OPTIONS] file
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
-h, --help Print help page
|
|
||||||
-n, --nstep Print number of steps
|
|
||||||
-A, --fileA Print file attributes
|
|
||||||
-a, --stepA Print step attributes & values for time step n
|
|
||||||
-d, --dataset Print data sets names & values for time step n
|
|
||||||
-H, --header Print shorter version without the values
|
|
||||||
</PRE>
|
|
||||||
|
|
||||||
<h3>Examples</h3>
|
|
||||||
<OL>
|
|
||||||
<LI>
|
|
||||||
Show file attribute names & values of sample.h5part
|
|
||||||
</LI>
|
|
||||||
h5pAttrib -A sample.h5part
|
|
||||||
<LI>
|
|
||||||
Show step attribute names for time step 5 of sample.h5part
|
|
||||||
</LI>
|
|
||||||
h5pAttrib -a 5 -H sample.h5part
|
|
||||||
</OL>
|
|
||||||
|
|
||||||
<a name="h5pToGNUplot">
|
|
||||||
<h2>h5pToGNUplot</h2>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<b>h5pToGNUplot</b> is a converter from H5Part to two column ASCII text format for loading into GNUplot. Usage options are given by typing:
|
|
||||||
<br><br>
|
|
||||||
<PRE>
|
|
||||||
% ./h5pToGNUplot -h
|
|
||||||
|
|
||||||
usage: h5pToGNUplot -t TIMESTEP -1 VARIABLE#1 -2 VARIABLE#2 -i INPUTFILE [OPTIONAL_FLAGS]
|
|
||||||
|
|
||||||
FLAGS
|
|
||||||
-h, --help Print help page
|
|
||||||
-1, --1var (REQUIRED) Takes first variable parameter
|
|
||||||
-2, --2var (REQUIRED) Takes second variable parameter
|
|
||||||
-i, --input (REQUIRED) Takes input file name
|
|
||||||
-t, --timestep (REQUIRED) Sets the timestep (Value -1 will result in dumping values of all timesteps.)
|
|
||||||
-o, --output (OPTIONAL) Takes output file name (without this flag, the program will print to stdout)
|
|
||||||
-n, --number (OPTIONAL) Sets number of output points
|
|
||||||
-s, --start (OPTIONAL) Sets the starting particle index
|
|
||||||
</PRE>
|
|
||||||
|
|
||||||
<h3>Examples</h3>
|
|
||||||
<OL>
|
|
||||||
<LI>
|
|
||||||
Create a GNU plot file output.txt from sample.h5part by ploting x vs px for timestep 54
|
|
||||||
</LI>
|
|
||||||
h5pToGNUplot -t 54 -1 x -2 px -i sample.h5part -o output.txt
|
|
||||||
<LI>
|
|
||||||
Create a GNU plot file output.txt from sample.h5part by ploting x vs px for timestep 54
|
|
||||||
using 1200 points from particle index 76
|
|
||||||
</LI>
|
|
||||||
h5pToGNUplot -t 54 -1 x -2 px -i sample.h5part -o output.txt -s 76 -n 1200
|
|
||||||
</OL>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>H5Part: VisIt Plugins</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
<font face="arial,helvetica"><h1>H5Part: VisIt Plugins</h1></font>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>Introduction</h2></font>
|
|
||||||
<P>
|
|
||||||
<a href="http://www.llnl.gov/visit">VisIt</a> is an open source point-and-click 3D scientific visualization application that supports most of the common visualization techniques on structured and unstructured grids. One of its advantages is that it employs a distributed and parallel architecture in order to handle extremely large data sets interactively. VisIt's rendering and data processing capabilities are split into viewer and engine components that may be distributed across multiple machines. See this link for <a href="http://vis.lbl.gov/NERSC/Software/visit/">details</a> on how to run VisIt in NERSC.
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
VisIt achieves extensibility through the use of dynamically loaded plugins. All of VisIt's plots, operators, and database readers are implemented as plugins and are loaded at run-time from the plugin directory. New plugins can be added simply by installing them in this directory. VisIt comes with a graphical plugin creation tool, which greatly simplifies the process of creating new plugins. The user describes the properties of the plugin and then the tool generates most of the code necessary to implement the plugin. For example, in the case of an operator, the plugin creation tool creates the code necessary for the graphical user interface attribute window; the C++, Python, and Java interfaces; and the code necessary to interface to VisIt. The only code you need to write is the C++ code that actually performs the operation.
|
|
||||||
</P>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>H5Part in VisIt</h2></font>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h3>Database Reader Plugin</h3></font>
|
|
||||||
<P>
|
|
||||||
We wrote a Multiple Time Step Multiple Domain database reader to read H5Part data into VisIt. H5Part datasets should be named with the extension <font color=red>".h5part"</font> to be recognized by the reader since VisIt does not have a format selection mechanism at the time of reading. Figure 1 shows a Pseudocolor plot of a data set and Figure 2 shows a Scatter plot x-y (any combination of x, px, y, py, z, pz, id are possible).
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
<TABLE>
|
|
||||||
<TR>
|
|
||||||
<TD>
|
|
||||||
<a href="H5PartVisIt/cloud_visit.png"><img src="H5PartVisIt/cloud_visit.s.png" width=400 height=300></a>
|
|
||||||
</TD
|
|
||||||
></TR>
|
|
||||||
<TR>
|
|
||||||
<TD width=300>
|
|
||||||
Figure 1. VisIt User interface showing an H5Part particle file rendered as spheres using the Pseudocolor plot.
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR>
|
|
||||||
<TD>
|
|
||||||
<a href="H5PartVisIt/cloud_visit_2D.png"><img src="H5PartVisIt/cloud_visit_2D.s.png" width=300 height=300></a>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR>
|
|
||||||
<TD>
|
|
||||||
Figure 2. A Scatter plot of the x-y projection of the particles.
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
</P>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
VisIt provides a Query interface, for single time steps and for time series. Figure 3 shows the query interace over time for the sum of the x position and the z position of the particoes.
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
<TABLE>
|
|
||||||
<TR>
|
|
||||||
<TD>
|
|
||||||
<a href="H5PartVisIt/visit_query1.png"><img src="H5PartVisIt/visit_query1.s.png" width=400 height=300></a>
|
|
||||||
</TD
|
|
||||||
></TR>
|
|
||||||
<TR>
|
|
||||||
<TD width=300>
|
|
||||||
Figure 3. VisIt's Time Query Output.
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
</p>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>Operator Plugins</h2></font>
|
|
||||||
<P>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h3>Particle Random Sampler</h3></font>
|
|
||||||
|
|
||||||
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h3>Particle Binner</h3></font>
|
|
||||||
</P>
|
|
||||||
</div>
|
|
||||||
|
Before Width: | Height: | Size: 329 KiB |
|
Before Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 243 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 181 KiB |
|
Before Width: | Height: | Size: 79 KiB |
@@ -0,0 +1,170 @@
|
|||||||
|
Proposal for a more general file format used by H5Part/H5Block
|
||||||
|
|
||||||
|
Authors: Achim Gsell
|
||||||
|
Status: Draft
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
|
||||||
|
H5X is the file format used by H5Part and H5Block. H5X is designed on
|
||||||
|
top of HDF5: A H5X file is a very special HDF5 file.
|
||||||
|
|
||||||
|
+--------------------+
|
||||||
|
| Application |
|
||||||
|
+--------------------+
|
||||||
|
| H5Part/H5Block API |
|
||||||
|
+--------------------+
|
||||||
|
| H5X API |
|
||||||
|
+--------------------+
|
||||||
|
| HDF5 API |
|
||||||
|
+--------------------+
|
||||||
|
| Filesystem of OS |
|
||||||
|
+--------------------+
|
||||||
|
|
||||||
|
|
||||||
|
2. H5X file format specification
|
||||||
|
|
||||||
|
2.1 The root group
|
||||||
|
|
||||||
|
2.1.1 File attributes
|
||||||
|
|
||||||
|
Attributes of the HDF5 root group are called "file attributes". There
|
||||||
|
are no restrictions on file attribute names. Names with "__" as prefix and
|
||||||
|
postfix are intended for internal use. Supported values for file attributes
|
||||||
|
are scalars and arrays of 64bit integer and 64bit floating point number as
|
||||||
|
well as string values. Arrays of strings are not supported.
|
||||||
|
|
||||||
|
2.1.1.1 Predefined file attributes
|
||||||
|
|
||||||
|
__stepname__ (optional)
|
||||||
|
See below.
|
||||||
|
|
||||||
|
__stepnumwidth__ (optional)
|
||||||
|
See below.
|
||||||
|
|
||||||
|
2.1.2 Members of the root group
|
||||||
|
|
||||||
|
Members of the root group are special formated HDF5 groups called
|
||||||
|
"step groups". The name of a step group is "<name>#<number>".
|
||||||
|
Whereby <name> is either defined by the optional file attribute
|
||||||
|
__stepname__ or set to "Step" by default. <number> is an
|
||||||
|
unsigned integer less than 2^63.
|
||||||
|
|
||||||
|
/
|
||||||
|
+- Step#0
|
||||||
|
+- Step#1
|
||||||
|
...
|
||||||
|
+- Step#n
|
||||||
|
+- StepProperties [NEW]
|
||||||
|
+- Mesh [NEW]
|
||||||
|
|
||||||
|
The optional file attribute __stepnumwidth__ defines the minimum width
|
||||||
|
of <number> in the name of the step group. The number is padded with
|
||||||
|
'0'. The minimum width defaults to zero, so that no paddings occurs.
|
||||||
|
Example: With __stepnumwidth__ := 5 the name of the step group with
|
||||||
|
number 42 is "Step#00042", with __stepnumwidth__ := 0 the name is
|
||||||
|
"Step#42".
|
||||||
|
|
||||||
|
Step groups may be unsorted in the HDF5 file und needn't be number
|
||||||
|
consecutively.
|
||||||
|
|
||||||
|
2.1.3 Other members of the root group
|
||||||
|
|
||||||
|
Other sub-groups of the root group are allowed, but the group names are restricted
|
||||||
|
to names not matching "Step#.*".
|
||||||
|
|
||||||
|
2.2 Format of a step group
|
||||||
|
|
||||||
|
2.2.1 Step attributes
|
||||||
|
|
||||||
|
Step attributes are HDF5 attributes asigned to a step group. There
|
||||||
|
are no restrictions on step attribute names. As with file attributes names
|
||||||
|
enclosed in "__" are intended for internal use. Supported values are the same
|
||||||
|
as for file attributes:
|
||||||
|
* 64bit integer value
|
||||||
|
* arrays of 64bit integer values
|
||||||
|
* 64bit floating point number
|
||||||
|
* array of 64bit floating point number
|
||||||
|
* strings
|
||||||
|
Note that array of strings are not supported!
|
||||||
|
|
||||||
|
2.2.2 Predefined step attributes
|
||||||
|
|
||||||
|
No predefined step attributes exists.
|
||||||
|
|
||||||
|
|
||||||
|
2.2.3 Members of a step group
|
||||||
|
|
||||||
|
Members of a step group are HDF5 datasets and optional one HDF5 group
|
||||||
|
with the name "Block". HDF5 datasets in a step group are called "step
|
||||||
|
datasets". The optional block group is called "block data".
|
||||||
|
|
||||||
|
Mesh?!
|
||||||
|
|
||||||
|
2.2.4 Step datasets
|
||||||
|
|
||||||
|
Step datasets are arrays of rank 1. The dataset size must be the same
|
||||||
|
for all datasets inside a step. The size of the dataset may vary
|
||||||
|
from step to step. Array values are 64bit integer or 64bit floating
|
||||||
|
point numbers. No limitations (other than given by HDF5) are given on
|
||||||
|
step dataset names.
|
||||||
|
|
||||||
|
|
||||||
|
2.2.5 Block Data
|
||||||
|
|
||||||
|
The block data group is a container for an arbitrary number of field
|
||||||
|
data. A field is a data structure to store arrays of rank m with
|
||||||
|
n-dimensional vector values. Fields are represented within HDF5
|
||||||
|
groups. The HDF5 group name is the unique identifier for a field in
|
||||||
|
the current step.
|
||||||
|
|
||||||
|
2.2.5.1 m-rank fields with n-dimensional-vector values
|
||||||
|
|
||||||
|
Values are stored per dimension in separate datasets. Thus we have n
|
||||||
|
datasets for a field with n-dimensional vector values. Each dataset
|
||||||
|
corresponse to one dimension. The datasets are numbered from '0' to
|
||||||
|
'n-1'. Arrays are stored in column major order (Fortran indexing
|
||||||
|
scheme).
|
||||||
|
|
||||||
|
/ # HDF5 root group
|
||||||
|
...
|
||||||
|
+- Step#<i> # HDF5 group
|
||||||
|
|
|
||||||
|
+- Block # HDF5 group
|
||||||
|
|
|
||||||
|
+- <field name> # HDF5 group
|
||||||
|
|
|
||||||
|
+- 0 # HDF5 dataset, first dim of vector
|
||||||
|
+- 1 # HDF5 dataset, second dim of vector
|
||||||
|
...
|
||||||
|
+- n-1 # HDF5 dataset, last dim of vector
|
||||||
|
...
|
||||||
|
|
||||||
|
2.2.5.2 m-rank fields with scalar values
|
||||||
|
|
||||||
|
Fields with scalar values are stored as special case of fields with
|
||||||
|
n-dimensional vector values with n := 1.
|
||||||
|
|
||||||
|
/ # HDF5 root group
|
||||||
|
...
|
||||||
|
+- Step#<i> # HDF5 group
|
||||||
|
|
|
||||||
|
+- Block # HDF5 group
|
||||||
|
|
|
||||||
|
+- <field name> # HDF5 group
|
||||||
|
|
|
||||||
|
+- 0 # HDF5 dataset, scalar value
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
2.3 Step properties [NEW]
|
||||||
|
|
||||||
|
Why? Much faster than step attributes if you need to access consecutive values
|
||||||
|
|
||||||
|
Group of root group with name "StepProperties"
|
||||||
|
|
||||||
|
Members are datasets
|
||||||
|
|
||||||
|
Supported values are the same as for step attributes
|
||||||
|
|
||||||
|
Mapping of value to step via object index of step group
|
||||||
|
|
||||||
@@ -1,417 +0,0 @@
|
|||||||
<html><head><title>H5Part Tools How-to</title>
|
|
||||||
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr"></head>
|
|
||||||
<body bgcolor="#ffffff" text="#000000">
|
|
||||||
|
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="987">
|
|
||||||
<tbody><tr>
|
|
||||||
<td height="6050" width="27"></td>
|
|
||||||
<td colspan="3" valign="top">
|
|
||||||
<div id="body">
|
|
||||||
<div id="mainleft"><font face="Arial, Helvetica, sans-serif"><a name="TOP"></a>
|
|
||||||
</font></div>
|
|
||||||
<div id="maincenter"> <font face="arial,helvetica">
|
|
||||||
<h1 align="center"><font face="Arial, Helvetica, sans-serif"><b><font color="#666699">H5Part
|
|
||||||
Tools How-to</font></b></font></h1>
|
|
||||||
</font><font color="#555588" face="arial,helvetica">
|
|
||||||
<h2><font color="#666699" face="Arial, Helvetica, sans-serif">Table
|
|
||||||
of Contents</font></h2>
|
|
||||||
</font>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b><a href="#Quick%20Guide">
|
|
||||||
[1] Quick Guide</a></b> </font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif" size="+1"><b><font color="#999999">---
|
|
||||||
For h5pAttrib</font></b></font><font face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
<b><br>
|
|
||||||
<a href="#timesteps">[2] To see number of timesteps in a h5part file</a><br>
|
|
||||||
<br>
|
|
||||||
<a href="#file%20attributes">[3] To see file attributes in a h5part
|
|
||||||
file</a><br>
|
|
||||||
<br>
|
|
||||||
<a href="#step%20attributes"> [4] To see step attributes in a h5part
|
|
||||||
file</a><br>
|
|
||||||
<br>
|
|
||||||
<a href="#dataset">[5] To see dataset in a h5part file</a><br>
|
|
||||||
<br>
|
|
||||||
<a href="#flags">[6] Providing more than one flag at once for h5pAttrib</a></b></font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif" size="+1"><b><font color="#999999">---
|
|
||||||
For h5pToGNUplot</font></b></font><font face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
<br>
|
|
||||||
<b><a href="#parameters">[7] What parameters to provide</a><br>
|
|
||||||
<br>
|
|
||||||
<a href="#input%20file">[8] How to create an input file to GNUplot</a></b></font></p>
|
|
||||||
<p> </p>
|
|
||||||
<p align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TOP"><back
|
|
||||||
to top></a></font></p>
|
|
||||||
<p> </p>
|
|
||||||
<h2><font color="#555588" face="Arial, Helvetica, sans-serif"><a name="Quick Guide">[1]
|
|
||||||
Quick Guide</a></font></h2>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif">Executing the program with
|
|
||||||
-h option will display a concise help page.</font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b><font face="Courier New, Courier, mono" size="+1">$></font></b><font face="Courier New, Courier, mono">./h5pAttrib
|
|
||||||
-h</font></font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">usage: h5pAttrib [OPTIONS]
|
|
||||||
file</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> OPTIONS<br>
|
|
||||||
-h, --help Print help page<br>
|
|
||||||
-n, --nstep Print number of steps<br>
|
|
||||||
-A, --fileA Print file attributes<br>
|
|
||||||
-a n, --stepA n Print step attributes & values for time step n<br>
|
|
||||||
-d n, --dataset n Print data sets names & values for time step
|
|
||||||
n<br>
|
|
||||||
-H, --header Print shorter version without the values</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> Examples:</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> 1) Show file attribute names
|
|
||||||
& values of sample.h5part</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> h5pAttrib -A sample.h5part<br>
|
|
||||||
OR<br>
|
|
||||||
h5pAttrib --fileA sample.h5part</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> 2) Show step attribute names
|
|
||||||
for time step 5 of sample.h5part</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> h5pAttrib -a 5 -H sample.h5part<br>
|
|
||||||
OR<br>
|
|
||||||
h5pAttrib --stepA 5 -H sample.h5part</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"><br>
|
|
||||||
<b><font size="+1">$></font></b> ./h5pToGNUplot -h</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">usage: h5pToGNUplot -t TIMESTEP
|
|
||||||
-1 VARIABLE#1 -2 VARIABLE#2 -i INPUTFILE [OPTIONAL_FLAGS]</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> FLAGS<br>
|
|
||||||
-h, --help Print help page</font><br>
|
|
||||||
<font face="Courier New, Courier, mono">-1 par, --1var par (REQUIRED)
|
|
||||||
Takes first variable parameter to "par"<br>
|
|
||||||
-2 par, --2var par (REQUIRED) Takes second variable parameter to "par"<br>
|
|
||||||
-i file, --input file (REQUIRED) Takes input file name to "file"<br>
|
|
||||||
</font><font face="Courier New, Courier, mono">-t step, --timestep
|
|
||||||
step (REQUIRED) Sets the timestep to "step" (Value -1 will
|
|
||||||
result in dumping values of all timesteps.)<br>
|
|
||||||
-o file, --output file (OPTIONAL) Takes output file name to "file"
|
|
||||||
(without this flag, the program will print to stdout)<br>
|
|
||||||
-n num, --number num (OPTIONAL) Sets number of output points to "num"<br>
|
|
||||||
-s idx, --start idx (OPTIONAL) Sets the starting particle index to
|
|
||||||
"idx"</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"><br>
|
|
||||||
Examples:</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> 1) Create GNU plot file
|
|
||||||
output.txt from sample.h5part by ploting x vs px for timestep 54</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> h5pToGNUplot -t 54 -1 x
|
|
||||||
-2 px -i sample.h5part -o output.txt</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> 2) Create GNU plot file
|
|
||||||
output.txt from sample.h5part by ploting x vs px for timestep 54<br>
|
|
||||||
using 1200 points from particle index 76</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> h5pToGNUplot -t 54 -1 x
|
|
||||||
-2 px -i sample.h5part -o output.txt -s 76 -n 1200</font></p>
|
|
||||||
<p> </p>
|
|
||||||
<p align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TOP"><back
|
|
||||||
to top></a></font></p>
|
|
||||||
<p> </p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif" size="+1"><b><font color="#999999">---
|
|
||||||
For h5pAttrib</font></b></font></p>
|
|
||||||
<p> </p>
|
|
||||||
<h2><font color="#555588" face="Arial, Helvetica, sans-serif"><a name="timesteps">[2]
|
|
||||||
To see number of timesteps in a h5part file</a></font></h2>
|
|
||||||
<p>Executing the program h5pAttrib with -n flag will display the number
|
|
||||||
of timesteps in the file.</p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b>EXAMPLE>></b></font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif" size="+1"><b><font face="Courier New, Courier, mono">$></font></b></font><font face="Courier New, Courier, mono">
|
|
||||||
./h5pAttrib -n sample.h5part</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Printing number of timesteps
|
|
||||||
for: sample.h5part ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">There are total 252 number
|
|
||||||
of timesteps.<br>
|
|
||||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">done</font><font face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
</font></p>
|
|
||||||
<p> </p>
|
|
||||||
<p align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TOP"><back
|
|
||||||
to top></a></font></p>
|
|
||||||
<h2><font color="#666699" face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
<font color="#555588"><a name="file attributes">[3] To see file attributes
|
|
||||||
in a h5part file</a></font></font></h2>
|
|
||||||
<p>File attribute contains information about the file. (file description
|
|
||||||
etc...) Executing the program h5pAttrib with -A flag will display
|
|
||||||
the file attributes in the file.</p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b>EXAMPLE>></b></font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif" size="+1"><b><font face="Courier New, Courier, mono">$></font></b></font><font face="Courier New, Courier, mono">
|
|
||||||
./h5pAttrib -A sample.h5part</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Printing file attributes
|
|
||||||
for: sample.h5part ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">The number of file attributes
|
|
||||||
for file sample.h5part is 0 ...<br>
|
|
||||||
There are no file attributes.<br>
|
|
||||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">done</font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
<i>NOTE: -H option will omit the list of values of file attributes.</i></font></p>
|
|
||||||
<p> </p>
|
|
||||||
<p align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TOP"><back
|
|
||||||
to top></a></font></p>
|
|
||||||
<p align="center"> </p>
|
|
||||||
<h2><font color="#555588" face="Arial, Helvetica, sans-serif"><a name="step attributes">[4]
|
|
||||||
To see step attributes in a h5part file</a></font></h2>
|
|
||||||
<p>Step attribute contains information that belongs to a specific step.
|
|
||||||
(step name, timestep number, etc...) Executing the program h5pAttrib
|
|
||||||
with -a flag will display the step attributes in the file.<br>
|
|
||||||
Note that the timestep index should follow -a flag.</p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b>EXAMPLE>></b></font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b><font face="Courier New, Courier, mono" size="+1">$></font></b><font face="Courier New, Courier, mono">
|
|
||||||
./h5pAttrib -a 2 sample.h5part</font></font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Printing step attributes
|
|
||||||
for: sample.h5part ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">The number of step attributes
|
|
||||||
for timestep #2 is 10 ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Attribute #0 = Step<br>
|
|
||||||
There are 1 elements in the attribute<br>
|
|
||||||
Attribute Type is H5T_NATIVE_INT64<br>
|
|
||||||
Printing 1 element value(s):<br>
|
|
||||||
COUNT[0]: 2</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Attribute #1 = Spos<br>
|
|
||||||
There are 1 elements in the attribute<br>
|
|
||||||
Attribute Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Printing 1 element value(s):<br>
|
|
||||||
COUNT[0]: 0.143580</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Attribute #2 = structLen<br>
|
|
||||||
There are 1 elements in the attribute<br>
|
|
||||||
Attribute Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Printing 1 element value(s):<br>
|
|
||||||
COUNT[0]: 2.393000</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">.<br>
|
|
||||||
.<br>
|
|
||||||
.</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"><br>
|
|
||||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">done</font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
<i>NOTE: -H option will omit the list of values of step attributes.</i></font></p>
|
|
||||||
<p> </p>
|
|
||||||
<p align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TOP"><back
|
|
||||||
to top></a></font></p>
|
|
||||||
<h2><font color="#555588" face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
<a name="dataset">[5] To see dataset in a h5part file</a></font></h2>
|
|
||||||
<p>Executing the program h5pAttrib with -d flag will display the datasets
|
|
||||||
information in the file. (dataset name, type, number of elements,
|
|
||||||
etc...) Executing the program h5pAttrib with -d flag will display
|
|
||||||
the datasets information in the file.<br>
|
|
||||||
Note that the timestep index should follow -d flag.</p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b>EXAMPLE>></b></font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif" size="+1"><b><font face="Courier New, Courier, mono">$></font></b></font><font face="Courier New, Courier, mono">
|
|
||||||
./h5pAttrib -d 2 -H sample.h5part</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Printing names of datasets
|
|
||||||
for: sample.h5part ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">The number of datasets for
|
|
||||||
timestep #2 is 7 ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #0 = id<br>
|
|
||||||
Dataset Type is H5T_NATIVE_INT64<br>
|
|
||||||
Number of elements: 67587</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #1 = px<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 67587</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #2 = py<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 67587</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #3 = pz<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 67587</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #4 = x<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 67587</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #5 = y<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 67587</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #6 = z<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 67587</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">done</font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
<i>NOTE: -H option will omit the list of values of datasets.</i></font></p>
|
|
||||||
<p> </p>
|
|
||||||
<p align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TOP"><back
|
|
||||||
to top></a></font></p>
|
|
||||||
<p> </p>
|
|
||||||
<h2><font color="#555588" face="Arial, Helvetica, sans-serif"><a name="flags">[6]
|
|
||||||
Providing more than one flag at once</a></font></h2>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif">When more than one flags
|
|
||||||
are provided, one result after another will be displayed.</font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b>EXAMPLE>></b></font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif" size="+1"><b><font face="Courier New, Courier, mono">$></font></b></font><font face="Courier New, Courier, mono">
|
|
||||||
./h5pAttrib -H -a 1 -d 1 sample.h5part</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Printing step attributes
|
|
||||||
for: sample.h5part ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">The number of step attributes
|
|
||||||
for timestep #1 is 10 ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Attribute #0 = Step<br>
|
|
||||||
Attribute #1 = Spos<br>
|
|
||||||
Attribute #2 = structLen<br>
|
|
||||||
Attribute #3 = org<br>
|
|
||||||
Attribute #4 = maxX<br>
|
|
||||||
Attribute #5 = minX<br>
|
|
||||||
Attribute #6 = maxP<br>
|
|
||||||
Attribute #7 = minP<br>
|
|
||||||
Attribute #8 = centroid<br>
|
|
||||||
Attribute #9 = nloc<br>
|
|
||||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"><br>
|
|
||||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Printing names of datasets
|
|
||||||
for: sample.h5part ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">The number of datasets for
|
|
||||||
timestep #1 is 7 ...</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #0 = id<br>
|
|
||||||
Dataset Type is H5T_NATIVE_INT64<br>
|
|
||||||
Number of elements: 60214</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #1 = px<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 60214</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #2 = py<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 60214</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #3 = pz<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 60214</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #4 = x<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 60214</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #5 = y<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 60214</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">Dataset Name #6 = z<br>
|
|
||||||
Dataset Type is H5T_NATIVE_DOUBLE<br>
|
|
||||||
Number of elements: 60214</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono">done</font></p>
|
|
||||||
<p> </p>
|
|
||||||
<div align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TOP"><back
|
|
||||||
to top></a></font></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td height="80"></td>
|
|
||||||
<td colspan="3" valign="top">
|
|
||||||
<h2><font face="Arial, Helvetica, sans-serif" size="+1"><b><font color="#999999">---
|
|
||||||
For h5pToGNUplot</font></b></font></h2>
|
|
||||||
<h2><font color="#555588" face="Arial, Helvetica, sans-serif"><a name="parameters">[7]
|
|
||||||
What parameters to provide</a></font></h2>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif">When you execute the program
|
|
||||||
with -h option, it displays what flags are necessary and what flags are
|
|
||||||
optional.</font></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td height="200"></td>
|
|
||||||
<td valign="top" width="137">
|
|
||||||
<p align="left"><b><font face="Arial, Helvetica, sans-serif">Short Version</font></b></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif">-h<br>
|
|
||||||
-1<br>
|
|
||||||
-2<br>
|
|
||||||
-i<br>
|
|
||||||
-t<br>
|
|
||||||
-o<br>
|
|
||||||
-n<br>
|
|
||||||
-s </font></p>
|
|
||||||
</td>
|
|
||||||
<td valign="top" width="144">
|
|
||||||
<p align="left"><b><font face="Arial, Helvetica, sans-serif">Long Version</font></b></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif">--help<br>
|
|
||||||
--1var<br>
|
|
||||||
--2var<br>
|
|
||||||
--input<br>
|
|
||||||
--timestep<br>
|
|
||||||
--output<br>
|
|
||||||
--number<br>
|
|
||||||
--start </font></p>
|
|
||||||
</td>
|
|
||||||
<td valign="top" width="679">
|
|
||||||
<p align="left"><b><font face="Arial, Helvetica, sans-serif">Meanings</font></b></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif">Print help page<br>
|
|
||||||
(REQUIRED) Takes first variable parameter<br>
|
|
||||||
(REQUIRED) Takes second variable parameter<br>
|
|
||||||
(REQUIRED) Takes input file name<br>
|
|
||||||
(REQUIRED) Sets the timestep (Value -1 will result in dumping values of
|
|
||||||
all timesteps.)<br>
|
|
||||||
(OPTIONAL) Takes output file name (without this flag, the program will
|
|
||||||
print to stdout)<br>
|
|
||||||
(OPTIONAL) Sets number of output points<br>
|
|
||||||
(OPTIONAL) Sets the starting particle index</font> </p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td height="1786"></td>
|
|
||||||
<td colspan="3" valign="top">
|
|
||||||
<p> </p>
|
|
||||||
<p align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TOP"><back
|
|
||||||
to top></a></font></p>
|
|
||||||
<h2><font color="#555588" face="Arial, Helvetica, sans-serif"><br>
|
|
||||||
<a name="input file">[8] How to create an input file to GNUplot</a></font></h2>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b>EXAMPLE>></b><br>
|
|
||||||
<i>Create input file to GNUplot that plots x vs. y.</i></font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><b><font face="Courier New, Courier, mono" size="+1">$></font></b><font face="Courier New, Courier, mono">
|
|
||||||
./h5pToGNUplot -1 x -2 y -t 1 -i sample.h5part -o output.txt<br>
|
|
||||||
<b><font size="+1">$></font></b> cat output.txt<br>
|
|
||||||
-0.390779 -0.254793<br>
|
|
||||||
-0.396527 -0.252781<br>
|
|
||||||
-0.375362 -0.285137<br>
|
|
||||||
-0.396527 -0.252781<br>
|
|
||||||
-0.379917 -0.283147<br>
|
|
||||||
-0.390779 -0.254793<br>
|
|
||||||
-0.387536 -0.287346<br>
|
|
||||||
-0.371787 -0.319797<br>
|
|
||||||
-0.379917 -0.283147<br>
|
|
||||||
-0.378967 -0.326058<br>
|
|
||||||
-0.378976 -0.326078<br>
|
|
||||||
-0.387536 -0.287346<br>
|
|
||||||
-0.378957 -0.326069<br>
|
|
||||||
-0.379917 -0.283147<br>
|
|
||||||
-0.388762 -0.265390<br>
|
|
||||||
-0.371787 -0.319797<br>
|
|
||||||
-0.390779 -0.254793<br>
|
|
||||||
-0.376825 -0.266804<br>
|
|
||||||
-0.379917 -0.283147<br>
|
|
||||||
-0.375362 -0.285137<br>
|
|
||||||
...</font></font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"><i>Then run GNUplot...</i></font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"><b><font size="+1">$></font></b>
|
|
||||||
gnuplot</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> G N U P L O T<br>
|
|
||||||
Version 4.0 patchlevel 0<br>
|
|
||||||
last modified Thu Apr 15 14:44:22 CEST 2004<br>
|
|
||||||
System: Linux 2.6.11.4-21.11-smp</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> Copyright (C) 1986 - 1993, 1998,
|
|
||||||
2004<br>
|
|
||||||
Thomas Williams, Colin Kelley and many others</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> This is gnuplot version 4.0.
|
|
||||||
Please refer to the documentation<br>
|
|
||||||
for command syntax changes. The old syntax will be accepted<br>
|
|
||||||
throughout the 4.0 series, but all save files use the new syntax.</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> Type `help` to access the on-line
|
|
||||||
reference manual.<br>
|
|
||||||
The gnuplot FAQ is available from<br>
|
|
||||||
http://www.gnuplot.info/faq/</font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"> Send comments and requests for
|
|
||||||
help to<br>
|
|
||||||
<gnuplot-info@lists.sourceforge.net><br>
|
|
||||||
Send bugs, suggestions and mods to<br>
|
|
||||||
<gnuplot-bugs@lists.sourceforge.net></font></p>
|
|
||||||
<p><font face="Courier New, Courier, mono"><br>
|
|
||||||
Terminal type set to 'x11'<br>
|
|
||||||
<font size="+1"><b>gnuplot></b></font> plot "output.txt"</font></p>
|
|
||||||
<p><font face="Arial, Helvetica, sans-serif"><i>This will open a GNUplot
|
|
||||||
window that plots output.txt.</i></font></p>
|
|
||||||
<p align="center"><img src="H5tools_files/snapshot1.jpg" height="541" width="672"><br>
|
|
||||||
<font face="Arial, Helvetica, sans-serif"><Sample screen shot of GNUplot
|
|
||||||
with input datafile generated by h5pToGNUplot></font></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td height="44"></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
</tbody></table>
|
|
||||||
</body></html>
|
|
||||||
|
Before Width: | Height: | Size: 239 KiB |
@@ -1,54 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>H5Part, Logical Internal HDF5 File Layout</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
<font face="arial,helvetica"><h1>H5Part: Logical Internal HDF5 File Layout</h1></font>
|
|
||||||
<P>
|
|
||||||
HDF5 is extremely flexible in the sense that it allows the user to define a higher level data model to describe domain-specific data relationships. This flexibility however makes it necessary to develop an agreement on the logical layout of the data. The H5Part data model consists of Particle groups corresponding to the simulation time steps, each with seven datasets corresponding to x, px, y, py, z, pz, id for each particle. Attributes can be added to the file and to the datasets.
|
|
||||||
</P>
|
|
||||||
<center><img src="layout.png"></center>
|
|
||||||
<PRE>
|
|
||||||
HDF5 "parttest.h5" {
|
|
||||||
GROUP "/" {
|
|
||||||
GROUP "Particles#0" {
|
|
||||||
DATASET "id" {
|
|
||||||
DATATYPE H5T_STD_I64LE
|
|
||||||
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
|
|
||||||
}
|
|
||||||
DATASET "px" {
|
|
||||||
DATATYPE H5T_IEEE_F64LE
|
|
||||||
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
|
|
||||||
}
|
|
||||||
DATASET "py" {
|
|
||||||
DATATYPE H5T_IEEE_F64LE
|
|
||||||
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
|
|
||||||
}
|
|
||||||
DATASET "pz" {
|
|
||||||
DATATYPE H5T_IEEE_F64LE
|
|
||||||
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
|
|
||||||
}
|
|
||||||
DATASET "x" {
|
|
||||||
DATATYPE H5T_IEEE_F64LE
|
|
||||||
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
|
|
||||||
}
|
|
||||||
DATASET "y" {
|
|
||||||
DATATYPE H5T_IEEE_F64LE
|
|
||||||
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
|
|
||||||
}
|
|
||||||
DATASET "z" {
|
|
||||||
DATATYPE H5T_IEEE_F64LE
|
|
||||||
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</PRE>
|
|
||||||
<P>
|
|
||||||
See <a href="http://www-vis.lbl.gov/Publications/2002/hdf5.pdf">hdf5.pdf</a> for an introduction on the use of HDF5.
|
|
||||||
</P>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@@ -1,7 +1,2 @@
|
|||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
Doxyfile doxyfooter \
|
Doxyfile doxyfooter
|
||||||
$(wildcard *.html) \
|
|
||||||
$(wildcard *.png) \
|
|
||||||
$(wildcard H5PartVisIt/*.png) \
|
|
||||||
$(wildcard H5tools/*.html) \
|
|
||||||
$(wildcard H5tools/H5tools_files/*.jpg)
|
|
||||||
|
|||||||
@@ -1,606 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>H5Part, the C/C++ API</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
|
|
||||||
<h1>The C/C++ Application Programming Interface (API)</h1>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="#Opening">Opening, Closing, and Validating Datafiles</a>
|
|
||||||
<LI><a href="#SetStep">Setting the Simulation Timestep</a>
|
|
||||||
<LI><a href="#SetNumParticles">Setting the Number of Particles</a>
|
|
||||||
<LI><a href="#Writing">Writing Datasets</a>
|
|
||||||
<LI><a href="#ReadingNumTimeSteps">Reading the Number of Time Steps</a>
|
|
||||||
<LI><a href="#ReadingNumParticles">Reading the Number of Particles</a>
|
|
||||||
<LI><a href="#Reading">Reading Datasets</a>
|
|
||||||
<LI><a href="#DatasetsInfo">Reading the Number and the Names of Datasets</a>
|
|
||||||
<LI><a href="#AttributesInfo">Attributes Interface</a>
|
|
||||||
<LI><a href="#WriteAttribs">Writing Additional Attributes</a>
|
|
||||||
<LI><a href="#ReadAttribs">Reading Attributes</a>
|
|
||||||
</UL>
|
|
||||||
<br>
|
|
||||||
<a href="ReferencePages/index.html">Reference Manual (Doxygen)</a>
|
|
||||||
<br>
|
|
||||||
<hr>
|
|
||||||
<a name="Opening"><h2>Opening Datafiles</h2></a>
|
|
||||||
<P>
|
|
||||||
Just like the familiar <code>FILE*</code> type for C stdio operations, all
|
|
||||||
H5Part file operations require a file handle. The type of this handle is
|
|
||||||
<code>(H5PartFile*)</code>.
|
|
||||||
<br>
|
|
||||||
<code>H5PartOpenFile()</code> is
|
|
||||||
used to open a serial file and
|
|
||||||
<code>HDFPartOpenFileParallel()</code> is used to open a file for
|
|
||||||
Parallel I/O (in an MPI program).
|
|
||||||
After you open the file handle you can use the same set of
|
|
||||||
subroutines for operations on the file regardless of whether the
|
|
||||||
file is a parallel or serial I/O file.
|
|
||||||
The libraries manage all of this internally.<p>
|
|
||||||
</P>
|
|
||||||
<b>C Prototypes</b><br>
|
|
||||||
<P>
|
|
||||||
<b>Serial File</b><br>
|
|
||||||
<code>H5PartFile *H5PartOpenFile(const char *filename, unsigned
|
|
||||||
accessmode);</code><br>
|
|
||||||
<b>Parallel File</b><br>
|
|
||||||
<code>H5PartFile *H5PartOpenFileParallel(char *filename,int
|
|
||||||
accessmode,MPI_Comm communicator);</code><br>
|
|
||||||
<DT><i>filename</i>: </DT><DD>The name of the IEEEIO data file to
|
|
||||||
open. The typical extension for these files is <i>.h5</i></DD>
|
|
||||||
<DT><i>accessmode</i>: </DT><DD>The accessmode for the file. This is
|
|
||||||
one of 2 different access modes<br>
|
|
||||||
<code>H5PART_READ</code> : Opens a file in read-only mode.</DT><br>
|
|
||||||
<code>H5PART_WRITE</code> : Opens a file in write-only mode.
|
|
||||||
If the
|
|
||||||
file does not exist, it will be created. If it does
|
|
||||||
exist, it will be
|
|
||||||
truncated.
|
|
||||||
<DT><i>communicator</i>: </DT>
|
|
||||||
<DD>This argument is only available if the program has been
|
|
||||||
compiled with the <code>PARALLEL_IO</code> C-preprocessor flag
|
|
||||||
defined. It is used to pass in the communicator that will be
|
|
||||||
used for all collective I/O operations that target the same
|
|
||||||
file on disk.</DD>
|
|
||||||
<DT><i>Returns</i>:</DT><DD>A new filehandle with an open file or NULL if error.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
. . . code . . .
|
|
||||||
/* Open an HDF5 file for writing */
|
|
||||||
H5PartFile *writer = H5PartOpenFile("datafileout.h5",H5PART_WRITE);
|
|
||||||
/* Open an HDF5 file for Parallel I/O */
|
|
||||||
H5PartFile *writer = H5PartOpenFileParallel("datafileout.h5",H5PART_WRITE,MPI_COMM_WORLD);
|
|
||||||
/* open HDF5 file for reading */
|
|
||||||
H5PartFile *reader = H5PartOpenFile("datafilein.h5",H5PART_READ);
|
|
||||||
/* open HDF5 file for parallel reads */
|
|
||||||
H5PartFile *reader = H5PartOpenFileParallel("datafilein.h5",H5PART_READ,MPI_COMM_WORLD);
|
|
||||||
. . . more code . . .
|
|
||||||
</pre> <br>
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Closing Datafiles</h2>
|
|
||||||
<P>
|
|
||||||
To close the file, you simply use H5PartCloseFile() for both
|
|
||||||
parallel and serial files. You must call H5PartCloseFile() on any
|
|
||||||
file descriptor created by H5PartFileOpen() regardless of
|
|
||||||
whether the file turns out to be valid or not.
|
|
||||||
</P>
|
|
||||||
<b>C Prototypes</b><br>
|
|
||||||
<P>
|
|
||||||
<code>void H5PartCloseFile(H5PartFile *fileID);</code>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
H5PartOpenFile() or H5PartOpenFileParallel().</DD>
|
|
||||||
<DT><i>Returns</i>:</DT><DD>void.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *file;
|
|
||||||
... code ...
|
|
||||||
file=H5PartOpenFileParallel("parttest.h5",H5PART_WRITE,comm);
|
|
||||||
... more code ...
|
|
||||||
H5PartCloseFile(file);
|
|
||||||
</pre>
|
|
||||||
<br>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Validating Datafiles</h2>
|
|
||||||
<P>
|
|
||||||
You can test if the file was opened successfully using the
|
|
||||||
H5PartFileIsValid() function. It returns 1 if valid, 0 if invalid.<p>
|
|
||||||
</P>
|
|
||||||
<b>C Prototype</b><br>
|
|
||||||
<P>
|
|
||||||
<code>int H5PartFileIsValid(H5PartFile *fileID);</code>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
H5PartOpenFile() or H5PartOpenFileParallel().</DD>
|
|
||||||
<DT><i>Returns</i>:</DT><DD>1 if valid, 0 if invalid.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<P>
|
|
||||||
Here is an example of validating a newly opened file. Even if
|
|
||||||
the file is invalid, you must use H5PartCloseFile() to reclaim
|
|
||||||
the file handle.
|
|
||||||
</P>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
. . . code . . .
|
|
||||||
H5PartFile *fileID = H5PartOpenFile("datafileout.h5",H5PART_WRITE);
|
|
||||||
if(!H5PartFileIsValid(fileID)){
|
|
||||||
puts("The file you specified does not exist or is not in a
|
|
||||||
readable format");
|
|
||||||
H5PartClose(fileID); /* must reclaim fileID even if file is invalid */
|
|
||||||
. . . do other cleanup . . .
|
|
||||||
}
|
|
||||||
. . . more code . . .
|
|
||||||
</pre><br>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="SetStep">
|
|
||||||
<h2>Setting the Timestep</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
When writing data to a file the current time step must be set (even if there is only one). In a file with N time steps, the steps are numbered from 0 to N-1.
|
|
||||||
</P>
|
|
||||||
<b>C Prototype</b><br>
|
|
||||||
<P>
|
|
||||||
<code>void H5PartSetStep((H5PartFile *fileID,int step);</code>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
H5PartOpenFile() or H5PartOpenFileParallel().</DD>
|
|
||||||
<DT><i>step</i>: </DT><DD>An integer time step.
|
|
||||||
</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>void.</DD>
|
|
||||||
</DL>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
</P>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
int timeStep;
|
|
||||||
....
|
|
||||||
H5PartSetStep(fileID,timeStep);
|
|
||||||
....
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
<a name="SetNumParticles">
|
|
||||||
</a>
|
|
||||||
<h2>Setting the Number of Particles</h2>
|
|
||||||
<P>
|
|
||||||
H5PartSetNumParticles: This function's sole purpose is to
|
|
||||||
prevent needless creation of new HDF5 DataSpace handles if
|
|
||||||
the number of particles is invariant throughout the sim.
|
|
||||||
That's its only reason for existence. After you call this
|
|
||||||
subroutine, all subsequent operations will assume this
|
|
||||||
number of particles will be written.
|
|
||||||
</P>
|
|
||||||
<b>C Prototype</b><br>
|
|
||||||
<P>
|
|
||||||
<code>void H5PartSetNumParticles(H5PartFile *fileID,long long nparticles);</code>
|
|
||||||
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
H5PartOpenFile() or H5PartOpenFileParallel().</DD>
|
|
||||||
<DT><i>nparticles</i>: </DT><DD>A long long integer specifying the number of particles.
|
|
||||||
</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>void.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
long long nparticles;
|
|
||||||
....
|
|
||||||
H5PartSetStep(fileID,nparticles);
|
|
||||||
....
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="Writing">
|
|
||||||
<h2>Writing Datasets</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
After setting the number of particles with
|
|
||||||
<a href="#SetNumParticles">H5PartSetNumParticles()</a>
|
|
||||||
and the current timestep using
|
|
||||||
<a href="#SetStep">H5PartSetStep()</a>, you can start
|
|
||||||
writing datasets into the file. Each dataset has a name
|
|
||||||
associated with it (chosen by the user) in order to facilitate
|
|
||||||
later retrieval. The writing routines also implicitly store
|
|
||||||
the datatype of the array so that the array can be
|
|
||||||
reconstructed properly on other systems with incompatible type
|
|
||||||
representations. The data is committed to disk before the
|
|
||||||
routine returns. All data that is written after setting the
|
|
||||||
timestep is associated with that timestep. While the number of
|
|
||||||
particles can change for each timestep, you cannot change the
|
|
||||||
number of particles in the middle of a given timestep.
|
|
||||||
</P>
|
|
||||||
<b>C Prototypes</b><br>
|
|
||||||
<P>
|
|
||||||
<code>int H5PartWriteDataFloat64(H5PartFile *fileID,char
|
|
||||||
*name,double *array);</code></br>
|
|
||||||
<code>int H5PartWriteDataInt64(H5PartFile *fileID,char
|
|
||||||
*name,double *array);</code>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>name</i>: </DT><DD>A null-terminated string for the
|
|
||||||
name of the array. When retrieving datasets from disk,
|
|
||||||
you ask for them by name. There are no restrictions on
|
|
||||||
naming of arrays, but it is useful to arrive at some common
|
|
||||||
naming convention when sharing data with other groups.</DD>
|
|
||||||
<DT><i>array</i>: </DT><DD>A buffer containing an array of
|
|
||||||
particle data to commit to disk. The datatype for
|
|
||||||
elements in the buffer is implicit in the name of the
|
|
||||||
subroutine call.</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>1 on success, 0 on failure.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
double *x,*y,*z;
|
|
||||||
int timeStep;
|
|
||||||
long long nparticles;
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
H5PartSetStep(fileID,timeStep); /* must set the current timestep in file */
|
|
||||||
H5PartSetNumParticles(fileID,nparticles); /* then set number of particles to store */
|
|
||||||
|
|
||||||
/* now write different tuples of data into this timestep of the file */
|
|
||||||
H5PartWriteDataFloat64(fileID,"x",x);
|
|
||||||
H5PartWriteDataFloat64(fileID,"y",y);
|
|
||||||
H5PartWriteDataFloat64(file,"z",z);
|
|
||||||
..
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<a name="ReadingNumTimeSteps">
|
|
||||||
<h2>Reading the Number of Time Steps</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
This reads the number of datasteps that are
|
|
||||||
currently stored in the datafile.
|
|
||||||
It works for both reading and writing of files, but is probably
|
|
||||||
only typically used when you are reading.
|
|
||||||
|
|
||||||
</P>
|
|
||||||
<b>C Prototype</b><br>
|
|
||||||
<P>
|
|
||||||
<code>int H5PartGetNumSteps (H5PartFile *fileID);</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by <a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>The number of timesteps currently stored in the file.
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="ReadingNumParticles">
|
|
||||||
<h2>Reading the Number of Particles</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
This reads the number of particles that are
|
|
||||||
currently stored in the current time step.
|
|
||||||
It will arbitrarily select a timestep if you haven't
|
|
||||||
already set the timestep with H5PartSetStep().
|
|
||||||
|
|
||||||
</P>
|
|
||||||
<b>C Prototype</b><br>
|
|
||||||
<P>
|
|
||||||
<code>long long H5PartGetNumParticles (H5PartFile *fileID);</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by <a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>The number of particles in current timestep.
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
int timeStep;
|
|
||||||
long long nparticles;
|
|
||||||
|
|
||||||
H5PartSetStep(fileID,0);
|
|
||||||
nparticles=H5PartGetNumParticles(fileID);
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="Reading">
|
|
||||||
<h2>Reading Datasets</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
After setting the time step and getting the number of particles to allocate the data arrays, you can start to read the data.
|
|
||||||
</P>
|
|
||||||
<b>C Prototypes</b><br>
|
|
||||||
<P>
|
|
||||||
<code>int H5PartReadDataFloat64(H5PartFile *fileID,char *name,double *array);</code><br>
|
|
||||||
<code>int H5PartReadDataInt64(H5PartFile *fileID,char *name,long long *array);</code><br>
|
|
||||||
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>name</i>: </DT><DD>A null-terminated string for the
|
|
||||||
name of the array. When retrieving datasets from disk,
|
|
||||||
you ask for them by name. There are no restrictions on
|
|
||||||
naming of arrays, but it is useful to arrive at some common
|
|
||||||
naming convention when sharing data with other groups.</DD>
|
|
||||||
<DT><i>array</i>: </DT><DD>A buffer to which the particle data will be read.i
|
|
||||||
The datatype for
|
|
||||||
elements in the buffer is implicit in the name of the
|
|
||||||
subroutine call.</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>1 on success, 0 on failure.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
double *x,*y,*z;
|
|
||||||
int timeStep;
|
|
||||||
long long nparticles;
|
|
||||||
|
|
||||||
H5PartSetStep(fileID,0);
|
|
||||||
nparticles=H5PartGetNumParticles(fileID);
|
|
||||||
...
|
|
||||||
|
|
||||||
H5PartReadDataFloat64(file,"x",x);
|
|
||||||
H5PartReadDataFloat64(file,"y",y);
|
|
||||||
H5PartReadDataFloat64(file,"z",z);
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
<hr>
|
|
||||||
<a name="DatasetsInfo"><h2>Reading the Number and Names of Datasets</h2></a>
|
|
||||||
<P>
|
|
||||||
H5Part provides funtions to find out how many datasets are stored at a particular timestep
|
|
||||||
and what their names are if you don't know what they are a-priori.
|
|
||||||
</P>
|
|
||||||
<b>C Prototypes</b><br>
|
|
||||||
<P>
|
|
||||||
<code>int H5PartGetNumDatasets(H5PartFile *fileID);</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>The number of datasets.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
<code>int H5PartGetDatasetName(H5PartFile *fileID,int index,char *name,int maxlen);</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>index</i>:</DT><DD> integer specifying the index of the dataset. If the number of datasets is
|
|
||||||
nds, the range of index is 0 to nds-1.</DD>
|
|
||||||
<DT><i>name</i>:</DT><DD> A null-terminated string for the name of the dataset.</DD>
|
|
||||||
<DT><i>maxlen</i>:</DT><DD> An integer specifying the maximum length of the name array.</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>1 on success, 0 on failure.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
char name[64];
|
|
||||||
int index, nds;
|
|
||||||
|
|
||||||
...
|
|
||||||
nds=H5PartGetNumDatasets(fileID);
|
|
||||||
for(index=0;index< nds;index++){
|
|
||||||
H5PartGetDatasetName(fileID,index,name,64);
|
|
||||||
printf("\tDataset[%u] name=[%s]\n", index,name);
|
|
||||||
}
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="AttributesInfo">
|
|
||||||
<h2>Attributes Interface</h2></a>
|
|
||||||
<P>
|
|
||||||
In the current H5Part implemtation there are two types of attributes: file attributes which are bound to the file
|
|
||||||
and step attributes which are bound to the current timestep. You
|
|
||||||
must set the timestep explicitly before writing the attributes (just
|
|
||||||
as you must do when you write a new dataset. Currently there are no
|
|
||||||
attributes that are bound to a particular data array, but this could
|
|
||||||
easily be done if required.
|
|
||||||
</P>
|
|
||||||
<P>H5PartGetNumStepAttribs and H5PartGetNumFileAttribs return the number of attributes bound to a step and to a file respectively. H5PartGetStepAttribInfo and H5PartGetFileAttribInfo return the name, type and number of elements of type "type" bound to a step and a file respectively.
|
|
||||||
</P>
|
|
||||||
<b>C Prototypes:</b><br>
|
|
||||||
<code>int H5PartGetNumStepAttribs(H5PartFile *fileID);
|
|
||||||
</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>Returns</i> </DT><DD> The number of step attributes for the current step.</DD>
|
|
||||||
</DL>
|
|
||||||
<code>int H5PartGetNumFileAttribs(H5PartFile *fileID);
|
|
||||||
</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>Returns</i> </DT><DD> The number of file attributes.</DD>
|
|
||||||
</DL>
|
|
||||||
<code>void H5PartGetStepAttribInfo(H5PartFile *fileID,int idx, char *name,size_t maxnamelen,hid_t *type,int *nelem);
|
|
||||||
</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>idx</i>: </DT><DD>Index of the attribute.</DD>
|
|
||||||
<DT><i>name</i>: </DT><DD>A null-terminated string with the name of the attribute.</DD>
|
|
||||||
<DT><i>maxnamelen</i></DT><DD>the length of the name of the attribute.</DD>
|
|
||||||
<DT><i>type</i>: </DT><DD>One of the following: H5T_NATIVE_DOUBLE H5T_NATIVE_INT64 H5T_NATIVE_CHAR.</DD>
|
|
||||||
<DT><i>nelem</i>: </DT><DD>Number of elements of type "type".</DD>
|
|
||||||
<DT><i>Returns</i> </DT><DD> void.</DD>
|
|
||||||
</DL>
|
|
||||||
|
|
||||||
<code>void H5PartGetFileAttribInfo(H5PartFile *fileID,int idx, char *name,size_t maxnamelen, hid_t *type,int *nelem);
|
|
||||||
</code><br>
|
|
||||||
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>idx</i>: </DT><DD>Index of the attribute.</DD>
|
|
||||||
<DT><i>name</i>: </DT><DD>A null-terminated string with the name of the attribute.</DD>
|
|
||||||
<DT><i>maxnamelen</i></DT><DD>the length of the name of the attribute.</DD>
|
|
||||||
<DT><i>type</i>: </DT><DD>One of the following: H5T_NATIVE_DOUBLE H5T_NATIVE_INT64 H5T_NATIVE_CHAR.</DD>
|
|
||||||
<DT><i>nelem</i>: </DT><DD>Number of elements of type "type".</DD>
|
|
||||||
<DT><i>Returns</i> </DT><DD> void.</DD>
|
|
||||||
</DL>
|
|
||||||
|
|
||||||
|
|
||||||
<a name="WriteAttribs">
|
|
||||||
<h2>Writing Attributes</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
An attribute can be bound to the file or after setting the time step to this time step.
|
|
||||||
</P>
|
|
||||||
|
|
||||||
<b>C Prototypes: Generic Attributes</b><br>
|
|
||||||
<P>
|
|
||||||
<code>int H5PartWriteFileAttrib(H5PartFile *fileID,char *name, hid_t type,void *value,int nelem);</code><br>
|
|
||||||
<code>int H5PartWriteStepAttrib(H5PartFile *fileID,char *name, hid_t type,void *value,int nelem);</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>name</i>: </DT><DD>A null-terminated string for the
|
|
||||||
name of the array. When retrieving datasets from disk,
|
|
||||||
you ask for them by name. There are no restrictions on
|
|
||||||
naming of arrays, but it is useful to arrive at some common
|
|
||||||
naming convention when sharing data with other groups.</DD>
|
|
||||||
<DT><i>type</i>: One of H5T_NATIVE_DOUBLE, H5T_NATIVE_INT64, H5T_NATIVE_CHAR.</DD>
|
|
||||||
<DT><i>value</i>: value of the attribute.</DD>
|
|
||||||
<DT><i>nelem</i>: number of elements of type "type".</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>1 on success, 0 on failure.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
double actPos;
|
|
||||||
|
|
||||||
...
|
|
||||||
H5PartWriteStepAttrib(file_m,"Spos",H5T_NATIVE_DOUBLE,&actPos,1);
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
|
|
||||||
<b>C Prototypes: String Attributes</b><br>
|
|
||||||
<P>
|
|
||||||
<code>int H5PartWriteStepAttribString(H5PartFile *fileID,char *name, char *attrib);</code><br>
|
|
||||||
<code>int H5PartWriteFileAttribString(H5PartFile *fileID,char *name, char *attrib);</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>name</i>: </DT><DD>A null-terminated string for the
|
|
||||||
name of the array. When retrieving datasets from disk,
|
|
||||||
you ask for them by name. There are no restrictions on
|
|
||||||
naming of arrays, but it is useful to arrive at some common
|
|
||||||
naming convention when sharing data with other groups.</DD>
|
|
||||||
<DT><i>attrib</i>: the attribute character string.</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>1 on success, 0 on failure.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
char *newattrib;
|
|
||||||
char *newname;
|
|
||||||
|
|
||||||
...
|
|
||||||
H5PartWriteFileAttribString(fileID, newname,newattrib);
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="ReadAttribs">
|
|
||||||
<h2>Reading Attributes</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
<P>
|
|
||||||
As with the writing of attributes, there are two basic reading interfaces one that reads file bound attributes and one that reads
|
|
||||||
step bound attributes. If the step is not set the current one will be used.
|
|
||||||
</P>
|
|
||||||
</P>
|
|
||||||
<b>C Prototypes</b><br>
|
|
||||||
<P>
|
|
||||||
<code>void H5PartReadStepAttrib(H5PartFile *fileID,char *name,void *value);</code><br>
|
|
||||||
<code>void H5PartReadAttrib(H5PartFile *fileID,char *name,void *value);</code><br>
|
|
||||||
<code>int H5PartReadFileAttrib(H5PartFile *fileID,char *name,void *value);</code><br>
|
|
||||||
<DL>
|
|
||||||
<DT><i>fileID</i>: </DT><DD>A FileHandle opened by
|
|
||||||
<a href="#Opening">H5PartOpenFile()</a> or
|
|
||||||
<a href="#Opening">H5PartOpenFileParallel()</a>.</DD>
|
|
||||||
<DT><i>name</i>: </DT><DD>A null-terminated string for the
|
|
||||||
name of the array. When retrieving datasets from disk,
|
|
||||||
you ask for them by name. There are no restrictions on
|
|
||||||
naming of arrays, but it is useful to arrive at some common
|
|
||||||
naming convention when sharing data with other groups.</DD>
|
|
||||||
<DT><i>value</i>: value of the attribute.</DD>
|
|
||||||
<DT><i>Returns</i>: </DT><DD>1 on success, 0 on failure.</DD>
|
|
||||||
</DL>
|
|
||||||
</P>
|
|
||||||
<br>
|
|
||||||
NOTE: H5PartReadAttrib has been superseeded by H5PartSetStep.
|
|
||||||
<br>
|
|
||||||
<br><b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
#include < H5Part.h >
|
|
||||||
H5PartFile *fileID;
|
|
||||||
int step;
|
|
||||||
char name[MAXNAME];
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
H5PartSetStep(fileID, step);
|
|
||||||
if (H5PartReadStepAttrib(file, "filename", &name[0]) == 1){
|
|
||||||
printf("Read step from file: %s\n", name);
|
|
||||||
}
|
|
||||||
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
@@ -1,504 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>H5part, the Fortran API</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
<!--#include virtual="/include/topIncludes.html"-->
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
|
|
||||||
|
|
||||||
<h1>The FORTRAN Application Programming Interface (API)</h1>
|
|
||||||
<P>
|
|
||||||
These references contain the information on how to access the H5Part API using FORTRAN bindings. All pointers are cast to haddr_t (a unint64_t) within the C/C++ code. In fortran, these pointers (handles) are carried as INTEGER*8
|
|
||||||
</P>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="#Opening">Opening, Closing, and Validating Datafiles</a>
|
|
||||||
<LI><a href="#SetStep">Setting the Simulation Timestep</a>
|
|
||||||
<LI><a href="#SetNumParticles">Setting the Number of Particles</a>
|
|
||||||
<LI><a href="#Writing">Writing Datasets</a>
|
|
||||||
<LI><a href="#ReadingNumTimeSteps">Reading the Number of Time Steps</a>
|
|
||||||
<LI><a href="#ReadingNumTimeSteps">Reading the Number of Particles</a>
|
|
||||||
<LI><a href="#Reading">Reading Datasets</a>
|
|
||||||
<LI><a href="#DatasetsInfo">Reading the Number and the Names of Datasets</a>
|
|
||||||
<LI><a href="#AttributesInfo">Attributes Interface</a>
|
|
||||||
<LI><a href="#WriteAttribs">Writing Additional Attributes</a>
|
|
||||||
<LI><a href="#ReadAttribs">Reading Attributes</a>
|
|
||||||
</UL>
|
|
||||||
<hr>
|
|
||||||
<a name="Opening"><h2>Opening Datafiles</h2></a>
|
|
||||||
<P>
|
|
||||||
Like the familiar OPEN in FORTRAN files can be opened to read and write. Different functions are used for the serial and parallel case.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<P>
|
|
||||||
<b>Serial File</b><br>
|
|
||||||
<code>INTEGER*8 h5pt_openr</code><br>
|
|
||||||
<code>FUNCTION h5pt_openw(file)<br>
|
|
||||||
in CHARACTER file(*) : the filename to open for writing </code><br>
|
|
||||||
returns INTEGER*8 : and open filehandle for serial reads</code><br>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER*8 h5pt_openw</code><br>
|
|
||||||
<code>FUNCTION h5pt_openw(file)<br>
|
|
||||||
in CHARACTER file(*) : the filename to open for writing<br>
|
|
||||||
returns INTEGER*8 : and open filehandle for serial writes</code><br>
|
|
||||||
<br>
|
|
||||||
<b>Parallel File</b><br>
|
|
||||||
<code>INTEGER*8 h5pt_openr_par</code><br>
|
|
||||||
<code>FUNCTION h5pt_openr_par(file,mpi_communicator)<br>
|
|
||||||
in CHARACTER file(*) : the filename to open for writing<br>
|
|
||||||
in INTEGER mpi_communicator : the MPI_Communicator used by the program<br>
|
|
||||||
returns INTEGER*8 : and open filehandle for parallel reads</code><br>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER*8 h5pt_openw_par</code><br>
|
|
||||||
<code>FUNCTION h5pt_openw_par(file,mpi_communicator)<br>
|
|
||||||
in CHARACTER file(*) : the filename to open for writing<br>
|
|
||||||
in INTEGER mpi_communicator : the MPI_Communicator used by the program<br>
|
|
||||||
returns INTEGER*8 : and open filehandle for parallel reads</code><br>
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
...
|
|
||||||
file = h5pt_openw("testfilef.h5")
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
</P>
|
|
||||||
<hr>
|
|
||||||
<h2>Closing Datafiles</h2>
|
|
||||||
<P>
|
|
||||||
To close the file, you simply use h5pt_close() for both parallel and serial files. You must call h5pt_close() on any file descriptor created by h5pt_open*() regardless of whether the file turns out to be valid or not.</P>
|
|
||||||
<b>FORTRAN Prototype</b><br>
|
|
||||||
<code>EXTERNAL h5pt_close</code><br>
|
|
||||||
<code>SUBROUTINE h5pt_close(filehandle)<br>
|
|
||||||
in INTEGER*8 filehandle : close this open filehandle</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
...
|
|
||||||
call h5pt_close(file)
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
</P>
|
|
||||||
<hr>
|
|
||||||
<h2> Validating Datafiles</h2>
|
|
||||||
<P>
|
|
||||||
You can test if the file was opened successfully using the
|
|
||||||
h5p_isvalid() function. It returns 1 if valid, 0 if invalid.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototype</b><br>
|
|
||||||
<code>INTEGER h5pt_isvalid</code><br>
|
|
||||||
<code>FUNCTION h5pt_isvalid(filehandle)<br>
|
|
||||||
in INTEGER*8 filehandle: an open filehandle <br>
|
|
||||||
returns INTEGER : 1 if the file is valid, 0 if it is not</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER status
|
|
||||||
...
|
|
||||||
status = h5pt_isvalid(file)
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
</P>
|
|
||||||
<hr>
|
|
||||||
<a name="SetStep">
|
|
||||||
<h2>Setting the Timestep</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
When writing data to a file the current time step must be set (even if there is only one). In a file with N time steps, the steps are numbered from 0 to N-1.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototype</b><br>
|
|
||||||
<code>EXTERNAL h5pt_setstep</code><br>
|
|
||||||
<code>SUBROUTINE h5pt_setstep(filehandle,step)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in INTEGER step : Set the current timestep in the file to this
|
|
||||||
</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER I
|
|
||||||
INTEGER nstep
|
|
||||||
...
|
|
||||||
do I=1,nstep
|
|
||||||
call h5pt_setstep(file,I)
|
|
||||||
... more code ...
|
|
||||||
enddo
|
|
||||||
</pre>
|
|
||||||
</P>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="SetNumParticles">
|
|
||||||
</a>
|
|
||||||
<h2>Setting the Number of Particles</h2>
|
|
||||||
<P>
|
|
||||||
This function's sole purpose is to
|
|
||||||
prevent needless creation of new HDF5 DataSpace handles if
|
|
||||||
the number of particles is invariant throughout the sim.
|
|
||||||
That's its only reason for existence. After you call this
|
|
||||||
subroutine, all subsequent operations will assume this
|
|
||||||
number of particles will be written.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototype</b><br>
|
|
||||||
<code>EXTERNAL h5pt_setnpoints</code><br>
|
|
||||||
<code>SUBROUTINE h5pt_setnpoints(filehandle,npoints)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in INTEGER*8 npoints : The number of particles on *this* processor</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER*8 npoints
|
|
||||||
|
|
||||||
...
|
|
||||||
call h5pt_setnpoints(file,npoints)
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<a name="Writing">
|
|
||||||
<h2>Writing Datasets</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
After setting the number of particles with
|
|
||||||
<a href="#SetNumParticles">h5pt_setnpoints()</a>
|
|
||||||
and the current timestep using
|
|
||||||
<a href="#SetStep">h5pt_setstep()</a>, you can start
|
|
||||||
writing datasets into the file. Each dataset has a name
|
|
||||||
associated with it (chosen by the user) in order to facilitate
|
|
||||||
later retrieval. The writing routines also implicitly store
|
|
||||||
the datatype of the array so that the array can be
|
|
||||||
reconstructed properly on other systems with incompatible type
|
|
||||||
representations. The data is committed to disk before the
|
|
||||||
routine returns. All data that is written after setting the
|
|
||||||
timestep is associated with that timestep. While the number of
|
|
||||||
particles can change for each timestep, you cannot change the
|
|
||||||
number of particles in the middle of a given timestep.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<P>
|
|
||||||
The two data types supported for the moment are REAL*8 and INTEGER*8 (float64 and int64).
|
|
||||||
</P>
|
|
||||||
<code>EXTERNAL h5pt_writedata_r8</code><br>
|
|
||||||
<code>SUBROUTINE h5pt_writedata_r8(filehandle,name,data)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the data we are writing eg. "X" or "Y" or "PX" etc...<br>
|
|
||||||
in REAL*8 data(*) : The dataarray to write</code><br>
|
|
||||||
<br>
|
|
||||||
<code>EXTERNAL h5pt_writedata_i8</code><br>
|
|
||||||
<code>SUBROUTINE h5pt_writedata_i8(filehandle,name,data)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the data we are writing eg. "X" or "Y" or "PX" etc...<br>
|
|
||||||
in INTEGER*8 data(*) : The dataarray to write</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER nstep
|
|
||||||
INTEGER I
|
|
||||||
REAL*8,ALLOCATABLE:: X(:)
|
|
||||||
|
|
||||||
...
|
|
||||||
do I=1,nstep
|
|
||||||
call h5pt_setstep(file,I)
|
|
||||||
call h5pt_writedata_r8(file,"x",X)
|
|
||||||
enddo
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
<hr>
|
|
||||||
<a name="ReadingNumTimeSteps">
|
|
||||||
<h2>Reading the Number of Time Steps</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
This reads the number of datasteps that are
|
|
||||||
currently stored in the datafile.
|
|
||||||
It works for both reading and writing of files, but is probably
|
|
||||||
only typically used when you are reading.
|
|
||||||
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<code>INTEGER h5pt_getnsteps</code><br>
|
|
||||||
<code>FUNCTION h5pt_getnsteps(filehandle)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
returns INTEGER : number of timesteps stored in the file</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER nstep
|
|
||||||
|
|
||||||
file = h5pt_openr("testfilef.h5")
|
|
||||||
nstep = h5pt_getnsteps(file)
|
|
||||||
</pre>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="ReadingNumParticles">
|
|
||||||
<h2>Reading the Number of Particles</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
This reads the number of particles that are currently stored in the current time step. It will arbitrarily select a timestep if you haven't already set the timestep with H5PartSetStep().
|
|
||||||
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<code>INTEGER h5pt_getnpointss</code><br>
|
|
||||||
<code>FUNCTION h5pt_getnpoints(filehandle)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
returns INTEGER : number of particles in the current time step</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER*8 npoints
|
|
||||||
INTEGET step;
|
|
||||||
|
|
||||||
file = h5pt_openr("testfilef.h5")
|
|
||||||
call h5pt_setstep(file,0)
|
|
||||||
npoints = h5pt_getnpoints(file)
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="Reading">
|
|
||||||
<h2>Reading Datasets</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
After setting the time step and getting the number of particles to allocate the data arrays, you can start to read the data.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<code>INTEGER h5pt_readdata_r8</code><br>
|
|
||||||
<code>FUNCTION h5pt_readdata_r8(filehandle,name,data)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the data we are writing, eg. "X" or "Y" or "PX" etc...<br>
|
|
||||||
out REAL*8 data(*) : The data array to read. The number of points to read is either the number within
|
|
||||||
the view setby h5pt_setview() or the default (the total number of particles in the file).<br>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER err
|
|
||||||
INTEGER*8,ALLOCATABLE:: ID(:)
|
|
||||||
|
|
||||||
...
|
|
||||||
call h5pt_setstep(file,step)
|
|
||||||
err=h5pt_readdata_i8(file,"id",ID)
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
<hr>
|
|
||||||
<a name="DatasetsInfo"><h2>Reading the Number and Names of Datasets</h2></a>
|
|
||||||
<P>
|
|
||||||
H5Part provides funtions to find out how many datasets are stored at a particular timestep
|
|
||||||
and what their names are if you don't know what they are a-priori.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<code>INTEGER h5pt_getndatasets</code><br>
|
|
||||||
<code>FUNCTION h5pt_getndatasets(filehandle)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
returns INTEGER*8 : number of datasets stored per timestep</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER ndata
|
|
||||||
|
|
||||||
...
|
|
||||||
call h5pt_setstep(file,1)
|
|
||||||
ndata = h5pt_getndatasets(file)
|
|
||||||
...
|
|
||||||
|
|
||||||
</pre>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<code>INTEGER h5pt_getdatasetname</code><br>
|
|
||||||
<code>FUNCTION h5pt_getdatasetname(filehandle,index,name)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in INTEGER index : Index for a given dataset name<br>
|
|
||||||
out CHARACTER name(*) returns the name of the dataset at that index<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure.</code><br>
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
INTEGER err
|
|
||||||
CHARACTER,ALLOCATABLE:: name(:)
|
|
||||||
|
|
||||||
...
|
|
||||||
err=h5pt_getdatasetname(file, 1, name)
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<a name="AttributesInfo">
|
|
||||||
<h2>Attributes Interface</h2></a>
|
|
||||||
<P>
|
|
||||||
In the current H5Part implemtation there are two types of attributes: file attributes which are bound to the file
|
|
||||||
and step attributes which are bound to the current timestep. You
|
|
||||||
must set the timestep explicitly before writing the attributes (just
|
|
||||||
as you must do when you write a new dataset. Currently there are no
|
|
||||||
attributes that are bound to a particular data array, but this could
|
|
||||||
easily be done if required.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<code>INTEGER h5pt_getnstepattribs</code><br>
|
|
||||||
<code>FUNCTION h5pt_getnstepattribs(filehandle)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
returns INTEGER : number of attributes bound to this particular step<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_getnfileattribs</code><br>
|
|
||||||
<code>FUNCTION h5pt_getnfileattribs(filehandle)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
returns INTEGER : number of attributes bound to the file<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_getstepattribinfo</code><br>
|
|
||||||
<code>FUNCTION h5pt_getstepattribinfo(filehandle,idx,attribname,nelem)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in INTEGER idx : index of the attribute being queried<br>
|
|
||||||
out CHARACTER name(*) : The name of the attribute<br>
|
|
||||||
out INTEGER nelem : Number of elements in the attrib array<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure.<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_getfileattribinfo</code><br>
|
|
||||||
<code>FUNCTION h5pt_getfileattribinfo(filehandle,idx,attribname,nelem)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in INTEGER idx : index of the attribute being queried<br>
|
|
||||||
out CHARACTER name(*) : The name of the attribute<br>
|
|
||||||
out INTEGER nelem : Number of elements in the attrib array<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure.
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<a name="WriteAttribs">
|
|
||||||
<h2>Writing Attributes</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
An attribute can be bound to the file or after setting the time step to this time step.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
<code>INTEGER h5pt_writefileattrib_r8</code><br>
|
|
||||||
<code>
|
|
||||||
FUNCTION h5pt_writefileattrib_r8(filehandle,name,attrib,nelem)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the attribute<br>
|
|
||||||
in REAL*8 attrib(*) : The array of data to write into the attribute<br>
|
|
||||||
in INTEGER nelem : Number of elements in the attrib array<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_writefileattrib_i8</code><br>
|
|
||||||
<code>FUNCTION h5pt_writefileattrib_i8(filehandle,name,attrib,nelem)<br>
|
|
||||||
in INTEGER*8 filehandle : The filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the attribute<br>
|
|
||||||
in INTEGER*8 attrib(*) : The array of data to write into the attribute<br>
|
|
||||||
in INTEGER nelem : Number of elements in the attrib array<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_writefileattrib_string</code><br>
|
|
||||||
<code>FUNCTION h5pt_writefileattrib_string(filehandle,name,string)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the attribute<br>
|
|
||||||
in CHARACTER*8 attrib(*) : The array of data to write into the attribute<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_writestepattrib_r8</code><br>
|
|
||||||
<code>FUNCTION h5pt_writestepattrib_r8(filehandle,name,attrib,nelem)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the attribute<br>
|
|
||||||
in REAL*8 attrib(*) : The array of data to write into the attribute<br>
|
|
||||||
in INTEGER nelem : Number of elements in the attrib array
|
|
||||||
returns INTEGER, 1 on success 0 on failure<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_writestepattrib_i8</code><br>
|
|
||||||
<code>FUNCTION h5pt_writestepattrib_i8(filehandle,name,attrib,nelem)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the attribute<br>
|
|
||||||
in INTEGER*8 attrib(*) : The array of data to write into the attribute<br>
|
|
||||||
in INTEGER nelem : Number of elements in the attrib array<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_writestepattrib_string</code><br>
|
|
||||||
<code>FUNCTION h5pt_writestepattrib_string(filehandle,name,string)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER name(*) : The name of the attribute<br>
|
|
||||||
in CHARACTER*8 attrib(*) : The array of data to write into the attribute<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure<br>
|
|
||||||
</code>
|
|
||||||
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
REAL*8 REALTIME
|
|
||||||
INTEGER err
|
|
||||||
|
|
||||||
...
|
|
||||||
err=h5pt_writefileattrib_string(file,"Annotation","Testing 1 2 3")
|
|
||||||
err=h5pt_writestepattrib_r8(file,"RealTime",REALTIME,1)
|
|
||||||
...
|
|
||||||
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<a name="ReadAttribs">
|
|
||||||
<h2>Reading Attributes</h2>
|
|
||||||
</a>
|
|
||||||
<P>
|
|
||||||
As with the writing of attributes, there are two basic reading interfaces one that reads file bound attributes and one that reads
|
|
||||||
step bound attributes. If the step is not set the current one will be used.
|
|
||||||
</P>
|
|
||||||
<b>FORTRAN Prototypes</b><br>
|
|
||||||
|
|
||||||
<code>INTEGER h5pt_readstepattrib</code><br>
|
|
||||||
<code>FUNCTION h5pt_readstepattrib(filehandle,name,data)<br>
|
|
||||||
in INTEGER*8 filehandle : an open filehandle<br>
|
|
||||||
in CHARACTER attributename(*) : name of the attribute to read<br>
|
|
||||||
out <anytype> data(*) : the attribute data will be read into this array<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure<br>
|
|
||||||
</code>
|
|
||||||
<br>
|
|
||||||
<code>INTEGER h5pt_readfileattrib</code><br>
|
|
||||||
<code>FUNCTION h5pt_readfileattrib(filehandle,name,data)<br>
|
|
||||||
in INTEGER*8 filehandle an open filehandle<br>
|
|
||||||
in CHARACTER attributename(*) : name of the attribute to read<br>
|
|
||||||
out <anytype> data(*) : the attribute data will be read into this array<br>
|
|
||||||
returns INTEGER, 1 on success 0 on failure<br>
|
|
||||||
</code>
|
|
||||||
|
|
||||||
<b>Example Use</b><br>
|
|
||||||
<pre>
|
|
||||||
include 'H5Part.inc'
|
|
||||||
INTEGER*8 file
|
|
||||||
REAL*8 REALTIME
|
|
||||||
|
|
||||||
...
|
|
||||||
call h5pt_setstep(file,0)
|
|
||||||
err=h5pt_readstepattrib(file,"RealTime",data)
|
|
||||||
...
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--#include virtual="/include/dateFooter.html"-->
|
|
||||||
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 187 KiB |
@@ -1,121 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>H5Part: a Portable High Performance Parallel Data Interface to HDF5</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
||||||
<meta name="keywords" content="scientific visualization">
|
|
||||||
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="maincenter">
|
|
||||||
<font face="arial,helvetica"><h1>H5Part: a Portable High Performance Parallel Data Interface to HDF5</h1></font>
|
|
||||||
<h2><font color="red"> THESE PAGES ARE UNDER CONSTRUCTION, September 2006</h2></font>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>Motivation</h2></font>
|
|
||||||
<P>
|
|
||||||
<TABLE>
|
|
||||||
<TR>
|
|
||||||
<TD>
|
|
||||||
<a href="collision_6.png"><img src="collision_6.s.png" width=300 height=300></a>
|
|
||||||
</TD
|
|
||||||
></TR>
|
|
||||||
<TR>
|
|
||||||
<TD>
|
|
||||||
Beam-beam collision simulation.
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
Particle based simulations of accelerator beam-lines, especially in
|
|
||||||
six dimensional phase space, generate vast amounts of data. Even
|
|
||||||
though a subset of statistical information regarding phase space
|
|
||||||
or analysis needs to be preserved, reading and writing such
|
|
||||||
enormous restart files on massively parallel supercomputing
|
|
||||||
systems remains challenging.<p>
|
|
||||||
</P>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
H5Part is a very simple data storage schema and provides an
|
|
||||||
API that simplifies the reading/writing of the data to the HDF5
|
|
||||||
file format. An important foundation for a stable visualization and data
|
|
||||||
analysis environment is a stable and portable file storage format and
|
|
||||||
its associated APIs. The presence of a "common file storage format,"
|
|
||||||
including associated APIs, will help foster a fundamental level of
|
|
||||||
interoperability across the project's software infrastructure. It will
|
|
||||||
also help ensure that key data analysis capabilities are present
|
|
||||||
during the earliest phases of the software development effort.
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
H5Part is built on top of the <a href="http://hdf.ncsa.uiuc.edu/HDF5">HDF5 (Hierarchical Data Format).</a>
|
|
||||||
HDF5 offers a self-describing machine-independent
|
|
||||||
binary file format that supports scalable parallel I/O
|
|
||||||
performance for MPI codes on a variety of supercomputing
|
|
||||||
systems, and works equally well on laptop computers. The API is
|
|
||||||
available for C, C++, and Fortran codes. The H5Part file format and APIs
|
|
||||||
enable disparate research groups with different simulation
|
|
||||||
implementations to transparently share datasets and data
|
|
||||||
analysis tools. For instance, the common file format will enable
|
|
||||||
groups that depend on completely different simulation
|
|
||||||
implementations to share data analysis tools.
|
|
||||||
</P>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>H5Part file organization and API</h2></font>
|
|
||||||
<P>
|
|
||||||
The proposed file storage format uses HDF5 for the lowlevel
|
|
||||||
file storage and a simple API to provide a high-level
|
|
||||||
interface to that file format. A programmer can either use
|
|
||||||
the H5Part API to access the data files or write directly to
|
|
||||||
the file format using some simple conventions for organizing
|
|
||||||
and naming the objects stored in the file.
|
|
||||||
</P>
|
|
||||||
<P>
|
|
||||||
In order to store Particle Data in the HDF5 file format,
|
|
||||||
we have formalized the hierarchical arrangement of the
|
|
||||||
datasets and naming conventions for the groups and associated
|
|
||||||
datasets. The sample H5Part API formally encodes
|
|
||||||
these conventions in order to provide a simple and uniform
|
|
||||||
way to access these files from C, C++, and Fortran codes.
|
|
||||||
The API makes it easier to write very portable data adaptors
|
|
||||||
for visualization tools in order to expand the number of
|
|
||||||
tools available to access the data. Even so, anyone can use
|
|
||||||
the HDF5 h5ls utility to examine the organization of the
|
|
||||||
H5Part files and even write their own HDF5-based interface
|
|
||||||
for reading and writing the file format. The standards
|
|
||||||
offered by the sample API are completely independent of
|
|
||||||
the standard for organizing data within the file.The file
|
|
||||||
format supports the storage of multiple timesteps
|
|
||||||
of datasets that contain multiple fields.
|
|
||||||
</P>
|
|
||||||
<!--
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>Requirements Specification</h2></font>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="H5PartSpecs.html">H5Part API specifications
|
|
||||||
</UL>
|
|
||||||
</a>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>Downloading and Installing H5Part</h2></font>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="Downloading.html">Downloading HDF5 and H5Part
|
|
||||||
<LI><a href="BuildingHDF5.html">Building the HDF5 Library</a>
|
|
||||||
<LI><a href="Building.html">Building the H5Part Library</a>
|
|
||||||
</UL>
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>Bindings</h2></font>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="UsingC.html">Using the C/C++ interface</a>
|
|
||||||
<LI><a href="UsingF.html">Using the F77/F90 interface</a>
|
|
||||||
<LI><a href="InternalLayout.html">Logical Internal HDF5 File</a>
|
|
||||||
<LI><a href="H5PartTools.html">H5Part Utility Tools</a>
|
|
||||||
<LI><a href="ReferencePages/index.html">Reference Manual</a>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<font face="arial,helvetica" color="#555588"><h2>H5Part Visualization Tools</h2></font>
|
|
||||||
<UL>
|
|
||||||
<LI><a href="H5PartExpress.html">H5Part Express Reader</a>
|
|
||||||
<LI><a href="H5PartVisIt.html">H5Part VisIt Reader</a>
|
|
||||||
<LI><a href="H5PartIDL.html">H5Part IDL Reader</a>
|
|
||||||
<LI><a href="http://www.cscs.ch/a-display.php?id=170">H5Part sparticles Reader: developed at CSCS, Switzerland</a>
|
|
||||||
|
|
||||||
<LI><a href="H5PartPartView.html">PartView Visualization Application</a>
|
|
||||||
</UL>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 15 KiB |
@@ -12,25 +12,25 @@ extern "C" {
|
|||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5BlockDefine3DFieldLayout (
|
H5BlockDefine3DFieldLayout (
|
||||||
H5PartFile *f, /*!< file handle */
|
H5PartFile *f,
|
||||||
const h5part_int64_t i_start, /*!< start index of i */
|
const h5part_int64_t i_start,
|
||||||
const h5part_int64_t i_end, /*!< end index of i */
|
const h5part_int64_t i_end,
|
||||||
const h5part_int64_t j_start, /*!< start index of j */
|
const h5part_int64_t j_start,
|
||||||
const h5part_int64_t j_end, /*!< end index of j */
|
const h5part_int64_t j_end,
|
||||||
const h5part_int64_t k_start, /*!< start index of k */
|
const h5part_int64_t k_start,
|
||||||
const h5part_int64_t k_end /*!< end index of k */
|
const h5part_int64_t k_end
|
||||||
);
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5Block3dGetPartitionOfProc (
|
H5Block3dGetPartitionOfProc (
|
||||||
H5PartFile *f, /*!< file handle */
|
H5PartFile *f,
|
||||||
const h5part_int64_t proc,
|
const h5part_int64_t proc,
|
||||||
h5part_int64_t *i_start, /*!< start index of i */
|
h5part_int64_t *i_start,
|
||||||
h5part_int64_t *i_end, /*!< end index of i */
|
h5part_int64_t *i_end,
|
||||||
h5part_int64_t *j_start, /*!< start index of j */
|
h5part_int64_t *j_start,
|
||||||
h5part_int64_t *j_end, /*!< end index of j */
|
h5part_int64_t *j_end,
|
||||||
h5part_int64_t *k_start, /*!< start index of k */
|
h5part_int64_t *k_start,
|
||||||
h5part_int64_t *k_end /*!< end index of k */
|
h5part_int64_t *k_end
|
||||||
);
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -53,6 +53,27 @@ H5Block3dGetProcOf (
|
|||||||
h5part_int64_t k
|
h5part_int64_t k
|
||||||
);
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dWriteScalarFieldFloat64 (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
const h5part_float64_t *data
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dWriteScalarFieldFloat32 (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
const h5part_float32_t *data
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dWriteScalarFieldInt64 (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
const h5part_int64_t *data
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5Block3dWriteScalarField (
|
H5Block3dWriteScalarField (
|
||||||
H5PartFile *f,
|
H5PartFile *f,
|
||||||
@@ -60,6 +81,27 @@ H5Block3dWriteScalarField (
|
|||||||
const h5part_float64_t *data
|
const h5part_float64_t *data
|
||||||
);
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dReadScalarFieldFloat64 (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
h5part_float64_t *data
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dReadScalarFieldFloat32 (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
h5part_float32_t *data
|
||||||
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5Block3dReadSclarFieldInt64 (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
h5part_int64_t *data
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5Block3dReadScalarField (
|
H5Block3dReadScalarField (
|
||||||
H5PartFile *f,
|
H5PartFile *f,
|
||||||
@@ -132,20 +174,20 @@ H5Block3dSetFieldSpacing (
|
|||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5Block3dWrite3dVectorField (
|
H5Block3dWrite3dVectorField (
|
||||||
H5PartFile *f, /*!< file handle */
|
H5PartFile *f,
|
||||||
const char *name, /*!< name of the data set */
|
const char *name,
|
||||||
const h5part_float64_t *xval, /*!< array of x component data */
|
const h5part_float64_t *xval,
|
||||||
const h5part_float64_t *yval, /*!< array of y component data */
|
const h5part_float64_t *yval,
|
||||||
const h5part_float64_t *zval /*!< array of z component data */
|
const h5part_float64_t *zval
|
||||||
);
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5Block3dRead3dVectorField (
|
H5Block3dRead3dVectorField (
|
||||||
H5PartFile *f, /*!< file handle */
|
H5PartFile *f,
|
||||||
const char *name, /*!< name of the data set */
|
const char *name,
|
||||||
h5part_float64_t *xval, /*!< array of x component data */
|
h5part_float64_t *xval,
|
||||||
h5part_float64_t *yval, /*!< array of y component data */
|
h5part_float64_t *yval,
|
||||||
h5part_float64_t *zval /*!< array of z component data */
|
h5part_float64_t *zval
|
||||||
);
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -196,128 +238,6 @@ H5BlockHasFieldData (
|
|||||||
H5PartFile *f
|
H5PartFile *f
|
||||||
);
|
);
|
||||||
|
|
||||||
/*!
|
|
||||||
Checks if the block of the actual time step is refined i.e. if we
|
|
||||||
have a patch
|
|
||||||
|
|
||||||
\return \c 1 if we have a patch, otherwise \c 0
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockIsPatch (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
const char *name /*!< name of the data set */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
return the maximum level refinement of refinement at the current
|
|
||||||
time step
|
|
||||||
|
|
||||||
\return number or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockGetMaxRefinementLevel (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
const char *name /*!< name of the data set */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Write the mesh spacing for the active (current) block
|
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockSetMeshSpacing (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
char *name, /*!< name of the data set */
|
|
||||||
h5part_float64_t dx, /*!< mesh spacing in x */
|
|
||||||
h5part_float64_t dy, /*!< mesh spacing in y */
|
|
||||||
h5part_float64_t dz /*!< mesh spacing in z */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*==========================================================================*/
|
|
||||||
/*
|
|
||||||
The following reflects the fact that we have fields which are decomposed
|
|
||||||
into modes.
|
|
||||||
|
|
||||||
Augment the field name with the mode number and use this name to store
|
|
||||||
the field. For the mode freqency use the same procedure.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Read the number of stored modes at actual timestep
|
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockGetNumberOfModes (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
char *name /*!< name of the data set */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Set the number of stored modes at actual timestep
|
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockSetNumberOfModes (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
char *name, /*!< name of the data set */
|
|
||||||
int modes /*!< the number of modes */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Write the quality factor for a given mode
|
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockSetQFactor (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
char *name, /*!< name of the data set */
|
|
||||||
int mode, /*!< the mode number of the field */
|
|
||||||
h5part_float64_t Q /*!< the quality factor */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Write the S-parameters for a given mode
|
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockSetSParams (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
char *name, /*!< name of the data set */
|
|
||||||
int mode, /*!< the mode number of the field */
|
|
||||||
h5part_float64_t **s /*!< S-parameters */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Read the quality factor for a given mode
|
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockGetQFactor (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
char *name, /*!< name of the data set */
|
|
||||||
int mode, /*!< the mode number of the field */
|
|
||||||
h5part_float64_t *Q /*!< the quality factor */
|
|
||||||
);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Read the S-parameters for a given mode
|
|
||||||
|
|
||||||
\return \c H5PART_SUCCESS or error code
|
|
||||||
*/
|
|
||||||
h5part_int64_t
|
|
||||||
H5BlockGetSParams (
|
|
||||||
H5PartFile *f, /*!< file handle */
|
|
||||||
char *name, /*!< name of the data set */
|
|
||||||
int mode, /*!< the mode number of the field */
|
|
||||||
h5part_float64_t **s /*!< S-parameters */
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,18 @@
|
|||||||
#define h5bl_has_fielddata F77NAME ( \
|
#define h5bl_has_fielddata F77NAME ( \
|
||||||
h5bl_has_fielddata_, \
|
h5bl_has_fielddata_, \
|
||||||
H5BL_HAS_FIELDDATA )
|
H5BL_HAS_FIELDDATA )
|
||||||
|
#define h5bl_3d_set_field_spacing F77NAME ( \
|
||||||
|
h5bl_3d_set_field_spacing_, \
|
||||||
|
H5BL_3D_SET_FIELD_SPACING )
|
||||||
|
#define h5bl_3d_get_field_spacing F77NAME ( \
|
||||||
|
h5bl_3d_get_field_spacing_, \
|
||||||
|
H5BL_3D_GET_FIELD_SPACING )
|
||||||
|
#define h5bl_3d_set_field_origin F77NAME ( \
|
||||||
|
h5bl_3d_set_field_origin_, \
|
||||||
|
H5BL_3D_SET_FIELD_ORIGIN )
|
||||||
|
#define h5bl_3d_get_field_origin F77NAME ( \
|
||||||
|
h5bl_3d_get_field_origin_, \
|
||||||
|
H5BL_3D_GET_FIELD_origin )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
@@ -483,3 +495,87 @@ h5bl_has_fielddata (
|
|||||||
|
|
||||||
return H5BlockHasFieldData ( filehandle );
|
return H5BlockHasFieldData ( filehandle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5b_3d_get_field_spacing (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
h5part_float64_t *x,
|
||||||
|
h5part_float64_t *y,
|
||||||
|
h5part_float64_t *z,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dGetFieldSpacing (
|
||||||
|
filehandle, field_name2, x, y, z );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5b_3d_set_field_spacing (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
const h5part_float64_t *x,
|
||||||
|
const h5part_float64_t *y,
|
||||||
|
const h5part_float64_t *z,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dSetFieldSpacing (
|
||||||
|
filehandle, field_name2, *x, *y, *z );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5b_3d_get_field_origin (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
h5part_float64_t *x,
|
||||||
|
h5part_float64_t *y,
|
||||||
|
h5part_float64_t *z,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dGetFieldOrigin (
|
||||||
|
filehandle, field_name2, x, y, z );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5b_3d_set_field_origin (
|
||||||
|
h5part_int64_t *f,
|
||||||
|
const char *field_name,
|
||||||
|
const h5part_float64_t *x,
|
||||||
|
const h5part_float64_t *y,
|
||||||
|
const h5part_float64_t *z,
|
||||||
|
const int l_field_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
H5PartFile *filehandle = (H5PartFile*)(size_t)*f;
|
||||||
|
|
||||||
|
char *field_name2 = _H5Part_strdupfor2c ( field_name, l_field_name );
|
||||||
|
|
||||||
|
h5part_int64_t herr = H5Block3dSetFieldOrigin (
|
||||||
|
filehandle, field_name2, *x, *y, *z );
|
||||||
|
|
||||||
|
free ( field_name2 );
|
||||||
|
return herr;
|
||||||
|
}
|
||||||
|
|||||||
@@ -141,4 +141,36 @@
|
|||||||
INTEGER*8, INTENT(IN) :: filehandle
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_get_field_spacing ( filehandle, name, x, y, z )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(OUT) :: x
|
||||||
|
REAL*8, INTENT(OUT) :: y
|
||||||
|
REAL*8, INTENT(OUT) :: z
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_set_field_spacing ( filehandle, name, x, y, z )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(IN) :: x
|
||||||
|
REAL*8, INTENT(IN) :: y
|
||||||
|
REAL*8, INTENT(IN) :: z
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_get_field_origin ( filehandle, name, x, y, z )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(OUT) :: x
|
||||||
|
REAL*8, INTENT(OUT) :: y
|
||||||
|
REAL*8, INTENT(OUT) :: z
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
INTEGER*8 FUNCTION h5bl_3d_set_field_origin ( filehandle, name, x, y, z )
|
||||||
|
INTEGER*8, INTENT(IN) :: filehandle
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||||
|
REAL*8, INTENT(IN) :: x
|
||||||
|
REAL*8, INTENT(IN) :: y
|
||||||
|
REAL*8, INTENT(IN) :: z
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
END INTERFACE
|
END INTERFACE
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ struct H5BlockStruct {
|
|||||||
struct H5BlockPartition *user_layout;
|
struct H5BlockPartition *user_layout;
|
||||||
struct H5BlockPartition *write_layout;
|
struct H5BlockPartition *write_layout;
|
||||||
int have_layout;
|
int have_layout;
|
||||||
|
hsize_t chunk[3];
|
||||||
|
|
||||||
hid_t shape;
|
hid_t shape;
|
||||||
hid_t memshape;
|
hid_t memshape;
|
||||||
|
|||||||
@@ -7,19 +7,40 @@ analysis needs to be preserved, reading and writing such enormous
|
|||||||
restart files on massively parallel supercomputing systems remains
|
restart files on massively parallel supercomputing systems remains
|
||||||
challenging.
|
challenging.
|
||||||
|
|
||||||
H5Part consists of Particles, Block structured Fields and unstructured
|
H5Part consists of Particles and Block structured Fields.
|
||||||
data (Topo).
|
|
||||||
|
|
||||||
Developed by .
|
Developed by:
|
||||||
|
|
||||||
For further information contact: <a href="mailto:xxxxx">xxxxxx</a> -
|
<UL>
|
||||||
xxxx xxxxx, (xxx) xxx.
|
<LI> Andreas Adelmann (PSI) </LI>
|
||||||
|
<LI> Achim Gsell (PSI) </LI>
|
||||||
|
<LI> Benedikt Oswald (PSI) </LI>
|
||||||
|
|
||||||
|
<LI> Wes Bethel (NERSC/LBNL)</LI>
|
||||||
|
<LI> John Shalf (NERSC/LBNL)</LI>
|
||||||
|
<LI> Cristina Siegerist (NERSC/LBNL)</LI>
|
||||||
|
</UL>
|
||||||
|
|
||||||
Last modified on xxx xx, 2006.
|
|
||||||
|
|
||||||
Papers:
|
Papers:
|
||||||
|
|
||||||
<a href="http://www-vis.lbl.gov/Research/AcceleratorSAPP/index.html">LBNL Vis Group </a><br>
|
<UL>
|
||||||
|
<LI> A. Adelmann, R.D. Ryne, C. Siegerist, J. Shalf,"From Visualization to Data Mining with Large Data Sets," <i>
|
||||||
|
<a href="http://www.sns.gov/pac05">Particle Accelerator Conference (PAC05)</a></i>, Knoxville TN., May 16-20, 2005. (LBNL-57603)
|
||||||
|
<a href="http://vis.lbl.gov/Publications/2005/FPAT082.pdf">FPAT082.pdf</a>
|
||||||
|
</LI>
|
||||||
|
|
||||||
|
|
||||||
|
<LI> A. Adelmann, R.D. Ryne, J. Shalf, C. Siegerist,"H5Part: A Portable High Performance Parallel Data Interface for Particle Simulations," <i>
|
||||||
|
<a href="http://www.sns.gov/pac05">Particle Accelerator Conference (PAC05)</a></i>, Knoxville TN., May 16-20, 2005.
|
||||||
|
<a href="http://vis.lbl.gov/Publications/2005/FPAT083.pdf">FPAT083.pdf</a>
|
||||||
|
</LI>
|
||||||
|
</UL>
|
||||||
|
|
||||||
|
For further information contact: <a href="mailto:h5part@lists.psi.ch">h5part</a>
|
||||||
|
|
||||||
|
Last modified on April 19, 2007.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -57,11 +78,18 @@ Papers:
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h> /* va_arg - System dependent ?! */
|
#include <stdarg.h> /* va_arg - System dependent ?! */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <hdf5.h>
|
#include <hdf5.h>
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <unistd.h>
|
||||||
|
#else /* WIN32 */
|
||||||
|
#include <io.h>
|
||||||
|
#define open _open
|
||||||
|
#define close _close
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
#include "H5PartTypes.h"
|
#include "H5PartTypes.h"
|
||||||
#include "H5Part.h"
|
#include "H5Part.h"
|
||||||
#include "H5PartPrivate.h"
|
#include "H5PartPrivate.h"
|
||||||
@@ -70,7 +98,7 @@ Papers:
|
|||||||
/********* Private Variable Declarations *************/
|
/********* Private Variable Declarations *************/
|
||||||
|
|
||||||
static unsigned _debug = 0;
|
static unsigned _debug = 0;
|
||||||
static h5part_int64_t _errno = H5PART_SUCCESS;
|
static h5part_int64_t _h5part_errno = H5PART_SUCCESS;
|
||||||
static h5part_error_handler _err_handler = H5PartReportErrorHandler;
|
static h5part_error_handler _err_handler = H5PartReportErrorHandler;
|
||||||
static char *__funcname = "NONE";
|
static char *__funcname = "NONE";
|
||||||
|
|
||||||
@@ -86,8 +114,14 @@ _file_is_valid (
|
|||||||
const H5PartFile *f
|
const H5PartFile *f
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
error handler for hdf5
|
||||||
|
*/
|
||||||
static herr_t
|
static herr_t
|
||||||
_h5_error_handler (
|
_h5_error_handler (
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
hid_t,
|
||||||
|
#endif
|
||||||
void *
|
void *
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -104,7 +138,7 @@ _H5Part_open_file (
|
|||||||
HANDLE_H5PART_INIT_ERR;
|
HANDLE_H5PART_INIT_ERR;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
_errno = H5PART_SUCCESS;
|
_h5part_errno = H5PART_SUCCESS;
|
||||||
H5PartFile *f = NULL;
|
H5PartFile *f = NULL;
|
||||||
|
|
||||||
f = (H5PartFile*) malloc( sizeof (H5PartFile) );
|
f = (H5PartFile*) malloc( sizeof (H5PartFile) );
|
||||||
@@ -123,11 +157,15 @@ _H5Part_open_file (
|
|||||||
|
|
||||||
f->xfer_prop = f->create_prop = f->access_prop = H5P_DEFAULT;
|
f->xfer_prop = f->create_prop = f->access_prop = H5P_DEFAULT;
|
||||||
|
|
||||||
#ifdef PARALLEL_IO
|
|
||||||
if ( f_parallel ) {
|
if ( f_parallel ) {
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
/* for the SP2... perhaps different for linux */
|
/* for the SP2... perhaps different for linux */
|
||||||
MPI_Info info = MPI_INFO_NULL;
|
MPI_Info info = MPI_INFO_NULL;
|
||||||
|
|
||||||
|
/* ks: IBM_large_block_io */
|
||||||
|
MPI_Info_create(&info);
|
||||||
|
MPI_Info_set(info, "IBM_largeblock_io", "true" );
|
||||||
|
|
||||||
if (MPI_Comm_size (comm, &f->nprocs) != MPI_SUCCESS) {
|
if (MPI_Comm_size (comm, &f->nprocs) != MPI_SUCCESS) {
|
||||||
HANDLE_MPI_COMM_SIZE_ERR;
|
HANDLE_MPI_COMM_SIZE_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
@@ -137,7 +175,8 @@ _H5Part_open_file (
|
|||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
f->pnparticles = malloc (f->nprocs * sizeof (h5part_int64_t));
|
f->pnparticles =
|
||||||
|
(h5part_int64_t*) malloc (f->nprocs * sizeof (h5part_int64_t));
|
||||||
if (f->pnparticles == NULL) {
|
if (f->pnparticles == NULL) {
|
||||||
HANDLE_H5PART_NOMEM_ERR;
|
HANDLE_H5PART_NOMEM_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
@@ -149,8 +188,17 @@ _H5Part_open_file (
|
|||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (f->myproc == 0) {
|
||||||
|
#ifdef H5PART_MPIPOSIX
|
||||||
|
_H5Part_print_info ( "Activating MPI-POSIX VFD" );
|
||||||
|
}
|
||||||
|
if (H5Pset_fapl_mpiposix (f->access_prop, comm, 0) < 0) {
|
||||||
|
#else
|
||||||
|
_H5Part_print_info ( "Activating MPI-IO VFD" );
|
||||||
|
}
|
||||||
if (H5Pset_fapl_mpio (f->access_prop, comm, info) < 0) {
|
if (H5Pset_fapl_mpio (f->access_prop, comm, info) < 0) {
|
||||||
HANDLE_H5P_SET_FAPL_MPIO_ERR;
|
#endif
|
||||||
|
HANDLE_H5P_SET_FAPL_ERR;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,13 +220,16 @@ _H5Part_open_file (
|
|||||||
}
|
}
|
||||||
|
|
||||||
f->comm = comm;
|
f->comm = comm;
|
||||||
|
|
||||||
|
MPI_Info_free(&info);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
f->pnparticles = 0;
|
f->comm = 0;
|
||||||
f->comm = MPI_COMM_WORLD;
|
|
||||||
f->nprocs = 1;
|
f->nprocs = 1;
|
||||||
f->myproc = 0;
|
f->myproc = 0;
|
||||||
|
f->pnparticles =
|
||||||
|
(h5part_int64_t*) malloc (f->nprocs * sizeof (h5part_int64_t));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -345,7 +396,7 @@ H5PartCloseFile (
|
|||||||
|
|
||||||
SET_FNAME ( "H5PartCloseFile" );
|
SET_FNAME ( "H5PartCloseFile" );
|
||||||
herr_t r = 0;
|
herr_t r = 0;
|
||||||
_errno = H5PART_SUCCESS;
|
_h5part_errno = H5PART_SUCCESS;
|
||||||
|
|
||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
|
|
||||||
@@ -398,7 +449,7 @@ H5PartCloseFile (
|
|||||||
}
|
}
|
||||||
free( f );
|
free( f );
|
||||||
|
|
||||||
return _errno;
|
return _h5part_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*============== File Writing Functions ==================== */
|
/*============== File Writing Functions ==================== */
|
||||||
@@ -413,7 +464,7 @@ H5PartDefineStepName (
|
|||||||
if( f->groupname_step == NULL ) {
|
if( f->groupname_step == NULL ) {
|
||||||
return HANDLE_H5PART_NOMEM_ERR;
|
return HANDLE_H5PART_NOMEM_ERR;
|
||||||
}
|
}
|
||||||
f->stepno_width = width;
|
f->stepno_width = (int)width;
|
||||||
|
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -503,6 +554,7 @@ H5PartSetNumParticles (
|
|||||||
/*
|
/*
|
||||||
acquire the number of particles to be written from each MPI process
|
acquire the number of particles to be written from each MPI process
|
||||||
*/
|
*/
|
||||||
|
|
||||||
r = MPI_Allgather (
|
r = MPI_Allgather (
|
||||||
&nparticles, 1, MPI_LONG_LONG,
|
&nparticles, 1, MPI_LONG_LONG,
|
||||||
f->pnparticles, 1, MPI_LONG_LONG,
|
f->pnparticles, 1, MPI_LONG_LONG,
|
||||||
@@ -525,8 +577,6 @@ H5PartSetNumParticles (
|
|||||||
start[0] += f->pnparticles[i];
|
start[0] += f->pnparticles[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* compute total nparticles */
|
/* compute total nparticles */
|
||||||
total = 0;
|
total = 0;
|
||||||
for (i=0; i < f->nprocs; i++) {
|
for (i=0; i < f->nprocs; i++) {
|
||||||
@@ -579,15 +629,35 @@ _write_data (
|
|||||||
"timestep %lld",
|
"timestep %lld",
|
||||||
name, (long long)f->timestep );
|
name, (long long)f->timestep );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
dataset_id = H5Dcreate2 (
|
||||||
|
f->timegroup,
|
||||||
|
name,
|
||||||
|
type,
|
||||||
|
f->shape,
|
||||||
|
H5P_DEFAULT,
|
||||||
|
H5P_DEFAULT,
|
||||||
|
H5P_DEFAULT );
|
||||||
|
#else
|
||||||
dataset_id = H5Dcreate (
|
dataset_id = H5Dcreate (
|
||||||
f->timegroup,
|
f->timegroup,
|
||||||
name,
|
name,
|
||||||
type,
|
type,
|
||||||
f->shape,
|
f->shape,
|
||||||
H5P_DEFAULT );
|
H5P_DEFAULT );
|
||||||
|
#endif
|
||||||
if ( dataset_id < 0 )
|
if ( dataset_id < 0 )
|
||||||
return HANDLE_H5D_CREATE_ERR ( name, f->timestep );
|
return HANDLE_H5D_CREATE_ERR ( name, f->timestep );
|
||||||
|
|
||||||
|
#ifdef COLLECTIVE_IO
|
||||||
|
herr = H5Dwrite (
|
||||||
|
dataset_id,
|
||||||
|
type,
|
||||||
|
f->memshape,
|
||||||
|
f->diskshape,
|
||||||
|
f->xfer_prop,
|
||||||
|
array );
|
||||||
|
#else
|
||||||
herr = H5Dwrite (
|
herr = H5Dwrite (
|
||||||
dataset_id,
|
dataset_id,
|
||||||
type,
|
type,
|
||||||
@@ -595,6 +665,8 @@ _write_data (
|
|||||||
f->diskshape,
|
f->diskshape,
|
||||||
H5P_DEFAULT,
|
H5P_DEFAULT,
|
||||||
array );
|
array );
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( herr < 0 ) return HANDLE_H5D_WRITE_ERR ( name, f->timestep );
|
if ( herr < 0 ) return HANDLE_H5D_WRITE_ERR ( name, f->timestep );
|
||||||
|
|
||||||
herr = H5Dclose ( dataset_id );
|
herr = H5Dclose ( dataset_id );
|
||||||
@@ -639,7 +711,7 @@ H5PartWriteDataFloat64 (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
SET_FNAME ( "H5PartWriteDataFloat64" );
|
SET_FNAME ( "H5PartWriteDataFloat64" );
|
||||||
herr_t herr;
|
h5part_int64_t herr;
|
||||||
|
|
||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
CHECK_WRITABLE_MODE( f );
|
CHECK_WRITABLE_MODE( f );
|
||||||
@@ -651,6 +723,52 @@ H5PartWriteDataFloat64 (
|
|||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5part_write
|
||||||
|
|
||||||
|
Write array of 32 bit floating point data to file.
|
||||||
|
|
||||||
|
After setting the number of particles with \c H5PartSetNumParticles() and
|
||||||
|
the current timestep using \c H5PartSetStep(), you can start writing datasets
|
||||||
|
into the file. Each dataset has a name associated with it (chosen by the
|
||||||
|
user) in order to facilitate later retrieval. The name of the dataset is
|
||||||
|
specified in the parameter \c name, which must be a null-terminated string.
|
||||||
|
|
||||||
|
There are no restrictions on naming of datasets, but it is useful to arrive
|
||||||
|
at some common naming convention when sharing data with other groups.
|
||||||
|
|
||||||
|
The writing routines also implicitly store the datatype of the array so that
|
||||||
|
the array can be reconstructed properly on other systems with incompatible
|
||||||
|
type representations.
|
||||||
|
|
||||||
|
All data that is written after setting the timestep is associated with that
|
||||||
|
timestep. While the number of particles can change for each timestep, you
|
||||||
|
cannot change the number of particles in the middle of a given timestep.
|
||||||
|
|
||||||
|
The data is committed to disk before the routine returns.
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartWriteDataFloat32 (
|
||||||
|
H5PartFile *f, /*!< [in] Handle to open file */
|
||||||
|
const char *name, /*!< [in] Name to associate array with */
|
||||||
|
const h5part_float32_t *array /*!< [in] Array to commit to disk */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5PartWriteDataFloat32" );
|
||||||
|
h5part_int64_t herr;
|
||||||
|
|
||||||
|
CHECK_FILEHANDLE ( f );
|
||||||
|
CHECK_WRITABLE_MODE( f );
|
||||||
|
CHECK_TIMEGROUP( f );
|
||||||
|
|
||||||
|
herr = _write_data ( f, name, (void*)array, H5T_NATIVE_FLOAT );
|
||||||
|
if ( herr < 0 ) return herr;
|
||||||
|
|
||||||
|
return H5PART_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5part_write
|
\ingroup h5part_write
|
||||||
|
|
||||||
@@ -686,7 +804,7 @@ H5PartWriteDataInt64 (
|
|||||||
|
|
||||||
SET_FNAME ( "H5PartOpenWriteDataInt64" );
|
SET_FNAME ( "H5PartOpenWriteDataInt64" );
|
||||||
|
|
||||||
herr_t herr;
|
h5part_int64_t herr;
|
||||||
|
|
||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
CHECK_WRITABLE_MODE( f );
|
CHECK_WRITABLE_MODE( f );
|
||||||
@@ -750,7 +868,11 @@ _H5Part_read_attrib (
|
|||||||
hid_t mytype;
|
hid_t mytype;
|
||||||
hsize_t nelem;
|
hsize_t nelem;
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
attrib_id = H5Aopen ( id, attrib_name, H5P_DEFAULT );
|
||||||
|
#else
|
||||||
attrib_id = H5Aopen_name ( id, attrib_name );
|
attrib_id = H5Aopen_name ( id, attrib_name );
|
||||||
|
#endif
|
||||||
if ( attrib_id <= 0 ) return HANDLE_H5A_OPEN_NAME_ERR( attrib_name );
|
if ( attrib_id <= 0 ) return HANDLE_H5A_OPEN_NAME_ERR( attrib_name );
|
||||||
|
|
||||||
mytype = H5Aget_type ( attrib_id );
|
mytype = H5Aget_type ( attrib_id );
|
||||||
@@ -796,12 +918,22 @@ _H5Part_write_attrib (
|
|||||||
if ( space_id < 0 )
|
if ( space_id < 0 )
|
||||||
return HANDLE_H5S_CREATE_SIMPLE_ERR ( attrib_nelem );
|
return HANDLE_H5S_CREATE_SIMPLE_ERR ( attrib_nelem );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
attrib_id = H5Acreate2 (
|
||||||
|
id,
|
||||||
|
attrib_name,
|
||||||
|
attrib_type,
|
||||||
|
space_id,
|
||||||
|
H5P_DEFAULT,
|
||||||
|
H5P_DEFAULT );
|
||||||
|
#else
|
||||||
attrib_id = H5Acreate (
|
attrib_id = H5Acreate (
|
||||||
id,
|
id,
|
||||||
attrib_name,
|
attrib_name,
|
||||||
attrib_type,
|
attrib_type,
|
||||||
space_id,
|
space_id,
|
||||||
H5P_DEFAULT );
|
H5P_DEFAULT );
|
||||||
|
#endif
|
||||||
if ( attrib_id < 0 ) return HANDLE_H5A_CREATE_ERR ( attrib_name );
|
if ( attrib_id < 0 ) return HANDLE_H5A_CREATE_ERR ( attrib_name );
|
||||||
|
|
||||||
herr = H5Awrite ( attrib_id, attrib_type, attrib_value);
|
herr = H5Awrite ( attrib_id, attrib_type, attrib_value);
|
||||||
@@ -831,7 +963,7 @@ _H5Part_get_attrib_info (
|
|||||||
hid_t mytype;
|
hid_t mytype;
|
||||||
hid_t space_id;
|
hid_t space_id;
|
||||||
|
|
||||||
attrib_id = H5Aopen_idx ( id, attrib_idx );
|
attrib_id = H5Aopen_idx ( id, (unsigned int)attrib_idx );
|
||||||
if ( attrib_id < 0 ) return HANDLE_H5A_OPEN_IDX_ERR ( attrib_idx );
|
if ( attrib_id < 0 ) return HANDLE_H5A_OPEN_IDX_ERR ( attrib_idx );
|
||||||
|
|
||||||
if ( attrib_nelem ) {
|
if ( attrib_nelem ) {
|
||||||
@@ -848,7 +980,7 @@ _H5Part_get_attrib_info (
|
|||||||
if ( attrib_name ) {
|
if ( attrib_name ) {
|
||||||
herr = H5Aget_name (
|
herr = H5Aget_name (
|
||||||
attrib_id,
|
attrib_id,
|
||||||
len_attrib_name,
|
(size_t)len_attrib_name,
|
||||||
attrib_name );
|
attrib_name );
|
||||||
if ( herr < 0 ) return HANDLE_H5A_GET_NAME_ERR;
|
if ( herr < 0 ) return HANDLE_H5A_GET_NAME_ERR;
|
||||||
}
|
}
|
||||||
@@ -895,7 +1027,11 @@ H5PartWriteFileAttribString (
|
|||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
CHECK_WRITABLE_MODE( f );
|
CHECK_WRITABLE_MODE( f );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
hid_t group_id = H5Gopen2(f->file,"/",H5P_DEFAULT);
|
||||||
|
#else
|
||||||
hid_t group_id = H5Gopen(f->file,"/");
|
hid_t group_id = H5Gopen(f->file,"/");
|
||||||
|
#endif
|
||||||
if ( group_id < 0 ) return HANDLE_H5G_OPEN_ERR( "/" );
|
if ( group_id < 0 ) return HANDLE_H5G_OPEN_ERR( "/" );
|
||||||
|
|
||||||
h5part_int64_t herr = _H5Part_write_attrib (
|
h5part_int64_t herr = _H5Part_write_attrib (
|
||||||
@@ -981,7 +1117,7 @@ H5PartWriteStepAttrib (
|
|||||||
|
|
||||||
SET_FNAME ( "H5PartWriteStepAttrib" );
|
SET_FNAME ( "H5PartWriteStepAttrib" );
|
||||||
|
|
||||||
herr_t herr;
|
h5part_int64_t herr;
|
||||||
|
|
||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
CHECK_WRITABLE_MODE( f );
|
CHECK_WRITABLE_MODE( f );
|
||||||
@@ -990,7 +1126,7 @@ H5PartWriteStepAttrib (
|
|||||||
herr = _H5Part_write_attrib (
|
herr = _H5Part_write_attrib (
|
||||||
f->timegroup,
|
f->timegroup,
|
||||||
attrib_name,
|
attrib_name,
|
||||||
attrib_type,
|
(const hid_t)attrib_type,
|
||||||
attrib_value,
|
attrib_value,
|
||||||
attrib_nelem );
|
attrib_nelem );
|
||||||
if ( herr < 0 ) return herr;
|
if ( herr < 0 ) return herr;
|
||||||
@@ -1028,19 +1164,23 @@ H5PartWriteFileAttrib (
|
|||||||
|
|
||||||
SET_FNAME ( "H5PartWriteFileAttrib" );
|
SET_FNAME ( "H5PartWriteFileAttrib" );
|
||||||
|
|
||||||
herr_t herr;
|
h5part_int64_t herr;
|
||||||
hid_t group_id;
|
hid_t group_id;
|
||||||
|
|
||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
CHECK_WRITABLE_MODE ( f );
|
CHECK_WRITABLE_MODE ( f );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
group_id = H5Gopen2(f->file,"/",H5P_DEFAULT);
|
||||||
|
#else
|
||||||
group_id = H5Gopen(f->file,"/");
|
group_id = H5Gopen(f->file,"/");
|
||||||
|
#endif
|
||||||
if ( group_id < 0 ) return HANDLE_H5G_OPEN_ERR( "/" );
|
if ( group_id < 0 ) return HANDLE_H5G_OPEN_ERR( "/" );
|
||||||
|
|
||||||
herr = _H5Part_write_attrib (
|
herr = _H5Part_write_attrib (
|
||||||
group_id,
|
group_id,
|
||||||
attrib_name,
|
attrib_name,
|
||||||
attrib_type,
|
(const hid_t)attrib_type,
|
||||||
attrib_value,
|
attrib_value,
|
||||||
attrib_nelem );
|
attrib_nelem );
|
||||||
if ( herr < 0 ) return herr;
|
if ( herr < 0 ) return herr;
|
||||||
@@ -1092,7 +1232,11 @@ H5PartGetNumFileAttribs (
|
|||||||
|
|
||||||
CHECK_FILEHANDLE ( f );
|
CHECK_FILEHANDLE ( f );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
hid_t group_id = H5Gopen2 ( f->file, "/", H5P_DEFAULT );
|
||||||
|
#else
|
||||||
hid_t group_id = H5Gopen ( f->file, "/" );
|
hid_t group_id = H5Gopen ( f->file, "/" );
|
||||||
|
#endif
|
||||||
if ( group_id < 0 ) HANDLE_H5G_OPEN_ERR ( "/" );
|
if ( group_id < 0 ) HANDLE_H5G_OPEN_ERR ( "/" );
|
||||||
|
|
||||||
nattribs = H5Aget_num_attrs ( group_id );
|
nattribs = H5Aget_num_attrs ( group_id );
|
||||||
@@ -1130,7 +1274,7 @@ H5PartGetStepAttribInfo (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
SET_FNAME ( "H5PartGetStepAttribInfo" );
|
SET_FNAME ( "H5PartGetStepAttribInfo" );
|
||||||
hid_t herr;
|
h5part_int64_t herr;
|
||||||
|
|
||||||
CHECK_FILEHANDLE( f );
|
CHECK_FILEHANDLE( f );
|
||||||
|
|
||||||
@@ -1174,11 +1318,15 @@ H5PartGetFileAttribInfo (
|
|||||||
|
|
||||||
SET_FNAME ( "H5PartGetFileAttribInfo" );
|
SET_FNAME ( "H5PartGetFileAttribInfo" );
|
||||||
hid_t group_id;
|
hid_t group_id;
|
||||||
herr_t herr;
|
h5part_int64_t herr;
|
||||||
|
|
||||||
CHECK_FILEHANDLE( f );
|
CHECK_FILEHANDLE( f );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
group_id = H5Gopen2(f->file,"/",H5P_DEFAULT);
|
||||||
|
#else
|
||||||
group_id = H5Gopen(f->file,"/");
|
group_id = H5Gopen(f->file,"/");
|
||||||
|
#endif
|
||||||
if ( group_id < 0 ) return HANDLE_H5G_OPEN_ERR( "/" );
|
if ( group_id < 0 ) return HANDLE_H5G_OPEN_ERR( "/" );
|
||||||
|
|
||||||
herr = _H5Part_get_attrib_info (
|
herr = _H5Part_get_attrib_info (
|
||||||
@@ -1212,7 +1360,7 @@ H5PartReadStepAttrib (
|
|||||||
|
|
||||||
SET_FNAME ( "H5PartReadStepAttrib" );
|
SET_FNAME ( "H5PartReadStepAttrib" );
|
||||||
|
|
||||||
hid_t herr;
|
h5part_int64_t herr;
|
||||||
|
|
||||||
CHECK_FILEHANDLE( f );
|
CHECK_FILEHANDLE( f );
|
||||||
|
|
||||||
@@ -1239,11 +1387,15 @@ H5PartReadFileAttrib (
|
|||||||
SET_FNAME ( "H5PartReadFileAttrib" );
|
SET_FNAME ( "H5PartReadFileAttrib" );
|
||||||
|
|
||||||
hid_t group_id;
|
hid_t group_id;
|
||||||
hid_t herr;
|
h5part_int64_t herr;
|
||||||
|
|
||||||
CHECK_FILEHANDLE( f );
|
CHECK_FILEHANDLE( f );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
group_id = H5Gopen2(f->file,"/",H5P_DEFAULT);
|
||||||
|
#else
|
||||||
group_id = H5Gopen(f->file,"/");
|
group_id = H5Gopen(f->file,"/");
|
||||||
|
#endif
|
||||||
if ( group_id < 0 ) return HANDLE_H5G_OPEN_ERR( "/" );
|
if ( group_id < 0 ) return HANDLE_H5G_OPEN_ERR( "/" );
|
||||||
|
|
||||||
herr = _H5Part_read_attrib ( group_id, attrib_name, attrib_value );
|
herr = _H5Part_read_attrib ( group_id, attrib_name, attrib_value );
|
||||||
@@ -1299,7 +1451,11 @@ _H5Part_set_step (
|
|||||||
(long long)step,
|
(long long)step,
|
||||||
(long long)(size_t) f );
|
(long long)(size_t) f );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
f->timegroup = H5Gopen2 ( f->file, name, H5P_DEFAULT );
|
||||||
|
#else
|
||||||
f->timegroup = H5Gopen ( f->file, name );
|
f->timegroup = H5Gopen ( f->file, name );
|
||||||
|
#endif
|
||||||
if ( f->timegroup < 0 ) return HANDLE_H5G_OPEN_ERR( name );
|
if ( f->timegroup < 0 ) return HANDLE_H5G_OPEN_ERR( name );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1309,7 +1465,16 @@ _H5Part_set_step (
|
|||||||
(long long)step,
|
(long long)step,
|
||||||
(long long)(size_t) f );
|
(long long)(size_t) f );
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
f->timegroup = H5Gcreate2 (
|
||||||
|
f->file,
|
||||||
|
name,
|
||||||
|
0,
|
||||||
|
H5P_DEFAULT,
|
||||||
|
H5P_DEFAULT );
|
||||||
|
#else
|
||||||
f->timegroup = H5Gcreate ( f->file, name, 0 );
|
f->timegroup = H5Gcreate ( f->file, name, 0 );
|
||||||
|
#endif
|
||||||
if ( f->timegroup < 0 ) return HANDLE_H5G_CREATE_ERR ( name );
|
if ( f->timegroup < 0 ) return HANDLE_H5G_CREATE_ERR ( name );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1359,13 +1524,13 @@ _H5Part_iteration_operator (
|
|||||||
void *operator_data /*!< [in,out] data passed to the iterator */
|
void *operator_data /*!< [in,out] data passed to the iterator */
|
||||||
) {
|
) {
|
||||||
|
|
||||||
struct _iter_op_data *data = operator_data;
|
struct _iter_op_data *data = (struct _iter_op_data*)operator_data;
|
||||||
herr_t herr;
|
herr_t herr;
|
||||||
H5G_stat_t objinfo;
|
H5G_stat_t objinfo;
|
||||||
|
|
||||||
if ( data->type != H5G_UNKNOWN ) {
|
if ( data->type != H5G_UNKNOWN ) {
|
||||||
herr = H5Gget_objinfo ( group_id, member_name, 1, &objinfo );
|
herr = H5Gget_objinfo ( group_id, member_name, 1, &objinfo );
|
||||||
if ( herr < 0 ) return HANDLE_H5G_GET_OBJINFO_ERR ( member_name );
|
if ( herr < 0 ) return (herr_t)HANDLE_H5G_GET_OBJINFO_ERR ( member_name );
|
||||||
|
|
||||||
if ( objinfo.type != data->type )
|
if ( objinfo.type != data->type )
|
||||||
return 0;/* don't count, continue iteration */
|
return 0;/* don't count, continue iteration */
|
||||||
@@ -1455,10 +1620,10 @@ _H5Part_get_object_name (
|
|||||||
int iterator_idx = 0;
|
int iterator_idx = 0;
|
||||||
|
|
||||||
memset ( &data, 0, sizeof ( data ) );
|
memset ( &data, 0, sizeof ( data ) );
|
||||||
data.stop_idx = idx;
|
data.stop_idx = (hid_t)idx;
|
||||||
data.type = type;
|
data.type = type;
|
||||||
data.name = obj_name;
|
data.name = obj_name;
|
||||||
data.len = len_obj_name;
|
data.len = (size_t)len_obj_name;
|
||||||
|
|
||||||
herr = H5Giterate ( group_id, group_name, &iterator_idx,
|
herr = H5Giterate ( group_id, group_name, &iterator_idx,
|
||||||
_H5Part_iteration_operator,
|
_H5Part_iteration_operator,
|
||||||
@@ -1471,6 +1636,34 @@ _H5Part_get_object_name (
|
|||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5part_read
|
||||||
|
|
||||||
|
Query whether a particular step already exists in the file
|
||||||
|
\c f.
|
||||||
|
|
||||||
|
It works for both reading and writing of files
|
||||||
|
|
||||||
|
\return true or false
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartHasStep (
|
||||||
|
H5PartFile *f, /*!< [in] Handle to open file */
|
||||||
|
h5part_int64_t step /*!< [in] Step number to query */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5PartHasStep" );
|
||||||
|
|
||||||
|
CHECK_FILEHANDLE( f );
|
||||||
|
|
||||||
|
char name[128];
|
||||||
|
sprintf ( name, "%s#%0*lld", f->groupname_step, f->stepno_width, (long long) step );
|
||||||
|
herr_t herr = H5Gget_objinfo( f->file, name, 1, NULL );
|
||||||
|
|
||||||
|
return ( herr >= 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5part_read
|
\ingroup h5part_read
|
||||||
|
|
||||||
@@ -1587,7 +1780,7 @@ H5PartGetDatasetInfo (
|
|||||||
|
|
||||||
SET_FNAME ( "H5PartGetDatasetInfo" );
|
SET_FNAME ( "H5PartGetDatasetInfo" );
|
||||||
|
|
||||||
herr_t herr;
|
h5part_int64_t herr;
|
||||||
hid_t dataset_id;
|
hid_t dataset_id;
|
||||||
hid_t mytype;
|
hid_t mytype;
|
||||||
char step_name[128];
|
char step_name[128];
|
||||||
@@ -1601,7 +1794,7 @@ H5PartGetDatasetInfo (
|
|||||||
f->groupname_step, f->stepno_width, (long long) f->timestep );
|
f->groupname_step, f->stepno_width, (long long) f->timestep );
|
||||||
|
|
||||||
herr = _H5Part_get_object_name (
|
herr = _H5Part_get_object_name (
|
||||||
f->timegroup,
|
f->file,
|
||||||
step_name,
|
step_name,
|
||||||
H5G_DATASET,
|
H5G_DATASET,
|
||||||
idx,
|
idx,
|
||||||
@@ -1612,7 +1805,11 @@ H5PartGetDatasetInfo (
|
|||||||
*nelem = _H5Part_get_num_particles ( f );
|
*nelem = _H5Part_get_num_particles ( f );
|
||||||
if ( *nelem < 0 ) return *nelem;
|
if ( *nelem < 0 ) return *nelem;
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
dataset_id = H5Dopen2 ( f->timegroup, dataset_name, H5P_DEFAULT );
|
||||||
|
#else
|
||||||
dataset_id = H5Dopen ( f->timegroup, dataset_name );
|
dataset_id = H5Dopen ( f->timegroup, dataset_name );
|
||||||
|
#endif
|
||||||
if ( dataset_id < 0 ) HANDLE_H5D_OPEN_ERR ( dataset_name );
|
if ( dataset_id < 0 ) HANDLE_H5D_OPEN_ERR ( dataset_name );
|
||||||
|
|
||||||
mytype = H5Dget_type ( dataset_id );
|
mytype = H5Dget_type ( dataset_id );
|
||||||
@@ -1638,10 +1835,8 @@ _get_diskshape_for_reading (
|
|||||||
|
|
||||||
herr_t r;
|
herr_t r;
|
||||||
|
|
||||||
CHECK_FILEHANDLE( f );
|
|
||||||
|
|
||||||
hid_t space = H5Dget_space(dataset);
|
hid_t space = H5Dget_space(dataset);
|
||||||
if ( space < 0 ) return HANDLE_H5D_GET_SPACE_ERR;
|
if ( space < 0 ) return (hid_t)HANDLE_H5D_GET_SPACE_ERR;
|
||||||
|
|
||||||
if ( H5PartHasView(f) ){
|
if ( H5PartHasView(f) ){
|
||||||
hsize_t stride;
|
hsize_t stride;
|
||||||
@@ -1663,13 +1858,13 @@ _get_diskshape_for_reading (
|
|||||||
r = H5Sselect_hyperslab (
|
r = H5Sselect_hyperslab (
|
||||||
f->diskshape, H5S_SELECT_SET,
|
f->diskshape, H5S_SELECT_SET,
|
||||||
&start, &stride, &count, NULL);
|
&start, &stride, &count, NULL);
|
||||||
if ( r < 0 ) return HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
if ( r < 0 ) return (hid_t)HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
||||||
}
|
}
|
||||||
/* now we select a subset */
|
/* now we select a subset */
|
||||||
r = H5Sselect_hyperslab (
|
r = H5Sselect_hyperslab (
|
||||||
space,H5S_SELECT_SET,
|
space,H5S_SELECT_SET,
|
||||||
&start, &stride, &count, NULL );
|
&start, &stride, &count, NULL );
|
||||||
if ( r < 0 ) return HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
if ( r < 0 ) return (hid_t)HANDLE_H5S_SELECT_HYPERSLAB_ERR;
|
||||||
|
|
||||||
_H5Part_print_debug (
|
_H5Part_print_debug (
|
||||||
"Selection: range=%d:%d, npoints=%d s=%d",
|
"Selection: range=%d:%d, npoints=%d s=%d",
|
||||||
@@ -1688,15 +1883,11 @@ _get_memshape_for_reading (
|
|||||||
hid_t dataset
|
hid_t dataset
|
||||||
) {
|
) {
|
||||||
|
|
||||||
hid_t r;
|
|
||||||
|
|
||||||
CHECK_FILEHANDLE( f );
|
|
||||||
|
|
||||||
if(H5PartHasView(f)) {
|
if(H5PartHasView(f)) {
|
||||||
hsize_t dmax=H5S_UNLIMITED;
|
hsize_t dmax=H5S_UNLIMITED;
|
||||||
hsize_t len = f->viewend - f->viewstart;
|
hsize_t len = f->viewend - f->viewstart;
|
||||||
r = H5Screate_simple(1,&len,&dmax);
|
hid_t r = H5Screate_simple(1,&len,&dmax);
|
||||||
if ( r < 0 ) return HANDLE_H5S_CREATE_SIMPLE_ERR ( len );
|
if ( r < 0 ) return (hid_t)HANDLE_H5S_CREATE_SIMPLE_ERR ( len );
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1730,7 +1921,11 @@ _H5Part_get_num_particles (
|
|||||||
dataset_name, sizeof (dataset_name) );
|
dataset_name, sizeof (dataset_name) );
|
||||||
if ( herr < 0 ) return herr;
|
if ( herr < 0 ) return herr;
|
||||||
|
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
dataset_id = H5Dopen2 ( f->timegroup, dataset_name, H5P_DEFAULT );
|
||||||
|
#else
|
||||||
dataset_id = H5Dopen ( f->timegroup, dataset_name );
|
dataset_id = H5Dopen ( f->timegroup, dataset_name );
|
||||||
|
#endif
|
||||||
if ( dataset_id < 0 )
|
if ( dataset_id < 0 )
|
||||||
return HANDLE_H5D_OPEN_ERR ( dataset_name );
|
return HANDLE_H5D_OPEN_ERR ( dataset_name );
|
||||||
|
|
||||||
@@ -2092,10 +2287,14 @@ _read_data (
|
|||||||
hid_t memspace_id;
|
hid_t memspace_id;
|
||||||
|
|
||||||
if ( f->timegroup < 0 ) {
|
if ( f->timegroup < 0 ) {
|
||||||
herr = _H5Part_set_step ( f, f->timestep );
|
h5part_int64_t h5err = _H5Part_set_step ( f, f->timestep );
|
||||||
if ( herr < 0 ) return herr;
|
if ( h5err < 0 ) return h5err;
|
||||||
}
|
}
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
dataset_id = H5Dopen2 ( f->timegroup, name, H5P_DEFAULT );
|
||||||
|
#else
|
||||||
dataset_id = H5Dopen ( f->timegroup, name );
|
dataset_id = H5Dopen ( f->timegroup, name );
|
||||||
|
#endif
|
||||||
if ( dataset_id < 0 ) return HANDLE_H5D_OPEN_ERR ( name );
|
if ( dataset_id < 0 ) return HANDLE_H5D_OPEN_ERR ( name );
|
||||||
|
|
||||||
space_id = _get_diskshape_for_reading ( f, dataset_id );
|
space_id = _get_diskshape_for_reading ( f, dataset_id );
|
||||||
@@ -2104,6 +2303,7 @@ _read_data (
|
|||||||
memspace_id = _get_memshape_for_reading ( f, dataset_id );
|
memspace_id = _get_memshape_for_reading ( f, dataset_id );
|
||||||
if ( memspace_id < 0 ) return (h5part_int64_t)memspace_id;
|
if ( memspace_id < 0 ) return (h5part_int64_t)memspace_id;
|
||||||
|
|
||||||
|
#ifdef INDEPENDENT_IO
|
||||||
herr = H5Dread (
|
herr = H5Dread (
|
||||||
dataset_id,
|
dataset_id,
|
||||||
type,
|
type,
|
||||||
@@ -2113,6 +2313,18 @@ _read_data (
|
|||||||
(get hyperslab if needed) */
|
(get hyperslab if needed) */
|
||||||
H5P_DEFAULT, /* ignore... its for parallel reads */
|
H5P_DEFAULT, /* ignore... its for parallel reads */
|
||||||
array );
|
array );
|
||||||
|
#else
|
||||||
|
herr = H5Dread (
|
||||||
|
dataset_id,
|
||||||
|
type,
|
||||||
|
memspace_id, /* shape/size of data in memory (the
|
||||||
|
complement to disk hyperslab) */
|
||||||
|
space_id, /* shape/size of data on disk
|
||||||
|
(get hyperslab if needed) */
|
||||||
|
f->xfer_prop, /* ignore... its for parallel reads */
|
||||||
|
array );
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( herr < 0 ) return HANDLE_H5D_READ_ERR ( name, f->timestep );
|
if ( herr < 0 ) return HANDLE_H5D_READ_ERR ( name, f->timestep );
|
||||||
|
|
||||||
if ( space_id != H5S_ALL ) {
|
if ( space_id != H5S_ALL ) {
|
||||||
@@ -2161,6 +2373,37 @@ H5PartReadDataFloat64 (
|
|||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\ingroup h5part_read
|
||||||
|
|
||||||
|
Read array of 32 bit floating point data from file.
|
||||||
|
|
||||||
|
When retrieving datasets from disk, you ask for them
|
||||||
|
by name. There are no restrictions on naming of arrays,
|
||||||
|
but it is useful to arrive at some common naming
|
||||||
|
convention when sharing data with other groups.
|
||||||
|
|
||||||
|
\return \c H5PART_SUCCESS or error code
|
||||||
|
*/
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartReadDataFloat32 (
|
||||||
|
H5PartFile *f, /*!< [in] Handle to open file */
|
||||||
|
const char *name, /*!< [in] Name to associate dataset with */
|
||||||
|
h5part_float32_t *array /*!< [out] Array of data */
|
||||||
|
) {
|
||||||
|
|
||||||
|
SET_FNAME ( "H5PartReadDataFloat32" );
|
||||||
|
|
||||||
|
h5part_int64_t herr;
|
||||||
|
|
||||||
|
CHECK_FILEHANDLE( f );
|
||||||
|
|
||||||
|
herr = _read_data ( f, name, array, H5T_NATIVE_FLOAT );
|
||||||
|
if ( herr < 0 ) return herr;
|
||||||
|
|
||||||
|
return H5PART_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup h5part_read
|
\ingroup h5part_read
|
||||||
|
|
||||||
@@ -2265,7 +2508,7 @@ H5PartSetVerbosityLevel (
|
|||||||
h5part_int64_t level
|
h5part_int64_t level
|
||||||
) {
|
) {
|
||||||
|
|
||||||
_debug = level;
|
_debug = (unsigned int)level;
|
||||||
return H5PART_SUCCESS;
|
return H5PART_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2309,7 +2552,7 @@ h5part_int64_t
|
|||||||
H5PartGetErrno (
|
H5PartGetErrno (
|
||||||
void
|
void
|
||||||
) {
|
) {
|
||||||
return _errno;
|
return _h5part_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -2328,14 +2571,14 @@ H5PartReportErrorHandler (
|
|||||||
...
|
...
|
||||||
) {
|
) {
|
||||||
|
|
||||||
_errno = eno;
|
_h5part_errno = eno;
|
||||||
if ( _debug > 0 ) {
|
if ( _debug > 0 ) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
_H5Part_vprint_error ( fmt, ap );
|
_H5Part_vprint_error ( fmt, ap );
|
||||||
va_end ( ap );
|
va_end ( ap );
|
||||||
}
|
}
|
||||||
return _errno;
|
return _h5part_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -2352,7 +2595,7 @@ H5PartAbortErrorHandler (
|
|||||||
...
|
...
|
||||||
) {
|
) {
|
||||||
|
|
||||||
_errno = eno;
|
_h5part_errno = eno;
|
||||||
if ( _debug > 0 ) {
|
if ( _debug > 0 ) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start ( ap, fmt );
|
va_start ( ap, fmt );
|
||||||
@@ -2360,7 +2603,7 @@ H5PartAbortErrorHandler (
|
|||||||
vfprintf ( stderr, fmt, ap );
|
vfprintf ( stderr, fmt, ap );
|
||||||
fprintf ( stderr, "\n" );
|
fprintf ( stderr, "\n" );
|
||||||
}
|
}
|
||||||
exit (-_errno);
|
exit (-(int)_h5part_errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -2372,7 +2615,11 @@ _init ( void ) {
|
|||||||
|
|
||||||
herr_t r5;
|
herr_t r5;
|
||||||
if ( ! __init ) {
|
if ( ! __init ) {
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
r5 = H5Eset_auto2 ( H5E_DEFAULT, _h5_error_handler, NULL );
|
||||||
|
#else
|
||||||
r5 = H5Eset_auto ( _h5_error_handler, NULL );
|
r5 = H5Eset_auto ( _h5_error_handler, NULL );
|
||||||
|
#endif
|
||||||
if ( r5 < 0 ) return H5PART_ERR_INIT;
|
if ( r5 < 0 ) return H5PART_ERR_INIT;
|
||||||
}
|
}
|
||||||
__init = 1;
|
__init = 1;
|
||||||
@@ -2381,10 +2628,18 @@ _init ( void ) {
|
|||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
static herr_t
|
static herr_t
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
_h5_error_handler ( hid_t estack, void* unused ) {
|
||||||
|
#else
|
||||||
_h5_error_handler ( void* unused ) {
|
_h5_error_handler ( void* unused ) {
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( _debug >= 5 ) {
|
if ( _debug >= 5 ) {
|
||||||
|
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||||
|
H5Eprint2 (H5E_DEFAULT,stderr);
|
||||||
|
#else
|
||||||
H5Eprint (stderr);
|
H5Eprint (stderr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2396,7 +2651,7 @@ _vprint (
|
|||||||
const char *fmt,
|
const char *fmt,
|
||||||
va_list ap
|
va_list ap
|
||||||
) {
|
) {
|
||||||
char *fmt2 = malloc( strlen ( prefix ) +strlen ( fmt ) + strlen ( __funcname ) + 16 );
|
char *fmt2 = (char*)malloc( strlen ( prefix ) +strlen ( fmt ) + strlen ( __funcname ) + 16 );
|
||||||
if ( fmt2 == NULL ) return;
|
if ( fmt2 == NULL ) return;
|
||||||
sprintf ( fmt2, "%s: %s: %s\n", prefix, __funcname, fmt );
|
sprintf ( fmt2, "%s: %s: %s\n", prefix, __funcname, fmt );
|
||||||
vfprintf ( stderr, fmt2, ap );
|
vfprintf ( stderr, fmt2, ap );
|
||||||
@@ -2493,9 +2748,9 @@ _H5Part_print_debug (
|
|||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_set_funcname (
|
_H5Part_set_funcname (
|
||||||
char * const fname
|
const char * const fname
|
||||||
) {
|
) {
|
||||||
__funcname = fname;
|
__funcname = (char* const) fname;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
#ifndef _H5Part_H_
|
#ifndef _H5Part_H_
|
||||||
#define _H5Part_H_
|
#define _H5Part_H_
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <hdf5.h>
|
#include <hdf5.h>
|
||||||
#ifdef PARALLEL_IO
|
#ifdef PARALLEL_IO
|
||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "H5PartTypes.h"
|
#include "H5PartTypes.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -81,6 +82,14 @@ H5PartWriteDataFloat64 (
|
|||||||
const h5part_float64_t *array
|
const h5part_float64_t *array
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartWriteDataFloat32 (
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
const h5part_float32_t *array
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5PartWriteDataInt64 (
|
H5PartWriteDataInt64 (
|
||||||
H5PartFile *f,
|
H5PartFile *f,
|
||||||
@@ -95,6 +104,12 @@ H5PartSetStep (
|
|||||||
const h5part_int64_t step
|
const h5part_int64_t step
|
||||||
);
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartHasStep (
|
||||||
|
H5PartFile *f,
|
||||||
|
const h5part_int64_t step
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5PartGetNumSteps (
|
H5PartGetNumSteps (
|
||||||
H5PartFile *f
|
H5PartFile *f
|
||||||
@@ -165,6 +180,13 @@ H5PartReadDataFloat64(
|
|||||||
h5part_float64_t *array
|
h5part_float64_t *array
|
||||||
);
|
);
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
H5PartReadDataFloat32(
|
||||||
|
H5PartFile *f,
|
||||||
|
const char *name,
|
||||||
|
h5part_float32_t *array
|
||||||
|
);
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
H5PartReadDataInt64 (
|
H5PartReadDataInt64 (
|
||||||
H5PartFile *f,
|
H5PartFile *f,
|
||||||
|
|||||||
@@ -258,13 +258,19 @@
|
|||||||
"MPI: Cannot set data transfer mode." );
|
"MPI: Cannot set data transfer mode." );
|
||||||
|
|
||||||
|
|
||||||
#define HANDLE_H5P_SET_FAPL_MPIO_ERR \
|
#define HANDLE_H5P_SET_FAPL_ERR \
|
||||||
(*_err_handler) ( \
|
(*_err_handler) ( \
|
||||||
_H5Part_get_funcname(), \
|
_H5Part_get_funcname(), \
|
||||||
H5PART_ERR_HDF5, \
|
H5PART_ERR_HDF5, \
|
||||||
"Cannot store IO communicator information to the " \
|
"Cannot store IO communicator information to the " \
|
||||||
"file access property list.");
|
"file access property list.");
|
||||||
|
|
||||||
|
#define HANDLE_H5P_SET_CHUNK_ERR \
|
||||||
|
(*_err_handler) ( \
|
||||||
|
_H5Part_get_funcname(), \
|
||||||
|
H5PART_ERR_HDF5, \
|
||||||
|
"Cannot set chunk dimensions." );
|
||||||
|
|
||||||
/* H5S: dataspace */
|
/* H5S: dataspace */
|
||||||
#define HANDLE_H5S_CREATE_SIMPLE_ERR( n ) \
|
#define HANDLE_H5S_CREATE_SIMPLE_ERR( n ) \
|
||||||
(*_err_handler) ( \
|
(*_err_handler) ( \
|
||||||
|
|||||||
@@ -20,12 +20,18 @@
|
|||||||
#define h5pt_openw F77NAME ( \
|
#define h5pt_openw F77NAME ( \
|
||||||
h5pt_openw_, \
|
h5pt_openw_, \
|
||||||
H5PT_OPENW )
|
H5PT_OPENW )
|
||||||
|
#define h5pt_opena F77NAME ( \
|
||||||
|
h5pt_opena_, \
|
||||||
|
H5PT_OPENA )
|
||||||
#define h5pt_openr_par F77NAME ( \
|
#define h5pt_openr_par F77NAME ( \
|
||||||
h5pt_openr_par_, \
|
h5pt_openr_par_, \
|
||||||
H5PT_OPENR_PAR )
|
H5PT_OPENR_PAR )
|
||||||
#define h5pt_openw_par F77NAME ( \
|
#define h5pt_openw_par F77NAME ( \
|
||||||
h5pt_openw_par_, \
|
h5pt_openw_par_, \
|
||||||
H5PT_OPENW_PAR )
|
H5PT_OPENW_PAR )
|
||||||
|
#define h5pt_opena_par F77NAME ( \
|
||||||
|
h5pt_opena_par_, \
|
||||||
|
H5PT_OPENA_PAR )
|
||||||
#define h5pt_close F77NAME ( \
|
#define h5pt_close F77NAME ( \
|
||||||
h5pt_close_, \
|
h5pt_close_, \
|
||||||
H5PT_CLOSE)
|
H5PT_CLOSE)
|
||||||
@@ -207,6 +213,20 @@ h5pt_openw (
|
|||||||
return (h5part_int64_t)(size_t)f;
|
return (h5part_int64_t)(size_t)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5pt_opena (
|
||||||
|
const char *file_name,
|
||||||
|
const int l_file_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||||
|
|
||||||
|
H5PartFile* f = H5PartOpenFile ( file_name2, H5PART_APPEND );
|
||||||
|
|
||||||
|
free ( file_name2 );
|
||||||
|
return (h5part_int64_t)(size_t)f;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef PARALLEL_IO
|
#ifdef PARALLEL_IO
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
h5pt_openr_par (
|
h5pt_openr_par (
|
||||||
@@ -224,7 +244,7 @@ h5pt_openr_par (
|
|||||||
return (h5part_int64_t)(size_t)f;
|
return (h5part_int64_t)(size_t)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
haddr_t
|
h5part_int64_t
|
||||||
h5pt_openw_par (
|
h5pt_openw_par (
|
||||||
const char *file_name,
|
const char *file_name,
|
||||||
MPI_Comm *comm,
|
MPI_Comm *comm,
|
||||||
@@ -239,6 +259,22 @@ h5pt_openw_par (
|
|||||||
free ( file_name2 );
|
free ( file_name2 );
|
||||||
return (h5part_int64_t)(size_t)f;
|
return (h5part_int64_t)(size_t)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h5part_int64_t
|
||||||
|
h5pt_opena_par (
|
||||||
|
const char *file_name,
|
||||||
|
MPI_Comm *comm,
|
||||||
|
const int l_file_name
|
||||||
|
) {
|
||||||
|
|
||||||
|
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
|
||||||
|
|
||||||
|
H5PartFile* f = H5PartOpenFileParallel (
|
||||||
|
file_name2, H5PART_APPEND, *comm );
|
||||||
|
|
||||||
|
free ( file_name2 );
|
||||||
|
return (h5part_int64_t)(size_t)f;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
h5part_int64_t
|
h5part_int64_t
|
||||||
|
|||||||
@@ -10,8 +10,12 @@
|
|||||||
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for writing
|
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for writing
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
|
INTEGER*8 FUNCTION h5pt_opena ( filename )
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for appending
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
INTEGER*8 FUNCTION h5pt_openr_par ( filename, mpi_communicator )
|
INTEGER*8 FUNCTION h5pt_openr_par ( filename, mpi_communicator )
|
||||||
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for writing
|
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
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
@@ -20,6 +24,12 @@
|
|||||||
INTEGER, INTENT(IN) :: mpi_communicator ! the MPI_Communicator used by the program
|
INTEGER, INTENT(IN) :: mpi_communicator ! the MPI_Communicator used by the program
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
|
INTEGER*8 FUNCTION h5pt_opena_par ( filename, mpi_communicator )
|
||||||
|
CHARACTER(LEN=*), INTENT(IN) :: filename ! the filename to open for appending
|
||||||
|
INTEGER, INTENT(IN) :: mpi_communicator ! the MPI_Communicator used by the program
|
||||||
|
END FUNCTION
|
||||||
|
|
||||||
|
|
||||||
INTEGER*8 FUNCTION h5pt_close ( filehandle )
|
INTEGER*8 FUNCTION h5pt_close ( filehandle )
|
||||||
INTEGER*8, INTENT(IN) :: filehandle ! close this open filehandle
|
INTEGER*8, INTENT(IN) :: filehandle ! close this open filehandle
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ _H5Part_iteration_operator (
|
|||||||
|
|
||||||
void
|
void
|
||||||
_H5Part_set_funcname (
|
_H5Part_set_funcname (
|
||||||
char * const fname
|
const char * const fname
|
||||||
);
|
);
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
|||||||
@@ -5,9 +5,13 @@
|
|||||||
#ifndef _H5PARTTYPES_H_
|
#ifndef _H5PARTTYPES_H_
|
||||||
#define _H5PARTTYPES_H_
|
#define _H5PARTTYPES_H_
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
typedef __int64 int64_t;
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
typedef int64_t h5part_int64_t;
|
typedef int64_t h5part_int64_t;
|
||||||
typedef double h5part_float64_t;
|
typedef double h5part_float64_t;
|
||||||
|
typedef float h5part_float32_t;
|
||||||
typedef h5part_int64_t (*h5part_error_handler)( const char*, const h5part_int64_t, const char*,...)
|
typedef h5part_int64_t (*h5part_error_handler)( const char*, const h5part_int64_t, const char*,...)
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__attribute__ ((format (printf, 3, 4)))
|
__attribute__ ((format (printf, 3, 4)))
|
||||||
|
|||||||
@@ -15,20 +15,29 @@
|
|||||||
|
|
||||||
#define FILENAME "testio"
|
#define FILENAME "testio"
|
||||||
/* normally 64 steps for real benchmark */
|
/* normally 64 steps for real benchmark */
|
||||||
#define NSTEPS 5
|
/* #define NSTEPS 5 */
|
||||||
|
|
||||||
/* normally 51e6 for real benchmark */
|
/* normally 51e6 for real benchmark */
|
||||||
#define NPARTICLES 51e4
|
#define NPARTICLES 51e4
|
||||||
#define NTRIALS 3
|
#define NTRIALS 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
bench <nParticles>
|
bench <nParticles> <nSteps>
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
int main(int argc,char *argv[]){
|
int main(int argc,char *argv[]){
|
||||||
|
|
||||||
|
if (argc < 3) {
|
||||||
|
printf("Usage: bench <nParticles> <nSteps> \n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("nparticles: %d, nsteps: %d \n", atoi(argv[1]), atoi(argv[2]));
|
||||||
|
}
|
||||||
|
|
||||||
MPI_Info info;
|
MPI_Info info;
|
||||||
int nprocs,rank;
|
int nprocs,rank;
|
||||||
int trial;
|
int trial;
|
||||||
@@ -36,6 +45,7 @@ int main(int argc,char *argv[]){
|
|||||||
double starttime,curtime, endtime;
|
double starttime,curtime, endtime;
|
||||||
|
|
||||||
int nparticles = atoi(argv[1]);
|
int nparticles = atoi(argv[1]);
|
||||||
|
int nsteps = atoi(argv[2]);
|
||||||
|
|
||||||
double *x,*y,*z,*px,*py,*pz;
|
double *x,*y,*z,*px,*py,*pz;
|
||||||
typedef double *ddouble;
|
typedef double *ddouble;
|
||||||
@@ -71,8 +81,6 @@ int main(int argc,char *argv[]){
|
|||||||
data[5]=pz=(double*)malloc(sizeof(double)*(size_t)localnp);
|
data[5]=pz=(double*)malloc(sizeof(double)*(size_t)localnp);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* printf("about to call create subarray with nparticles=%u localnp=%u offset=%u\n",
|
/* printf("about to call create subarray with nparticles=%u localnp=%u offset=%u\n",
|
||||||
nparticles,localnp,offset); */
|
nparticles,localnp,offset); */
|
||||||
MPI_Type_create_subarray(1, /* rank */
|
MPI_Type_create_subarray(1, /* rank */
|
||||||
@@ -84,9 +92,10 @@ int main(int argc,char *argv[]){
|
|||||||
&chunktype);
|
&chunktype);
|
||||||
MPI_Type_commit(&chunktype);
|
MPI_Type_commit(&chunktype);
|
||||||
MPI_Info_create(&info);
|
MPI_Info_create(&info);
|
||||||
|
MPI_Info_set(info, "IBM_largeblock_io", "true" );
|
||||||
|
|
||||||
if(rank==0) printf("Nprocs=%u Particles=%u*6attribs*sizeof(double) Particles/proc=%u Nsteps=%u Ntrials=%u\n",
|
if(rank==0) printf("Nprocs=%u Particles=%u*6attribs*sizeof(double) Particles/proc=%u Nsteps=%u Ntrials=%u\n",
|
||||||
nprocs,nparticles,localnp,NSTEPS,NTRIALS);
|
nprocs,nparticles,localnp,nsteps,NTRIALS);
|
||||||
|
|
||||||
|
|
||||||
for(trial=0;trial<NTRIALS;trial++){
|
for(trial=0;trial<NTRIALS;trial++){
|
||||||
@@ -114,7 +123,7 @@ int main(int argc,char *argv[]){
|
|||||||
foffset=0;
|
foffset=0;
|
||||||
i=0;
|
i=0;
|
||||||
curtime=starttime;
|
curtime=starttime;
|
||||||
for(i=0;i<NSTEPS;i++){
|
for(i=0;i<nsteps;i++){
|
||||||
int n;
|
int n;
|
||||||
MPI_Status status;
|
MPI_Status status;
|
||||||
for(j=0;j<6;j++){
|
for(j=0;j<6;j++){
|
||||||
@@ -123,20 +132,33 @@ int main(int argc,char *argv[]){
|
|||||||
(data[j])[n]=(double)rank;
|
(data[j])[n]=(double)rank;
|
||||||
/* write to that file */
|
/* write to that file */
|
||||||
/* MPI_File_set_view(file,foffset,MPI_DOUBLE,chunktype,"native",info);*/
|
/* MPI_File_set_view(file,foffset,MPI_DOUBLE,chunktype,"native",info);*/
|
||||||
|
|
||||||
|
#ifdef COLLECTIVE_IO
|
||||||
MPI_File_write_at_all(file,
|
MPI_File_write_at_all(file,
|
||||||
foffset,
|
foffset,
|
||||||
data[j],
|
data[j],
|
||||||
localnp,
|
localnp,
|
||||||
MPI_DOUBLE,&status);
|
MPI_DOUBLE,&status);
|
||||||
|
#else
|
||||||
|
MPI_File_write_at(file,
|
||||||
|
foffset,
|
||||||
|
data[j],
|
||||||
|
localnp,
|
||||||
|
MPI_DOUBLE,&status);
|
||||||
|
#endif
|
||||||
|
|
||||||
foffset+=nparticles/nprocs;
|
foffset+=nparticles/nprocs;
|
||||||
}
|
}
|
||||||
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
curtime=MPI_Wtime(); /* ensure no race condition by broadcasting time */
|
||||||
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
MPI_Bcast(&curtime,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MPI_File_close(&file);
|
MPI_File_close(&file);
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
endtime=MPI_Wtime();
|
endtime=MPI_Wtime();
|
||||||
sprintf(filename,"%s.%u.h5.dat",FILENAME,nprocs);
|
|
||||||
|
|
||||||
/* foffset*=nprocs; if we want total megabytes written */
|
/* foffset*=nprocs; if we want total megabytes written */
|
||||||
if(rank==0){
|
if(rank==0){
|
||||||
puts("*");
|
puts("*");
|
||||||
@@ -145,20 +167,21 @@ int main(int argc,char *argv[]){
|
|||||||
printf("Raw MPI-IO Total Duration %lf seconds, iterations=%u %lf Megabytes written per processor Nprocs= %u \n",
|
printf("Raw MPI-IO Total Duration %lf seconds, iterations=%u %lf Megabytes written per processor Nprocs= %u \n",
|
||||||
(endtime-starttime),i,((double)foffset)/(1024.0*1024.0),nprocs);
|
(endtime-starttime),i,((double)foffset)/(1024.0*1024.0),nprocs);
|
||||||
printf("Raw MPI-IO Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
printf("Raw MPI-IO Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
||||||
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
(double)(nprocs*localnp*sizeof(double))*((double)nsteps)*6.0/((endtime-starttime)*1024.0*1024.0),
|
||||||
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
(double)(localnp*sizeof(double))*((double)nsteps)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
||||||
puts("======================================================");
|
puts("======================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
/* OK, now we do this using H5Part */
|
|
||||||
|
/* OK, now we do this using POSIX IO */
|
||||||
sprintf(newfilename,"testio%u.%u.dat",rank,nprocs);
|
sprintf(newfilename,"testio%u.%u.dat",rank,nprocs);
|
||||||
unlink(newfilename);
|
unlink(newfilename);
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
fd = fopen(newfilename,"w");
|
fd = fopen(newfilename,"w");
|
||||||
/* start the timer */
|
/* start the timer */
|
||||||
starttime=endtime=MPI_Wtime();
|
starttime=endtime=MPI_Wtime();
|
||||||
for(i=0;i<NSTEPS;i++){
|
for(i=0;i<nsteps;i++){
|
||||||
for(j=0;j<6;j++){
|
for(j=0;j<6;j++){
|
||||||
/* touch data */
|
/* touch data */
|
||||||
for(n=0;n<localnp;n++)
|
for(n=0;n<localnp;n++)
|
||||||
@@ -178,22 +201,28 @@ int main(int argc,char *argv[]){
|
|||||||
if(rank==0){
|
if(rank==0){
|
||||||
puts("======================================================");
|
puts("======================================================");
|
||||||
printf("Raw 1-file-per-proc Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
|
printf("Raw 1-file-per-proc Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
|
||||||
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
|
(endtime-starttime),nsteps,((double)foffset)/(1024.0*1024.0),nprocs);
|
||||||
printf("Raw 1-file-per-proc Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
printf("Raw 1-file-per-proc Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
||||||
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
(double)(nprocs*localnp*sizeof(double))*((double)nsteps)*6.0/((endtime-starttime)*1024.0*1024.0),
|
||||||
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
(double)(localnp*sizeof(double))*((double)nsteps)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
||||||
puts("======================================================");
|
puts("======================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_H5PART
|
#ifndef DISABLE_H5PART
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
/* OK, now we do this using H5Part */
|
/* OK, now we do this using H5Part */
|
||||||
|
|
||||||
|
sprintf(filename,"%s.%u.h5.dat",FILENAME,nprocs);
|
||||||
|
if(rank==0) unlink(filename);
|
||||||
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
|
|
||||||
f = H5PartOpenFileParallel(filename,H5PART_WRITE,MPI_COMM_WORLD);
|
f = H5PartOpenFileParallel(filename,H5PART_WRITE,MPI_COMM_WORLD);
|
||||||
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
MPI_Barrier(MPI_COMM_WORLD); /* to prevent unlink from interfering with file open */
|
||||||
/* start the timer */
|
/* start the timer */
|
||||||
starttime=endtime=MPI_Wtime();
|
starttime=endtime=MPI_Wtime();
|
||||||
H5PartSetNumParticles(f,localnp);
|
H5PartSetNumParticles(f,localnp);
|
||||||
for(i=0;i<NSTEPS;i++){
|
for(i=0;i<nsteps;i++){
|
||||||
for(j=0;j<6;j++){
|
for(j=0;j<6;j++){
|
||||||
/* touch data */
|
/* touch data */
|
||||||
for(n=0;n<localnp;n++)
|
for(n=0;n<localnp;n++)
|
||||||
@@ -218,15 +247,16 @@ int main(int argc,char *argv[]){
|
|||||||
unlink(filename);
|
unlink(filename);
|
||||||
puts("======================================================");
|
puts("======================================================");
|
||||||
printf("H5Part Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
|
printf("H5Part Total Duration %lf seconds, iterations=%u %lf Megabytes written Nprocs= %u \n",
|
||||||
(endtime-starttime),NSTEPS,((double)foffset)/(1024.0*1024.0),nprocs);
|
(endtime-starttime),nsteps,((double)foffset)/(1024.0*1024.0),nprocs);
|
||||||
printf("H5Part Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
printf("H5Part Effective Data Rate = %lf Megabytes/sec global and %lf Megabytes/sec per task Nprocs= %u \n",
|
||||||
(double)(nprocs*localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),
|
(double)(nprocs*localnp*sizeof(double))*((double)nsteps)*6.0/((endtime-starttime)*1024.0*1024.0),
|
||||||
(double)(localnp*sizeof(double))*((double)NSTEPS)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
(double)(localnp*sizeof(double))*((double)nsteps)*6.0/((endtime-starttime)*1024.0*1024.0),nprocs);
|
||||||
puts("======================================================");
|
puts("======================================================");
|
||||||
}
|
}
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
#endif
|
#endif
|
||||||
} /* trials */
|
} /* trials */
|
||||||
|
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -4,10 +4,7 @@
|
|||||||
#include "H5Part.h"
|
#include "H5Part.h"
|
||||||
#include "H5Block.h"
|
#include "H5Block.h"
|
||||||
#include "H5BlockTypes.h"
|
#include "H5BlockTypes.h"
|
||||||
#ifdef PARALLEL_IO
|
#ifndef PARALLEL_IO
|
||||||
#include <mpi.h>
|
|
||||||
#else
|
|
||||||
typedef int MPI_Comm;
|
|
||||||
#ifndef MPI_COMM_WORLD
|
#ifndef MPI_COMM_WORLD
|
||||||
#define MPI_COMM_WORLD 0
|
#define MPI_COMM_WORLD 0
|
||||||
#endif
|
#endif
|
||||||
@@ -36,7 +33,7 @@ _write_data (
|
|||||||
|
|
||||||
printf ( "Writing Step #%lld\n", (long long)f->timestep );
|
printf ( "Writing Step #%lld\n", (long long)f->timestep );
|
||||||
|
|
||||||
data = malloc ( i_dims * j_dims * k_dims * sizeof ( *data ) );
|
data = (h5part_float64_t *) malloc ( i_dims * j_dims * k_dims * sizeof ( *data ) );
|
||||||
for ( i = 0; i < i_dims; i++ ) {
|
for ( i = 0; i < i_dims; i++ ) {
|
||||||
for ( j = 0; j < j_dims; j++ ) {
|
for ( j = 0; j < j_dims; j++ ) {
|
||||||
for ( k = 0; k < k_dims; k++ ) {
|
for ( k = 0; k < k_dims; k++ ) {
|
||||||
@@ -173,7 +170,7 @@ _read_data (
|
|||||||
|
|
||||||
printf ( "Reading Step #%lld\n", (long long)f->timestep );
|
printf ( "Reading Step #%lld\n", (long long)f->timestep );
|
||||||
|
|
||||||
data = malloc ( i_dims * j_dims * k_dims * sizeof ( *data ) );
|
data = (h5part_float64_t *) malloc ( i_dims * j_dims * k_dims * sizeof ( *data ) );
|
||||||
|
|
||||||
herr = H5BlockDefine3DFieldLayout (
|
herr = H5BlockDefine3DFieldLayout (
|
||||||
f,
|
f,
|
||||||
|
|||||||
@@ -8,34 +8,59 @@
|
|||||||
A simple regression test that shows how you use this API
|
A simple regression test that shows how you use this API
|
||||||
to write and read multi-timestep files of particle data.
|
to write and read multi-timestep files of particle data.
|
||||||
*/
|
*/
|
||||||
#ifdef PARALLEL_IO
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc,char *argv[]){
|
int main(int argc,char *argv[]){
|
||||||
int sz=5;
|
int sz=5;
|
||||||
double *x,*y,*z;
|
double *x,*y,*z;
|
||||||
h5part_int64_t *id;
|
h5part_int64_t *id;
|
||||||
H5PartFile *file;
|
H5PartFile *file;
|
||||||
int i,t,nt,nds;
|
int i,t,nt,nds, np;
|
||||||
int nprocs,myproc;
|
int nprocs = 1;
|
||||||
|
int myproc = 0;
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
MPI_Comm comm=MPI_COMM_WORLD;
|
MPI_Comm comm=MPI_COMM_WORLD;
|
||||||
|
|
||||||
MPI_Init(&argc,&argv);
|
MPI_Init(&argc,&argv);
|
||||||
MPI_Comm_size(comm,&nprocs);
|
MPI_Comm_size(comm,&nprocs);
|
||||||
MPI_Comm_rank(comm,&myproc);
|
MPI_Comm_rank(comm,&myproc);
|
||||||
|
#endif
|
||||||
x=(double*)malloc(sz*nprocs*sizeof(double));
|
x=(double*)malloc(sz*nprocs*sizeof(double));
|
||||||
y=(double*)malloc(sz*nprocs*sizeof(double));
|
y=(double*)malloc(sz*nprocs*sizeof(double));
|
||||||
z=(double*)malloc(sz*nprocs*sizeof(double));
|
z=(double*)malloc(sz*nprocs*sizeof(double));
|
||||||
id=(h5part_int64_t*)malloc(sz*nprocs*sizeof(h5part_int64_t));
|
id=(h5part_int64_t*)malloc(sz*nprocs*sizeof(h5part_int64_t));
|
||||||
/* parallel file creation */
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
file=H5PartOpenFileParallel("parttest.h5",H5PART_WRITE,comm);
|
file=H5PartOpenFileParallel("parttest.h5",H5PART_WRITE,comm);
|
||||||
|
#else
|
||||||
|
file=H5PartOpenFile("parttest.h5",H5PART_WRITE);
|
||||||
|
#endif
|
||||||
if(!file) {
|
if(!file) {
|
||||||
perror("File open failed: exiting!");
|
perror("File open failed: exiting!");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( myproc == 0 ) {
|
||||||
|
H5PartWriteFileAttribString (
|
||||||
|
file,
|
||||||
|
"File Description",
|
||||||
|
"Simple H5Part file for testing purpose...");
|
||||||
|
char* FileAttrib = "Created by H5PartTest.cc";
|
||||||
|
H5PartWriteFileAttrib (
|
||||||
|
file,
|
||||||
|
"Origin",
|
||||||
|
H5T_NATIVE_CHAR,
|
||||||
|
FileAttrib,
|
||||||
|
strlen(FileAttrib));
|
||||||
|
}
|
||||||
for(t=0;t<5;t++){
|
for(t=0;t<5;t++){
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
MPI_Barrier(comm);
|
MPI_Barrier(comm);
|
||||||
|
#endif
|
||||||
|
fprintf(stdout,"Writing timestep %u\n",t);
|
||||||
|
|
||||||
for(i=0;i<sz;i++) {
|
for(i=0;i<sz;i++) {
|
||||||
x[i]=(double)(i+t)+10.0*(double)myproc;
|
x[i]=(double)(i+t)+10.0*(double)myproc;
|
||||||
y[i]=0.1 + (double)(i+t);
|
y[i]=0.1 + (double)(i+t);
|
||||||
@@ -55,26 +80,40 @@ int main(int argc,char *argv[]){
|
|||||||
H5PartWriteDataFloat64(file,"pz",z);
|
H5PartWriteDataFloat64(file,"pz",z);
|
||||||
|
|
||||||
H5PartWriteDataInt64(file,"id",id);
|
H5PartWriteDataInt64(file,"id",id);
|
||||||
|
if ( myproc == 0 ) {
|
||||||
|
H5PartWriteStepAttribString (
|
||||||
|
file,
|
||||||
|
"Step Description",
|
||||||
|
"STEP STEP STEP"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int idStart = 0+sz*myproc;
|
}
|
||||||
unsigned int idEnd = (sz-1)+sz*myproc;
|
|
||||||
|
h5part_int64_t idStart = 0+sz*myproc;
|
||||||
|
h5part_int64_t idEnd = (sz-1)+sz*myproc;
|
||||||
|
|
||||||
printf("AllDone p[%u]\n",myproc);
|
printf("AllDone p[%u]\n",myproc);
|
||||||
H5PartCloseFile(file);
|
H5PartCloseFile(file);
|
||||||
fprintf(stderr,"Closed files p[%u]\n",myproc);
|
fprintf(stderr,"Closed files p[%u]\n",myproc);
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
MPI_Barrier(comm);
|
MPI_Barrier(comm);
|
||||||
|
#endif
|
||||||
|
fprintf (
|
||||||
|
stderr,
|
||||||
|
"p[%u:%u] : OK, close file and reopen for reading idStart %lld idEnd %lld \n",
|
||||||
|
myproc, nprocs, (long long)idStart,
|
||||||
|
(long long)idEnd );
|
||||||
|
|
||||||
fprintf(stderr,"p[%u:%u] : OK, close file and reopen for reading idStart %u idEnd %u \n",myproc,nprocs,idStart,idEnd);
|
#ifdef PARALLEL_IO
|
||||||
|
|
||||||
file = H5PartOpenFileParallel ( "parttest.h5", H5PART_READ, comm );
|
file = H5PartOpenFileParallel ( "parttest.h5", H5PART_READ, comm );
|
||||||
|
#else
|
||||||
|
file = H5PartOpenFile ( "parttest.h5", H5PART_READ );
|
||||||
|
#endif
|
||||||
H5PartSetStep(file,0);
|
H5PartSetStep(file,0);
|
||||||
// unsigned int np = 0;
|
|
||||||
unsigned int np = (int)H5PartGetNumParticles(file);
|
|
||||||
nt = H5PartGetNumSteps(file); /* get number of steps in file */
|
nt = H5PartGetNumSteps(file); /* get number of steps in file */
|
||||||
nds = H5PartGetNumDatasets(file); /* get number of datasets in timestep 0 */
|
nds = H5PartGetNumDatasets(file); /* get number of datasets in timestep 0 */
|
||||||
|
np = H5PartGetNumParticles(file);
|
||||||
MPI_Barrier(comm);
|
|
||||||
|
|
||||||
H5PartSetView(file,idStart,idEnd);
|
H5PartSetView(file,idStart,idEnd);
|
||||||
|
|
||||||
@@ -83,95 +122,9 @@ int main(int argc,char *argv[]){
|
|||||||
(int)idStart,(int)idEnd,
|
(int)idStart,(int)idEnd,
|
||||||
nt,nds,np);
|
nt,nds,np);
|
||||||
|
|
||||||
if(x)
|
#ifdef PARALLEL_IO
|
||||||
free(x);
|
|
||||||
if(y)
|
|
||||||
free(y);
|
|
||||||
if(z)
|
|
||||||
free(z);
|
|
||||||
if(id)
|
|
||||||
free(id);
|
|
||||||
|
|
||||||
H5PartCloseFile(file);
|
|
||||||
MPI_Barrier(comm);
|
MPI_Barrier(comm);
|
||||||
fprintf(stderr,"proc[%u]: done\n",myproc);
|
#endif
|
||||||
return MPI_Finalize();
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
int main(int argc,char *argv[]){
|
|
||||||
int sz=10;
|
|
||||||
double *x,*y,*z;
|
|
||||||
h5part_int64_t *id;
|
|
||||||
H5PartFile *file;
|
|
||||||
int i,t,nt,nds,np;
|
|
||||||
h5part_int64_t idStart = 0;
|
|
||||||
h5part_int64_t idEnd = 0;
|
|
||||||
|
|
||||||
|
|
||||||
x=(double*)malloc(sz*sizeof(double));
|
|
||||||
y=(double*)malloc(sz*sizeof(double));
|
|
||||||
z=(double*)malloc(sz*sizeof(double));
|
|
||||||
id=(h5part_int64_t*)malloc(sz*sizeof(h5part_int64_t));
|
|
||||||
/* parallel file creation */
|
|
||||||
file=H5PartOpenFile("parttest.h5",H5PART_WRITE);
|
|
||||||
if(!file) {
|
|
||||||
perror("File open failed: exiting!");
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
H5PartWriteFileAttribString(file,"File Description", "This file is created by H5PartTest.cc. Simple H5Part file for testing purpose...");
|
|
||||||
char* FileAttrib = "Created by H5PartTest.cc";
|
|
||||||
H5PartWriteFileAttrib(file, "Origin", H5T_NATIVE_CHAR, FileAttrib ,strlen(FileAttrib));
|
|
||||||
|
|
||||||
for(t=0;t<5;t++){
|
|
||||||
fprintf(stdout,"Writing timestep %u\n",t);
|
|
||||||
for(i=0;i<sz;i++) {
|
|
||||||
x[i]=(double)(i+t);
|
|
||||||
y[i]=0.1 + (double)(i+t);
|
|
||||||
z[i]=0.2 + (double)(i+t*10);
|
|
||||||
id[i]=i;
|
|
||||||
fprintf(stdout,"\tp[%u] x=%f y=%f z=%f id=%d\n",
|
|
||||||
i,x[i],y[i],z[i],(int)id[i]);
|
|
||||||
}
|
|
||||||
H5PartSetStep(file,t); /* must set the current timestep in file */
|
|
||||||
|
|
||||||
H5PartSetNumParticles(file,sz); /* then set number of particles to store */
|
|
||||||
/* now write different tuples of data into this timestep of the file */
|
|
||||||
H5PartWriteDataFloat64(file,"x",x);
|
|
||||||
H5PartWriteDataFloat64(file,"y",y);
|
|
||||||
H5PartWriteDataFloat64(file,"z",z);
|
|
||||||
|
|
||||||
H5PartWriteDataFloat64(file,"px",x);
|
|
||||||
H5PartWriteDataFloat64(file,"py",y);
|
|
||||||
H5PartWriteDataFloat64(file,"pz",z);
|
|
||||||
|
|
||||||
H5PartWriteDataInt64(file,"id",id);
|
|
||||||
|
|
||||||
H5PartWriteStepAttribString(file,"Step Description", "STEP STEP STEP");
|
|
||||||
char* StepAttrib = "STEP";
|
|
||||||
H5PartWriteStepAttrib(file, "Step", H5T_NATIVE_CHAR, StepAttrib ,strlen(StepAttrib));
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("AllDone writing\n");
|
|
||||||
H5PartCloseFile(file);
|
|
||||||
|
|
||||||
|
|
||||||
/*+++++++++++++ Reopen File for Reading +++++++++++*/
|
|
||||||
file=H5PartOpenFile("parttest.h5",H5PART_READ);
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************/
|
|
||||||
H5PartSetStep(file,0);
|
|
||||||
nt=H5PartGetNumSteps(file); /* get number of steps in file */
|
|
||||||
nds=H5PartGetNumDatasets(file); /* get number of datasets in timestep 0 */
|
|
||||||
np=H5PartGetNumParticles(file);
|
|
||||||
|
|
||||||
|
|
||||||
fprintf(stdout,"OK, close file and reopen for reading\n");
|
|
||||||
fprintf(stdout,"steps= %u\tdatasets=%u\tparticles= %u\n",
|
|
||||||
nt,nds,np);
|
|
||||||
|
|
||||||
// clear the particles
|
// clear the particles
|
||||||
for(i=0;i<np;i++){
|
for(i=0;i<np;i++){
|
||||||
x[i]=y[i]=z[i]=0.0;
|
x[i]=y[i]=z[i]=0.0;
|
||||||
@@ -188,7 +141,7 @@ int main(int argc,char *argv[]){
|
|||||||
"\tp[%3u] x=%lf y=%lf z=%lf id=%lld\n",
|
"\tp[%3u] x=%lf y=%lf z=%lf id=%lld\n",
|
||||||
i,x[i],y[i],z[i],(long long)(id[i]));
|
i,x[i],y[i],z[i],(long long)(id[i]));
|
||||||
}
|
}
|
||||||
/********************************************/
|
|
||||||
printf("Set to last step and reload data\n");
|
printf("Set to last step and reload data\n");
|
||||||
H5PartSetStep(file,nt-1);
|
H5PartSetStep(file,nt-1);
|
||||||
H5PartReadDataFloat64(file,"x",x);
|
H5PartReadDataFloat64(file,"x",x);
|
||||||
@@ -246,6 +199,34 @@ int main(int argc,char *argv[]){
|
|||||||
"\tp[%3u] x=%lf y=%lf z=%lf id=%lld\n",
|
"\tp[%3u] x=%lf y=%lf z=%lf id=%lld\n",
|
||||||
i,x[i],y[i],z[i],(long long)id[i]);
|
i,x[i],y[i],z[i],(long long)id[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// read dataset names
|
||||||
|
h5part_int64_t status = H5PART_SUCCESS;
|
||||||
|
|
||||||
|
H5PartSetStep ( file, 0 );
|
||||||
|
for (h5part_int64_t i=0; i < nds; i++) {
|
||||||
|
const h5part_int64_t lenName = 64;
|
||||||
|
char datasetName[lenName];
|
||||||
|
h5part_int64_t datasetType;
|
||||||
|
h5part_int64_t datasetNElems;
|
||||||
|
|
||||||
|
status = H5PartGetDatasetInfo(file, i, datasetName, lenName,
|
||||||
|
&datasetType, &datasetNElems);
|
||||||
|
|
||||||
|
if (status != H5PART_SUCCESS) {
|
||||||
|
perror("Could not retrieve dataset names!");
|
||||||
|
} else {
|
||||||
|
printf("datasetName: %s, type: %lld, nElements: %lld ",
|
||||||
|
datasetName, datasetType, datasetNElems);
|
||||||
|
if (datasetType == H5PART_INT64) {
|
||||||
|
printf("H5PPART_INT64 \n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("H5PPART_FLOAT64 \n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(x)
|
if(x)
|
||||||
free(x);
|
free(x);
|
||||||
if(y)
|
if(y)
|
||||||
@@ -256,10 +237,15 @@ int main(int argc,char *argv[]){
|
|||||||
free(id);
|
free(id);
|
||||||
|
|
||||||
H5PartCloseFile(file);
|
H5PartCloseFile(file);
|
||||||
fprintf(stderr,"done\n");
|
fprintf(stderr,"proc[%u]: done\n",myproc);
|
||||||
|
|
||||||
|
#ifdef PARALLEL_IO
|
||||||
|
MPI_Barrier(comm);
|
||||||
|
return MPI_Finalize();
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <hdf5.h>
|
#include <hdf5.h>
|
||||||
#include "H5Part.hh"
|
#include "H5Part.h"
|
||||||
|
|
||||||
#ifdef PARALLEL_IO
|
#ifdef PARALLEL_IO
|
||||||
|
|
||||||
@@ -84,8 +84,8 @@ int main(int argc,char *argv[]){
|
|||||||
/* now lets compute the appropriate idStart and idEnd
|
/* now lets compute the appropriate idStart and idEnd
|
||||||
for this particular processor */
|
for this particular processor */
|
||||||
|
|
||||||
unsigned h5part_int64_t idStart = sz*myproc;
|
h5part_int64_t idStart = sz*myproc;
|
||||||
unsigned h5part_int64_t idEnd = (sz-1)+sz*myproc;
|
h5part_int64_t idEnd = (sz-1)+sz*myproc;
|
||||||
H5PartSetView(file,idStart,idEnd);
|
H5PartSetView(file,idStart,idEnd);
|
||||||
np=H5PartGetNumParticles(file);
|
np=H5PartGetNumParticles(file);
|
||||||
printf("Proc[%u]: View=%u:%u : particles= %u\n",
|
printf("Proc[%u]: View=%u:%u : particles= %u\n",
|
||||||
|
|||||||
@@ -48,6 +48,13 @@ h5pToGNUplot_SOURCES = h5pToGNUplot.cc
|
|||||||
# Specific building instruction (What compilers to use...)
|
# Specific building instruction (What compilers to use...)
|
||||||
# ------------ Build Tools ------------
|
# ------------ Build Tools ------------
|
||||||
|
|
||||||
|
|
||||||
|
h5ToVtk.o: h5ToVtk.cc
|
||||||
|
$(TOOLS_CXX) $(CFLAGS) $(INC) -g -c h5ToVtk.cc
|
||||||
|
|
||||||
|
h5ToVtk: h5ToVtk.o
|
||||||
|
$(TOOLS_CXX) -o h5ToVtk h5ToVtk.o $(H5PLIB) $(LIBS)
|
||||||
|
|
||||||
h5pAttrib: h5pAttrib.o
|
h5pAttrib: h5pAttrib.o
|
||||||
$(TOOLS_CXX) -o h5pAttrib h5pAttrib.o $(H5PLIB) $(LIBS)
|
$(TOOLS_CXX) -o h5pAttrib h5pAttrib.o $(H5PLIB) $(LIBS)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,532 @@
|
|||||||
|
/* h5ToVtk.cc
|
||||||
|
Andreas Adelmann
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <cctype>
|
||||||
|
#include <string.h>
|
||||||
|
#include <hdf5.h>
|
||||||
|
#include "H5Part.h"
|
||||||
|
#include <set>
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <cassert>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
#define MAX_LEN 100
|
||||||
|
|
||||||
|
/* Function headers */
|
||||||
|
int get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts);
|
||||||
|
static void print_help();
|
||||||
|
static void variable_assign(int argc, const char *argv[]);
|
||||||
|
|
||||||
|
/* Global variables */
|
||||||
|
static char* input_name = NULL;
|
||||||
|
static char* output_name = NULL;
|
||||||
|
static bool flg_alive = false;
|
||||||
|
static double z_pos = 0.0;
|
||||||
|
static int print_all = 0;
|
||||||
|
|
||||||
|
/* `get_option' variables */
|
||||||
|
int opt_err = 1; /*get_option prints errors if this is on */
|
||||||
|
int opt_ind = 1; /*token pointer */
|
||||||
|
const char *opt_arg = NULL; /*flag argument (or value) */
|
||||||
|
|
||||||
|
/* indication whether the flag (option) requires an argument or not */
|
||||||
|
enum {
|
||||||
|
no_arg = 0, /* doesn't take an argument */
|
||||||
|
require_arg, /* requires an argument */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* struct for flags (options) */
|
||||||
|
typedef struct long_options
|
||||||
|
{
|
||||||
|
const char *name; /* name of the long option */
|
||||||
|
int has_arg; /* whether we should look for an arg */
|
||||||
|
char shortval; /* the shortname equivalent of long arg
|
||||||
|
* this gets returned from get_option */
|
||||||
|
} long_options;
|
||||||
|
|
||||||
|
/* List of options in single characters */
|
||||||
|
static const char *s_opts = "h1:2:i:o:a:";
|
||||||
|
|
||||||
|
/* List of options in full words */
|
||||||
|
static struct long_options l_opts[] =
|
||||||
|
{
|
||||||
|
{ "help", no_arg, 'h' }, // Print help page
|
||||||
|
{ "input", require_arg, 'i' }, // Takes input file name
|
||||||
|
{ "output", require_arg, 'o' }, // Takes output file name (without this flag, the program will print to stdout)
|
||||||
|
{ "alive ", no_arg , 'a' }, // also generate the alive dark current to display the dark current source
|
||||||
|
{ NULL, 0, '\0' }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
*********************************** FUNCTIONS *************************************
|
||||||
|
*************************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
string convert2Int(int number) {
|
||||||
|
stringstream ss;
|
||||||
|
ss << setw(5) << setfill('0') << number;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* get_option is the parsing function that was majorly ported from h5dump utility */
|
||||||
|
int get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) {
|
||||||
|
static int sp = 1; /* character index in current token */
|
||||||
|
int opt_opt = '?'; /* option character passed back to user */
|
||||||
|
|
||||||
|
if (sp == 1)
|
||||||
|
{
|
||||||
|
/* check for more flag-like tokens */
|
||||||
|
if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0')
|
||||||
|
{
|
||||||
|
return EOF;
|
||||||
|
}
|
||||||
|
else if (strcmp(argv[opt_ind], "--") == 0)
|
||||||
|
{
|
||||||
|
opt_ind++;
|
||||||
|
return EOF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-')
|
||||||
|
{
|
||||||
|
/* long command line option */
|
||||||
|
const char *arg = &argv[opt_ind][2];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; l_opts && l_opts[i].name; i++)
|
||||||
|
{
|
||||||
|
size_t len = strlen(l_opts[i].name);
|
||||||
|
|
||||||
|
if (strncmp(arg, l_opts[i].name, len) == 0)
|
||||||
|
{
|
||||||
|
/* we've found a matching long command line flag */
|
||||||
|
opt_opt = l_opts[i].shortval;
|
||||||
|
|
||||||
|
if (l_opts[i].has_arg != no_arg)
|
||||||
|
{
|
||||||
|
if (arg[len] == '=')
|
||||||
|
{
|
||||||
|
opt_arg = &arg[len + 1];
|
||||||
|
}
|
||||||
|
else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-')
|
||||||
|
{
|
||||||
|
opt_arg = argv[++opt_ind];
|
||||||
|
}
|
||||||
|
else if (l_opts[i].has_arg == require_arg)
|
||||||
|
{
|
||||||
|
if (opt_err)
|
||||||
|
fprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg);
|
||||||
|
|
||||||
|
opt_opt = '?';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (arg[len] == '=')
|
||||||
|
{
|
||||||
|
if (opt_err)
|
||||||
|
fprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg);
|
||||||
|
|
||||||
|
opt_opt = '?';
|
||||||
|
}
|
||||||
|
|
||||||
|
opt_arg = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (l_opts[i].name == NULL)
|
||||||
|
{
|
||||||
|
/* exhausted all of the l_opts we have and still didn't match */
|
||||||
|
if (opt_err)
|
||||||
|
fprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg);
|
||||||
|
|
||||||
|
opt_opt = '?';
|
||||||
|
}
|
||||||
|
|
||||||
|
opt_ind++;
|
||||||
|
sp = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
register char *cp; /* pointer into current token */
|
||||||
|
|
||||||
|
/* short command line option */
|
||||||
|
opt_opt = argv[opt_ind][sp];
|
||||||
|
|
||||||
|
if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (opt_err)
|
||||||
|
fprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt);
|
||||||
|
/* if no chars left in this token, move to next token */
|
||||||
|
if (argv[opt_ind][++sp] == '\0')
|
||||||
|
{
|
||||||
|
opt_ind++;
|
||||||
|
sp = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return '?';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*++cp == ':')
|
||||||
|
{
|
||||||
|
|
||||||
|
/* if a value is expected, get it */
|
||||||
|
if (argv[opt_ind][sp + 1] != '\0')
|
||||||
|
{
|
||||||
|
/* flag value is rest of current token */
|
||||||
|
opt_arg = &argv[opt_ind++][sp + 1];
|
||||||
|
}
|
||||||
|
else if (++opt_ind >= argc)
|
||||||
|
{
|
||||||
|
if (opt_err)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt);
|
||||||
|
}
|
||||||
|
opt_opt = '?';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* flag value is next token */
|
||||||
|
opt_arg = argv[opt_ind++];
|
||||||
|
}
|
||||||
|
|
||||||
|
sp = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* set up to look at next char in token, next time */
|
||||||
|
if (argv[opt_ind][++sp] == '\0')
|
||||||
|
{
|
||||||
|
/* no more in current token, so setup next token */
|
||||||
|
opt_ind++;
|
||||||
|
sp = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
opt_arg = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return the current flag character found */
|
||||||
|
return opt_opt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Assigns functions according to the parsed result */
|
||||||
|
static void variable_assign(int argc, const char *argv[])
|
||||||
|
{
|
||||||
|
int option;
|
||||||
|
|
||||||
|
/* set options according to the command line */
|
||||||
|
while ((option = get_option(argc, argv, s_opts, l_opts)) != EOF)
|
||||||
|
{
|
||||||
|
switch ((char)option)
|
||||||
|
{
|
||||||
|
case 'h': // Print help page
|
||||||
|
print_help();
|
||||||
|
exit(1);
|
||||||
|
case 'o': // Print number of steps
|
||||||
|
output_name = strdup(opt_arg);
|
||||||
|
break;
|
||||||
|
case 'i': // Print shorter version without the values
|
||||||
|
input_name = strdup(opt_arg);
|
||||||
|
break;
|
||||||
|
case 'a': //
|
||||||
|
{ flg_alive = true;
|
||||||
|
z_pos = atof(strdup(opt_arg));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
print_help();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* For printing help page */
|
||||||
|
static void print_help()
|
||||||
|
{
|
||||||
|
fflush(stdout);
|
||||||
|
fprintf(stdout, "\nusage: h5ToVtk -i INPUTFILE -o OUTPUTFILE [OPTIONAL_FLAGS] -a ZVALUE\n");
|
||||||
|
fprintf(stdout, "\n");
|
||||||
|
fprintf(stdout, " FLAGS\n");
|
||||||
|
fprintf(stdout, " -h, --help Print help page\n");
|
||||||
|
fprintf(stdout, " -i file, --input file (REQUIRED) Takes input base file name to \"file\" (extension h5 is assumed \n");
|
||||||
|
fprintf(stdout, " -o file, --output file (REQUIRED) Takes output base file name to \"file\" (extension vtk is added)\n");
|
||||||
|
fprintf(stdout, " -a zvalue Only display particles which have servived and reached z value \n");
|
||||||
|
|
||||||
|
fprintf(stdout, "\n");
|
||||||
|
fprintf(stdout, " Examples:\n");
|
||||||
|
fprintf(stdout, "\n");
|
||||||
|
fprintf(stdout, " /h5ToVtk -i ctf3-injector-darkcurrent-1 -o ctf3-injector-darkcurrent-1- \n");
|
||||||
|
fprintf(stdout, "\n");
|
||||||
|
fprintf(stdout, " /h5ToVtk -i ctf3-injector-darkcurrent-1 -o ctf3-injector-darkcurrent-1- -a 0.19 \n");
|
||||||
|
fprintf(stdout, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, const char *argv[])
|
||||||
|
{
|
||||||
|
H5PartFile *h5file = NULL;
|
||||||
|
|
||||||
|
std::ofstream of, ofalive;
|
||||||
|
|
||||||
|
int j;
|
||||||
|
|
||||||
|
int num_dataset;
|
||||||
|
|
||||||
|
int ntime_step = 0;
|
||||||
|
|
||||||
|
variable_assign(argc, argv);
|
||||||
|
|
||||||
|
if(input_name == NULL) {
|
||||||
|
fprintf(stdout, "missing input file name\n");
|
||||||
|
print_help();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(output_name == NULL) {
|
||||||
|
fprintf(stdout, "missing output file name\n");
|
||||||
|
print_help();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
string ifn = string(input_name) + string(".h5");
|
||||||
|
|
||||||
|
h5file = H5PartOpenFile(ifn.c_str(), H5PART_READ);
|
||||||
|
|
||||||
|
if( h5file == NULL ) {
|
||||||
|
fprintf(stdout, "unable to open file %s\n", input_name);
|
||||||
|
print_help();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ntime_step = H5PartGetNumSteps(h5file);
|
||||||
|
|
||||||
|
if (flg_alive) {
|
||||||
|
|
||||||
|
set<h5part_int64_t> idSet;
|
||||||
|
|
||||||
|
H5PartSetStep(h5file, ntime_step-1);
|
||||||
|
num_dataset = H5PartGetNumDatasets(h5file);
|
||||||
|
h5part_int64_t nparticles = H5PartGetNumParticles(h5file);
|
||||||
|
|
||||||
|
h5part_int64_t* larray = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*nparticles);
|
||||||
|
H5PartReadDataInt64(h5file, "id", larray);
|
||||||
|
|
||||||
|
h5part_float64_t* z = (h5part_float64_t*)malloc(sizeof(h5part_float64_t)*nparticles);
|
||||||
|
H5PartReadDataFloat64(h5file, "z", z);
|
||||||
|
|
||||||
|
for(unsigned long int n = 0; n < nparticles; ++n) {
|
||||||
|
if (z[n] >= z_pos)
|
||||||
|
idSet.insert(larray[n]);
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Last timestep contains " << nparticles << " particles" << endl;
|
||||||
|
|
||||||
|
for (size_t j = 0; j<ntime_step ; j ++) {
|
||||||
|
|
||||||
|
H5PartSetStep(h5file,j);
|
||||||
|
|
||||||
|
num_dataset = H5PartGetNumDatasets(h5file);
|
||||||
|
|
||||||
|
h5part_int64_t nparticles = H5PartGetNumParticles(h5file);
|
||||||
|
h5part_int64_t* larray = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*nparticles);
|
||||||
|
H5PartReadDataInt64(h5file, "id", larray);
|
||||||
|
|
||||||
|
h5part_float64_t* x = (h5part_float64_t*)malloc(sizeof(h5part_float64_t)*nparticles);
|
||||||
|
H5PartReadDataFloat64(h5file, "x", x);
|
||||||
|
vector<h5part_float64_t> x_alive;
|
||||||
|
|
||||||
|
h5part_float64_t* y = (h5part_float64_t*)malloc(sizeof(h5part_float64_t)*nparticles);
|
||||||
|
H5PartReadDataFloat64(h5file, "y", y);
|
||||||
|
vector<h5part_float64_t> y_alive;
|
||||||
|
|
||||||
|
h5part_float64_t* z = (h5part_float64_t*)malloc(sizeof(h5part_float64_t)*nparticles);
|
||||||
|
H5PartReadDataFloat64(h5file, "z", z);
|
||||||
|
vector<h5part_float64_t> z_alive;
|
||||||
|
|
||||||
|
h5part_int64_t* ptype = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*nparticles);
|
||||||
|
H5PartReadDataInt64(h5file, "ptype", ptype);
|
||||||
|
vector<h5part_int64_t> ptype_alive;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < nparticles ; i ++) {
|
||||||
|
if ( idSet.find(larray[i]) != idSet.end() ) {
|
||||||
|
x_alive.push_back(x[i]);
|
||||||
|
y_alive.push_back(y[i]);
|
||||||
|
z_alive.push_back(z[i]);
|
||||||
|
ptype_alive.push_back(ptype[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string ffnlive = string("vtk/") + string(output_name) + string("-alive-") + convert2Int(j) + string(".vtk");
|
||||||
|
ofalive.open(ffnlive.c_str());
|
||||||
|
assert(ofalive.is_open());
|
||||||
|
ofalive.precision(6);
|
||||||
|
|
||||||
|
size_t alive_num = x_alive.size();
|
||||||
|
|
||||||
|
ofalive << setprecision(5)
|
||||||
|
<< "# vtk DataFile Version 2.0" << endl
|
||||||
|
<< "unstructured grid and vector field on the nodes" << endl
|
||||||
|
<< "ASCII" << endl
|
||||||
|
<< "DATASET UNSTRUCTURED_GRID" << endl
|
||||||
|
<< "POINTS " << alive_num << " float" << endl;
|
||||||
|
|
||||||
|
// Particle positions
|
||||||
|
|
||||||
|
|
||||||
|
for(size_t i = 0; i < alive_num; i++)
|
||||||
|
ofalive << x_alive[i] << " " << y_alive[i] << " " << z_alive[i] << endl;
|
||||||
|
|
||||||
|
ofalive << endl; // defining VTK_poly_vertex
|
||||||
|
|
||||||
|
ofalive << "CELLS " << alive_num << " " << 2 * alive_num << endl;
|
||||||
|
|
||||||
|
for(size_t i = 0; i < alive_num; i++)
|
||||||
|
ofalive << "1 " << i << endl;
|
||||||
|
ofalive << endl;
|
||||||
|
|
||||||
|
// defining Cell_types
|
||||||
|
ofalive << "CELL_TYPES " << alive_num << endl;
|
||||||
|
for(size_t i = 0; i < alive_num; i++)
|
||||||
|
ofalive << "2" << endl;
|
||||||
|
|
||||||
|
// defining Cell_types
|
||||||
|
ofalive << "POINT_DATA " << alive_num << endl;
|
||||||
|
ofalive << "SCALARS " << "Pointtype" << " float " << "1" << endl;
|
||||||
|
ofalive << "LOOKUP_TABLE " << "mytable" << endl ;
|
||||||
|
for(size_t i = 0; i < alive_num ; i ++) {
|
||||||
|
if (ptype_alive[i] == 0) {
|
||||||
|
ofalive << 0.0 << endl;
|
||||||
|
}
|
||||||
|
else if (ptype_alive[i] == 1) {
|
||||||
|
ofalive << 0.5 << endl;
|
||||||
|
}
|
||||||
|
else if (ptype_alive[i] == 2) {
|
||||||
|
ofalive << 1.0 << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ofalive << "LOOKUP_TABLE " << "mytable " << 3 << endl ;
|
||||||
|
ofalive << 1.0 <<" "<< 0.0 <<" "<< 0.0 <<" "<< 1.0 << endl;
|
||||||
|
ofalive << 0.0 <<" "<< 1.0 <<" "<< 0.0 <<" "<< 1.0 << endl;
|
||||||
|
ofalive << 0.0 <<" "<< 0.0 <<" "<< 1.0 <<" "<< 1.0 << endl;
|
||||||
|
ofalive << endl;
|
||||||
|
ofalive.close();
|
||||||
|
|
||||||
|
free(x);
|
||||||
|
free(y);
|
||||||
|
free(z);
|
||||||
|
free(ptype);
|
||||||
|
|
||||||
|
x_alive.clear();
|
||||||
|
y_alive.clear();
|
||||||
|
z_alive.clear();
|
||||||
|
ptype_alive.clear();
|
||||||
|
|
||||||
|
cout <<"Done time step "<< j << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else {
|
||||||
|
|
||||||
|
for (size_t j=0; j<ntime_step; j++) {
|
||||||
|
|
||||||
|
H5PartSetStep(h5file,j);
|
||||||
|
|
||||||
|
num_dataset = H5PartGetNumDatasets(h5file);
|
||||||
|
h5part_int64_t nparticles = H5PartGetNumParticles(h5file);
|
||||||
|
|
||||||
|
cout << "Working on timestep " << j << " expecting " << nparticles << " particles " << endl;
|
||||||
|
|
||||||
|
h5part_float64_t* x = (h5part_float64_t*)malloc(sizeof(h5part_float64_t)*nparticles);
|
||||||
|
H5PartReadDataFloat64(h5file, "x", x);
|
||||||
|
|
||||||
|
h5part_float64_t* y = (h5part_float64_t*)malloc(sizeof(h5part_float64_t)*nparticles);
|
||||||
|
H5PartReadDataFloat64(h5file, "y", y);
|
||||||
|
|
||||||
|
h5part_float64_t* z = (h5part_float64_t*)malloc(sizeof(h5part_float64_t)*nparticles);
|
||||||
|
H5PartReadDataFloat64(h5file, "z", z);
|
||||||
|
|
||||||
|
h5part_int64_t* ptype = (h5part_int64_t*)malloc(sizeof(h5part_int64_t)*nparticles);
|
||||||
|
H5PartReadDataInt64(h5file, "ptype", ptype);
|
||||||
|
|
||||||
|
string ffn = string("vtk/") + string(output_name) + convert2Int(j) + string(".vtk");
|
||||||
|
|
||||||
|
of.open(ffn.c_str());
|
||||||
|
assert(of.is_open());
|
||||||
|
of.precision(6);
|
||||||
|
|
||||||
|
of << setprecision(5)
|
||||||
|
<< "# vtk DataFile Version 2.0" << endl
|
||||||
|
<< "unstructured grid and vector field on the nodes" << endl
|
||||||
|
<< "ASCII" << endl
|
||||||
|
<< "DATASET UNSTRUCTURED_GRID" << endl
|
||||||
|
<< "POINTS " << nparticles << " float" << endl;
|
||||||
|
|
||||||
|
// Particle positions
|
||||||
|
for(size_t i = 0; i < nparticles; i++)
|
||||||
|
of << x[i] << " " << y[i] << " " << z[i] << endl;
|
||||||
|
|
||||||
|
of << endl; // defining VTK_poly_vertex
|
||||||
|
|
||||||
|
of << "CELLS " << nparticles << " " << 2 * nparticles << endl;
|
||||||
|
|
||||||
|
for(size_t i = 0; i < nparticles; i++)
|
||||||
|
of << "1 " << i << endl;
|
||||||
|
of << endl;
|
||||||
|
|
||||||
|
// defining Cell_types
|
||||||
|
of << "CELL_TYPES " << nparticles << endl;
|
||||||
|
for(size_t i = 0; i < nparticles; i++)
|
||||||
|
of << "2" << endl;
|
||||||
|
|
||||||
|
// defining Cell_types
|
||||||
|
of << "POINT_DATA " << nparticles << endl;
|
||||||
|
of << "SCALARS " << "Pointtype" << " float " << "1" << endl;
|
||||||
|
of << "LOOKUP_TABLE " << "mytable" << endl ;
|
||||||
|
for(size_t i = 0; i < nparticles ; i ++) {
|
||||||
|
if (ptype[i] == 0) {
|
||||||
|
of << 0.0 << endl;
|
||||||
|
}
|
||||||
|
else if (ptype[i] == 1) {
|
||||||
|
of << 0.5 << endl;
|
||||||
|
}
|
||||||
|
else if (ptype[i] == 2) {
|
||||||
|
of << 1.0 << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
of << "LOOKUP_TABLE " << "mytable " << 3 << endl ;
|
||||||
|
of << 1.0 <<" "<< 0.0 <<" "<< 0.0 <<" "<< 1.0 << endl;
|
||||||
|
of << 0.0 <<" "<< 1.0 <<" "<< 0.0 <<" "<< 1.0 << endl;
|
||||||
|
of << 0.0 <<" "<< 0.0 <<" "<< 1.0 <<" "<< 1.0 << endl;
|
||||||
|
of << endl;
|
||||||
|
of.close();
|
||||||
|
free(x);
|
||||||
|
free(y);
|
||||||
|
free(z);
|
||||||
|
free(ptype);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
H5PartCloseFile(h5file);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||