summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-04-03 21:41:28 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-04-03 21:41:28 (GMT)
commit5630846ea34f29b45aecdb431f846327c4fde9e1 (patch)
tree83e65a0feb757f39472e70d2168048d091cfed50 /testpar
parent820b4dc39136072bccad1455fc0232ec9e710d58 (diff)
parentb9e5e2af4e31b0a60c2d2f6421fb1b3cb9aa0564 (diff)
downloadhdf5-5630846ea34f29b45aecdb431f846327c4fde9e1.zip
hdf5-5630846ea34f29b45aecdb431f846327c4fde9e1.tar.gz
hdf5-5630846ea34f29b45aecdb431f846327c4fde9e1.tar.bz2
[svn-r26724] - merge from trunk & fix conflicts.
- fix bug in opending an already open named datatype. - fix dynamically loaded VOL plugin support with new changes coming in.
Diffstat (limited to 'testpar')
-rw-r--r--testpar/CMakeLists.txt8
-rw-r--r--testpar/Makefile.am5
-rw-r--r--testpar/Makefile.in51
-rw-r--r--testpar/t_cache.c3
-rw-r--r--testpar/t_dset.c30
-rw-r--r--testpar/t_filter_read.c25
-rw-r--r--testpar/t_pflush1.c11
-rw-r--r--testpar/t_pflush2.c6
-rw-r--r--testpar/t_prestart.c138
-rw-r--r--testpar/t_pshutdown.c127
-rw-r--r--testpar/t_shapesame.c3
11 files changed, 337 insertions, 70 deletions
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index 8c631a3..70e0246 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.8.11)
+cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_TEST_PAR)
#-----------------------------------------------------------------------------
@@ -29,14 +29,14 @@ set (testphdf5_SRCS
#-- Adding test for testhdf5
add_executable (testphdf5 ${testphdf5_SRCS})
TARGET_NAMING (testphdf5 ${LIB_TYPE})
-TARGET_C_PROPERTIES (testphdf5 " " " ")
+TARGET_C_PROPERTIES (testphdf5 ${LIB_TYPE} " " " ")
target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
set_target_properties (testphdf5 PROPERTIES FOLDER test/par)
MACRO (ADD_H5P_EXE file)
add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c)
TARGET_NAMING (${file} ${LIB_TYPE})
- TARGET_C_PROPERTIES (${file} " " " ")
+ TARGET_C_PROPERTIES (${file} ${LIB_TYPE} " " " ")
target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
set_target_properties (${file} PROPERTIES FOLDER test/par)
ENDMACRO (ADD_H5P_EXE file)
@@ -46,6 +46,8 @@ set (H5P_TESTS
t_cache
t_pflush1
t_pflush2
+ t_pshutdown
+ t_prestart
t_shapesame
)
diff --git a/testpar/Makefile.am b/testpar/Makefile.am
index 448f745..1eae439 100644
--- a/testpar/Makefile.am
+++ b/testpar/Makefile.am
@@ -25,7 +25,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test
# Test programs. These are our main targets.
#
-TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_shapesame
+TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_shapesame
check_PROGRAMS = $(TEST_PROG_PARA)
@@ -39,7 +39,8 @@ LDADD = $(LIBH5TEST) $(LIBHDF5)
# Temporary files
# MPItest.h5 is from t_mpi
# Para*.h5 are from testphdf
+# shutdown.h5 is from t_pshutdown
# go is used for debugging. See testphdf5.c.
-CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 go
+CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 shutdown.h5 go
include $(top_srcdir)/config/conclude.am
diff --git a/testpar/Makefile.in b/testpar/Makefile.in
index fef13bd..7787a65 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -103,7 +103,8 @@ check_PROGRAMS = $(am__EXEEXT_1)
TESTS =
subdir = testpar
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
+ $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
@@ -111,7 +112,8 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = t_mpi$(EXEEXT) testphdf5$(EXEEXT) t_cache$(EXEEXT) \
- t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) t_shapesame$(EXEEXT)
+ t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) t_pshutdown$(EXEEXT) \
+ t_prestart$(EXEEXT) t_shapesame$(EXEEXT)
t_cache_SOURCES = t_cache.c
t_cache_OBJECTS = t_cache.$(OBJEXT)
t_cache_LDADD = $(LDADD)
@@ -132,6 +134,14 @@ t_pflush2_SOURCES = t_pflush2.c
t_pflush2_OBJECTS = t_pflush2.$(OBJEXT)
t_pflush2_LDADD = $(LDADD)
t_pflush2_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5)
+t_prestart_SOURCES = t_prestart.c
+t_prestart_OBJECTS = t_prestart.$(OBJEXT)
+t_prestart_LDADD = $(LDADD)
+t_prestart_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5)
+t_pshutdown_SOURCES = t_pshutdown.c
+t_pshutdown_OBJECTS = t_pshutdown.$(OBJEXT)
+t_pshutdown_LDADD = $(LDADD)
+t_pshutdown_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5)
t_shapesame_SOURCES = t_shapesame.c
t_shapesame_OBJECTS = t_shapesame.$(OBJEXT)
t_shapesame_LDADD = $(LDADD)
@@ -178,10 +188,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_shapesame.c \
- $(testphdf5_SOURCES)
-DIST_SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_shapesame.c \
- $(testphdf5_SOURCES)
+SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_prestart.c \
+ t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES)
+DIST_SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_prestart.c \
+ t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -425,7 +435,6 @@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
AM_MAKEFLAGS = @AM_MAKEFLAGS@
AR = @AR@
-AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -457,7 +466,6 @@ DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
-DYNAMIC_DIRS = @DYNAMIC_DIRS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -476,17 +484,14 @@ FCFLAGS_f90 = @FCFLAGS_f90@
FCLIBS = @FCLIBS@
FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
-FILTERS = @FILTERS@
FSEARCH_DIRS = @FSEARCH_DIRS@
GREP = @GREP@
H5_CFLAGS = @H5_CFLAGS@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
-H5_CXX_SHARED = @H5_CXX_SHARED@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
H5_LDFLAGS = @H5_LDFLAGS@
-H5_LONE_COLON = @H5_LONE_COLON@
H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
@@ -549,7 +554,6 @@ R_INTEGER = @R_INTEGER@
R_LARGE = @R_LARGE@
SEARCH = @SEARCH@
SED = @SED@
-SETX = @SETX@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIZE_T = @SIZE_T@
@@ -564,10 +568,6 @@ TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
-USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@
-USE_FILTER_NBIT = @USE_FILTER_NBIT@
-USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@
-USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
VERSION = @VERSION@
@@ -681,18 +681,19 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chkexe files are used to mark tests that have run successfully.
# .chklog files are output from those tests.
-# *.clog are from the MPE option.
+# *.clog and *.clog2 are from the MPE option.
# Temporary files
# MPItest.h5 is from t_mpi
# Para*.h5 are from testphdf
+# shutdown.h5 is from t_pshutdown
# go is used for debugging. See testphdf5.c.
-CHECK_CLEANFILES = *.chkexe *.chklog *.clog MPItest.h5 Para*.h5 \
- CacheTestDummy.h5 go
+CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 MPItest.h5 \
+ Para*.h5 CacheTestDummy.h5 shutdown.h5 go
# Test programs. These are our main targets.
#
-TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_shapesame
+TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_shapesame
testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \
t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c \
t_prop.c
@@ -781,6 +782,14 @@ t_pflush2$(EXEEXT): $(t_pflush2_OBJECTS) $(t_pflush2_DEPENDENCIES) $(EXTRA_t_pfl
@rm -f t_pflush2$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_pflush2_OBJECTS) $(t_pflush2_LDADD) $(LIBS)
+t_prestart$(EXEEXT): $(t_prestart_OBJECTS) $(t_prestart_DEPENDENCIES) $(EXTRA_t_prestart_DEPENDENCIES)
+ @rm -f t_prestart$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(t_prestart_OBJECTS) $(t_prestart_LDADD) $(LIBS)
+
+t_pshutdown$(EXEEXT): $(t_pshutdown_OBJECTS) $(t_pshutdown_DEPENDENCIES) $(EXTRA_t_pshutdown_DEPENDENCIES)
+ @rm -f t_pshutdown$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(t_pshutdown_OBJECTS) $(t_pshutdown_LDADD) $(LIBS)
+
t_shapesame$(EXEEXT): $(t_shapesame_OBJECTS) $(t_shapesame_DEPENDENCIES) $(EXTRA_t_shapesame_DEPENDENCIES)
@rm -f t_shapesame$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_shapesame_OBJECTS) $(t_shapesame_LDADD) $(LIBS)
@@ -807,7 +816,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_pflush1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_pflush2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_ph5basic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_prestart.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_prop.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_pshutdown.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_shapesame.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_span_tree.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testphdf5.Po@am__quote@
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index cffe832..f875a76 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -4245,7 +4245,6 @@ setup_rand(void)
unsigned predefined_seeds[3] = {33402, 33505, 33422};
unsigned seed;
struct timeval tv;
- struct timezone tz;
if ( ( use_predefined_seeds ) &&
( world_mpi_size == num_predefined_seeds ) ) {
@@ -4261,7 +4260,7 @@ setup_rand(void)
} else {
- if ( HDgettimeofday(&tv, &tz) != 0 ) {
+ if ( HDgettimeofday(&tv, NULL) != 0 ) {
nerrors++;
if ( verbose ) {
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index e27cddc..ae022fb 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -2502,7 +2502,6 @@ extend_readAll(void)
* Example of using the parallel HDF5 library to read a compressed
* dataset in an HDF5 file with collective parallel access support.
*/
-
#ifdef H5_HAVE_FILTER_DEFLATE
void
compress_readAll(void)
@@ -3451,7 +3450,6 @@ actual_io_mode_tests(void) {
#define DSET_NOCOLCAUSE "nocolcause"
#define NELM 2
#define FILE_EXTERNAL "nocolcause_extern.data"
-#undef H5_HAVE_FILTER_FLETCHER32
static void
test_no_collective_cause_mode(int selection_mode)
{
@@ -3487,9 +3485,9 @@ test_no_collective_cause_mode(int selection_mode)
hid_t file_space = -1;
hsize_t chunk_dims[RANK];
herr_t ret;
-#ifdef H5_HAVE_FILTER_FLETCHER32
+#ifdef LATER /* fletcher32 */
H5Z_filter_t filter_info;
-#endif
+#endif /* LATER */
/* set to global value as default */
int l_facc_type = facc_type;
char message[256];
@@ -3521,7 +3519,7 @@ test_no_collective_cause_mode(int selection_mode)
is_chunked = 0;
}
-#ifdef H5_HAVE_FILTER_FLETCHER32
+#ifdef LATER /* fletcher32 */
if (selection_mode & TEST_FILTERS) {
ret = H5Zfilter_avail(H5Z_FILTER_FLETCHER32);
VRFY ((ret >=0 ), "Fletcher32 filter is available.\n");
@@ -3532,7 +3530,7 @@ test_no_collective_cause_mode(int selection_mode)
ret = H5Pset_fletcher32(dcpl);
VRFY((ret >= 0),"set filter (flecher32) succeeded");
}
-#endif /* H5_HAVE_FILTER_FLETCHER32 */
+#endif /* LATER */
if (selection_mode & TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES) {
sid = H5Screate(H5S_NULL);
@@ -3613,13 +3611,13 @@ test_no_collective_cause_mode(int selection_mode)
no_collective_cause_global_expected |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET;
}
-#ifdef H5_HAVE_FILTER_FLETCHER32
+#ifdef LATER /* fletcher32 */
if (selection_mode & TEST_FILTERS) {
test_name = "Broken Collective I/O - Filter is required";
no_collective_cause_local_expected |= H5D_MPIO_FILTERS;
no_collective_cause_global_expected |= H5D_MPIO_FILTERS;
}
-#endif /* H5_HAVE_FILTER_FLETCHER32 */
+#endif /* LATER */
if (selection_mode & TEST_COLLECTIVE) {
test_name = "Broken Collective I/O - Not Broken";
@@ -3808,9 +3806,9 @@ test_no_collective_cause_mode_filter(int selection_mode)
hid_t file_space = -1;
hsize_t chunk_dims[RANK];
herr_t ret;
-#ifdef H5_HAVE_FILTER_FLETCHER32
+#ifdef LATER /* fletcher32 */
H5Z_filter_t filter_info;
-#endif
+#endif /* LATER */
char message[256];
/* Set up MPI parameters */
@@ -3829,7 +3827,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
VRFY((dcpl >= 0), "dataset creation plist created successfully");
if (selection_mode == TEST_FILTERS_READ ) {
-#ifdef H5_HAVE_FILTER_FLETCHER32
+#ifdef LATER /* fletcher32 */
ret = H5Zfilter_avail(H5Z_FILTER_FLETCHER32);
VRFY ((ret >=0 ), "Fletcher32 filter is available.\n");
@@ -3838,7 +3836,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
ret = H5Pset_fletcher32(dcpl);
VRFY((ret >= 0),"set filter (flecher32) succeeded");
-#endif /* H5_HAVE_FILTER_FLETCHER32 */
+#endif /* LATER */
}
else {
VRFY(0, "Unexpected mode, only test for TEST_FILTERS_READ.");
@@ -3876,12 +3874,12 @@ test_no_collective_cause_mode_filter(int selection_mode)
dcpl, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded");
-#ifdef H5_HAVE_FILTER_FLETCHER32
+#ifdef LATER /* fletcher32 */
/* Set expected cause */
test_name = "Broken Collective I/O - Filter is required";
no_collective_cause_local_expected = H5D_MPIO_FILTERS;
no_collective_cause_global_expected = H5D_MPIO_FILTERS;
-#endif
+#endif /* LATER */
/* Get the file dataspace */
file_space = H5Dget_space(dataset);
@@ -4010,13 +4008,13 @@ no_collective_cause_tests(void)
test_no_collective_cause_mode (TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES);
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT);
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL);
-#ifdef H5_HAVE_FILTER_FLETCHER32
+#ifdef LATER /* fletcher32 */
/* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
* H5Dwrite is ready for mpio + filter feature.
*/
/* test_no_collective_cause_mode (TEST_FILTERS); */
test_no_collective_cause_mode_filter (TEST_FILTERS_READ);
-#endif
+#endif /* LATER */
/*
* Test combined causes
diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c
index 7e782ce..5e1cd04 100644
--- a/testpar/t_filter_read.c
+++ b/testpar/t_filter_read.c
@@ -215,9 +215,7 @@ test_filter_read(void)
hsize_t null_size; /* Size of dataset without filters */
herr_t hrc;
const char *filename;
-#ifdef H5_HAVE_FILTER_FLETCHER32
hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */
-#endif /* H5_HAVE_FILTER_FLETCHER32 */
#ifdef H5_HAVE_FILTER_DEFLATE
hsize_t deflate_size; /* Size of dataset with deflate filter */
@@ -229,13 +227,11 @@ test_filter_read(void)
unsigned szip_pixels_per_block=4;
#endif /* H5_HAVE_FILTER_SZIP */
-#ifdef H5_HAVE_FILTER_SHUFFLE
hsize_t shuffle_size; /* Size of dataset with shuffle filter */
-#endif /* H5_HAVE_FILTER_SHUFFLE */
-#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
- hsize_t combo_size; /* Size of dataset with shuffle+deflate filter */
-#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
+#if(defined H5_HAVE_FILTER_DEFLATE || defined H5_HAVE_FILTER_SZIP)
+ hsize_t combo_size; /* Size of dataset with multiple filters */
+#endif /* H5_HAVE_FILTER_DEFLATE || H5_HAVE_FILTER_SZIP */
filename = GetTestParameters();
@@ -262,7 +258,6 @@ test_filter_read(void)
* STEP 1: Test Fletcher32 Checksum by itself.
*----------------------------------------------------------
*/
-#ifdef H5_HAVE_FILTER_FLETCHER32
dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0,"H5Pset_filter");
@@ -280,7 +275,6 @@ test_filter_read(void)
hrc = H5Pclose (dc);
VRFY(hrc>=0, "H5Pclose");
-#endif /* H5_HAVE_FILTER_FLETCHER32 */
/*----------------------------------------------------------
* STEP 2: Test deflation by itself.
@@ -305,6 +299,7 @@ test_filter_read(void)
#endif /* H5_HAVE_FILTER_DEFLATE */
+
/*----------------------------------------------------------
* STEP 3: Test szip compression by itself.
*----------------------------------------------------------
@@ -328,11 +323,12 @@ test_filter_read(void)
}
#endif /* H5_HAVE_FILTER_SZIP */
+
/*----------------------------------------------------------
* STEP 4: Test shuffling by itself.
*----------------------------------------------------------
*/
-#ifdef H5_HAVE_FILTER_SHUFFLE
+
dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0, "H5Pcreate");
@@ -349,13 +345,12 @@ test_filter_read(void)
hrc = H5Pclose (dc);
VRFY(hrc>=0, "H5Pclose");
-#endif /* H5_HAVE_FILTER_SHUFFLE */
/*----------------------------------------------------------
* STEP 5: Test shuffle + deflate + checksum in any order.
*----------------------------------------------------------
*/
-#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
+#ifdef H5_HAVE_FILTER_DEFLATE
/* Testing shuffle+deflate+checksum filters (checksum first) */
dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0, "H5Pcreate");
@@ -400,13 +395,13 @@ test_filter_read(void)
hrc = H5Pclose (dc);
VRFY(hrc>=0, "H5Pclose");
-#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
+#endif /* H5_HAVE_FILTER_DEFLATE */
/*----------------------------------------------------------
* STEP 6: Test shuffle + szip + checksum in any order.
*----------------------------------------------------------
*/
-#if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
+#ifdef H5_HAVE_FILTER_SZIP
/* Testing shuffle+szip(with encoder)+checksum filters(checksum first) */
dc = H5Pcreate(H5P_DATASET_CREATE);
@@ -458,6 +453,6 @@ test_filter_read(void)
VRFY(hrc>=0, "H5Pclose");
}
-#endif /* H5_HAVE_FILTER_SZIP && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
+#endif /* H5_HAVE_FILTER_SZIP */
}
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c
index ebe5c38..1bcfeb8 100644
--- a/testpar/t_pflush1.c
+++ b/testpar/t_pflush1.c
@@ -164,12 +164,9 @@ main(int argc, char* argv[])
} /* end else */
/*
- * Some systems like Linux with mpich, if you just _exit without MPI_Finalize
- * called, it would terminate but left the launching process waiting forever.
- * OTHO, some systems like AIX do not like files not closed when MPI_Finalize
- * is called. So, we need to get the MPI file handles, close them by hand,
- * then MPI_Finalize. Then the _exit is still needed to stop at_exit from
- * happening in some systems.
+ * Some systems like AIX do not like files not closed when MPI_Finalize
+ * is called. So, we need to get the MPI file handles, close them by hand.
+ * Then the _exit is still needed to stop at_exit from happening in some systems.
* Note that MPIO VFD returns the address of the file-handle in the VFD struct
* because MPI_File_close wants to modify the file-handle variable.
*/
@@ -195,13 +192,11 @@ main(int argc, char* argv[])
fflush(stdout);
fflush(stderr);
- MPI_Finalize();
HD_exit(0);
error:
fflush(stdout);
fflush(stderr);
- MPI_Finalize();
HD_exit(1);
}
diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c
index 743a3d3..03f7c82 100644
--- a/testpar/t_pflush2.c
+++ b/testpar/t_pflush2.c
@@ -101,13 +101,17 @@ check_file(char* name, hid_t fapl)
if(H5Dclose(dset) < 0) goto error;
if(H5Fclose(file) < 0) goto error;
if(H5Pclose(plist) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
H5Pclose(plist);
+ H5Gclose(groups);
+ H5Dclose(dset);
+ H5Fclose(file);
+ H5Sclose(space);
} H5E_END_TRY;
return 1;
}
diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c
new file mode 100644
index 0000000..fab4a7c
--- /dev/null
+++ b/testpar/t_prestart.c
@@ -0,0 +1,138 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Mohamad Chaarawi
+ * February 2015
+ *
+ * Purpose: This test opens a file created by the t_pshutdown program
+ * and makes sure the objects created are there.
+ */
+
+#include "testphdf5.h"
+
+int nerrors = 0; /* errors count */
+
+const char *FILENAME[] = {
+ "shutdown",
+ NULL
+};
+
+int
+main (int argc, char **argv)
+{
+ hid_t file_id, dset_id, grp_id;
+ hid_t fapl, sid, mem_dataspace;
+ herr_t ret;
+ char filename[1024];
+ int mpi_size, mpi_rank, ndims, i, j;
+ MPI_Comm comm = MPI_COMM_WORLD;
+ MPI_Info info = MPI_INFO_NULL;
+ hsize_t dims[RANK];
+ hsize_t start[RANK];
+ hsize_t count[RANK];
+ hsize_t stride[RANK];
+ hsize_t block[RANK];
+ DATATYPE *data_array = NULL, *dataptr; /* data buffer */
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_size(comm, &mpi_size);
+ MPI_Comm_rank(comm, &mpi_rank);
+
+ if(MAINPROCESS)
+ TESTING("proper shutdown of HDF5 library");
+
+ /* Set up file access property list with parallel I/O access */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((fapl >= 0), "H5Pcreate succeeded");
+ ret = H5Pset_fapl_mpio(fapl, comm, info);
+ VRFY((ret >= 0), "");
+
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
+ VRFY((file_id >= 0), "H5Fopen succeeded");
+
+ grp_id = H5Gopen2(file_id, "Group", H5P_DEFAULT);
+ VRFY((grp_id >= 0), "H5Gopen succeeded");
+
+ dset_id = H5Dopen2(grp_id, "Dataset", H5P_DEFAULT);
+ VRFY((dset_id >= 0), "H5Dopen succeeded");
+
+ sid = H5Dget_space(dset_id);
+ VRFY((dset_id >= 0), "H5Dget_space succeeded");
+
+ ndims = H5Sget_simple_extent_dims(sid, dims, NULL);
+ VRFY((ndims == 2), "H5Sget_simple_extent_dims succeeded");
+ VRFY(dims[0] == ROW_FACTOR*mpi_size, "Wrong dataset dimensions");
+ VRFY(dims[1] == COL_FACTOR*mpi_size, "Wrong dataset dimensions");
+
+ /* allocate memory for data buffer */
+ data_array = (DATATYPE *)HDmalloc(dims[0]*dims[1]*sizeof(DATATYPE));
+ VRFY((data_array != NULL), "data_array HDmalloc succeeded");
+
+ /* Each process takes a slabs of rows. */
+ block[0] = dims[0]/mpi_size;
+ block[1] = dims[1];
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = mpi_rank*block[0];
+ start[1] = 0;
+
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
+
+ /* create a memory dataspace independently */
+ mem_dataspace = H5Screate_simple (RANK, block, NULL);
+ VRFY((mem_dataspace >= 0), "");
+
+ /* write data independently */
+ ret = H5Dread(dset_id, H5T_NATIVE_INT, mem_dataspace, sid,
+ H5P_DEFAULT, data_array);
+ VRFY((ret >= 0), "H5Dwrite succeeded");
+
+ dataptr = data_array;
+
+ for (i=0; i < block[0]; i++){
+ for (j=0; j < block[1]; j++){
+ if(*dataptr != mpi_rank+1) {
+ printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
+ (unsigned long)i, (unsigned long)j,
+ (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
+ mpi_rank+1, *(dataptr));
+ nerrors ++;
+ }
+ dataptr++;
+ }
+ }
+ MPI_Finalize();
+ HDremove(filename);
+
+ /* release data buffers */
+ if(data_array)
+ HDfree(data_array);
+
+ nerrors += GetTestNumErrs();
+
+ if(MAINPROCESS) {
+ if(0 == nerrors)
+ PASSED()
+ else
+ H5_FAILED()
+ }
+
+ return (nerrors!=0);
+}
diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c
new file mode 100644
index 0000000..be9734f
--- /dev/null
+++ b/testpar/t_pshutdown.c
@@ -0,0 +1,127 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Mohamad Chaarawi
+ * February 2015
+ *
+ * Purpose: This test creates a file and a bunch of objects in the
+ * file and then calls MPI_Finalize without closing anything. The
+ * library should exercise the attribute callback destroy attached to
+ * MPI_COMM_SELF and terminate the HDF5 library closing all open
+ * objects. The t_prestart test will read back the file and make sure
+ * all created objects are there.
+ */
+
+#include "testphdf5.h"
+
+int nerrors = 0; /* errors count */
+
+const char *FILENAME[] = {
+ "shutdown",
+ NULL
+};
+
+int
+main (int argc, char **argv)
+{
+ hid_t file_id, dset_id, grp_id;
+ hid_t fapl, sid, mem_dataspace;
+ hsize_t dims[RANK], i;
+ herr_t ret;
+ char filename[1024];
+ int mpi_size, mpi_rank;
+ MPI_Comm comm = MPI_COMM_WORLD;
+ MPI_Info info = MPI_INFO_NULL;
+ hsize_t start[RANK];
+ hsize_t count[RANK];
+ hsize_t stride[RANK];
+ hsize_t block[RANK];
+ DATATYPE *data_array = NULL; /* data buffer */
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_size(comm, &mpi_size);
+ MPI_Comm_rank(comm, &mpi_rank);
+
+ if(MAINPROCESS)
+ TESTING("proper shutdown of HDF5 library");
+
+ /* Set up file access property list with parallel I/O access */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((fapl >= 0), "H5Pcreate succeeded");
+ ret = H5Pset_fapl_mpio(fapl, comm, info);
+ VRFY((ret >= 0), "");
+
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ VRFY((file_id >= 0), "H5Fcreate succeeded");
+ grp_id = H5Gcreate2(file_id, "Group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((grp_id >= 0), "H5Gcreate succeeded");
+
+ dims[0] = ROW_FACTOR*mpi_size;
+ dims[1] = COL_FACTOR*mpi_size;
+ sid = H5Screate_simple (RANK, dims, NULL);
+ VRFY((sid >= 0), "H5Screate_simple succeeded");
+
+ dset_id = H5Dcreate2(grp_id, "Dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dset_id >= 0), "H5Dcreate succeeded");
+
+ /* allocate memory for data buffer */
+ data_array = (DATATYPE *)HDmalloc(dims[0]*dims[1]*sizeof(DATATYPE));
+ VRFY((data_array != NULL), "data_array HDmalloc succeeded");
+
+ /* Each process takes a slabs of rows. */
+ block[0] = dims[0]/mpi_size;
+ block[1] = dims[1];
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = mpi_rank*block[0];
+ start[1] = 0;
+
+ /* put some trivial data in the data_array */
+ for(i=0 ; i<dims[0]*dims[1]; i++)
+ data_array[i] = mpi_rank + 1;
+
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
+
+ /* create a memory dataspace independently */
+ mem_dataspace = H5Screate_simple (RANK, block, NULL);
+ VRFY((mem_dataspace >= 0), "");
+
+ /* write data independently */
+ ret = H5Dwrite(dset_id, H5T_NATIVE_INT, mem_dataspace, sid,
+ H5P_DEFAULT, data_array);
+ VRFY((ret >= 0), "H5Dwrite succeeded");
+
+ /* release data buffers */
+ if(data_array)
+ HDfree(data_array);
+
+ MPI_Finalize();
+
+ nerrors += GetTestNumErrs();
+
+ if(MAINPROCESS) {
+ if(0 == nerrors)
+ PASSED()
+ else
+ H5_FAILED()
+ }
+
+ return (nerrors!=0);
+}
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c
index d167687..9088470 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -5142,10 +5142,7 @@ int main(int argc, char **argv)
printf("Shape Same tests finished with no errors\n");
printf("===================================\n");
}
- /* close HDF5 library */
- H5close();
- /* MPI_Finalize must be called AFTER H5close which may use MPI calls */
MPI_Finalize();
/* cannot just return (nerrors) because exit code is limited to 1byte */