Merge pull request #2527 in HDFFV/hdf5 from trim_whitespace to develop

* commit '9e5dbf69062d4d2cb40ba8f68edb355477fc9b67':
  Trim trailing whitespace
This commit is contained in:
Quincey Koziol 2020-04-21 08:10:26 -05:00
commit c9a21e932e
374 changed files with 7333 additions and 7333 deletions

View File

@ -13,7 +13,7 @@
## Makefile.am
## Run automake to generate a Makefile.in from this file.
##
#
#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.
@ -45,7 +45,7 @@ include $(top_srcdir)/config/commence.am
# Since we're explicitly listing DIST_SUBDIRS, we also need to list
# directories that are only conditionally built (so that their Makefiles
# are cleaned as well).
# Note that `make clean' will not affect the examples or doc directories.
# Note that `make clean' will not affect the examples or doc directories.
# Conditionals. These conditionals are defined during configure
# Define each variable to empty if it is not used to placate pmake
@ -133,7 +133,7 @@ mostlyclean-local:
# 'make install' will now install examples, the same as 'make install-all'.
# 'make-install-all' will be redundant but will still work.
install: install-recursive install-examples
uninstall: uninstall-recursive uninstall-examples
uninstall: uninstall-recursive uninstall-examples
# 'make install-all' also installs examples
install-all:
@ -154,7 +154,7 @@ install-doc:
uninstall-doc:
@echo "docs no longer live in this tree. Use install-examples to install examples."
# `make check-install' or `make installcheck' checks that examples can
# `make check-install' or `make installcheck' checks that examples can
# be successfully built
installcheck-local:
if test -n "${DESTDIR}"; then \

View File

@ -7,8 +7,8 @@ Please refer to the release_docs/INSTALL file for installation instructions.
THE HDF GROUP
---------------
The HDF Group is the developer of HDF5®, a high-performance software library and
data format that has been adopted across multiple industries and has become a
The HDF Group is the developer of HDF5®, a high-performance software library and
data format that has been adopted across multiple industries and has become a
de facto standard in scientific and research communities.
More information about The HDF Group, the HDF5 Community and the HDF5 software
@ -19,21 +19,21 @@ project, tools and services can be found at the Group's website.
DOCUMENTATION
-------------
This release is fully functional for the API described in the documentation.
This release is fully functional for the API described in the documentation.
https://portal.hdfgroup.org/display/HDF5/The+HDF5+API
Full Documentation and Programming Resources for this release can be found at
https://portal.hdfgroup.org/display/HDF5
See the RELEASE.txt file in the release_docs/ directory for information specific
to the features and updates included in this release of the library.
See the RELEASE.txt file in the release_docs/ directory for information specific
to the features and updates included in this release of the library.
Several more files are located within the release_docs/ directory with specific
Several more files are located within the release_docs/ directory with specific
details for several common platforms and configurations.
INSTALL - Start Here. General instructions for compiling and installing the library
INSTALL_CMAKE - instructions for building with CMake (Kitware.com)
INSTALL_parallel - instructions for building and configuring Parallel HDF5
INSTALL_parallel - instructions for building and configuring Parallel HDF5
INSTALL_Windows and INSTALL_Cygwin - MS Windows installations.
@ -48,7 +48,7 @@ Information regarding Help Desk and Support services is available at
FORUM and NEWS
--------------
The following public forums are provided for public announcements and discussions
The following public forums are provided for public announcements and discussions
of interest to the general HDF5 Community.
Homepage of the Forum
@ -59,10 +59,10 @@ of interest to the general HDF5 Community.
HDF5 and HDF4 Topics
https://forum.hdfgroup.org/c/hdf5
These forums are provided as an open and public service for searching and reading.
Posting requires completing a simple registration and allows one to join in the
conversation. Please read the following instructions pertaining to the Forum's
These forums are provided as an open and public service for searching and reading.
Posting requires completing a simple registration and allows one to join in the
conversation. Please read the following instructions pertaining to the Forum's
use and configuration
https://forum.hdfgroup.org/t/quickstart-guide-welcome-to-the-new-hdf-forum

View File

@ -21,9 +21,9 @@ dnl -------------------------------------------------------------------------
dnl _AC_SYS_LARGEFILE_MACRO_VALUE
dnl
dnl The following macro overrides the autoconf macro of the same name
dnl with this custom definition. This macro performs the same checks as
dnl with this custom definition. This macro performs the same checks as
dnl autoconf's native _AC_SYS_LARGEFILE_MACRO_VALUE, but will also set
dnl AM_CPPFLAGS with the appropriate -D defines so additional configure
dnl AM_CPPFLAGS with the appropriate -D defines so additional configure
dnl sizeof checks do not fail.
dnl
# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,

View File

@ -10,5 +10,5 @@
cd @HDF5_BINARY_DIR@
ctest . -R MPI_TEST_ -C Release -T test >& ctestP.out
echo "Done running ctestP.sl"
echo "Done running ctestP.sl"

View File

@ -83,10 +83,10 @@ CLINKERBASE="@CC@"
# CFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user.
# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS.
# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's
# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and
# before the hdf5 libraries in $link_args, followed by any external library
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's
# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and
# before the hdf5 libraries in $link_args, followed by any external library
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# from the hdf5 build. The order of the flags is intended to give precedence
# to the user's flags.
H5BLD_CFLAGS="@AM_CFLAGS@ @CFLAGS@"
@ -102,9 +102,9 @@ LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}"
LIBS="${HDF5_LIBS:-$LIBSBASE}"
# If a static library is available, the default will be to use it. If the only
# available library is shared, it will be used by default. The user can
# available library is shared, it will be used by default. The user can
# override either default, although choosing an unavailable library will result
# in link errors.
# in link errors.
STATIC_AVAILABLE="@enable_static@"
if test "${STATIC_AVAILABLE}" = "yes"; then
USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
@ -140,7 +140,7 @@ usage() {
echo " HDF5_CC - use a different C compiler"
echo " HDF5_CLINKER - use a different linker"
echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library"
echo " [default: no except when built with only"
echo " [default: no except when built with only"
echo " shared libraries]"
echo " "
echo " You can also add or change paths and flags to the compile line using"
@ -318,7 +318,7 @@ fi
if test "x$do_link" = "xyes"; then
shared_link=""
# conditionnaly link with the hl library
# conditionnaly link with the hl library
if test "X$HL" = "Xhl"; then
libraries=" $libraries -lhdf5_hl -lhdf5 "
else
@ -379,10 +379,10 @@ if test "x$do_link" = "xyes"; then
# module. It's okay if they're included twice in the compile line.
link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS"
# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's
# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and
# before the hdf5 libraries in $link_args, followed by any external library
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# User's CPPFLAGS and CFLAGS come after their H5BLD counterparts. User's
# LDFLAGS come just before clibpath, user's LIBS come after $link_objs and
# before the hdf5 libraries in $link_args, followed by any external library
# paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in
# from the hdf5 build. The order of the flags is intended to give precedence
# to the user's flags.
$SHOW $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link

View File

@ -14,7 +14,7 @@
## Run automake to generate a Makefile.in from this file.
#
# Top-level HDF5-C++ Makefile(.in)
#
#
include $(top_srcdir)/config/commence.am

View File

@ -42,7 +42,7 @@ int main (void)
// handle the errors appropriately
Exception::dontPrint();
// Create a new file using the default property lists.
// Create a new file using the default property lists.
H5File file(FILE_NAME, H5F_ACC_TRUNC);
// Create the data space for the dataset.
@ -60,9 +60,9 @@ int main (void)
// unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK;
// unsigned szip_pixels_per_block = 16;
// plist->setSzip(szip_options_mask, szip_pixels_per_block);
// Create the dataset.
DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME,
// Create the dataset.
DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME,
PredType::STD_I32BE, *dataspace, *plist) );
for (i = 0; i< DIM0; i++)
@ -79,10 +79,10 @@ int main (void)
file.close();
// -----------------------------------------------
// Re-open the file and dataset, retrieve filter
// Re-open the file and dataset, retrieve filter
// information for dataset and read the data back.
// -----------------------------------------------
int rbuf[DIM0][DIM1];
int numfilt;
size_t nelmts={1}, namelen={1};
@ -113,7 +113,7 @@ int main (void)
cout << "H5Z_FILTER_DEFLATE" << endl;
break;
case H5Z_FILTER_SZIP:
cout << "H5Z_FILTER_SZIP" << endl;
cout << "H5Z_FILTER_SZIP" << endl;
break;
default:
cout << "Other filter type included." << endl;
@ -123,7 +123,7 @@ int main (void)
// Read data.
dataset->read(rbuf, PredType::NATIVE_INT);
delete plist;
delete plist;
delete dataset;
file.close(); // can be skipped

View File

@ -31,7 +31,7 @@ int main (void)
{
int attr_data[2] = { 100, 200};
hsize_t dims[1] = { DIM1 };
// Try block to detect exceptions raised by any of the calls inside it
try
@ -47,11 +47,11 @@ int main (void)
// Create the data space for the attribute.
DataSpace attr_dataspace = DataSpace (1, dims );
// Create a dataset attribute.
Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE,
// Create a dataset attribute.
Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE,
attr_dataspace);
// Write the attribute data.
// Write the attribute data.
attribute.write( PredType::NATIVE_INT, attr_data);
} // end of try block

View File

@ -37,7 +37,7 @@ int main (void)
// handle the errors appropriately
Exception::dontPrint();
// Create a new file using the default property lists.
// Create a new file using the default property lists.
H5File file(FILE_NAME, H5F_ACC_TRUNC);
// Create the data space for the dataset.
@ -46,7 +46,7 @@ int main (void)
dims[1] = NY;
DataSpace dataspace(RANK, dims);
// Create the dataset.
// Create the dataset.
DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace);
} // end of try block

View File

@ -37,12 +37,12 @@ int main(void)
// Create a new file using default property lists.
H5File file(FILE_NAME, H5F_ACC_TRUNC);
// Create a group named "/MygGroup" in the file
Group group(file.createGroup("/MyGroup"));
// File and group will be closed as their instances go out of scope.
} // end of try block
// catch failure caused by the H5File operations
@ -57,6 +57,6 @@ int main(void)
error.printErrorStack();
return -1;
}
return 0;
}

View File

@ -32,7 +32,7 @@ int main(void)
// Try block to detect exceptions raised by any of the calls inside it
try
{
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately.
@ -43,26 +43,26 @@ int main(void)
H5File file(FILE_NAME, H5F_ACC_TRUNC);
// Create group "MyGroup" in the root group using an absolute name.
Group group1(file.createGroup( "/MyGroup"));
// Create group "Group_A" in group "MyGroup" using an
// absolute name.
Group group2(file.createGroup("/MyGroup/Group_A"));
Group group2(file.createGroup("/MyGroup/Group_A"));
// Create group "Group_B" in group "MyGroup" using a
// relative name.
Group group3(group1.createGroup ("Group_B"));
// Close the groups and file.
group1.close();
group2.close();
group3.close();
file.close();
} // end of try block
// catch failure caused by the File operations

View File

@ -45,12 +45,12 @@ int main(void)
// handle the errors appropriately
Exception::dontPrint();
// Initialize the first dataset.
// Initialize the first dataset.
for (i = 0; i < D1DIM1; i++)
for (j = 0; j < D1DIM2; j++)
dset1_data[i][j] = j + 1;
// Initialize the second dataset.
// Initialize the second dataset.
for (i = 0; i < D2DIM1; i++)
for (j = 0; j < D2DIM2; j++)
dset2_data[i][j] = j + 1;
@ -69,7 +69,7 @@ int main(void)
// Create the dataset in group "MyGroup". Same note as for the
// dataspace above.
DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1,
DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1,
PredType::STD_I32BE, *dataspace));
// Write the data to the dataset using default memory space, file
@ -89,7 +89,7 @@ int main(void)
Group group(file.openGroup("/MyGroup/Group_A"));
// Create the second dataset in group "Group_A".
dataset = new DataSet (group.createDataSet(DATASET_NAME2,
dataset = new DataSet (group.createDataSet(DATASET_NAME2,
PredType::STD_I32BE, *dataspace));
// Write the data to the dataset using default memory space, file
@ -100,7 +100,7 @@ int main(void)
delete dataspace;
delete dataset;
group.close();
} // end of try block
// catch failure caused by the H5File operations
@ -129,6 +129,6 @@ int main(void)
error.printErrorStack();
return -1;
}
return 0;
}

View File

@ -30,17 +30,17 @@ const H5std_string DATASETNAME("ExtendibleArray");
int main (void)
{
hsize_t dims[2] = {3,3}; // dataset dimensions at creation
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t chunk_dims[2] ={2, 5};
int data[3][3] = { {1, 1, 1}, // data to write
int data[3][3] = { {1, 1, 1}, // data to write
{1, 1, 1},
{1, 1, 1} };
// Variables used in extending and writing to the extended portion of dataset
// Variables used in extending and writing to the extended portion of dataset
hsize_t size[2];
hsize_t offset[2];
hsize_t dimsext[2] = {7, 3}; // extend dimensions
hsize_t dimsext[2] = {7, 3}; // extend dimensions
int dataext[7][3] = { {2, 3, 4},
{2, 3, 4},
{2, 3, 4},
@ -56,7 +56,7 @@ int main (void)
// handle the errors appropriately
Exception::dontPrint();
// Create a new file using the default property lists.
// Create a new file using the default property lists.
H5File file(FILE_NAME, H5F_ACC_TRUNC);
// Create the data space for the dataset. Note the use of pointer
@ -70,23 +70,23 @@ int main (void)
prop.setChunk(2, chunk_dims);
// Create the chunked dataset. Note the use of pointer.
DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME,
DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME,
PredType::STD_I32BE, *dataspace, prop) );
// Write data to dataset.
dataset->write(data, PredType::NATIVE_INT);
// Extend the dataset. Dataset becomes 10 x 3.
size[0] = dims[0] + dimsext[0];
size[1] = dims[1];
dataset->extend(size);
dataset->extend(size);
// Select a hyperslab in extended portion of the dataset.
DataSpace *filespace = new DataSpace(dataset->getSpace ());
offset[0] = 3;
offset[1] = 0;
filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset);
// Define memory space.
DataSpace *memspace = new DataSpace(2, dimsext, NULL);
@ -101,9 +101,9 @@ int main (void)
delete dataset;
file.close();
// ---------------------------------------
// ---------------------------------------
// Re-open the file and read the data back
// ---------------------------------------
// ---------------------------------------
int rdata[10][3];
int i,j, rank, rank_chunk;
@ -111,7 +111,7 @@ int main (void)
// Open the file and dataset.
file.openFile(FILE_NAME, H5F_ACC_RDONLY);
dataset = new DataSet(file.openDataSet( DATASETNAME));
dataset = new DataSet(file.openDataSet( DATASETNAME));
// Get the dataset's dataspace and creation property list.
filespace = new DataSpace(dataset->getSpace());
@ -127,7 +127,7 @@ int main (void)
memspace = new DataSpace(rank, dimsr, NULL);
dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace);
cout << endl;
for (j = 0; j < dimsr[0]; j++) {
for (i = 0; i < dimsr[1]; i++)
@ -141,7 +141,7 @@ int main (void)
delete memspace;
delete dataset;
file.close();
} // end of try block
// catch failure caused by the H5File operations

View File

@ -28,9 +28,9 @@ const int DIM1 = 6;
int main (void)
{
// Data initialization.
int i, j;
int data[DIM0][DIM1]; // buffer for data to write

View File

@ -46,19 +46,19 @@ int main (void)
Exception::dontPrint();
// ---------------------------------------------------
// Create a new file using the default property lists.
// Then create a dataset and write data to it.
// Create a new file using the default property lists.
// Then create a dataset and write data to it.
// Close the file and dataset.
// ---------------------------------------------------
H5File file(FILE_NAME, H5F_ACC_TRUNC);
hsize_t dims[2];
hsize_t dims[2];
dims[0] = DIM0;
dims[1] = DIM1;
DataSpace dataspace = DataSpace (RANK, dims);
DataSet dataset(file.createDataSet( DATASET_NAME,
DataSet dataset(file.createDataSet( DATASET_NAME,
PredType::STD_I32BE, dataspace) );
@ -94,7 +94,7 @@ int main (void)
file.openFile(FILE_NAME, H5F_ACC_RDWR);
dataset = file.openDataSet(DATASET_NAME);
// Specify size and shape of subset to write.
// Specify size and shape of subset to write.
offset[0] = 1;
offset[1] = 2;
@ -107,7 +107,7 @@ int main (void)
block[0] = 1;
block[1] = 1;
// Define Memory Dataspace. Get file dataspace and select
// a subset from the file dataspace.
@ -117,7 +117,7 @@ int main (void)
DataSpace memspace(RANK, dimsm, NULL);
dataspace = dataset.getSpace();
dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block);
dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block);
// Write a subset of data to the dataset, then read the
// entire dataset back from the file.
@ -127,15 +127,15 @@ int main (void)
for (j = 0; j < DIM0_SUB; j++) {
for (i = 0; i < DIM1_SUB; i++)
sdata[j][i] = 5;
}
}
dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace);
dataset.read(rdata, PredType::NATIVE_INT);
cout << endl << "Data in File after Subset is Written:" << endl;
for (i = 0; i < DIM0; i++) {
for (j = 0; j < DIM1; j++)
for (j = 0; j < DIM1; j++)
cout << " " << rdata[i][j];
cout << endl;
}

View File

@ -141,5 +141,5 @@ rm *.o
rm *.h5
echo
exit $EXIT_VALUE
exit $EXIT_VALUE

View File

@ -25,7 +25,7 @@
* \section intro_sec Introduction
*
* The C++ API provides C++ wrappers for the HDF5 C Library.
*
*
* It is assumed that the user has knowledge of the HDF5 file format and its
* components. For more information on the HDF5 C Library, please refer to
* the HDF5 Software Documentation page.
@ -54,9 +54,9 @@
* \section install_sec Installation
*
* The HDF5 C++ API is included with the HDF5 source code.
*
* Please refer to the release_docs/INSTALL file under the top directory
* of the HDF5 source code for information about installing, building,
*
* Please refer to the release_docs/INSTALL file under the top directory
* of the HDF5 source code for information about installing, building,
* and testing the C++ API.
*
* <br />

View File

@ -122,7 +122,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type,
{
id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
}
*/
*/
//--------------------------------------------------------------------------
// Function: DataType copy constructor

View File

@ -60,7 +60,7 @@ H5std_string Exception::getMajorString(hid_t err_major) const
{
// Preliminary call to H5Eget_msg() to get the length of the message
ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0);
// If H5Eget_msg() returns a negative value, raise an exception,
if (mesg_size < 0)
throw IdComponentException("Exception::getMajorString",

View File

@ -83,7 +83,7 @@ IntType::IntType(const DataSet& dataset) : AtomType()
{
// Calls C function H5Dget_type to get the id of the datatype
id = H5Dget_type(dataset.getId());
if (id < 0)
{
throw DataSetIException("IntType constructor", "H5Dget_type failed");

View File

@ -568,7 +568,7 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t
{
p_setId(p_dereference(attr.getId(), ref, ref_type, plist, "dereference"));
}
*/
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
//--------------------------------------------------------------------------

View File

@ -72,7 +72,7 @@ class H5_DLLCPP H5Location : public IdComponent {
// Creates a reference to a named object or to a dataset region
// in this object.
void reference(void* ref, const char* name,
void reference(void* ref, const char* name,
H5R_type_t ref_type = H5R_OBJECT) const;
void reference(void* ref, const H5std_string& name,
H5R_type_t ref_type = H5R_OBJECT) const;

View File

@ -31,7 +31,7 @@ namespace H5 {
H5Object is H5File is not an HDF5 object, and renaming H5Object
to H5Location will risk breaking user applications.
-BMR
Apr 2, 2014: Added wrapper getObjName for H5Iget_name
Apr 2, 2014: Added wrapper getObjName for H5Iget_name
Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back
into H5Object. This way, C functions that takes attribute id
can be in H5Location and those that cannot take attribute id

View File

@ -311,7 +311,7 @@ fi
if test "x$do_link" = "xyes"; then
shared_link=""
# conditionally link with the hl library
# conditionally link with the hl library
if test "X$HL" = "Xhl"; then
libraries=" $libraries -lhdf5_hl_cpp -lhdf5_cpp -lhdf5_hl -lhdf5 "
else

View File

@ -268,7 +268,7 @@ static herr_t test_simple_io( H5File& file)
/*-------------------------------------------------------------------------
* Function: test_datasize
*
* Purpose Tests DataSet::getInMemDataSize().
* Purpose Tests DataSet::getInMemDataSize().
*
* Return Success: 0
*
@ -901,7 +901,7 @@ static herr_t test_multiopen (H5File& file)
if (cur_size[0]!=tmp_size[0])
{
cerr << " Got " << static_cast<int>(tmp_size[0])
<< " instead of " << static_cast<int>(cur_size[0])
<< " instead of " << static_cast<int>(cur_size[0])
<< "!" << endl;
throw Exception("test_multiopen", "Failed in multi-open with extending");
}

View File

@ -55,7 +55,7 @@ class TestFailedException : public Exception {
// Overloaded/Template functions to verify values and display proper info
// Verifies
// Verifies
void verify_val(const char* x, const char* value, const char* where, int line, const char* file_name);
template <class Type1, class Type2>

View File

@ -210,7 +210,7 @@ static void test_array_compound_array()
// Verify the compound datatype info
CompType ctype_check(base_type.getId());
base_type.close();
// Check the number of members
nmemb = ctype_check.getNmembers();
verify_val(nmemb, 2, "ctype_check.getNmembers", __LINE__, __FILE__);
@ -282,11 +282,11 @@ static void test_array_compound_array()
*/
H5::DataType getArr()
{
hsize_t *dims = new hsize_t;
*dims = 5;
H5::ArrayType ret;
ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims);
delete dims;
hsize_t *dims = new hsize_t;
*dims = 5;
H5::ArrayType ret;
ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims);
delete dims;
return ret;
}

View File

@ -282,7 +282,7 @@ static void test_attr_getname()
if (attr_exists == false)
throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not");
// Open attribute
// Open attribute
Attribute fattr1(fid1.openAttribute(FATTR1_NAME));
// A. Get attribute name with
@ -1221,7 +1221,7 @@ static void test_attr_delete()
attr_name = fattr.getName();
verify_val(attr_name, FATTR1_NAME, "Attribute::getName", __LINE__, __FILE__);
fattr.close();
// Test deleting non-existing attribute
// Open the dataset

View File

@ -633,7 +633,7 @@ static void test_file_attribute()
verify_val(num_objs, 0, "H5File::getObjCount(H5F_OBJ_DATATYPE)", __LINE__, __FILE__);
num_objs = file5.getObjCount(H5F_OBJ_FILE);
verify_val(num_objs, 1, "H5File::getObjCount(H5F_OBJ_FILE)", __LINE__, __FILE__);
// Get the file name using the attributes
H5std_string fname = fattr1.getFileName();
verify_val(fname, FILE5, "H5File::getFileName()", __LINE__, __FILE__);
@ -984,7 +984,7 @@ static void test_file_info()
/* ret=H5Pget_shared_mesg_nindexes(fcpl2,&nindexes);
CHECK(ret, FAIL, "H5Pget_shared_mesg_nindexes");
VERIFY(nindexes, MISC11_NINDEXES, "H5Pget_shared_mesg_nindexes");
*/
*/
// Get and verify the file space info from the creation property list */
fcpl2.getFileSpaceStrategy(out_strategy, out_persist, out_threshold);

View File

@ -400,7 +400,7 @@ static void test_HDFFV_9920()
{
int attr_data[2] = { 100, 200};
hsize_t dims[1] = { DIM1 };
try
{
// Create a new file and a group in it
@ -414,13 +414,13 @@ static void test_HDFFV_9920()
DataSet fds = file.createDataSet(FDATASET_NAME, PredType::STD_I32BE, dspace);
DataSet gds = gr1.createDataSet(GDATASET_NAME, PredType::STD_I32BE, dspace);
// Create a file attribute and a group attribute.
Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE,
// Create a file attribute and a group attribute.
Attribute fa1 = file.createAttribute(FATTR_NAME, PredType::STD_I32BE,
dspace);
Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE,
Attribute ga1 = gr1.createAttribute(GATTR_NAME, PredType::STD_I32BE,
dspace);
// Write the attribute data.
// Write the attribute data.
fa1.write( PredType::NATIVE_INT, attr_data);
ga1.write( PredType::NATIVE_INT, attr_data);

View File

@ -476,7 +476,7 @@ static void test_reference_group()
// Check getting file name given the group dereferenced via constructor
H5std_string fname = refgroup.getFileName();
verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__);
// Check getting file name given the group dereferenced by ::reference
fname = group.getFileName();
verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__);

View File

@ -54,7 +54,7 @@ using namespace H5;
H5T_NATIVE_##TYPE##_ALIGN_g=MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL)
#endif
/* #include "H5Tpkg.h"
*/
*/
const char *FILENAME[] = {
"dtypes1.h5",
@ -392,7 +392,7 @@ static void test_vltype()
try
{
VarLenType vltype(PredType::NATIVE_INT);
bool in_class = vltype.detectClass(H5T_VLEN);
verify_val(in_class, true, "VarLenType::detectClass() with H5T_VLEN", __LINE__, __FILE__);
in_class = vltype.detectClass(H5T_INTEGER);

View File

@ -172,7 +172,7 @@ option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF)
endif ()
# ----------------------------------------------------------------------
# Check whether we can build the Mirror VFD
# Check whether we can build the Mirror VFD
# Header-check flags set in config/cmake_ext_mod/ConfigureChecks.cmake
# ----------------------------------------------------------------------
option (HDF5_ENABLE_MIRROR_VFD "Build the Mirror Virtual File Driver" OFF)

View File

@ -1 +1 @@
FMWK????
FMWK????

View File

@ -44,15 +44,15 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
# has been removed. According to the official description of DESTDIR by Gnu at
# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
# prepended to the normal and complete install path that it precedes for the
# purpose of installing in a temporary directory which is useful for building
# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
# '/' at the beginning of the normal install path. When DESTDIR is empty the
# path then begins with '//', which is incorrect and causes problems at least for
# Cygwin.
# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
# has been removed. According to the official description of DESTDIR by Gnu at
# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
# prepended to the normal and complete install path that it precedes for the
# purpose of installing in a temporary directory which is useful for building
# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
# '/' at the beginning of the normal install path. When DESTDIR is empty the
# path then begins with '//', which is incorrect and causes problems at least for
# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@ -62,11 +62,11 @@ H5CC_PP=${DESTDIR}$(bindir)/h5pcc
H5FC=${DESTDIR}$(bindir)/h5fc
H5FC_PP=${DESTDIR}$(bindir)/h5pfc
H5CPP=${DESTDIR}$(bindir)/h5c++
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
# AM_CFLAGS is an automake construct which should be used by Makefiles
# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.

View File

@ -25,8 +25,8 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
$(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB)
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST)
chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
@ -198,7 +198,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
fi; \
fi; \
fi
# The dummysh.chkexe here prevents the target from being
# empty if there are no tests in the current directory.
# $${log} is the log file.

View File

@ -33,7 +33,7 @@
## INSTALL_TOP_FILES
##
## EXAMPLEDIR
## The directory into which examples should be installed.
## The directory into which examples should be installed.
##
## Build rules for $(EXTRA_PROG).
## Dependencies for example programs.
@ -62,7 +62,7 @@ install-data-local:
uninstall-local:
@$(MAKE) $(AM_MAKEFLAGS) uninstall-examples
install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
@for f in X $(INSTALL_FILES); do \
if test $$f != X; then \
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \
@ -109,7 +109,7 @@ installcheck-local:
H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \
else \
$(MAKE) $(AM_MAKEFLAGS) check; \
fi
fi
@if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \
echo "============================"; \
echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \

View File

@ -72,4 +72,4 @@ else ()
# for libraries and headers in the target directories
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif ()
endif ()

View File

@ -1,4 +1,4 @@
Attribute Examples:
Attribute Examples:
H5Acreate2 example: Show how to create an attribute for a dataset and a group
----------------
@ -19,7 +19,7 @@ H5Acreate2 example: Show how to create an attribute for a dataset and a group
rank=2;
dimsf[0] = H5S_UNLIMITED;
dimsf[1] = H5S_UNLIMITED;
dataspace = H5Screate_simple(rank, dimsf, NULL);
dataspace = H5Screate_simple(rank, dimsf, NULL);
/* Create a dataset */
dataset = H5Dcreate2(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@ -122,7 +122,7 @@ H5Alink Example: Shows how to share an attribute between two datasets.
/* Get the OID of the attribute */
attr=H5Aopen(dataset1, "Foo", H5P_DEFAULT);
/*
/*
* Create an attribute in the second dataset to the attribute in dataset1,
* changing the name of the attribute information in dataset2.
*/

View File

@ -39,7 +39,7 @@ EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \
h5_ref2reg_deprec h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \
h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \
h5_vds-percival-unlim h5_vds-percival-unlim-maxmin
TEST_SCRIPT=testh5cc.sh
TEST_SCRIPT=testh5cc.sh
TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES)
# Install files

View File

@ -11,10 +11,10 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This example illustrates how to create a compressed dataset.
* It is used in the HDF5 Tutorial.
*/
*/
#include "hdf5.h"
@ -22,11 +22,11 @@
#define RANK 2
#define DIM0 100
#define DIM1 20
int main () {
hid_t file_id, dataset_id, dataspace_id; /* identifiers */
hid_t plist_id;
hid_t plist_id;
size_t nelmts;
unsigned flags, filter_info;
@ -35,12 +35,12 @@ int main () {
herr_t status;
hsize_t dims[2];
hsize_t cdims[2];
int i,j, numfilt;
int buf[DIM0][DIM1];
int rbuf [DIM0][DIM1];
/* Uncomment these variables to use SZIP compression
/* Uncomment these variables to use SZIP compression
unsigned szip_options_mask;
unsigned szip_pixels_per_block;
*/
@ -62,21 +62,21 @@ int main () {
status = H5Pset_chunk (plist_id, 2, cdims);
/* Set ZLIB / DEFLATE Compression using compression level 6.
* To use SZIP Compression comment out these lines.
*/
status = H5Pset_deflate (plist_id, 6);
* To use SZIP Compression comment out these lines.
*/
status = H5Pset_deflate (plist_id, 6);
/* Uncomment these lines to set SZIP Compression
/* Uncomment these lines to set SZIP Compression
szip_options_mask = H5_SZIP_NN_OPTION_MASK;
szip_pixels_per_block = 16;
status = H5Pset_szip (plist_id, szip_options_mask, szip_pixels_per_block);
*/
dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE,
dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT);
for (i = 0; i< DIM0; i++)
for (j=0; j<DIM1; j++)
dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE,
dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT);
for (i = 0; i< DIM0; i++)
for (j=0; j<DIM1; j++)
buf[i][j] = i+j;
status = H5Dwrite (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@ -92,10 +92,10 @@ int main () {
/* Retrieve filter information. */
plist_id = H5Dget_create_plist (dataset_id);
numfilt = H5Pget_nfilters (plist_id);
printf ("Number of filters associated with dataset: %i\n", numfilt);
for (i=0; i<numfilt; i++) {
nelmts = 0;
filter_type = H5Pget_filter2 (plist_id, 0, &flags, &nelmts, NULL, 0, NULL,
@ -113,9 +113,9 @@ int main () {
}
}
status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, rbuf);
status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, rbuf);
status = H5Dclose (dataset_id);
status = H5Pclose (plist_id);
status = H5Fclose (file_id);

View File

@ -41,7 +41,7 @@ int main() {
dataspace_id = H5Screate_simple(1, &dims, NULL);
/* Create a dataset attribute. */
attribute_id = H5Acreate2 (dataset_id, "Units", H5T_STD_I32BE, dataspace_id,
attribute_id = H5Acreate2 (dataset_id, "Units", H5T_STD_I32BE, dataspace_id,
H5P_DEFAULT, H5P_DEFAULT);
/* Write the attribute data. */

View File

@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This example illustrates how to create a dataset that is a 4 x 6
* This example illustrates how to create a dataset that is a 4 x 6
* array. It is used in the HDF5 Tutorial.
*/
@ -29,18 +29,18 @@ int main() {
file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* Create the data space for the dataset. */
dims[0] = 4;
dims[1] = 6;
dims[0] = 4;
dims[1] = 6;
dataspace_id = H5Screate_simple(2, dims, NULL);
/* Create the dataset. */
dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id,
dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* End access to the dataset and release resources used by it. */
status = H5Dclose(dataset_id);
/* Terminate access to the data space. */
/* Terminate access to the data space. */
status = H5Sclose(dataspace_id);
/* Close the file. */

View File

@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This example illustrates how to create and close a group.
* This example illustrates how to create and close a group.
* It is used in the HDF5 Tutorial.
*/

View File

@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This example illustrates the creation of groups using absolute and
* This example illustrates the creation of groups using absolute and
* relative names. It is used in the HDF5 Tutorial.
*/

View File

@ -67,7 +67,7 @@ int main() {
dataspace_id = H5Screate_simple(2, dims, NULL);
/* Create the second dataset in group "Group_A". */
dataset_id = H5Dcreate2(group_id, "dset2", H5T_STD_I32BE, dataspace_id,
dataset_id = H5Dcreate2(group_id, "dset2", H5T_STD_I32BE, dataspace_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write the second dataset. */

View File

@ -12,9 +12,9 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This example how to work with extendible datasets. The dataset
* This example how to work with extendible datasets. The dataset
* must be chunked in order to be extendible.
*
*
* It is used in the HDF5 Tutorial.
*/
@ -29,28 +29,28 @@ int
main (void)
{
hid_t file; /* handles */
hid_t dataspace, dataset;
hid_t dataspace, dataset;
hid_t filespace, memspace;
hid_t prop;
hid_t prop;
hsize_t dims[2] = {3, 3}; /* dataset dimensions at creation time */
hsize_t dims[2] = {3, 3}; /* dataset dimensions at creation time */
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
herr_t status;
herr_t status;
hsize_t chunk_dims[2] = {2, 5};
int data[3][3] = { {1, 1, 1}, /* data to write */
{1, 1, 1},
{1, 1, 1} };
{1, 1, 1} };
/* Variables used in extending and writing to the extended portion of dataset */
hsize_t size[2];
hsize_t offset[2];
hsize_t dimsext[2] = {7, 3}; /* extend dimensions */
int dataext[7][3] = { {2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
int dataext[7][3] = { {2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4} };
/* Variables used in reading data back */
@ -58,11 +58,11 @@ main (void)
hsize_t dimsr[2];
hsize_t i, j;
int rdata[10][3];
herr_t status_n;
herr_t status_n;
int rank, rank_chunk;
/* Create the data space with unlimited dimensions. */
dataspace = H5Screate_simple (RANK, dims, maxdims);
dataspace = H5Screate_simple (RANK, dims, maxdims);
/* Create a new file. If file exists its contents will be overwritten. */
file = H5Fcreate (FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@ -71,7 +71,7 @@ main (void)
prop = H5Pcreate (H5P_DATASET_CREATE);
status = H5Pset_chunk (prop, RANK, chunk_dims);
/* Create a new dataset within the file using chunk
/* Create a new dataset within the file using chunk
creation properties. */
dataset = H5Dcreate2 (file, DATASETNAME, H5T_NATIVE_INT, dataspace,
H5P_DEFAULT, prop, H5P_DEFAULT);
@ -90,10 +90,10 @@ main (void)
offset[0] = 3;
offset[1] = 0;
status = H5Sselect_hyperslab (filespace, H5S_SELECT_SET, offset, NULL,
dimsext, NULL);
dimsext, NULL);
/* Define memory space */
memspace = H5Screate_simple (RANK, dimsext, NULL);
memspace = H5Screate_simple (RANK, dimsext, NULL);
/* Write the data to the extended portion of dataset */
status = H5Dwrite (dataset, H5T_NATIVE_INT, memspace, filespace,
@ -120,7 +120,7 @@ main (void)
prop = H5Dget_create_plist (dataset);
if (H5D_CHUNKED == H5Pget_layout (prop))
if (H5D_CHUNKED == H5Pget_layout (prop))
rank_chunk = H5Pget_chunk (prop, rank, chunk_dimsr);
memspace = H5Screate_simple (rank, dimsr, NULL);

View File

@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/*
* This example illustrates how to write and read data in an existing
* dataset. It is used in the HDF5 Tutorial.
*/
@ -37,10 +37,10 @@ int main() {
dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT);
/* Write the dataset. */
status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
status = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
dset_data);
status = H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
status = H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
dset_data);
/* Close the dataset. */

View File

@ -14,7 +14,7 @@
* The example below illustrates the use of the new API with files that are
* opened read-only. Created references to the objects in that file are
* stored into a separate file, and accessed from that file, without the user
* explicitly opening the original file that was referenced.
* explicitly opening the original file that was referenced.
*/
#include <stdlib.h>

View File

@ -11,44 +11,44 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This example illustrates how to read/write a subset of data (a slab)
/*
* This example illustrates how to read/write a subset of data (a slab)
* from/to a dataset in an HDF5 file. It is used in the HDF5 Tutorial.
*/
#include "hdf5.h"
#define FILE "subset.h5"
#define DATASETNAME "IntArray"
#define DATASETNAME "IntArray"
#define RANK 2
#define DIM0_SUB 3 /* subset dimensions */
#define DIM1_SUB 4
#define DIM0_SUB 3 /* subset dimensions */
#define DIM1_SUB 4
#define DIM0 8 /* size of dataset */
#define DIM1 10
#define DIM0 8 /* size of dataset */
#define DIM1 10
int
main (void)
{
hsize_t dims[2], dimsm[2];
hsize_t dims[2], dimsm[2];
int data[DIM0][DIM1]; /* data to write */
int sdata[DIM0_SUB][DIM1_SUB]; /* subset to write */
int rdata[DIM0][DIM1]; /* buffer for read */
hid_t file_id, dataset_id; /* handles */
hid_t dataspace_id, memspace_id;
herr_t status;
hid_t file_id, dataset_id; /* handles */
hid_t dataspace_id, memspace_id;
herr_t status;
hsize_t count[2]; /* size of subset in the file */
hsize_t offset[2]; /* subset offset in the file */
hsize_t stride[2];
hsize_t block[2];
int i, j;
/*****************************************************************
* Create a new file with default creation and access properties.*
* Then create a dataset and write data to it and close the file *
@ -59,7 +59,7 @@ main (void)
dims[0] = DIM0;
dims[1] = DIM1;
dataspace_id = H5Screate_simple (RANK, dims, NULL);
dataspace_id = H5Screate_simple (RANK, dims, NULL);
dataset_id = H5Dcreate2 (file_id, DATASETNAME, H5T_STD_I32BE, dataspace_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@ -71,7 +71,7 @@ main (void)
data[j][i] = 1;
else
data[j][i] = 2;
}
}
status = H5Dwrite (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, data);
@ -89,7 +89,7 @@ main (void)
/*****************************************************
* Reopen the file and dataset and write a subset of *
* values to the dataset.
* values to the dataset.
*****************************************************/
file_id = H5Fopen (FILE, H5F_ACC_RDWR, H5P_DEFAULT);
@ -100,7 +100,7 @@ main (void)
offset[0] = 1;
offset[1] = 2;
count[0] = DIM0_SUB;
count[0] = DIM0_SUB;
count[1] = DIM1_SUB;
stride[0] = 1;
@ -109,18 +109,18 @@ main (void)
block[0] = 1;
block[1] = 1;
/* Create memory space with size of subset. Get file dataspace
/* Create memory space with size of subset. Get file dataspace
and select subset from file dataspace. */
dimsm[0] = DIM0_SUB;
dimsm[1] = DIM1_SUB;
memspace_id = H5Screate_simple (RANK, dimsm, NULL);
memspace_id = H5Screate_simple (RANK, dimsm, NULL);
dataspace_id = H5Dget_space (dataset_id);
status = H5Sselect_hyperslab (dataspace_id, H5S_SELECT_SET, offset,
stride, count, block);
/* Write a subset of data to the dataset, then read the
/* Write a subset of data to the dataset, then read the
entire dataset back from the file. */
printf ("\nWrite subset to file specifying:\n");
@ -128,11 +128,11 @@ main (void)
for (j = 0; j < DIM0_SUB; j++) {
for (i = 0; i < DIM1_SUB; i++)
sdata[j][i] = 5;
}
}
status = H5Dwrite (dataset_id, H5T_NATIVE_INT, memspace_id,
dataspace_id, H5P_DEFAULT, sdata);
status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, rdata);
@ -147,5 +147,5 @@ main (void)
status = H5Sclose (dataspace_id);
status = H5Dclose (dataset_id);
status = H5Fclose (file_id);
}

View File

@ -12,7 +12,7 @@
/************************************************************
This example illustrates the concept of the virtual dataset.
Eiger use case. Every 5 frames 10x10 are in the source
Eiger use case. Every 5 frames 10x10 are in the source
dataset "/A" in file with the name f-<#>.h5
This file is intended for use with HDF5 Library version 1.10
@ -25,13 +25,13 @@
#define FILE "vds-eiger.h5"
#define DATASET "VDS-Eiger"
#define VDSDIM0 5
#define VDSDIM1 10
#define VDSDIM2 10
#define DIM0 5
#define DIM1 10
#define DIM2 10
#define RANK 3
#define VDSDIM0 5
#define VDSDIM1 10
#define VDSDIM2 10
#define DIM0 5
#define DIM1 10
#define DIM2 10
#define RANK 3
int
main (void)
@ -69,7 +69,7 @@ main (void)
/* Create VDS creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
/* Initialize hyperslab values */
start[0] = 0;
@ -85,13 +85,13 @@ main (void)
block[1] = DIM1;
block[2] = DIM2;
/*
* Build the mappings
/*
* Build the mappings
*
*/
status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block);
status = H5Pset_virtual (dcpl, vspace, "f-%b.h5", "/A", src_space);
/* Create a virtual dataset */
@ -100,8 +100,8 @@ main (void)
status = H5Sclose (vspace);
status = H5Sclose (src_space);
status = H5Dclose (dset);
status = H5Fclose (file);
status = H5Fclose (file);
/*
* Now we begin the read section of this example.
@ -123,7 +123,7 @@ main (void)
*/
layout = H5Pget_layout (dcpl);
if (H5D_VIRTUAL == layout)
if (H5D_VIRTUAL == layout)
printf(" Dataset has a virtual layout \n");
else
printf(" Wrong layout found \n");
@ -134,15 +134,15 @@ main (void)
status = H5Pget_virtual_count (dcpl, &num_map);
printf(" Number of mappings is %d\n", (int)num_map);
/*
/*
* Get mapping parameters for each mapping.
*/
for (i = 0; i < (int)num_map; i++) {
for (i = 0; i < (int)num_map; i++) {
printf(" Mapping %d \n", i);
printf(" Selection in the virtual dataset \n");
/* Get selection in the virttual dataset */
vspace = H5Pget_virtual_vspace (dcpl, (size_t)i);
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sis_regular_hyperslab(vspace)) {
status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out);
printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]);

View File

@ -24,16 +24,16 @@
#define FILE "vds-exc.h5"
#define DATASET "VDS-Excalibur"
#define VDSDIM0 0
#define VDSDIM1 15
#define VDSDIM2 6
#define KDIM0 0
#define KDIM1 2
#define KDIM2 6
#define NDIM0 0
#define NDIM1 3
#define NDIM2 6
#define RANK 3
#define VDSDIM0 0
#define VDSDIM1 15
#define VDSDIM2 6
#define KDIM0 0
#define KDIM1 2
#define KDIM2 6
#define NDIM0 0
#define NDIM1 3
#define NDIM2 6
#define RANK 3
const char *SRC_FILE[] = {
"a.h5",
@ -96,7 +96,7 @@ main (void)
/* Create VDS creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
/* Initialize hyperslab values */
start[0] = 0;
@ -109,7 +109,7 @@ main (void)
block[1] = k;
block[2] = VDSDIM2;
/*
/*
* Build the mappings for A, C and E source datasets.
* Unlimited hyperslab selection is the same in the source datasets.
* Unlimited hyperslab selections in the virtual dataset have different offsets.
@ -124,7 +124,7 @@ main (void)
/* Reinitialize start[1] and block[1] to build the second set of mappings. */
start[1] = 0;
block[1] = n;
/*
/*
* Build the mappings for B, D and F source datasets.
* Unlimited hyperslab selection is the same in the source datasets.
* Unlimited hyperslab selections in the virtual dataset have different offsets.
@ -143,8 +143,8 @@ main (void)
status = H5Sclose (nsrc_space);
status = H5Sclose (ksrc_space);
status = H5Dclose (dset);
status = H5Fclose (file);
status = H5Fclose (file);
/*
* Now we begin the read section of this example.
@ -166,7 +166,7 @@ main (void)
*/
layout = H5Pget_layout (dcpl);
if (H5D_VIRTUAL == layout)
if (H5D_VIRTUAL == layout)
printf(" Dataset has a virtual layout \n");
else
printf("Wrong layout found \n");
@ -177,15 +177,15 @@ main (void)
status = H5Pget_virtual_count (dcpl, &num_map);
printf(" Number of mappings is %lu\n", (unsigned long)num_map);
/*
/*
* Get mapping parameters for each mapping.
*/
for (i = 0; i < (int)num_map; i++) {
for (i = 0; i < (int)num_map; i++) {
printf(" Mapping %d \n", i);
printf(" Selection in the virtual dataset \n");
/* Get selection in the virttual dataset */
vspace = H5Pget_virtual_vspace (dcpl, (size_t)i);
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sis_regular_hyperslab(vspace)) {
status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out);
printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]);
@ -209,7 +209,7 @@ main (void)
/* Get selection in the source dataset */
printf(" Selection in the source dataset \n");
src_space = H5Pget_virtual_srcspace (dcpl, (size_t)i);
if (H5Sget_select_type(src_space) == H5S_SEL_HYPERSLABS) {
if (H5Sget_select_type(src_space) == H5S_SEL_HYPERSLABS) {
if (H5Sis_regular_hyperslab(vspace)) {
status = H5Sget_regular_hyperslab (src_space, start_out, stride_out, count_out, block_out);
printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]);

View File

@ -25,16 +25,16 @@
#define FILE "vds-exclim.h5"
#define DATASET "VDS-Excaliburlim"
#define VDSDIM0 3
#define VDSDIM1 15
#define VDSDIM2 6
#define KDIM0 3
#define KDIM1 2
#define KDIM2 6
#define NDIM0 3
#define NDIM1 3
#define NDIM2 6
#define RANK 3
#define VDSDIM0 3
#define VDSDIM1 15
#define VDSDIM2 6
#define KDIM0 3
#define KDIM1 2
#define KDIM2 6
#define NDIM0 3
#define NDIM1 3
#define NDIM2 6
#define RANK 3
const char *SRC_FILE[] = {
"a.h5",
@ -94,7 +94,7 @@ main (void)
/* Create VDS creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
/* Initialize hyperslab values */
start[0] = 0;
@ -107,7 +107,7 @@ main (void)
block[1] = k;
block[2] = VDSDIM2;
/*
/*
* Build the mappings for A, C and E source datasets.
*
*/
@ -121,7 +121,7 @@ main (void)
/* Reinitialize start[0] and block[1] */
start[0] = 0;
block[1] = n;
/*
/*
* Build the mappings for B, D and F source datasets.
*
*/
@ -139,8 +139,8 @@ main (void)
status = H5Sclose (nsrc_space);
status = H5Sclose (ksrc_space);
status = H5Dclose (dset);
status = H5Fclose (file);
status = H5Fclose (file);
/*
* Now we begin the read section of this example.
@ -162,7 +162,7 @@ main (void)
*/
layout = H5Pget_layout (dcpl);
if (H5D_VIRTUAL == layout)
if (H5D_VIRTUAL == layout)
printf(" Dataset has a virtual layout \n");
else
printf("Wrong layout found \n");
@ -173,15 +173,15 @@ main (void)
status = H5Pget_virtual_count (dcpl, &num_map);
printf(" Number of mappings is %lu\n", (unsigned long)num_map);
/*
/*
* Get mapping parameters for each mapping.
*/
for (i = 0; i < (int)num_map; i++) {
for (i = 0; i < (int)num_map; i++) {
printf(" Mapping %d \n", i);
printf(" Selection in the virtual dataset \n");
/* Get selection in the virttual dataset */
vspace = H5Pget_virtual_vspace (dcpl, (size_t)i);
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sis_regular_hyperslab(vspace)) {
status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out);
printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]);

View File

@ -12,8 +12,8 @@
/************************************************************
This example illustrates the concept of the virtual dataset.
Percival use case. Every fifth 10x10 plane in VDS is stored in
the corresponding 3D unlimited dataset.
Percival use case. Every fifth 10x10 plane in VDS is stored in
the corresponding 3D unlimited dataset.
There are 4 source datasets total.
Each of the source datasets is extended to different sizes.
VDS access property can be used to get max and min extent.
@ -28,15 +28,15 @@
#define VFILE "vds-percival-unlim-maxmin.h5"
#define DATASET "VDS-Percival-unlim-maxmin"
#define VDSDIM0 H5S_UNLIMITED
#define VDSDIM1 10
#define VDSDIM2 10
#define VDSDIM0 H5S_UNLIMITED
#define VDSDIM1 10
#define VDSDIM2 10
#define DIM0 H5S_UNLIMITED
#define DIM0 H5S_UNLIMITED
#define DIM0_1 4 /* Initial size of the source datasets */
#define DIM1 10
#define DIM2 10
#define RANK 3
#define DIM1 10
#define DIM2 10
#define RANK 3
#define PLANE_STRIDE 4
const char *SRC_FILE[] = {
@ -61,7 +61,7 @@ main (void)
hid_t dcpl, dapl;
herr_t status;
hsize_t vdsdims[3] = {4*DIM0_1, VDSDIM1, VDSDIM2},
vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2},
vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2},
dims[3] = {DIM0_1, DIM1, DIM2},
memdims[3] = {DIM0_1, DIM1, DIM2},
extdims[3] = {0, DIM1, DIM2}, /* Dimensions of the extended source datasets */
@ -96,7 +96,7 @@ main (void)
for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = i+1;
/*
* Create the source files and datasets. Write data to each dataset and
* Create the source files and datasets. Write data to each dataset and
* close all resources.
*/
@ -112,7 +112,7 @@ main (void)
status = H5Pclose (dcpl);
status = H5Dclose (dset);
status = H5Fclose (file);
}
}
vfile = H5Fcreate (VFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@ -124,7 +124,7 @@ main (void)
/* Create VDS creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
/* Initialize hyperslab values */
start[0] = 0;
@ -143,18 +143,18 @@ main (void)
block[1] = DIM1;
block[2] = DIM2;
/*
* Build the mappings
/*
* Build the mappings
*
*/
status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block);
for (i=0; i < PLANE_STRIDE; i++) {
status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block);
status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space);
start[0]++;
}
start[0]++;
}
H5Sselect_none(vspace);
H5Sselect_none(vspace);
/* Create a virtual dataset */
vdset = H5Dcreate2 (vfile, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT,
@ -174,14 +174,14 @@ main (void)
for (j = 0; j < (i+1)*DIM1*DIM2; j++) wdata[j] = 10*(i+1);
/*
* Open the source files and datasets. Appen data to each dataset and
* Open the source files and datasets. Appen data to each dataset and
* close all resources.
*/
file = H5Fopen (SRC_FILE[i], H5F_ACC_RDWR, H5P_DEFAULT);
dset = H5Dopen2 (file, SRC_DATASET[i], H5P_DEFAULT);
extdims[0] = DIM0_1+i+1;
status = H5Dset_extent (dset, extdims);
status = H5Dset_extent (dset, extdims);
src_space = H5Dget_space (dset);
start[0] = DIM0_1;
start[1] = 0;
@ -194,7 +194,7 @@ main (void)
block[2] = DIM2;
memdims[0] = i+1;
mem_space = H5Screate_simple(RANK, memdims, NULL);
mem_space = H5Screate_simple(RANK, memdims, NULL);
status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, count, block);
status = H5Dwrite (dset, H5T_NATIVE_INT, mem_space, src_space, H5P_DEFAULT,
wdata);
@ -204,8 +204,8 @@ main (void)
}
status = H5Dclose (vdset);
status = H5Fclose (vfile);
status = H5Fclose (vfile);
/*
* Now we begin the read section of this example.
*/
@ -214,8 +214,8 @@ main (void)
* Open file and dataset using the default properties.
*/
vfile = H5Fopen (VFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
/*
/*
* Open VDS using different access properties to use max or
* min extents depending on the sizes of the underlying datasets
*/
@ -252,7 +252,7 @@ main (void)
*/
layout = H5Pget_layout (dcpl);
if (H5D_VIRTUAL == layout)
if (H5D_VIRTUAL == layout)
printf(" Dataset has a virtual layout \n");
else
printf(" Wrong layout found \n");
@ -263,15 +263,15 @@ main (void)
status = H5Pget_virtual_count (dcpl, &num_map);
printf(" Number of mappings is %lu\n", (unsigned long)num_map);
/*
/*
* Get mapping parameters for each mapping.
*/
for (i = 0; i < (int)num_map; i++) {
for (i = 0; i < (int)num_map; i++) {
printf(" Mapping %d \n", i);
printf(" Selection in the virtual dataset \n");
/* Get selection in the virttual dataset */
vspace = H5Pget_virtual_vspace (dcpl, (size_t)i);
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sis_regular_hyperslab(vspace)) {
status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out);
printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]);

View File

@ -12,8 +12,8 @@
/************************************************************
This example illustrates the concept of the virtual dataset.
Percival use case. Every fifth 10x10 plane in VDS is stored in
the corresponding 3D unlimited dataset.
Percival use case. Every fifth 10x10 plane in VDS is stored in
the corresponding 3D unlimited dataset.
There are 4 source datasets total.
This file is intended for use with HDF5 Library version 1.10
@ -26,15 +26,15 @@
#define VFILE "vds-percival-unlim.h5"
#define DATASET "VDS-Percival-unlim"
#define VDSDIM0 H5S_UNLIMITED
#define VDSDIM1 10
#define VDSDIM2 10
#define VDSDIM0 H5S_UNLIMITED
#define VDSDIM1 10
#define VDSDIM2 10
#define DIM0 H5S_UNLIMITED
#define DIM0 H5S_UNLIMITED
#define DIM0_1 10 /* Initial size of the datasets */
#define DIM1 10
#define DIM2 10
#define RANK 3
#define DIM1 10
#define DIM2 10
#define RANK 3
#define PLANE_STRIDE 4
const char *SRC_FILE[] = {
@ -59,7 +59,7 @@ main (void)
hid_t dcpl;
herr_t status;
hsize_t vdsdims[3] = {4*DIM0_1, VDSDIM1, VDSDIM2},
vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2},
vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2},
dims[3] = {DIM0_1, DIM1, DIM2},
extdims[3] = {2*DIM0_1, DIM1, DIM2},
chunk_dims[3] = {DIM0_1, DIM1, DIM2},
@ -95,7 +95,7 @@ main (void)
for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = i+1;
/*
* Create the source files and datasets. Write data to each dataset and
* Create the source files and datasets. Write data to each dataset and
* close all resources.
*/
@ -111,7 +111,7 @@ main (void)
status = H5Pclose (dcpl);
status = H5Dclose (dset);
status = H5Fclose (file);
}
}
vfile = H5Fcreate (VFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@ -123,7 +123,7 @@ main (void)
/* Create VDS creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
/* Initialize hyperslab values */
start[0] = 0;
@ -142,18 +142,18 @@ main (void)
block[1] = DIM1;
block[2] = DIM2;
/*
* Build the mappings
/*
* Build the mappings
*
*/
status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block);
for (i=0; i < PLANE_STRIDE; i++) {
status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block);
status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space);
start[0]++;
}
start[0]++;
}
H5Sselect_none(vspace);
H5Sselect_none(vspace);
/* Create a virtual dataset */
vdset = H5Dcreate2 (vfile, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT,
@ -179,13 +179,13 @@ main (void)
for (j = 0; j < DIM0_1*DIM1*DIM2; j++) wdata[j] = 10*(i+1);
/*
* Create the source files and datasets. Write data to each dataset and
* Create the source files and datasets. Write data to each dataset and
* close all resources.
*/
file = H5Fopen (SRC_FILE[i], H5F_ACC_RDWR, H5P_DEFAULT);
dset = H5Dopen2 (file, SRC_DATASET[i], H5P_DEFAULT);
status = H5Dset_extent (dset, extdims);
status = H5Dset_extent (dset, extdims);
src_space = H5Dget_space (dset);
start[0] = DIM0_1;
start[1] = 0;
@ -197,7 +197,7 @@ main (void)
block[1] = DIM1;
block[2] = DIM2;
mem_space = H5Screate_simple(RANK, dims, NULL);
mem_space = H5Screate_simple(RANK, dims, NULL);
status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, count, block);
status = H5Dwrite (dset, H5T_NATIVE_INT, mem_space, src_space, H5P_DEFAULT,
wdata);
@ -207,8 +207,8 @@ main (void)
}
status = H5Dclose (vdset);
status = H5Fclose (vfile);
status = H5Fclose (vfile);
/*
* Now we begin the read section of this example.
*/
@ -229,7 +229,7 @@ main (void)
*/
layout = H5Pget_layout (dcpl);
if (H5D_VIRTUAL == layout)
if (H5D_VIRTUAL == layout)
printf(" Dataset has a virtual layout \n");
else
printf(" Wrong layout found \n");
@ -240,15 +240,15 @@ main (void)
status = H5Pget_virtual_count (dcpl, &num_map);
printf(" Number of mappings is %lu\n", (unsigned long)num_map);
/*
/*
* Get mapping parameters for each mapping.
*/
for (i = 0; i < (int)num_map; i++) {
for (i = 0; i < (int)num_map; i++) {
printf(" Mapping %d \n", i);
printf(" Selection in the virtual dataset \n");
/* Get selection in the virttual dataset */
vspace = H5Pget_virtual_vspace (dcpl, (size_t)i);
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sis_regular_hyperslab(vspace)) {
status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out);
printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]);
@ -300,7 +300,7 @@ main (void)
/* Read all VDS data */
/* EIP We should be able to do it by using H5S_ALL instead of making selection
* or using H5Sselect_all from vspace.
* or using H5Sselect_all from vspace.
*/
start[0] = 0;
start[1] = 0;
@ -315,12 +315,12 @@ main (void)
status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, NULL, count, block);
mem_space = H5Screate_simple(RANK, vdsdims_out, NULL);
status = H5Dread (vdset, H5T_NATIVE_INT, mem_space, vspace, H5P_DEFAULT,
rdata);
rdata);
printf (" All data: \n");
for (i=0; i < (int)vdsdims_out[0]; i++) {
for (j=0; j < (int)vdsdims_out[1]; j++) {
printf ("(%d, %d, 0)", i, j);
for (k=0; k < (int)vdsdims_out[2]; k++)
for (k=0; k < (int)vdsdims_out[2]; k++)
printf (" %d ", rdata[i][j][k]);
printf ("\n");
}
@ -338,16 +338,16 @@ main (void)
block[0] = 1;
block[1] = vdsdims_out[1];
block[2] = vdsdims_out[2];
dims[0] = 2*DIM0_1;
dims[0] = 2*DIM0_1;
status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block);
mem_space = H5Screate_simple(RANK, dims, NULL);
status = H5Dread (vdset, H5T_NATIVE_INT, mem_space, vspace, H5P_DEFAULT,
a_rdata);
a_rdata);
printf (" All data: \n");
for (i=0; i < 2*DIM0_1; i++) {
for (j=0; j < (int)vdsdims_out[1]; j++) {
printf ("(%d, %d, 0)", i, j);
for (k=0; k < (int)vdsdims_out[2]; k++)
for (k=0; k < (int)vdsdims_out[2]; k++)
printf (" %d ", a_rdata[i][j][k]);
printf ("\n");
}

View File

@ -12,8 +12,8 @@
/************************************************************
This example illustrates the concept of the virtual dataset.
Percival use case. Every fifth 10x10 plane in VDS is stored in
the corresponding 3D unlimited dataset.
Percival use case. Every fifth 10x10 plane in VDS is stored in
the corresponding 3D unlimited dataset.
EIP: For now we will use finite dimension.
There are 4 source datasets total.
This file is intended for use with HDF5 Library version 1.10
@ -28,18 +28,18 @@
#define FILE "vds-percival.h5"
#define DATASET "VDS-Percival"
/* later
#define VDSDIM0 H5S_UNLIMITED
#define VDSDIM0 H5S_UNLIMITED
*/
#define VDSDIM0 40
#define VDSDIM1 10
#define VDSDIM2 10
#define VDSDIM1 10
#define VDSDIM2 10
/* later
#define DIM0 H5S_UNLIMITED
#define DIM0 H5S_UNLIMITED
*/
#define DIM0 10
#define DIM1 10
#define DIM2 10
#define RANK 3
#define DIM0 10
#define DIM1 10
#define DIM2 10
#define RANK 3
#define PLANE_STRIDE 4
const char *SRC_FILE[] = {
@ -64,7 +64,7 @@ main (void)
hid_t dcpl;
herr_t status;
hsize_t vdsdims[3] = {VDSDIM0, VDSDIM1, VDSDIM2},
vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2},
vdsdims_max[3] = {VDSDIM0, VDSDIM1, VDSDIM2},
dims[3] = {DIM0, DIM1, DIM2},
dims_max[3] = {DIM0, DIM1, DIM2},
start[3], /* Hyperslab start parameter for VDS */
@ -94,7 +94,7 @@ main (void)
for (j = 0; j < DIM0*DIM1*DIM2; j++) wdata[j] = i+1;
/*
* Create the source files and datasets. Write data to each dataset and
* Create the source files and datasets. Write data to each dataset and
* close all resources.
*/
@ -107,7 +107,7 @@ main (void)
status = H5Sclose (src_space);
status = H5Dclose (dset);
status = H5Fclose (file);
}
}
file = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@ -119,7 +119,7 @@ main (void)
/* Create VDS creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
/* Initialize hyperslab values */
start[0] = 0;
@ -144,18 +144,18 @@ main (void)
block[1] = DIM1;
block[2] = DIM2;
/*
* Build the mappings
/*
* Build the mappings
*
*/
status = H5Sselect_hyperslab (src_space, H5S_SELECT_SET, start, NULL, src_count, block);
for (i=0; i < PLANE_STRIDE; i++) {
status = H5Sselect_hyperslab (vspace, H5S_SELECT_SET, start, stride, count, block);
status = H5Pset_virtual (dcpl, vspace, SRC_FILE[i], SRC_DATASET[i], src_space);
start[0]++;
}
start[0]++;
}
H5Sselect_none(vspace);
H5Sselect_none(vspace);
/* Create a virtual dataset */
dset = H5Dcreate2 (file, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT,
@ -163,8 +163,8 @@ main (void)
status = H5Sclose (vspace);
status = H5Sclose (src_space);
status = H5Dclose (dset);
status = H5Fclose (file);
status = H5Fclose (file);
/*
* Now we begin the read section of this example.
*/
@ -185,7 +185,7 @@ main (void)
*/
layout = H5Pget_layout (dcpl);
if (H5D_VIRTUAL == layout)
if (H5D_VIRTUAL == layout)
printf(" Dataset has a virtual layout \n");
else
printf(" Wrong layout found \n");
@ -196,15 +196,15 @@ main (void)
status = H5Pget_virtual_count (dcpl, &num_map);
printf(" Number of mappings is %lu\n", (unsigned long)num_map);
/*
/*
* Get mapping parameters for each mapping.
*/
for (i = 0; i < (int)num_map; i++) {
for (i = 0; i < (int)num_map; i++) {
printf(" Mapping %d \n", i);
printf(" Selection in the virtual dataset \n");
/* Get selection in the virttual dataset */
vspace = H5Pget_virtual_vspace (dcpl, (size_t)i);
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sis_regular_hyperslab(vspace)) {
status = H5Sget_regular_hyperslab (vspace, start_out, stride_out, count_out, block_out);
printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]);

View File

@ -14,7 +14,7 @@
This example illustrates the concept of virtual dataset I/O
The program creates 2-dim source dataset and writes
data to it. Then it creates 2-dim virtual dataset that has
the same dimension sizes and maps the all elements of the
the same dimension sizes and maps the all elements of the
virtual dataset to all elements of the source dataset.
Then VDS is read back.
@ -30,7 +30,7 @@
#define FILE "vds-simpleIO.h5"
#define DATASET "VDS"
#define DIM1 6
#define DIM0 4
#define DIM0 4
#define RANK 2
#define SRC_FILE "a.h5"
@ -40,27 +40,27 @@
int
main (void)
{
hid_t file, space, src_space, vspace, dset; /* Handles */
hid_t file, space, src_space, vspace, dset; /* Handles */
hid_t dcpl;
herr_t status;
hsize_t vdsdims[2] = {DIM0, DIM1}, /* Virtual dataset dimension */
dims[2] = {DIM0, DIM1}; /* Source dataset dimensions */
int wdata[DIM0][DIM1], /* Write buffer for source dataset */
rdata[DIM0][DIM1], /* Read buffer for virtual dataset */
i, j;
i, j;
H5D_layout_t layout; /* Storage layout */
size_t num_map; /* Number of mappings */
ssize_t len; /* Length of the string; also a return value */
char *filename;
char *filename;
char *dsetname;
/*
* Initialize data.
*/
for (i = 0; i < DIM0; i++)
for (i = 0; i < DIM0; i++)
for (j = 0; j < DIM1; j++) wdata[i][j] = i+1;
/*
* Create the source file and the dataset. Write data to the source dataset
* Create the source file and the dataset. Write data to the source dataset
* and close all resources.
*/
@ -82,12 +82,12 @@ main (void)
/* Set VDS creation property. */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
/*
/*
* Build the mappings.
* Selections in the source datasets are H5S_ALL.
* In the virtual dataset we select the first, the second and the third rows
* and map each row to the data in the corresponding source dataset.
* In the virtual dataset we select the first, the second and the third rows
* and map each row to the data in the corresponding source dataset.
*/
src_space = H5Screate_simple (RANK, dims, NULL);
status = H5Pset_virtual (dcpl, vspace, SRC_FILE, SRC_DATASET, src_space);
@ -98,8 +98,8 @@ main (void)
status = H5Sclose (vspace);
status = H5Sclose (src_space);
status = H5Dclose (dset);
status = H5Fclose (file);
status = H5Fclose (file);
/*
* Now we begin the read section of this example.
*/
@ -118,7 +118,7 @@ main (void)
* Get storage layout.
*/
layout = H5Pget_layout (dcpl);
if (H5D_VIRTUAL == layout)
if (H5D_VIRTUAL == layout)
printf(" Dataset has a virtual layout \n");
else
printf(" Wrong layout found \n");
@ -129,10 +129,10 @@ main (void)
status = H5Pget_virtual_count (dcpl, &num_map);
printf(" Number of mappings is %lu\n", (unsigned long)num_map);
/*
/*
* Get mapping parameters for each mapping.
*/
for (i = 0; i < (int)num_map; i++) {
for (i = 0; i < (int)num_map; i++) {
printf(" Mapping %d \n", i);
printf(" Selection in the virtual dataset ");
/* Get selection in the virttual dataset */

View File

@ -16,15 +16,15 @@
This example illustrates the concept of virtual dataset.
The program creates three 1-dim source datasets and writes
data to them. Then it creates a 2-dim virtual dataset and
maps the first three rows of the virtual dataset to the data
in the source datasets. Elements of a row are mapped to all
maps the first three rows of the virtual dataset to the data
in the source datasets. Elements of a row are mapped to all
elements of the corresponding source dataset.
The fourth row is not mapped and will be filled with the fill
values when virtual dataset is read back.
The fourth row is not mapped and will be filled with the fill
values when virtual dataset is read back.
The program closes all datasets, and then reopens the virtual
dataset, and finds and prints its creation properties.
Then it reads the values.
Then it reads the values.
This file is intended for use with HDF5 Library version 1.10
@ -37,9 +37,9 @@
#define FILE "vds.h5"
#define DATASET "VDS"
#define VDSDIM1 6
#define VDSDIM0 4
#define DIM0 6
#define VDSDIM1 6
#define VDSDIM0 4
#define DIM0 6
#define RANK1 1
#define RANK2 2
@ -58,7 +58,7 @@ const char *SRC_DATASET[] = {
int
main (void)
{
hid_t file, space, src_space, vspace, dset; /* Handles */
hid_t file, space, src_space, vspace, dset; /* Handles */
hid_t dcpl;
herr_t status;
hsize_t vdsdims[2] = {VDSDIM0, VDSDIM1}, /* Virtual datasets dimension */
@ -73,12 +73,12 @@ main (void)
block_out[2];
int wdata[DIM0], /* Write buffer for source dataset */
rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */
i, j, k, l;
i, j, k, l;
int fill_value = -1; /* Fill value for VDS */
H5D_layout_t layout; /* Storage layout */
size_t num_map; /* Number of mappings */
ssize_t len; /* Length of the string; also a return value */
char *filename;
char *filename;
char *dsetname;
hsize_t nblocks;
hsize_t *buf; /* Buffer to hold hyperslab coordinates */
@ -91,9 +91,9 @@ main (void)
* Initialize data for i-th source dataset.
*/
for (j = 0; j < DIM0; j++) wdata[j] = i+1;
/*
* Create the source files and datasets. Write data to each dataset and
* Create the source files and datasets. Write data to each dataset and
* close all resources.
*/
@ -117,7 +117,7 @@ main (void)
/* Set VDS creation property. */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
status = H5Pset_fill_value (dcpl, H5T_NATIVE_INT, &fill_value);
/* Initialize hyperslab values. */
start[0] = 0;
start[1] = 0;
@ -126,11 +126,11 @@ main (void)
block[0] = 1;
block[1] = VDSDIM1;
/*
/*
* Build the mappings.
* Selections in the source datasets are H5S_ALL.
* In the virtual dataset we select the first, the second and the third rows
* and map each row to the data in the corresponding source dataset.
* In the virtual dataset we select the first, the second and the third rows
* and map each row to the data in the corresponding source dataset.
*/
src_space = H5Screate_simple (RANK1, dims, NULL);
for (i = 0; i < 3; i++) {
@ -146,8 +146,8 @@ main (void)
status = H5Sclose (space);
status = H5Sclose (src_space);
status = H5Dclose (dset);
status = H5Fclose (file);
status = H5Fclose (file);
/*
* Now we begin the read section of this example.
*/
@ -167,7 +167,7 @@ main (void)
* Get storage layout.
*/
layout = H5Pget_layout (dcpl);
if (H5D_VIRTUAL == layout)
if (H5D_VIRTUAL == layout)
printf(" Dataset has a virtual layout \n");
else
printf(" Wrong layout found \n");
@ -178,26 +178,26 @@ main (void)
status = H5Pget_virtual_count (dcpl, &num_map);
printf(" Number of mappings is %lu\n", (unsigned long)num_map);
/*
/*
* Get mapping parameters for each mapping.
*/
for (i = 0; i < (int)num_map; i++) {
for (i = 0; i < (int)num_map; i++) {
printf(" Mapping %d \n", i);
printf(" Selection in the virtual dataset ");
/* Get selection in the virttual dataset */
vspace = H5Pget_virtual_vspace (dcpl, (size_t)i);
/* Make sure that this is a hyperslab selection and then print information. */
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
if (H5Sget_select_type(vspace) == H5S_SEL_HYPERSLABS) {
nblocks = H5Sget_select_hyper_nblocks (vspace);
buf = (hsize_t *)malloc(sizeof(hsize_t)*2*RANK2*nblocks);
status = H5Sget_select_hyper_blocklist (vspace, (hsize_t)0, nblocks, buf);
for (l=0; l<nblocks; l++) {
printf("(");
for (k=0; k<RANK2-1; k++)
for (k=0; k<RANK2-1; k++)
printf("%d,", (int)buf[k]);
printf("%d ) - (", (int)buf[k]);
for (k=0; k<RANK2-1; k++)
for (k=0; k<RANK2-1; k++)
printf("%d,", (int)buf[RANK2+k]);
printf("%d)\n", (int)buf[RANK2+k]);
}

View File

@ -53,7 +53,7 @@ fi
)
# Where the tool is installed.
# default is relative path to installed location of the tools
# default is relative path to installed location of the tools
prefix="${prefix:-../${prefix_relto_examplesdir}}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
@ -179,5 +179,5 @@ rm *.h5
rm -rf red blue u2w
echo
exit $EXIT_VALUE
exit $EXIT_VALUE

View File

@ -100,9 +100,9 @@ main (void)
printf("HDF5 C Sample program ran successfully. File %s generated.\n", H5FILE_NAME);
remove(H5FILE_NAME);
return 0;
}
}
EOF
# generate prog1
@ -143,7 +143,7 @@ main (void)
remove(H5FILE_NAME);
return 0;
}
}
EOF
# Generate HDF5 v1.6 Main Program:

View File

@ -11,8 +11,8 @@
! help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
! This example shows how to create an array of a compound datatype which
! contains an array of type complex and how to write it to hdf5
! This example shows how to create an array of a compound datatype which
! contains an array of type complex and how to write it to hdf5
! and how to read it back into a compound datatype for hdf5.
!
@ -85,7 +85,7 @@ PROGRAM compound_complex_fortran2003
! Open the file and the dataset.
!
CALL H5Fopen_f("test.h5", H5F_ACC_RDONLY_F, file_id, error)
CALL H5Dopen_f(file_id, "samples", dset_id, error)
!
! Create the memory data type.

View File

@ -77,10 +77,10 @@ PROGRAM main
INTEGER(SIZE_T) :: offset, sizeof_compound
INTEGER :: hdferr
TYPE(C_PTR) :: f_ptr
INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
INTEGER(SIZE_T) :: type_sized ! Size of the double datatype
INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
INTEGER(SIZE_T) :: type_sized ! Size of the double datatype
INTEGER(hid_t) :: tid3 ! /* Nested Array Datatype ID */
INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/13/)
!
@ -133,7 +133,7 @@ PROGRAM main
!
! Write data to the dataset
!
f_ptr = C_LOC(s1(1))
CALL H5Dwrite_f(dataset, s1_tid, f_ptr, hdferr)
@ -150,7 +150,7 @@ PROGRAM main
!
CALL H5Fopen_f(H5FILE_NAME, H5F_ACC_RDONLY_F, file, hdferr)
CALL H5Dopen_f(file, DATASETNAME, dataset,hdferr)
!

View File

@ -10,17 +10,17 @@
! If you do not have access to either file, you may request a copy from *
! help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
!
! This example illustrates how to create a compressed dataset.
! It is used in the HDF5 Tutorial.
!
!
PROGRAM h5_cmprss
USE HDF5 ! This module contains all necessary modules
USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
!
! The dataset is stored in file "h5_cmprss.h5"
! The dataset is stored in file "h5_cmprss.h5"
!
CHARACTER(LEN=12), PARAMETER :: filename = "h5_cmprss.h5"
INTEGER, PARAMETER :: rank = 2 ! Rank of the data set
@ -33,7 +33,7 @@ PROGRAM h5_cmprss
INTEGER :: error
INTEGER(hsize_t), DIMENSION(1:rank) :: dims ! dimensions of data
INTEGER(hsize_t), DIMENSION(1:rank) :: cdims ! sizes of chunked data
INTEGER :: i,j, numfilt
INTEGER, DIMENSION(1:dim0,1:dim1) :: buf ! write buffer
INTEGER, DIMENSION(1:dim0,1:dim1) :: rbuf ! read buffer
@ -63,15 +63,15 @@ PROGRAM h5_cmprss
CALL h5screate_simple_f(rank, dims, dataspace_id, error)
CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error)
!
! Dataset must be chunked for compression
! Dataset must be chunked for compression
cdims(1:2) = 20
CALL h5pset_chunk_f(plist_id, 2, cdims, error)
! Set ZLIB / DEFLATE Compression using compression level 6.
! To use SZIP Compression comment out these lines.
! To use SZIP Compression comment out these lines.
CALL h5pset_deflate_f(plist_id, 6, error)
! Uncomment these lines to set SZIP Compression
! Uncomment these lines to set SZIP Compression
!szip_options_mask = H5_SZIP_NN_OM_F
!szip_pixels_per_block = 16
!CALL H5Pset_szip_f(plist_id, szip_options_mask, szip_pixels_per_block, error)
@ -86,7 +86,7 @@ PROGRAM h5_cmprss
ENDDO
ENDDO
data_dims(1:2) = (/dim0,dim1/)
data_dims(1:2) = (/dim0,dim1/)
CALL h5dwrite_f(dataset_id, H5T_NATIVE_INTEGER, buf, data_dims, error)
! Close resources
@ -99,12 +99,12 @@ PROGRAM h5_cmprss
CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file_id, error)
CALL h5dopen_f(file_id, "Compressed_Data", dataset_id, error)
! Retrieve filter information.
! Retrieve filter information.
CALL h5dget_create_plist_f(dataset_id, plist_id, error)
CALL h5pget_nfilters_f(plist_id, numfilt, error)
WRITE(*,'(A, I0)') "Number of filters associated with dataset: ", numfilt
DO i = 1, numfilt
nelmts = 1
CALL h5pget_filter_f(plist_id, 0, flags, nelmts, cd_values, &
@ -121,7 +121,7 @@ PROGRAM h5_cmprss
ENDDO
data_dims(1:2) = (/dim0,dim1/)
CALL h5dread_f(dataset_id, H5T_NATIVE_INTEGER, rbuf, data_dims, error)
CALL h5dclose_f(dataset_id, error)
CALL h5pclose_f(plist_id, error)
CALL h5fclose_f(file_id, error)

View File

@ -15,12 +15,12 @@
PROGRAM H5_EXTEND
USE HDF5 ! This module contains all necessary modules
USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
!
!the dataset is stored in file "extend.h5"
!the dataset is stored in file "extend.h5"
!
CHARACTER(LEN=9), PARAMETER :: filename = "extend.h5"
@ -30,11 +30,11 @@ PROGRAM H5_EXTEND
CHARACTER(LEN=15), PARAMETER :: dsetname = "ExtendibleArray"
INTEGER :: RANK = 2
INTEGER(HID_T) :: file_id ! File identifier
INTEGER(HID_T) :: dset_id ! Dataset identifier
INTEGER(HID_T) :: dataspace ! Dataspace identifier
INTEGER(HID_T) :: memspace ! Memory dataspace identifier
INTEGER(HID_T) :: crp_list ! Dataset creation property identifier
INTEGER(HID_T) :: file_id ! File identifier
INTEGER(HID_T) :: dset_id ! Dataset identifier
INTEGER(HID_T) :: dataspace ! Dataspace identifier
INTEGER(HID_T) :: memspace ! Memory dataspace identifier
INTEGER(HID_T) :: crp_list ! Dataset creation property identifier
!
!dataset dimensions at creation time
@ -42,7 +42,7 @@ PROGRAM H5_EXTEND
INTEGER(HSIZE_T), DIMENSION(1:2) :: dims = (/3,3/)
!
!data dimensions
!data dimensions
!
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsc = (/2,5/)
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsm = (/3,7/)
@ -50,49 +50,49 @@ PROGRAM H5_EXTEND
!
!Maximum dimensions
!
INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims
INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims
INTEGER(HSIZE_T), DIMENSION(1:2) :: offset
INTEGER(HSIZE_T), DIMENSION(1:2) :: count
INTEGER(HSIZE_T), DIMENSION(1:2) :: count
!
! Variables for reading and writing
! Variables for reading and writing
!
INTEGER, DIMENSION(1:3,1:3) :: data1
INTEGER, DIMENSION(1:3,1:3) :: data1
INTEGER, DIMENSION(1:21) :: data2 = &
(/2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4/)
INTEGER(HSIZE_T), DIMENSION(1:2) :: data_dims
!
!Size of data in the file
!Size of data in the file
!
INTEGER(HSIZE_T), DIMENSION(1:2) :: size
!
!general purpose integer
!general purpose integer
!
INTEGER(HSIZE_T) :: i, j
!
!flag to check operation success
!flag to check operation success
!
INTEGER :: error
INTEGER :: error
!
!Variables used in reading data back
!
!
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsr, maxdimsr
INTEGER :: rankr
INTEGER, DIMENSION(1:3,1:10) :: rdata
INTEGER, DIMENSION(1:3,1:10) :: rdata
!
!Initialize FORTRAN predifined datatypes
!
CALL h5open_f(error)
CALL h5open_f(error)
!
!Create a new file using default properties.
!
!
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
!
@ -117,7 +117,7 @@ PROGRAM H5_EXTEND
CALL h5sclose_f(dataspace, error)
!
!Fill data array with 1's
!Fill data array with 1's
!
DO i = 1, dims(1)
DO j = 1, dims(2)
@ -128,7 +128,7 @@ PROGRAM H5_EXTEND
!
!Write data array to dataset
!
data_dims(1:2) = (/3,3/)
data_dims(1:2) = (/3,3/)
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data1, data_dims, error)
!
@ -144,7 +144,7 @@ PROGRAM H5_EXTEND
!
!Write to 3x7 extended part of dataset
!
!
CALL h5dget_space_f(dset_id, dataspace, error)
CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, &
offset, count, error)
@ -185,7 +185,7 @@ PROGRAM H5_EXTEND
!
!Get dataspace's dimensions.
!
!
CALL h5sget_simple_extent_dims_f(dataspace, dimsr, maxdimsr, error)
!
@ -204,15 +204,15 @@ PROGRAM H5_EXTEND
CALL h5screate_simple_f(rankr, dimsr, memspace, error)
!
!Read data
!Read data
!
data_dims(1:2) = (/3,10/)
CALL H5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, data_dims, &
error, memspace, dataspace)
WRITE(*,'(A)') "Dataset:"
WRITE(*,'(A)') "Dataset:"
DO i = 1, dimsr(1)
WRITE(*,'(100(I0,1X))') rdata(i,1:dimsr(2))
WRITE(*,'(100(I0,1X))') rdata(i,1:dimsr(2))
END DO
!

View File

@ -11,23 +11,23 @@
! help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
! This example shows how to write and read a hyperslab.
! This example shows how to write and read a hyperslab.
! It is used in the HDF5 Tutorial.
!
PROGRAM H5_SUBSET
PROGRAM H5_SUBSET
USE HDF5 ! This module contains all necessary modules
USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
CHARACTER(LEN=9), PARAMETER :: filename = "subset.h5" ! File name
CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" ! Dataset name
INTEGER(HID_T) :: file_id ! File identifier
INTEGER(HID_T) :: dset_id ! Dataset identifier
INTEGER(HID_T) :: dataspace ! Dataspace identifier
INTEGER(HID_T) :: memspace ! memspace identifier
INTEGER(HID_T) :: file_id ! File identifier
INTEGER(HID_T) :: dset_id ! Dataset identifier
INTEGER(HID_T) :: dataspace ! Dataspace identifier
INTEGER(HID_T) :: memspace ! memspace identifier
!
! To change the subset size, modify size of dimsm, sdata, dim0_sub,
@ -35,57 +35,57 @@ PROGRAM H5_SUBSET
!
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsm = (/4,3/) ! Dataset dimensions
INTEGER, DIMENSION(1:4,1:3) :: sdata ! Subset buffer
INTEGER :: dim0_sub = 4
INTEGER :: dim1_sub = 3
INTEGER :: dim0_sub = 4
INTEGER :: dim1_sub = 3
INTEGER(HSIZE_T), DIMENSION(1:2) :: count = (/4,3/) ! Size of hyperslab
INTEGER(HSIZE_T), DIMENSION(1:2) :: offset = (/2,1/) ! Hyperslab offset
INTEGER(HSIZE_T), DIMENSION(1:2) :: stride = (/1,1/) ! Hyperslab stride
INTEGER(HSIZE_T), DIMENSION(1:2) :: block = (/1,1/) ! Hyperslab block size
INTEGER(HSIZE_T), DIMENSION(1:2) :: stride = (/1,1/) ! Hyperslab stride
INTEGER(HSIZE_T), DIMENSION(1:2) :: block = (/1,1/) ! Hyperslab block size
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsf = (/10,8/) ! Dataset dimensions
INTEGER, DIMENSION(1:10,1:8) :: data ! Data to write
INTEGER, DIMENSION(1:10,1:8) :: rdata ! Data to read
INTEGER, DIMENSION(1:10,1:8) :: rdata ! Data to read
INTEGER :: rank = 2 ! Dataset rank ( in file )
INTEGER :: dim0 = 10 ! Dataset size in file
INTEGER :: dim1 = 8
INTEGER :: dim1 = 8
INTEGER :: i, j
INTEGER :: i, j
INTEGER :: error ! Error flag
INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
!
! Write data to the HDF5 file.
! Write data to the HDF5 file.
!
!
! Data initialization.
! Data initialization.
!
DO i = 1, dim0
DO i = 1, dim0
DO j = 1, dim1
IF (i .LE. (dim0 / 2)) THEN
data(i,j) = 1
ELSE
data(i,j) = 2
data(i,j) = 1
ELSE
data(i,j) = 2
END IF
END DO
END DO
!
! Initialize FORTRAN interface.
! Initialize FORTRAN interface.
!
CALL h5open_f(error)
CALL h5open_f(error)
!
! Create a new file using default properties.
!
!
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
!
! Create the data space for the dataset.
! Create the data space for the dataset.
!
CALL h5screate_simple_f(rank, dimsf, dataspace, error)
@ -98,12 +98,12 @@ PROGRAM H5_SUBSET
!
! Write the dataset.
!
data_dims(1) = dim0
data_dims(2) = dim1
data_dims(1) = dim0
data_dims(2) = dim1
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, data_dims, error)
!
! Data Written to File
! Data Written to File
!
WRITE(*,'(/,A)') "Original Data Written to File:"
DO i = 1, dim0
@ -138,7 +138,7 @@ PROGRAM H5_SUBSET
!
CALL h5dget_space_f(dset_id, dataspace, error)
CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, &
offset, count, error, stride, BLOCK)
offset, count, error, stride, BLOCK)
!
! Create memory dataspace.
!
@ -148,9 +148,9 @@ PROGRAM H5_SUBSET
WRITE(*,'(A,/)') " offset=2x1 stride=1x1 count=4x3 block=1x1"
!
! Write subset to dataset
! Write subset to dataset
!
data_dims(1:2) = (/dim0_sub, dim1_sub/)
data_dims(1:2) = (/dim0_sub, dim1_sub/)
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, sdata, data_dims, error, &
memspace, dataspace)
@ -158,10 +158,10 @@ PROGRAM H5_SUBSET
CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, data_dims, error)
!
! Read entire dataset back
! Read entire dataset back
!
WRITE(*,'(A)') "Data in File after Subset Written:"
DO i = 1, dim0
DO i = 1, dim0
WRITE(*,'(100(1X,I0,1X))') rdata(i,1:dim1)
END DO
PRINT *, " "

View File

@ -1,4 +1,4 @@
!
!
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
@ -82,10 +82,10 @@ PROGRAM main
INTEGER(SIZE_T) :: offset, sizeof_compound
INTEGER :: hdferr
TYPE(C_PTR) :: f_ptr
INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
INTEGER(SIZE_T) :: type_sized ! Size of the double datatype
INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
INTEGER(SIZE_T) :: type_sized ! Size of the double datatype
INTEGER(hid_t) :: tid3 ! /* Nested Array Datatype ID */
INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/7/)
INTEGER(HSIZE_T), DIMENSION(1) :: tdims1a=(/4/)
@ -136,7 +136,7 @@ PROGRAM main
!
! Write data to the dataset
!
f_ptr = C_LOC(s1(1))
CALL H5Dwrite_f(dataset, s1_tid, f_ptr, hdferr)
@ -153,7 +153,7 @@ PROGRAM main
!
CALL H5Fopen_f(H5FILE_NAME, H5F_ACC_RDONLY_F, file, hdferr)
CALL H5Dopen_f(file, DATASETNAME, dataset,hdferr)
!
! Create a data type for s2

View File

@ -1,4 +1,4 @@
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by The HDF Group. *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
@ -9,12 +9,12 @@
! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
! If you do not have access to either file, you may request a copy from *
! help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
!
! The following example shows how to write and read to/from an existing dataset.
! It opens the file created in the previous example, obtains the dataset
! identifier, writes the data to the dataset in the file,
! The following example shows how to write and read to/from an existing dataset.
! It opens the file created in the previous example, obtains the dataset
! identifier, writes the data to the dataset in the file,
! then reads the dataset to memory. Uses updated Fortran 2003 interface
! with different KINDs of integers and reals.
!
@ -22,8 +22,8 @@ PROGRAM RWDSET_FORTRAN2003
USE ISO_C_BINDING
USE HDF5 ! This module contains all necessary modules
USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(2) !should map to INTEGER*1 on most modern processors
@ -42,13 +42,13 @@ PROGRAM RWDSET_FORTRAN2003
CHARACTER(LEN=6), PARAMETER :: dsetnamer4 = "dsetr4" ! Dataset name
CHARACTER(LEN=6), PARAMETER :: dsetnamer8 = "dsetr8" ! Dataset name
INTEGER(HID_T) :: file_id ! File identifier
INTEGER(HID_T) :: dset_id1 ! Dataset identifier
INTEGER(HID_T) :: dset_id4 ! Dataset identifier
INTEGER(HID_T) :: dset_id8 ! Dataset identifier
INTEGER(HID_T) :: dset_id16 ! Dataset identifier
INTEGER(HID_T) :: dset_idr4 ! Dataset identifier
INTEGER(HID_T) :: dset_idr8 ! Dataset identifier
INTEGER(HID_T) :: file_id ! File identifier
INTEGER(HID_T) :: dset_id1 ! Dataset identifier
INTEGER(HID_T) :: dset_id4 ! Dataset identifier
INTEGER(HID_T) :: dset_id8 ! Dataset identifier
INTEGER(HID_T) :: dset_id16 ! Dataset identifier
INTEGER(HID_T) :: dset_idr4 ! Dataset identifier
INTEGER(HID_T) :: dset_idr8 ! Dataset identifier
INTEGER :: error ! Error flag
INTEGER :: i
@ -65,15 +65,15 @@ PROGRAM RWDSET_FORTRAN2003
REAL(real_kind_7), DIMENSION(1:4), TARGET :: dset_data_r7, data_out_r7
REAL(real_kind_15), DIMENSION(1:4), TARGET :: dset_data_r15, data_out_r15
INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/)
INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/)
INTEGER(HID_T) :: dspace_id ! Dataspace identifier
TYPE(C_PTR) :: f_ptr
!
! Initialize FORTRAN interface.
!
CALL h5open_f(error)
CALL h5open_f(error)
!
! Initialize the dset_data array.
!
@ -130,7 +130,7 @@ PROGRAM RWDSET_FORTRAN2003
!
! Read the dataset.
!
! Read data back into an integer size that is larger then the original size used for
! Read data back into an integer size that is larger then the original size used for
! writing the data
f_ptr = C_LOC(data_out_i8a(1))
CALL h5dread_f(dset_id1, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error)
@ -172,5 +172,5 @@ PROGRAM RWDSET_FORTRAN2003
END PROGRAM RWDSET_FORTRAN2003

View File

@ -71,13 +71,13 @@ temp_FILES="a.out $applib"
# An application Main that calls hdf5 and application's own functions.
cat > $appmain <<EOF
PROGRAM FILEEXAMPLE
USE HDF5 ! This module contains all necessary modules
USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
CHARACTER(LEN=8), PARAMETER :: filename = "apptmp.h5" ! File name
INTEGER(HID_T) :: file_id ! File identifier
INTEGER :: error ! Error flag
CALL sub1
@ -86,7 +86,7 @@ cat > $appmain <<EOF
CALL h5fclose_f(file_id, error)
CALL h5close_f(error)
CALL sub2
END PROGRAM FILEEXAMPLE
END PROGRAM FILEEXAMPLE
EOF
# generate prog1
@ -107,20 +107,20 @@ EOF
# An HDF5 sample program that calls hdf5 functions.
cat > $hdf5main <<EOF
PROGRAM FILEEXAMPLE
USE HDF5 ! This module contains all necessary modules
USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
CHARACTER(LEN=8), PARAMETER :: filename = "apptmp.h5" ! File name
INTEGER(HID_T) :: file_id ! File identifier
INTEGER :: error ! Error flag
CALL h5open_f (error)
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
CALL h5fclose_f(file_id, error)
CALL h5close_f(error)
END PROGRAM FILEEXAMPLE
END PROGRAM FILEEXAMPLE
EOF

View File

@ -1286,16 +1286,16 @@ h5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id)
* PURPOSE
* Call H5Treclaim
* INPUTS
* type_id - Identifier of the datatype.
* space_id - Identifier of the dataspace.
* plist_id - Identifier of the property list used to create the buffer.
* buf - Pointer to the buffer to be reclaimed.
* type_id - Identifier of the datatype.
* space_id - Identifier of the dataspace.
* plist_id - Identifier of the property list used to create the buffer.
* buf - Pointer to the buffer to be reclaimed.
*
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
* M. Scot Breitenfeld
* January 15, 2011
* January 15, 2011
*
* SOURCE
*/

View File

@ -164,7 +164,7 @@ h5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen)
size_t c_namelen = (size_t)*namelen;
int_f ret_value = 0;
if(c_namelen > 0)
if(c_namelen > 0)
c_name = (char *)HDmalloc(c_namelen + 1);
if(!c_name)
@ -212,7 +212,7 @@ h5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen)
size_t c_namelen = (size_t)*namelen;
int_f ret_value = 0;
if(c_namelen > 0)
if(c_namelen > 0)
c_name = (char *)HDmalloc(c_namelen + 1);
if(!c_name)
@ -242,7 +242,7 @@ done:
* estack_id - Error stack identifier.
* func - Function to be called upon an error condition.
* client_data - Data passed to the error function.
*
*
* RETURNS
* 0 on success, -1 on failure
* AUTHOR

View File

@ -486,11 +486,11 @@ h5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count)
* Changed type of max_obj to size_t_f; added parameter for the
* number of open objects
* Thursday, September 25, 2008 EIP
*
*
* SOURCE
*/
int_f
h5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs,
h5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs,
hid_t_f *obj_ids, size_t_f *num_objs)
/******/
{
@ -693,7 +693,7 @@ h5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f
/*
* Call h5fget_file_image function
*/
if ( (c_buf_req = H5Fget_file_image((hid_t)*file_id, buf_ptr, (size_t)*buf_len)) < 0)
HGOTO_DONE(FAIL);

View File

@ -939,7 +939,7 @@ int_f
h5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size,
void *linkval_buff, hid_t_f *lapl_id)
/******/
{
{
char *c_link_name = NULL; /* Buffer to hold C string */
int_f ret_value = 0; /* Return value */

View File

@ -27,7 +27,7 @@ fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info);
int_f
fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info) {
/* This function does not used the field parameter because we want
/* This function does not used the field parameter because we want
* this function to fill the unfilled fields with C's default values.
*/
@ -184,7 +184,7 @@ h5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_
* PURPOSE
* Call H5Oclose
* INPUTS
* object_id - Object identifier
* object_id - Object identifier
* RETURNS
* 0 on success, -1 on failure
* AUTHOR
@ -197,10 +197,10 @@ h5oclose_c ( hid_t_f *object_id )
/******/
{
int_f ret_value=0; /* Return value */
if (H5Oclose((hid_t)*object_id) < 0)
HGOTO_DONE(FAIL);
done:
return ret_value;
}
@ -312,7 +312,7 @@ h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *l
char *c_name = NULL; /* Buffer to hold C string */
int_f ret_value = 0; /* Return value */
H5O_info2_t Oinfo;
/*
* Convert FORTRAN name to C name
*/
@ -356,7 +356,7 @@ h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *l
* SOURCE
*/
int_f
h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen,
h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen,
int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields)
/******/
{
@ -432,12 +432,12 @@ h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields)
* H5Ocopy_c
* PURPOSE
* Calls H5Ocopy
* INPUTS
* src_loc_id - Object identifier indicating the location of the source object to be copied
* src_name - Name of the source object to be copied
* INPUTS
* src_loc_id - Object identifier indicating the location of the source object to be copied
* src_name - Name of the source object to be copied
* src_name_len - Length of src_name
* dst_loc_id - Location identifier specifying the destination
* dst_name - Name to be assigned to the new copy
* dst_loc_id - Location identifier specifying the destination
* dst_name - Name to be assigned to the new copy
* dst_name_len - Length of dst_name
* ocpypl_id - Object copy property list
* lcpl_id - Link creation property list for the new hard link
@ -451,15 +451,15 @@ h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields)
*/
int_f
h5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len,
hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len,
hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len,
hid_t_f *ocpypl_id, hid_t_f *lcpl_id )
/******/
{
char *c_src_name = NULL; /* Buffer to hold C string */
char *c_dst_name = NULL; /* Buffer to hold C string */
int_f ret_value = 0; /* Return value */
/*
* Convert FORTRAN name to C name
*/
@ -471,7 +471,7 @@ h5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len,
/*
* Call H5Ocopy function.
*/
if(H5Ocopy( (hid_t)*src_loc_id, c_src_name, (hid_t)*dst_loc_id, c_dst_name,
if(H5Ocopy( (hid_t)*src_loc_id, c_src_name, (hid_t)*dst_loc_id, c_dst_name,
(hid_t)*ocpypl_id, (hid_t)*lcpl_id) < 0)
HGOTO_DONE(FAIL);
@ -689,8 +689,8 @@ h5oset_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentlen)
* Calls H5Oset_comment_by_name
* INPUTS
* object_id - Identifier of the target object.
* name - Name of the object whose comment is to be set or reset,
* specified as a path relative to loc_id.
* name - Name of the object whose comment is to be set or reset,
* specified as a path relative to loc_id.
* namelen - Length of the name.
* comment - The new comment.
* commentlen - Length of the comment.
@ -757,7 +757,7 @@ h5oset_comment_by_name_c (hid_t_f *object_id, _fcd name, size_t_f *namelen, _fc
* SOURCE
*/
int_f
h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id)
/******/
{
@ -765,7 +765,7 @@ h5oopen_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
int_f ret_value = 0;
H5_index_t c_index_type;
H5_iter_order_t c_order;
/*
* Convert FORTRAN string to C string
*/
@ -818,13 +818,13 @@ h5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssi
/*
* Allocate buffer to hold comment name
*/
if(NULL == (c_comment = (char *)HDmalloc(c_commentsize)))
HGOTO_DONE(FAIL);
/*
* Call H5Oget_comment function.
*/
*/
if((*bufsize = (hssize_t_f)H5Oget_comment((hid_t)*object_id, c_comment, (size_t)*commentsize)) < 0)
HGOTO_DONE(FAIL);
@ -862,7 +862,7 @@ h5oget_comment_c (hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssi
* SOURCE
*/
int_f
h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size,
h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size,
_fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id)
/******/
{
@ -883,13 +883,13 @@ h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size,
/*
* Allocate buffer to hold comment name
*/
if(NULL == (c_comment = (char *)HDmalloc(c_commentsize)))
HGOTO_DONE(FAIL);
/*
* Call H5Oget_comment_by_name function.
*/
*/
if((c_bufsize = H5Oget_comment_by_name((hid_t)*loc_id, c_name, c_comment, (size_t)*commentsize,(hid_t)*lapl_id )) < 0)
HGOTO_DONE(FAIL);

View File

@ -1831,7 +1831,7 @@ DONE:
* Wednesday, February 23, 2000
* HISTORY
* Changed type of 'offset' from int_f to off_t_f -- MSB January 9, 2012
*
*
* SOURCE
*/
int_f
@ -3153,7 +3153,7 @@ h5pget_class_name_c(hid_t_f *cls, _fcd name, int_f *name_len)
char *c_name;
/*
* Call H5Pget_class_name function. c_name is allocated by the library,
* Call H5Pget_class_name function. c_name is allocated by the library,
* has to be freed by application.
*/
if(NULL == (c_name = H5Pget_class_name((hid_t)*cls)))
@ -3216,7 +3216,7 @@ DONE:
* plist - property list class identifier
* name - name of the new property
* name_len - length of the "name" buffer
* Output:
* Output:
* value - property value
* RETURNS
* 0 on success, -1 on failure
@ -5177,7 +5177,7 @@ h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nby
*
* Inputs:
* fapl_id - File access property list identifier
* buf_ptr - Pointer to the initial file image,
* buf_ptr - Pointer to the initial file image,
* or NULL if no initial file image is desired
* buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired
*
@ -5207,7 +5207,7 @@ h5pset_file_image_c(hid_t_f *fapl_id, void *buf_ptr, size_t_f *buf_len)
* Inputs:
* fapl_id - File access property list identifier
* Outputs:
* buf_ptr - Pointer to the initial file image,
* buf_ptr - Pointer to the initial file image,
* or NULL if no initial file image is desired
* buf_len - Size of the supplied buffer, or 0 (zero) if no initial image is desired
*

View File

@ -351,7 +351,7 @@ h5rget_name_ptr_c (hid_t_f *loc_id, int_f *ref_type, void *ref, _fcd name, size_
* OUTPUTS
* obj_type - Type of referenced object. These are defined in H5Opublic.h,
* enum H5O_type_t
*
*
* RETURNS
* 0 on success, -1 on failure
* AUTHOR

View File

@ -101,7 +101,7 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes
if (sizeof(int_f) == sizeof(long long)) {
if ((types[5] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value;
} /*end else */
/* Find appropriate size to store Fortran REAL */
if(sizeof(real_f)==sizeof(float)) {
if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value;
@ -230,7 +230,7 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes
if ((integertypes[12] = (hid_t_f)H5Tcopy(H5T_STD_U32BE)) < 0) return ret_value;
if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value;
if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value;
if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value;
if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value;
if ((integertypes[17] = (hid_t_f)H5Tcopy(H5T_STD_B8BE)) < 0) return ret_value;
if ((integertypes[18] = (hid_t_f)H5Tcopy(H5T_STD_B8LE)) < 0) return ret_value;
if ((integertypes[19] = (hid_t_f)H5Tcopy(H5T_STD_B16BE)) < 0) return ret_value;
@ -359,12 +359,12 @@ h5close_types_c( hid_t_f * types, int_f *lentypes,
* SOURCE
*/
int_f
h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags,
int_f *h5fd_flags, hid_t_f *h5fd_hid_flags,
int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags,
hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags,
int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags,
hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags,
int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags,
int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags,
haddr_t_f *h5_haddr_generic_flags)
/******/

View File

@ -12,7 +12,7 @@
! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure
! The script to replace the defines in H5config_f.inc.in is
! located in configure.ac in the Fortran section.
! located in configure.ac in the Fortran section.
! Define if we have parallel support
#undef HAVE_PARALLEL
@ -47,7 +47,7 @@
! If C has quad precision
#undef HAVE_FLOAT128
! Define if INTEGER*16 is available
! Define if INTEGER*16 is available
#undef HAVE_Fortran_INTEGER_SIZEOF_16
! Maximum decimal precision for C

View File

@ -160,9 +160,9 @@ H5_FCDLL int_f h5dfill_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *spac
H5_FCDLL int_f h5dget_space_status_c( hid_t_f *dset_id, int_f *flag);
H5_FCDLL int_f h5dcreate_anon_c(hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id,
hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id);
H5_FCDLL int_f h5dwrite_f_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id,
H5_FCDLL int_f h5dwrite_f_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id,
hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf);
H5_FCDLL int_f h5dread_f_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id,
H5_FCDLL int_f h5dread_f_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id,
hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf);
H5_FCDLL int_f h5dvlen_reclaim_c(hid_t_f *type_id , hid_t_f *space_id, hid_t_f *plist_id, void *buf);
@ -323,22 +323,22 @@ H5_FCDLL int_f h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5
H5_FCDLL int_f h5ovisit_by_name_c(hid_t_f *loc_id, _fcd object_name, size_t_f *namelen, int_f *index_type, int_f *order,
H5O_iterate2_t op, void *op_data, hid_t_f *lapl_id, int_f *fields );
H5_FCDLL int_f h5oget_info_c(hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields);
H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen,
H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen,
int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields);
H5_FCDLL int_f h5oget_info_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id,
H5O_info_t_f *object_info, int_f *fields);
H5_FCDLL int_f h5ocopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len,
hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len,
hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len,
hid_t_f *ocpypl_id, hid_t_f *lcpl_id );
H5_FCDLL int_f h5odecr_refcount_c(hid_t_f *object_id);
H5_FCDLL int_f h5oincr_refcount_c(hid_t_f *object_id);
H5_FCDLL int_f h5oexists_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id);
H5_FCDLL int_f h5oset_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentlen);
H5_FCDLL int_f h5oset_comment_by_name_c(hid_t_f *object_id, _fcd name, size_t_f *namelen, _fcd comment, size_t_f *commentlen, hid_t_f *lapl_id);
H5_FCDLL int_f h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
H5_FCDLL int_f h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id);
H5_FCDLL int_f h5oget_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssize_t_f *bufsize);
H5_FCDLL int_f h5oget_comment_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *name_size,
H5_FCDLL int_f h5oget_comment_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *name_size,
_fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id);
H5_FCDLL int_f h5otoken_cmp_c(hid_t_f *loc_id, H5O_token_t *token1,
H5O_token_t *token2, int_f *cmp_value);
@ -528,12 +528,12 @@ H5_FCDLL int_f h5open_c(void);
H5_FCDLL int_f h5close_c(void);
H5_FCDLL int_f h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes);
H5_FCDLL int_f h5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f *floatinglen, hid_t_f *integertypes, int_f *integerlen);
H5_FCDLL int_f h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
H5_FCDLL int_f h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags,
int_f *h5fd_flags, hid_t_f *h5fd_hid_flags,
int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags,
hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags,
int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags,
hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags,
int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags,
int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags,
haddr_t_f *h5_haddr_generic_flags);
H5_FCDLL int_f h5init1_flags_c(int_f *h5lib_flags);

View File

@ -150,7 +150,7 @@ int main(void)
int RealKinds[] = H5_FORTRAN_REAL_KINDS;
int RealKinds_SizeOf[] = H5_FORTRAN_REAL_KINDS_SIZEOF;
char Real_C_TYPES[10][32];
int FORTRAN_NUM_INTEGER_KINDS=H5_FORTRAN_NUM_INTEGER_KINDS;
int H5_FORTRAN_NUM_REAL_KINDS;
#if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0
@ -208,13 +208,13 @@ int main(void)
}
else if(sizeof(double) == RealKinds_SizeOf[i]) {
writeTypedef("float", "double", RealKinds[i]);
strcpy(Real_C_TYPES[i], "C_DOUBLE");
strcpy(Real_C_TYPES[i], "C_DOUBLE");
}
#if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0
else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) {
writeTypedef("float", "long double", RealKinds[i]);
strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE");
found_long_double = 1;
found_long_double = 1;
}
# ifdef H5_HAVE_FLOAT128
/* Don't select a higher precision than Fortran can support */
@ -329,7 +329,7 @@ int main(void)
/* Defined different KINDs of integers */
fprintf(fort_header," INTEGER, DIMENSION(1:%d), PARAMETER :: Fortran_INTEGER_AVAIL_KINDS = (/", FORTRAN_NUM_INTEGER_KINDS);
for(i=0;i<FORTRAN_NUM_INTEGER_KINDS;i++) {
fprintf(fort_header,"%d",(int)IntKinds[i]);
if(i==FORTRAN_NUM_INTEGER_KINDS-1) {
@ -337,7 +337,7 @@ int main(void)
} else {
fprintf(fort_header,",");
}
}
/* real_4, real_8, real_16 */

View File

@ -48,7 +48,7 @@ libhdf5_fortran_la_SOURCES=H5f90global.F90 \
H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \
H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c HDF5.F90
# HDF5 Fortran library depends on HDF5 Library.
# HDF5 Fortran library depends on HDF5 Library.
libhdf5_fortran_la_LIBADD=$(LIBHDF5)
# h5fc is generated during configure.

View File

@ -75,12 +75,12 @@ SHOW="eval"
FCBASE="@FC@"
FLINKERBASE="@FC@"
# FCFLAGS and LDFLAGS are reserved for use by the script user.
# FCFLAGS and LDFLAGS are reserved for use by the script user.
# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS.
# User's FCFLAGS come after their H5BLD counterparts. User's LDFLAGS come just
# before clibpath, user's LIBS come after $link_objs and before the hdf5
# libraries in $link_args, followed by any external library paths and libraries
# User's FCFLAGS come after their H5BLD counterparts. User's LDFLAGS come just
# before clibpath, user's LIBS come after $link_objs and before the hdf5
# libraries in $link_args, followed by any external library paths and libraries
# from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build.
# The order of the flags is intended to give precedence to the user's flags.
H5BLD_FCFLAGS="@AM_FCFLAGS@ @FCFLAGS@"
@ -358,9 +358,9 @@ if test "x$do_link" = "xyes"; then
# module. It's okay if they're included twice in the compile line.
link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS"
# User's FCFLAGS come after their H5BLD counterparts. User's LDFLAGS come just
# before clibpath, user's LIBS come after $link_objs and before the hdf5
# libraries in $link_args, followed by any external library paths and libraries
# User's FCFLAGS come after their H5BLD counterparts. User's LDFLAGS come just
# before clibpath, user's LIBS come after $link_objs and before the hdf5
# libraries in $link_args, followed by any external library paths and libraries
# from AM_LDFLAGS, LDFLAGS, AM_LIBS or LIBS carried in from the hdf5 build.
# The order of the flags is intended to give precedence to the user's flags.
$SHOW $FLINKER $FCFLAGS $H5BLD_FCFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link

View File

@ -91,7 +91,7 @@ tf_gen.F90: H5_test_buildiface$(EXEEXT)
H5_test_buildiface_SOURCES = H5_test_buildiface.F90
# The build of the H5_test_buildiface does not depend on any libraries, so set it
# The build of the H5_test_buildiface does not depend on any libraries, so set it
# to nothing.
H5_test_buildiface_LDADD =

View File

@ -135,7 +135,7 @@ SUBROUTINE hyper(length,do_collective,do_chunk, mpi_size, mpi_rank, nerrors)
! Collective metadata READ API calling requirement
CALL h5pset_all_coll_metadata_ops_f(fapl_id, is_coll_true, hdferror)
CALL check("h5pset_all_coll_metadata_ops_f", hdferror, nerrors)
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, hdferror, access_prp = fapl_id)
CALL check("h5fcreate_f", hdferror, nerrors)
@ -144,7 +144,7 @@ SUBROUTINE hyper(length,do_collective,do_chunk, mpi_size, mpi_rank, nerrors)
CALL check("h5pclose_f", hdferror, nerrors)
CALL h5fget_access_plist_f(file_id, fapl_id, hdferror)
CALL check("h5fget_access_plist_f", hdferror, nerrors)
! verify settings for file access properties
! Collective metadata writes

View File

@ -18,8 +18,8 @@
PROGRAM parallel_test
USE HDF5
USE MPI
USE TH5_MISC
USE TH5_MISC
IMPLICIT NONE
INTEGER :: mpierror ! MPI hdferror flag

View File

@ -10,7 +10,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
#
#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.

View File

@ -14,7 +14,7 @@
## Run automake to generate a Makefile.in from this file.
#
# High-Level API C++ Makefile(.in)
#
#
include $(top_srcdir)/config/commence.am

View File

@ -98,5 +98,5 @@ rm *.o
rm *.h5
echo
exit $EXIT_VALUE
exit $EXIT_VALUE

View File

@ -138,5 +138,5 @@ rm *.o
rm *.h5
echo
exit $EXIT_VALUE
exit $EXIT_VALUE

View File

@ -10,7 +10,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
#
#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.

View File

@ -18,7 +18,7 @@ PROGRAM example_ds
IMPLICIT NONE
INTEGER, PARAMETER :: RANK = 2 ! rank of DATA dataset
INTEGER, PARAMETER :: RANK = 2 ! rank of DATA dataset
INTEGER, PARAMETER :: DIM_DATA = 12
INTEGER, PARAMETER :: DIM1_SIZE = 3
INTEGER, PARAMETER :: DIM2_SIZE = 4
@ -33,13 +33,13 @@ PROGRAM example_ds
INTEGER(hid_t) :: fid ! file ID
INTEGER(hid_t) :: did ! dataset ID
INTEGER(hid_t) :: dsid ! DS dataset ID
INTEGER :: rankds = 1 ! rank of DS dataset
INTEGER(hsize_t), DIMENSION(1:rank) :: dims = (/DIM2_SIZE,DIM1_SIZE/) ! size of data dataset
INTEGER, DIMENSION(1:DIM_DATA) :: buf = (/1,2,3,4,5,6,7,8,9,10,11,12/) ! data of data dataset
INTEGER(hsize_t), DIMENSION(1:1) :: s1_dim = (/DIM1_SIZE/) ! size of DS 1 dataset
INTEGER(hsize_t), DIMENSION(1:1) :: s2_dim = (/DIM2_SIZE/) ! size of DS 2 dataset
REAL, DIMENSION(1:DIM1_SIZE) :: s1_wbuf = (/10,20,30/) ! data of DS 1 dataset
REAL, DIMENSION(1:DIM2_SIZE) :: s2_wbuf = (/10,20,50,100/) ! data of DS 2 dataset
INTEGER :: rankds = 1 ! rank of DS dataset
INTEGER(hsize_t), DIMENSION(1:rank) :: dims = (/DIM2_SIZE,DIM1_SIZE/) ! size of data dataset
INTEGER, DIMENSION(1:DIM_DATA) :: buf = (/1,2,3,4,5,6,7,8,9,10,11,12/) ! data of data dataset
INTEGER(hsize_t), DIMENSION(1:1) :: s1_dim = (/DIM1_SIZE/) ! size of DS 1 dataset
INTEGER(hsize_t), DIMENSION(1:1) :: s2_dim = (/DIM2_SIZE/) ! size of DS 2 dataset
REAL, DIMENSION(1:DIM1_SIZE) :: s1_wbuf = (/10,20,30/) ! data of DS 1 dataset
REAL, DIMENSION(1:DIM2_SIZE) :: s2_wbuf = (/10,20,50,100/) ! data of DS 2 dataset
INTEGER :: err
INTEGER :: num_scales
INTEGER(size_t) :: name_len
@ -56,7 +56,7 @@ PROGRAM example_ds
! create a file using default properties
CALL H5Fcreate_f("ex_ds1.h5",H5F_ACC_TRUNC_F, fid, err)
! make a dataset
! make a dataset
CALL H5LTmake_dataset_int_f(fid, DSET_NAME, rank,dims,buf, err)
! make a DS dataset for the first dimension
@ -69,7 +69,7 @@ PROGRAM example_ds
! attach the DS_1_NAME dimension scale to DSET_NAME at dimension 1
! and then detach it.
!-------------------------------------------------------------------------
! get the dataset id for DSET_NAME
CALL H5Dopen_f(fid, DSET_NAME, did, err)
@ -82,11 +82,11 @@ PROGRAM example_ds
! attach the DS_1_NAME dimension scale to DSET_NAME at dimension index 1
CALL H5DSattach_scale_f(did, dsid, DIM1, err)
! Test if dimension Scale Attached
! Test if dimension Scale Attached
CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err)
WRITE(*,'(/,5X,3(A,1X),I0,A,L1)') 'Is',TRIM(DS_1_NAME),&
'attached to dimension',DIM1,' ... ',is_attached
! Check to see how many Dimension Scales are attached
@ -103,11 +103,11 @@ PROGRAM example_ds
CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err)
WRITE(*,'(/,5X,3(A,1X),I0,A,L1)') 'Is',TRIM(DS_1_NAME),&
'attached to dimension',DIM1,' ... ',is_attached
!-------------------------------------------------------------------------
! set the DS_1_NAME dimension scale to DSET_NAME at dimension 1
!-------------------------------------------------------------------------
WRITE(*,'(/,5A,I0)') &
'Set Dimension Scale "', TRIM(DS_1_NAME), '" to "', TRIM(DSET_NAME), '" at dimension ', DIM1
@ -123,11 +123,11 @@ PROGRAM example_ds
name = ''
CALL H5DSget_scale_name_f(dsid, name, name_len, err)
WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len)
WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len)
! Setting Dimension Scale Label
WRITE(*,'(/,A,I0)') "Setting Dimension Scale label ""X"" for dimension ", DIM1
WRITE(*,'(/,A,I0)') "Setting Dimension Scale label ""X"" for dimension ", DIM1
CALL H5DSset_label_f(did, DIM1, "X", err)
@ -139,11 +139,11 @@ PROGRAM example_ds
! close DS id
CALL H5Dclose_f(dsid, err)
!-------------------------------------------------------------------------
! attach the DS_2_NAME dimension scale to DSET_NAME
!-------------------------------------------------------------------------
! get the DS dataset id
CALL H5Dopen_f(fid, DS_2_NAME, dsid, err)
@ -163,7 +163,7 @@ PROGRAM example_ds
name = ''
CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err)
WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len)
WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len)
! Setting Dimension Scale Label
@ -177,13 +177,13 @@ PROGRAM example_ds
label_len = 25
label = ''
CALL H5DSget_label_f(did, DIM2, label, label_len, err)
WRITE(*,'(/,5X,A,I0,2A,/)') 'Dimension Scale Label for dimension ', DIM2, ' is ... ', label(1:label_len)
! close DS id
CALL H5Dclose_f(dsid, err)
! close file
! close file
CALL H5Fclose_f(fid, err)
END PROGRAM example_ds

View File

@ -80,5 +80,5 @@ rm *.o
rm *.h5
echo
exit $EXIT_VALUE
exit $EXIT_VALUE

View File

@ -33,15 +33,15 @@
*-------------------------------------------------------------------------
*/
int_f
h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen)
h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen)
{
char *c_dimname = NULL;
int_f ret_value = 0;
/*
* convert FORTRAN name to C name
*/
if(*dimnamelen != 0)
if(NULL == (c_dimname = (char *)HD5f2cstring(dimname, (size_t)*dimnamelen)))
HGOTO_DONE(FAIL)
@ -78,17 +78,17 @@ h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen)
*-------------------------------------------------------------------------
*/
int_f
h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx)
h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx)
{
int_f ret_value = 0;
/*
* call H5DSset_scale function.
*/
if(H5DSattach_scale( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx ) < 0)
HGOTO_DONE(FAIL)
done:
return ret_value;
@ -111,17 +111,17 @@ h5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx)
*-------------------------------------------------------------------------
*/
int_f
h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx)
h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx)
{
int_f ret_value = 0;
/*
* call H5DSset_scale function.
*/
if(H5DSdetach_scale( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx ) < 0)
HGOTO_DONE(FAIL)
done:
return ret_value;
@ -144,11 +144,11 @@ h5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx)
*-------------------------------------------------------------------------
*/
int_f
h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached)
h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached)
{
int_f ret_value = 0;
htri_t c_is_attached;
/*
* call H5DSis_attached function.
*/
@ -157,7 +157,7 @@ h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached)
HGOTO_DONE(FAIL)
*is_attached = (int_f)c_is_attached;
done:
return ret_value;
@ -179,20 +179,20 @@ h5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached)
*-------------------------------------------------------------------------
*/
int_f
h5dsis_scale_c( hid_t_f *did, int_f *is_scale)
h5dsis_scale_c( hid_t_f *did, int_f *is_scale)
{
int_f ret_value = 0;
htri_t c_is_scale;
/*
* call H5DSis_scale function.
*/
if((c_is_scale=H5DSis_scale( (hid_t)*did )) < 0)
HGOTO_DONE(FAIL)
*is_scale = (int_f)c_is_scale;
done:
return ret_value;
@ -215,15 +215,15 @@ h5dsis_scale_c( hid_t_f *did, int_f *is_scale)
*-------------------------------------------------------------------------
*/
int_f
h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen)
h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen)
{
char *c_label = NULL;
int_f ret_value = 0;
/*
* convert FORTRAN name to C name
*/
if(NULL == (c_label = (char *)HD5f2cstring(label, (size_t)*labellen)))
HGOTO_DONE(FAIL)
@ -258,7 +258,7 @@ h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen)
*-------------------------------------------------------------------------
*/
int_f
h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size)
h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size)
{
char *c_label = NULL;
ssize_t size_c = -1;
@ -273,18 +273,18 @@ h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size)
/*
* call H5DSget_label function.
*/
if( (size_c = H5DSget_label( (hid_t)*did, (unsigned)*idx, c_label, (size_t)*size+1)) < 0)
HGOTO_DONE(FAIL)
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
HD5packFstring(c_label, _fcdtocp(label), (size_t)*size);
done:
*size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the
*size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the
* trailing NULL in the length calculation, Ref. HDFFV-7596 */
if(c_label) HDfree(c_label);
return ret_value;
@ -307,7 +307,7 @@ done:
*-------------------------------------------------------------------------
*/
int_f
h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size)
h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size)
{
char *c_scale_name = NULL;
ssize_t size_c = -1;
@ -322,7 +322,7 @@ h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size)
/*
* call H5DSget_scale_name function.
*/
if( (size_c = H5DSget_scale_name( (hid_t)*did, c_scale_name, (size_t)*size+1)) < 0)
HGOTO_DONE(FAIL)
@ -354,17 +354,17 @@ done:
*-------------------------------------------------------------------------
*/
int_f
h5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales)
h5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales)
{
int_f ret_value = 0;
/*
* call H5DSset_scale function.
*/
if( (*num_scales = (int_f)H5DSget_num_scales( (hid_t)*did, (unsigned)*idx)) < 0)
HGOTO_DONE(FAIL)
done:
return ret_value;

View File

@ -174,9 +174,9 @@ h5ltread_dataset_string_c (hid_t_f *loc_id,
HDF5_HL_F90CSTUBDLL
int_f
h5ltpath_valid_c(hid_t_f *loc_id,
_fcd path,
size_t_f *pathlen,
h5ltpath_valid_c(hid_t_f *loc_id,
_fcd path,
size_t_f *pathlen,
int_f *check_object_valid_c);
/*-------------------------------------------------------------------------
@ -429,7 +429,7 @@ h5tbget_field_info_c(hid_t_f *loc_id,
size_t_f *namelen2,
size_t_f *lenmax,
_fcd field_names,
size_t_f *maxlen_out);
size_t_f *maxlen_out);
#endif /* _H5LTf90proto_H */

View File

@ -438,7 +438,7 @@ h5ltget_attribute_c(hid_t_f *loc_id,
else
goto done;
}
if (ret < 0)
goto done;
@ -512,7 +512,7 @@ h5ltget_attribute_string_c(hid_t_f *loc_id,
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
HD5packFstring(c_buf, _fcdtocp(buf), (size_t)*buf_size);
HD5packFstring(c_buf, _fcdtocp(buf), (size_t)*buf_size);
ret_value = 0;
@ -893,9 +893,9 @@ done:
*/
int_f
h5ltpath_valid_c(hid_t_f *loc_id,
_fcd path,
size_t_f *pathlen,
h5ltpath_valid_c(hid_t_f *loc_id,
_fcd path,
size_t_f *pathlen,
int_f *check_object_valid_c)
{
htri_t ret = -1;
@ -907,7 +907,7 @@ h5ltpath_valid_c(hid_t_f *loc_id,
*/
if( NULL == (c_path = (char *)HD5f2cstring(path, (size_t)*pathlen)))
goto done;
check_object_valid = FALSE;
if(*check_object_valid_c == 1)
check_object_valid = TRUE;

View File

@ -142,7 +142,7 @@ int_f
h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *namelen,
_fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size,
size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size,
void *fill_data, int_f *compress,
void *fill_data, int_f *compress,
size_t_f *char_len_field_names, /* field_names lengths */
size_t_f *max_char_size_field_names, /* char len of fields */
char *field_names,
@ -233,7 +233,7 @@ done:
/*-------------------------------------------------------------------------
* Function: h5tbread_table_c
*
* Purpose: Call H5TBread_table using F2003 features
* Purpose: Call H5TBread_table using F2003 features
*
* Return: Success: 0, Failure: -1
*
@ -261,7 +261,7 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel
*/
if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL)
if(NULL == (c_dst_offset = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
if(NULL == (c_dst_sizes = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields)))
@ -270,7 +270,7 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel
for(i = 0; i < c_nfields; i++) {
c_dst_offset[i] = (size_t)dst_offset[i];
c_dst_sizes[i] = (size_t)dst_sizes[i];
} /* end for */
} /* end for */
/*
* call H5TBread_table function.
@ -514,7 +514,7 @@ h5tbinsert_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *name
* call H5TBinsert_field function.
*/
if(H5TBinsert_field((hid_t)*loc_id, c_name, c_name1, (hid_t)*field_type,
if(H5TBinsert_field((hid_t)*loc_id, c_name, c_name1, (hid_t)*field_type,
(hsize_t)*position, NULL, buf) < 0)
HGOTO_DONE(FAIL)
@ -683,7 +683,7 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n
if(H5TBget_field_info((hid_t)*loc_id, c_name, c_field_names, c_field_sizes,
c_field_offsets, &c_type_size) < 0)
HGOTO_DONE(FAIL)
/* return values */
/* names array */
@ -709,7 +709,7 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n
field_offsets[i] = (size_t_f)c_field_offsets[i];
} /* end for */
*maxlen_out = (size_t_f)length;
*maxlen_out = (size_t_f)length;
done:
if(c_name)

View File

@ -36,7 +36,7 @@ check_PROGRAMS=$(TEST_PROG)
LIBOBJS=$(top_builddir)/fortran/test/tf_gen.o
LDADD=$(LIBOBJS) $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5)
LDADD=$(LIBOBJS) $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5)
# Source files for the programs
tstds_SOURCES=tstds.F90

View File

@ -90,7 +90,7 @@ H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fi
* This routine is copied from the fast forward feature branch: features/hdf5_ff
* src/H5FF.c:H5DOappend() with the following modifications:
* 1) Remove and replace macro calls such as
* FUNC_ENTER_API, H5TRACE, HGOTO_ERROR
* FUNC_ENTER_API, H5TRACE, HGOTO_ERROR
* accordingly because hl does not have these macros
* 2) Replace H5I_get_type() by H5Iget_type()
* 3) Replace H5P_isa_class() by H5Pisa_class()
@ -103,7 +103,7 @@ H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fi
*-------------------------------------------------------------------------
*/
herr_t
H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension,
H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension,
hid_t memtype, const void *buf)
{
hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */
@ -161,7 +161,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension,
if(H5Sget_simple_extent_dims(space_id, size, NULL) < 0)
goto done;
/* Adjust the dimension size of the requested dimension,
/* Adjust the dimension size of the requested dimension,
* but first record the old dimension size
*/
old_size = size[axis];

View File

@ -44,7 +44,7 @@ herr_t H5IMmake_image_8bit( hid_t loc_id,
hsize_t dims[IMAGE8_RANK];
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* Initialize the image dimensions */
@ -104,9 +104,9 @@ herr_t H5IMmake_image_24bit( hid_t loc_id,
hsize_t dims[IMAGE24_RANK];
/* check the arguments */
if (interlace == NULL)
if (interlace == NULL)
return -1;
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
@ -180,7 +180,7 @@ static herr_t find_palette(hid_t loc_id,
int ret = H5_ITER_CONT;
/* check the arguments */
if (name == NULL)
if (name == NULL)
return -1;
/* Shut compiler up */
@ -261,9 +261,9 @@ herr_t H5IMget_image_info( hid_t loc_id,
int has_attr;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
if (interlace == NULL)
if (interlace == NULL)
return -1;
/*assume initially we have no palettes attached*/
@ -430,7 +430,7 @@ herr_t H5IMread_image( hid_t loc_id,
hid_t did;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* Open the dataset. */
@ -483,7 +483,7 @@ herr_t H5IMmake_palette( hid_t loc_id,
int has_pal;
/* check the arguments */
if (pal_name == NULL)
if (pal_name == NULL)
return -1;
/* Check if the dataset already exists */
@ -548,11 +548,11 @@ herr_t H5IMlink_palette( hid_t loc_id,
hsize_t dim_ref;
int ok_pal;
/* check the arguments */
if (image_name == NULL)
if (image_name == NULL)
return -1;
if (pal_name == NULL)
if (pal_name == NULL)
return -1;
/* The image dataset may or may not have the attribute "PALETTE"
@ -717,9 +717,9 @@ herr_t H5IMunlink_palette( hid_t loc_id,
int ok_pal, has_pal;
/* check the arguments */
if(image_name == NULL)
if(image_name == NULL)
return -1;
if(pal_name == NULL)
if(pal_name == NULL)
return -1;
/* Try to find the palette dataset */
@ -818,7 +818,7 @@ herr_t H5IMget_npalettes( hid_t loc_id,
int has_pal;
/* check the arguments */
if(image_name == NULL)
if(image_name == NULL)
return -1;
/*assume initially we have no palettes attached*/
@ -916,7 +916,7 @@ herr_t H5IMget_palette_info( hid_t loc_id,
hsize_t pal_maxdims[2];
/* check the arguments */
if (image_name == NULL)
if (image_name == NULL)
return -1;
/* Open the dataset. */
@ -1030,9 +1030,9 @@ herr_t H5IMget_palette( hid_t loc_id,
hid_t pal_id;
/* check the arguments */
if (image_name == NULL)
if (image_name == NULL)
return -1;
if (pal_data == NULL)
if (pal_data == NULL)
return -1;
@ -1133,7 +1133,7 @@ herr_t H5IMis_image( hid_t loc_id,
herr_t ret;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* Assume initially fail condition */
@ -1237,7 +1237,7 @@ herr_t H5IMis_palette( hid_t loc_id,
herr_t ret;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* Assume initially fail condition */

View File

@ -209,7 +209,7 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[]/*OUT*/, hid_t par_tid)
valid = FALSE;
end_of_fields = TRUE;
break;
case '\\': /* escape character */
++fields_ptr; /* skip it */
if(*fields_ptr == '\0')
@ -241,7 +241,7 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[]/*OUT*/, hid_t par_tid)
gotcomma = TRUE;
break;
default:
default:
*cur++ = *fields_ptr++;
gotmember = TRUE;
break;
@ -438,7 +438,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
/* Get dataset's dataspace */
if((sid = H5Dget_space(did)) < 0)
goto done;
/* Get the number of dimensions */
if((ndims = H5Sget_simple_extent_ndims(sid)) < 0)
goto done;
@ -508,7 +508,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
/* Get the total size of the dataset's datatypes */
if(0 == (tot_tsize = H5LD_get_dset_type_size(did, NULL)))
goto done;
/* Allocate memory for reading in the elements in the dataset selection */
if(NULL == (sav_buf = tmp_buf = (char *)HDcalloc((size_t)num_elmts, tot_tsize)))
goto done;

View File

@ -29,19 +29,19 @@ char *myinput;
size_t indent = 0;
/* File Image operations
A file image is a representation of an HDF5 file in a memory
buffer. In order to perform operations on an image in a similar way
/* File Image operations
A file image is a representation of an HDF5 file in a memory
buffer. In order to perform operations on an image in a similar way
to a file, the application buffer is copied to a FAPL buffer, which
in turn is copied to a VFD buffer. Buffer copying can decrease
performance, especially when using large file images. A solution to
this issue is to simulate the copying of the application buffer,
when actually the same buffer is used for the FAPL and the VFD.
This is implemented by using callbacks that simulate the standard
functions for memory management (additional callbacks are used for
the management of associated data structures). From the application
standpoint, a file handle can be obtained from a file image by using
in turn is copied to a VFD buffer. Buffer copying can decrease
performance, especially when using large file images. A solution to
this issue is to simulate the copying of the application buffer,
when actually the same buffer is used for the FAPL and the VFD.
This is implemented by using callbacks that simulate the standard
functions for memory management (additional callbacks are used for
the management of associated data structures). From the application
standpoint, a file handle can be obtained from a file image by using
the API routine H5LTopen_file_image(). This function takes a flag
argument that indicates the HDF5 library how to handle the given image;
several flag values can be combined by using the bitwise OR operator.
@ -61,9 +61,9 @@ size_t indent = 0;
well. The application is responsible to release the image buffer.
*/
/* Data structure to pass application data to callbacks. */
/* Data structure to pass application data to callbacks. */
typedef struct {
void *app_image_ptr; /* Pointer to application buffer */
void *app_image_ptr; /* Pointer to application buffer */
size_t app_image_size; /* Size of application buffer */
void *fapl_image_ptr; /* Pointer to FAPL buffer */
size_t fapl_image_size; /* Size of FAPL buffer */
@ -88,17 +88,17 @@ static herr_t udata_free(void *udata);
/*-------------------------------------------------------------------------
* Function: image_malloc
* Function: image_malloc
*
* Purpose: Simulates malloc() function to avoid copying file images.
* The application buffer is set to the buffer on only one FAPL.
* Then the FAPL buffer can be copied to other FAPL buffers or
* to only one VFD buffer.
* to only one VFD buffer.
*
* Return: Address of "allocated" buffer, if successful. Otherwise, it returns
* NULL.
*
* Programmer: Christian Chilan
* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@ -109,23 +109,23 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata)
{
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
void * return_value = NULL;
/* callback is only used if the application buffer is not actually copied */
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
switch ( file_image_op ) {
/* the app buffer is "copied" to only one FAPL. Afterwards, FAPLs can be "copied" */
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET:
if (udata->app_image_ptr == NULL)
if (udata->app_image_ptr == NULL)
goto out;
if (udata->app_image_size != size)
if (udata->app_image_size != size)
goto out;
if (udata->fapl_image_ptr != NULL)
if (udata->fapl_image_ptr != NULL)
goto out;
if (udata->fapl_image_size != 0)
if (udata->fapl_image_size != 0)
goto out;
if (udata->fapl_ref_count != 0)
if (udata->fapl_ref_count != 0)
goto out;
udata->fapl_image_ptr = udata->app_image_ptr;
@ -135,11 +135,11 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata)
break;
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY:
if (udata->fapl_image_ptr == NULL)
if (udata->fapl_image_ptr == NULL)
goto out;
if (udata->fapl_image_size != size)
if (udata->fapl_image_size != size)
goto out;
if (udata->fapl_ref_count == 0)
if (udata->fapl_ref_count == 0)
goto out;
return_value = udata->fapl_image_ptr;
@ -151,17 +151,17 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata)
case H5FD_FILE_IMAGE_OP_FILE_OPEN:
/* FAPL buffer is "copied" to only one VFD buffer */
if (udata->vfd_image_ptr != NULL)
if (udata->vfd_image_ptr != NULL)
goto out;
if (udata->vfd_image_size != 0)
if (udata->vfd_image_size != 0)
goto out;
if (udata->vfd_ref_count != 0)
if (udata->vfd_ref_count != 0)
goto out;
if (udata->fapl_image_ptr == NULL)
if (udata->fapl_image_ptr == NULL)
goto out;
if (udata->fapl_image_size != size)
if (udata->fapl_image_size != size)
goto out;
if (udata->fapl_ref_count == 0)
if (udata->fapl_ref_count == 0)
goto out;
udata->vfd_image_ptr = udata->fapl_image_ptr;
@ -189,15 +189,15 @@ out:
/*-------------------------------------------------------------------------
* Function: image_memcpy
*
* Purpose: Simulates memcpy() function to avoid copying file images.
* Purpose: Simulates memcpy() function to avoid copying file images.
* The image buffer can be set to only one FAPL buffer, and
* "copied" to only one VFD buffer. The FAPL buffer can be
* "copied" to other FAPLs buffers.
* "copied" to other FAPLs buffers.
*
* Return: The address of the destination buffer, if successful. Otherwise, it
* returns NULL.
*
* Programmer: Christian Chilan
* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@ -210,31 +210,31 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
/* callback is only used if the application buffer is not actually copied */
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
switch(file_image_op) {
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET:
if (dest != udata->fapl_image_ptr)
if (dest != udata->fapl_image_ptr)
goto out;
if (src != udata->app_image_ptr)
if (src != udata->app_image_ptr)
goto out;
if (size != udata->fapl_image_size)
if (size != udata->fapl_image_size)
goto out;
if (size != udata->app_image_size)
if (size != udata->app_image_size)
goto out;
if (udata->fapl_ref_count == 0)
if (udata->fapl_ref_count == 0)
goto out;
break;
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY:
if (dest != udata->fapl_image_ptr)
if (dest != udata->fapl_image_ptr)
goto out;
if (src != udata->fapl_image_ptr)
if (src != udata->fapl_image_ptr)
goto out;
if (size != udata->fapl_image_size)
if (size != udata->fapl_image_size)
goto out;
if (udata->fapl_ref_count < 2)
if (udata->fapl_ref_count < 2)
goto out;
break;
@ -242,17 +242,17 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file
goto out;
case H5FD_FILE_IMAGE_OP_FILE_OPEN:
if (dest != udata->vfd_image_ptr)
if (dest != udata->vfd_image_ptr)
goto out;
if (src != udata->fapl_image_ptr)
if (src != udata->fapl_image_ptr)
goto out;
if (size != udata->vfd_image_size)
if (size != udata->vfd_image_size)
goto out;
if (size != udata->fapl_image_size)
if (size != udata->fapl_image_size)
goto out;
if (udata->fapl_ref_count == 0)
if (udata->fapl_ref_count == 0)
goto out;
if (udata->vfd_ref_count != 1)
if (udata->vfd_ref_count != 1)
goto out;
break;
@ -273,15 +273,15 @@ out:
/*-------------------------------------------------------------------------
* Function: image_realloc
* Function: image_realloc
*
* Purpose: Reallocates the shared application image buffer and updates data
* structures that manage buffer "copying".
*
* Return: Address of reallocated buffer, if successful. Otherwise, it returns
* NULL.
* structures that manage buffer "copying".
*
* Programmer: Christian Chilan
* Return: Address of reallocated buffer, if successful. Otherwise, it returns
* NULL.
*
* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@ -294,29 +294,29 @@ image_realloc(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *
void * return_value = NULL;
/* callback is only used if the application buffer is not actually copied */
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
/* realloc() is not allowed when the HDF5 library won't release the image
/* realloc() is not allowed when the HDF5 library won't release the image
buffer because reallocation may change the address of the buffer. The
new address cannot be communicated to the application to release it. */
if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)
goto out;
if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)
goto out;
/* realloc() is not allowed if the image is open in read-only mode */
if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW))
goto out;
if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW))
goto out;
if (file_image_op == H5FD_FILE_IMAGE_OP_FILE_RESIZE) {
if (udata->vfd_image_ptr != ptr)
goto out;
if (udata->vfd_image_ptr != ptr)
goto out;
if (udata->vfd_ref_count != 1)
if (udata->vfd_ref_count != 1)
goto out;
if (NULL == (udata->vfd_image_ptr = HDrealloc(ptr, size)))
goto out;
goto out;
udata->vfd_image_size = size;
return_value = udata->vfd_image_ptr;
} /* end if */
@ -337,9 +337,9 @@ out:
* reference counters. Shared application buffer is actually
* deallocated if there are no outstanding references.
*
* Return: SUCCEED or FAIL
* Return: SUCCEED or FAIL
*
* Programmer: Christian Chilan
* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@ -351,19 +351,19 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata)
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
/* callback is only used if the application buffer is not actually copied */
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
switch(file_image_op) {
case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE:
if (udata->fapl_image_ptr != ptr)
if (udata->fapl_image_ptr != ptr)
goto out;
if (udata->fapl_ref_count == 0)
if (udata->fapl_ref_count == 0)
goto out;
udata->fapl_ref_count--;
/* release the shared buffer only if indicated by the respective flag and there are no outstanding references */
/* release the shared buffer only if indicated by the respective flag and there are no outstanding references */
if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 &&
!(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) {
HDfree(udata->fapl_image_ptr);
@ -374,14 +374,14 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata)
break;
case H5FD_FILE_IMAGE_OP_FILE_CLOSE:
if (udata->vfd_image_ptr != ptr)
if (udata->vfd_image_ptr != ptr)
goto out;
if (udata->vfd_ref_count != 1)
if (udata->vfd_ref_count != 1)
goto out;
udata->vfd_ref_count--;
/* release the shared buffer only if indicated by the respective flag and there are no outstanding references */
/* release the shared buffer only if indicated by the respective flag and there are no outstanding references */
if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 &&
!(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) {
HDfree(udata->vfd_image_ptr);
@ -410,7 +410,7 @@ out:
/*-------------------------------------------------------------------------
* Function: udata_copy
* Function: udata_copy
*
* Purpose: Simulates the copying of the user data structure utilized in the
* management of the "copying" of file images.
@ -418,7 +418,7 @@ out:
* Return: Address of "newly allocated" structure, if successful. Otherwise, it
* returns NULL.
*
* Programmer: Christian Chilan
* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@ -430,9 +430,9 @@ udata_copy(void *_udata)
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
/* callback is only used if the application buffer is not actually copied */
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
if (udata->ref_count == 0)
if (udata->ref_count == 0)
goto out;
udata->ref_count++;
@ -449,11 +449,11 @@ out:
*
* Purpose: Simulates deallocation of the user data structure utilized in the
* management of the "copying" of file images. The data structure is
* actually deallocated when there are no outstanding references.
* actually deallocated when there are no outstanding references.
*
* Return: SUCCEED or FAIL
* Return: SUCCEED or FAIL
*
* Programmer: Christian Chilan
* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@ -465,9 +465,9 @@ udata_free(void *_udata)
H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata;
/* callback is only used if the application buffer is not actually copied */
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY))
goto out;
if (udata->ref_count == 0)
if (udata->ref_count == 0)
goto out;
udata->ref_count--;
@ -479,7 +479,7 @@ udata_free(void *_udata)
return(SUCCEED);
out:
out:
return(FAIL);
} /* end udata_free */
@ -522,7 +522,7 @@ H5LT_make_dataset_numerical( hid_t loc_id,
hid_t did = -1, sid = -1;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* Create the data space for the dataset. */
@ -801,7 +801,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id,
size_t size;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* create a string data type */
@ -852,11 +852,11 @@ out:
/*-------------------------------------------------------------------------
* Function: H5LTopen_file_image
*
* Purpose: Open a user supplied file image using the core file driver.
* Purpose: Open a user supplied file image using the core file driver.
*
* Return: File identifier, Failure: -1
*
* Programmer: Christian Chilan
* Programmer: Christian Chilan
*
* Date: October 3, 2011
*
@ -871,22 +871,22 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
size_t min_incr = 65536; /* Minimum buffer increment */
double buf_prcnt = 0.1f; /* Percentage of buffer size to set
as increment */
static long file_name_counter;
H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy,
&image_realloc, &image_free,
&udata_copy, &udata_free,
static long file_name_counter;
H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy,
&image_realloc, &image_free,
&udata_copy, &udata_free,
(void *)NULL};
/* check arguments */
if (buf_ptr == NULL)
if (buf_ptr == NULL)
goto out;
if (buf_size == 0)
if (buf_size == 0)
goto out;
if (flags & (unsigned)~(H5LT_FILE_IMAGE_ALL))
goto out;
/* Create FAPL to transmit file image */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto out;
/* set allocation increment to a percentage of the supplied buffer size, or
@ -898,7 +898,7 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
alloc_incr = min_incr;
/* Configure FAPL to use the core file driver */
if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0)
if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0)
goto out;
/* Set callbacks for file image ops ONLY if the file image is NOT copied */
@ -932,10 +932,10 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
} /* end if */
/* Assign file image in user buffer to FAPL */
if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0)
if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0)
goto out;
/* set file open flags */
/* set file open flags */
if (flags & H5LT_FILE_IMAGE_OPEN_RW)
file_open_flags = H5F_ACC_RDWR;
else
@ -943,17 +943,17 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
/* define a unique file name */
HDsnprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++);
/* Assign file image in FAPL to the core file driver */
if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0)
/* Assign file image in FAPL to the core file driver */
if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0)
goto out;
/* Close FAPL */
if (H5Pclose(fapl) < 0)
if (H5Pclose(fapl) < 0)
goto out;
/* Return file identifier */
return file_id;
/* Return file identifier */
return file_id;
out:
H5E_BEGIN_TRY {
@ -983,7 +983,7 @@ H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void
hid_t did;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* Open the dataset. */
@ -1178,7 +1178,7 @@ herr_t H5LTread_dataset_string( hid_t loc_id,
hid_t tid = -1;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* Open the dataset. */
@ -1231,7 +1231,7 @@ herr_t H5LTget_dataset_ndims( hid_t loc_id,
hid_t sid = -1;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* Open the dataset. */
@ -1291,7 +1291,7 @@ herr_t H5LTget_dataset_info( hid_t loc_id,
hid_t sid = -1;
/* check the arguments */
if (dset_name == NULL)
if (dset_name == NULL)
return -1;
/* open the dataset. */
@ -1368,9 +1368,9 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_
int ret = 0;
/* check the arguments */
if (name == NULL)
if (name == NULL)
return ret;
/* Shut the compiler up */
loc_id = loc_id;
linfo = linfo;
@ -1460,11 +1460,11 @@ herr_t H5LTset_attribute_string( hid_t loc_id,
size_t attr_size;
/* check the arguments */
if (obj_name == NULL)
if (obj_name == NULL)
return -1;
if (attr_name == NULL)
if (attr_name == NULL)
return -1;
if (attr_data == NULL)
if (attr_data == NULL)
return -1;
/* Open the object */
@ -1557,9 +1557,9 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id,
int has_attr;
/* check the arguments */
if (obj_name == NULL)
if (obj_name == NULL)
return -1;
if (attr_name == NULL)
if (attr_name == NULL)
return -1;
/* Open the object */
@ -1974,7 +1974,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
int ret = H5_ITER_CONT;
/* check the arguments */
if (name == NULL)
if (name == NULL)
return H5_ITER_CONT;
/* Shut compiler up */
@ -2076,9 +2076,9 @@ herr_t H5LTget_attribute_ndims( hid_t loc_id,
hid_t obj_id;
/* check the arguments */
if (obj_name == NULL)
if (obj_name == NULL)
return -1;
if (attr_name == NULL)
if (attr_name == NULL)
return -1;
/* Open the object */
@ -2149,9 +2149,9 @@ herr_t H5LTget_attribute_info( hid_t loc_id,
hid_t obj_id;
/* check the arguments */
if (obj_name == NULL)
if (obj_name == NULL)
return -1;
if (attr_name == NULL)
if (attr_name == NULL)
return -1;
/* Open the object */
@ -2230,7 +2230,7 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type)
hid_t type_id;
/* check the arguments */
if (text == NULL)
if (text == NULL)
return -1;
if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG)
@ -2273,7 +2273,7 @@ out:
*
*-------------------------------------------------------------------------
*/
static char*
static char*
realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str_to_add)
{
size_t size_str_to_add, size_str;
@ -2298,7 +2298,7 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str
/* find the size of the current buffer */
size_str = HDstrlen(buf);
/* Check to make sure the appended string does not
/* Check to make sure the appended string does not
* extend past the allocated buffer; if it does then truncate the string
*/
if(size_str < *len - 1) {
@ -2555,7 +2555,7 @@ char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *sl
if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, NULL)))
goto out;
if(lang != H5LT_DDL) {
HDsnprintf(dt_str, *slen, "only DDL is supported for now");
goto out;
@ -3122,9 +3122,9 @@ herr_t H5LTget_attribute_string( hid_t loc_id,
hid_t obj_id;
/* check the arguments */
if (obj_name == NULL)
if (obj_name == NULL)
return -1;
if (attr_name == NULL)
if (attr_name == NULL)
return -1;
/* Open the object */
@ -3132,9 +3132,9 @@ herr_t H5LTget_attribute_string( hid_t loc_id,
return -1;
/* Get the attribute */
if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 )
if ( H5LT_get_attribute_disk( obj_id, attr_name, data ) < 0 )
{
H5Oclose(obj_id);
H5Oclose(obj_id);
return -1;
}
@ -3548,9 +3548,9 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id,
hid_t attr_id = -1;
/* check the arguments */
if (obj_name == NULL)
if (obj_name == NULL)
return -1;
if (attr_name == NULL)
if (attr_name == NULL)
return -1;
/* Open the object */
@ -3790,7 +3790,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
ret_value = FALSE;
goto done;
}
/* Determine if link resolves to an actual object */
if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
ret_value = FAIL;

Some files were not shown because too many files have changed in this diff Show More