diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-04-01 15:42:43 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-04-01 15:42:43 (GMT) |
commit | 72e8017eadf211257caceb43095b2aed76e81632 (patch) | |
tree | 0fae8d91bc2587a7b3b44129c5afaf37d4842098 /testpar | |
parent | d4c2e51d1e255fde2c0b2e359078cfd0de82720a (diff) | |
parent | c86aedeba1f683daaf0289435450fd4e518fecc4 (diff) | |
download | hdf5-72e8017eadf211257caceb43095b2aed76e81632.zip hdf5-72e8017eadf211257caceb43095b2aed76e81632.tar.gz hdf5-72e8017eadf211257caceb43095b2aed76e81632.tar.bz2 |
[svn-r24940] merge from trunk.
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/CMakeLists.txt | 30 | ||||
-rw-r--r-- | testpar/CMakeTests.cmake | 40 | ||||
-rw-r--r-- | testpar/Makefile.am | 9 | ||||
-rw-r--r-- | testpar/Makefile.in | 551 | ||||
-rw-r--r-- | testpar/t_coll_chunk.c | 410 | ||||
-rw-r--r-- | testpar/t_dset.c | 539 | ||||
-rw-r--r-- | testpar/t_file.c | 3 | ||||
-rw-r--r-- | testpar/t_mdset.c | 34 | ||||
-rw-r--r-- | testpar/t_ph5basic.c | 114 | ||||
-rw-r--r-- | testpar/t_posix_compliant.c | 927 | ||||
-rw-r--r-- | testpar/t_shapesame.c | 23 | ||||
-rw-r--r-- | testpar/t_span_tree.c | 14 | ||||
-rw-r--r-- | testpar/testph5.sh.in | 77 | ||||
-rw-r--r-- | testpar/testphdf5.c | 22 | ||||
-rw-r--r-- | testpar/testphdf5.h | 27 |
15 files changed, 1276 insertions, 1544 deletions
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 30cdcda..6d4f4d4 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) @@ -12,7 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Define Tests #----------------------------------------------------------------------------- -SET (testphdf5_SRCS +set (testphdf5_SRCS ${HDF5_TEST_PAR_SOURCE_DIR}/testphdf5.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_dset.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_file.c @@ -27,21 +27,21 @@ SET (testphdf5_SRCS ) #-- Adding test for testhdf5 -ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) +add_executable (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (testphdf5 " " " ") -TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) -SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par) +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) + add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_C_PROPERTIES (${file} " " " ") - TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) - SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par) + 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) -SET (H5P_TESTS +set (H5P_TESTS t_mpi # t_posix_compliant t_cache @@ -50,12 +50,12 @@ SET (H5P_TESTS t_shapesame ) -FOREACH (testp ${H5P_TESTS}) +foreach (testp ${H5P_TESTS}) ADD_H5P_EXE(${testp}) -ENDFOREACH (testp ${H5P_TESTS}) +endforeach (testp ${H5P_TESTS}) -IF (NOT WIN32) +if (NOT WIN32) ADD_H5P_EXE(t_posix_compliant) -ENDIF (NOT WIN32) +endif (NOT WIN32) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index bc8fc90..5ac96e6 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -5,21 +5,17 @@ ############################################################################## ############################################################################## -ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:testphdf5>) +add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:testphdf5>) -FOREACH (testp ${H5P_TESTS}) - ADD_TEST (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:${testp}>) -ENDFOREACH (testp ${H5P_TESTS}) +foreach (testp ${H5P_TESTS}) + add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:${testp}>) +endforeach (testp ${H5P_TESTS}) SET_TESTS_PROPERTIES(TEST_PAR_t_pflush2 PROPERTIES DEPENDS TEST_PAR_t_pflush1) -IF (NOT WIN32) - ADD_TEST (NAME TEST_PAR_t_posix_compliant COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:t_posix_compliant>) -ENDIF (NOT WIN32) - -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -28,19 +24,19 @@ IF (HDF5_TEST_VFD) family ) - SET (H5P_VFD_TESTS + set (H5P_VFD_TESTS t_pflush1 t_pflush2 ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - FOREACH (test ${H5P_VFD_TESTS}) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + foreach (test ${H5P_VFD_TESTS}) + add_test ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${test}>" @@ -51,13 +47,13 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDFOREACH (test ${H5P_VFD_TESTS}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endforeach (test ${H5P_VFD_TESTS}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) diff --git a/testpar/Makefile.am b/testpar/Makefile.am index e934f08..448f745 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -21,15 +21,13 @@ include $(top_srcdir)/config/commence.am -INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/test +AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -# Test programs and scripts. These are our main targets. +# Test programs. These are our main targets. # -TEST_PROG_PARA=t_mpi t_posix_compliant testphdf5 t_cache t_pflush1 t_pflush2 t_shapesame -TEST_SCRIPT_PARA=testph5.sh +TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_shapesame check_PROGRAMS = $(TEST_PROG_PARA) -check_SCRIPTS= $(TEST_SCRIPT) 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 \ @@ -43,6 +41,5 @@ LDADD = $(LIBH5TEST) $(LIBHDF5) # Para*.h5 are from testphdf # go is used for debugging. See testphdf5.c. CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 go -DISTCLEANFILES=testph5.sh include $(top_srcdir)/config/conclude.am diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 6ddfef2..559606f 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -31,23 +31,51 @@ # hdf5 Parallel Library Test Makefile(.in) # VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -66,11 +94,11 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/testph5.sh.in $(top_srcdir)/bin/depcomp \ - $(top_srcdir)/bin/mkinstalldirs \ - $(top_srcdir)/config/commence.am \ - $(top_srcdir)/config/conclude.am COPYING +DIST_COMMON = $(top_srcdir)/config/commence.am \ + $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ + $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/test-driver \ + COPYING check_PROGRAMS = $(am__EXEEXT_1) TESTS = subdir = testpar @@ -80,11 +108,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = testph5.sh +CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__EXEEXT_1 = t_mpi$(EXEEXT) t_posix_compliant$(EXEEXT) \ - testphdf5$(EXEEXT) t_cache$(EXEEXT) t_pflush1$(EXEEXT) \ - t_pflush2$(EXEEXT) t_shapesame$(EXEEXT) +am__EXEEXT_1 = t_mpi$(EXEEXT) testphdf5$(EXEEXT) t_cache$(EXEEXT) \ + t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) t_shapesame$(EXEEXT) t_cache_SOURCES = t_cache.c t_cache_OBJECTS = t_cache.$(OBJEXT) t_cache_LDADD = $(LDADD) @@ -105,10 +132,6 @@ t_pflush2_SOURCES = t_pflush2.c t_pflush2_OBJECTS = t_pflush2.$(OBJEXT) t_pflush2_LDADD = $(LDADD) t_pflush2_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) -t_posix_compliant_SOURCES = t_posix_compliant.c -t_posix_compliant_OBJECTS = t_posix_compliant.$(OBJEXT) -t_posix_compliant_LDADD = $(LDADD) -t_posix_compliant_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) t_shapesame_SOURCES = t_shapesame.c t_shapesame_OBJECTS = t_shapesame.$(OBJEXT) t_shapesame_LDADD = $(LDADD) @@ -155,21 +178,234 @@ 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_posix_compliant.c t_shapesame.c $(testphdf5_SOURCES) -DIST_SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c \ - t_posix_compliant.c t_shapesame.c $(testphdf5_SOURCES) +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) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no -am__tty_colors = $(am__tty_colors_dummy) +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.sh.log=.log) +SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver +SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@ @@ -181,7 +417,8 @@ AMTAR = @AMTAR@ # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ -AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ +AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ + -I$(top_srcdir)/test AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ @@ -241,7 +478,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ @@ -456,13 +692,10 @@ TRACE = perl $(top_srcdir)/bin/trace # go is used for debugging. See testphdf5.c. CHECK_CLEANFILES = *.chkexe *.chklog *.clog MPItest.h5 Para*.h5 \ CacheTestDummy.h5 go -INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test -# Test programs and scripts. These are our main targets. +# Test programs. These are our main targets. # -TEST_PROG_PARA = t_mpi t_posix_compliant testphdf5 t_cache t_pflush1 t_pflush2 t_shapesame -TEST_SCRIPT_PARA = testph5.sh -check_SCRIPTS = $(TEST_SCRIPT) +TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 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 @@ -470,7 +703,6 @@ testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \ # The tests all depend on the hdf5 library and the test library LDADD = $(LIBH5TEST) $(LIBHDF5) -DISTCLEANFILES = testph5.sh # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -494,7 +726,7 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) all: all-am .SUFFIXES: -.SUFFIXES: .c .lo .o .obj +.SUFFIXES: .c .lo .log .o .obj .sh .sh$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -526,8 +758,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -testph5.sh: $(top_builddir)/config.status $(srcdir)/testph5.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ @@ -537,24 +767,27 @@ clean-checkPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + t_cache$(EXEEXT): $(t_cache_OBJECTS) $(t_cache_DEPENDENCIES) $(EXTRA_t_cache_DEPENDENCIES) @rm -f t_cache$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_cache_OBJECTS) $(t_cache_LDADD) $(LIBS) + t_mpi$(EXEEXT): $(t_mpi_OBJECTS) $(t_mpi_DEPENDENCIES) $(EXTRA_t_mpi_DEPENDENCIES) @rm -f t_mpi$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_mpi_OBJECTS) $(t_mpi_LDADD) $(LIBS) + t_pflush1$(EXEEXT): $(t_pflush1_OBJECTS) $(t_pflush1_DEPENDENCIES) $(EXTRA_t_pflush1_DEPENDENCIES) @rm -f t_pflush1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_pflush1_OBJECTS) $(t_pflush1_LDADD) $(LIBS) + t_pflush2$(EXEEXT): $(t_pflush2_OBJECTS) $(t_pflush2_DEPENDENCIES) $(EXTRA_t_pflush2_DEPENDENCIES) @rm -f t_pflush2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_pflush2_OBJECTS) $(t_pflush2_LDADD) $(LIBS) -t_posix_compliant$(EXEEXT): $(t_posix_compliant_OBJECTS) $(t_posix_compliant_DEPENDENCIES) $(EXTRA_t_posix_compliant_DEPENDENCIES) - @rm -f t_posix_compliant$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(t_posix_compliant_OBJECTS) $(t_posix_compliant_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) + testphdf5$(EXEEXT): $(testphdf5_OBJECTS) $(testphdf5_DEPENDENCIES) $(EXTRA_testphdf5_DEPENDENCIES) @rm -f testphdf5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testphdf5_OBJECTS) $(testphdf5_LDADD) $(LIBS) @@ -577,7 +810,6 @@ 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_posix_compliant.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_prop.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@ @@ -588,14 +820,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -610,26 +842,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -641,15 +862,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -658,9 +875,10 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am -cscopelist: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP)'; \ +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ @@ -676,6 +894,151 @@ cscopelist: $(HEADERS) $(SOURCES) $(LISP) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.sh.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.sh$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -707,7 +1070,7 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile all-local @@ -732,13 +1095,15 @@ install-strip: "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -816,19 +1181,19 @@ uninstall-am: .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \ - clean clean-checkPROGRAMS clean-generic clean-libtool \ - cscopelist ctags distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am tags uninstall uninstall-am + pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am # List all build rules defined by HDF5 Makefiles as "PHONY" targets here. diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 5dac36f..11d7b10 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -16,6 +16,9 @@ #include "testphdf5.h" #include "H5Dprivate.h" +#define HYPER 1 +#define POINT 2 +#define ALL 3 /* some commonly used routines for collective chunk IO tests*/ @@ -23,14 +26,17 @@ static void ccslab_set(int mpi_rank,int mpi_size,hsize_t start[],hsize_t count[] hsize_t stride[],hsize_t block[],int mode); static void ccdataset_fill(hsize_t start[],hsize_t count[], - hsize_t stride[],hsize_t block[],DATATYPE*dataset); + hsize_t stride[],hsize_t block[],DATATYPE*dataset, + int mem_selection); static void ccdataset_print(hsize_t start[],hsize_t block[],DATATYPE*dataset); static int ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], - hsize_t block[], DATATYPE *dataset, DATATYPE *original); + hsize_t block[], DATATYPE *dataset, DATATYPE *original, + int mem_selection); -static void coll_chunktest(const char* filename,int chunk_factor,int select_factor,int api_option); +static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, + int api_option, int file_selection, int mem_selection, int mode); /*------------------------------------------------------------------------- @@ -73,7 +79,15 @@ coll_chunk1(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_CONT, API_NONE); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); } @@ -117,7 +131,15 @@ coll_chunk2(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, HYPER, IN_ORDER); } @@ -164,7 +186,15 @@ coll_chunk3(void) int mpi_size; MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -208,7 +238,15 @@ coll_chunk4(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -252,7 +290,15 @@ coll_chunk5(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -298,7 +344,15 @@ coll_chunk6(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -342,7 +396,15 @@ coll_chunk7(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -386,7 +448,15 @@ coll_chunk8(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -430,7 +500,15 @@ coll_chunk9(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -474,7 +552,15 @@ coll_chunk10(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, HYPER, IN_ORDER); } @@ -505,14 +591,16 @@ coll_chunk10(void) *------------------------------------------------------------------------- */ - static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, - int api_option) + int api_option, + int file_selection, + int mem_selection, + int mode) { - hid_t file,dataset, file_dataspace; + hid_t file, dataset, file_dataspace, mem_dataspace; hid_t acc_plist,xfer_plist,crp_plist; hsize_t dims[RANK], chunk_dims[RANK]; @@ -525,20 +613,24 @@ coll_chunktest(const char* filename, unsigned prop_value; #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ - hbool_t use_gpfs = FALSE; int mpi_size,mpi_rank; herr_t status; MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i; + /* set up MPI parameters */ MPI_Comm_size(comm,&mpi_size); MPI_Comm_rank(comm,&mpi_rank); /* Create the data space */ - acc_plist = create_faccess_plist(comm,info,facc_type,use_gpfs); + acc_plist = create_faccess_plist(comm,info,facc_type); VRFY((acc_plist >= 0),""); file = H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_plist); @@ -551,7 +643,6 @@ coll_chunktest(const char* filename, dims[0] = SPACE_DIM1*mpi_size; dims[1] = SPACE_DIM2; - /* allocate memory for data buffer */ data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); @@ -559,9 +650,25 @@ coll_chunktest(const char* filename, /* set up dimensions of the slab this process accesses */ ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + /* set up the coords array selection */ + num_points = block[0] * block[1] * count[0] * count[1]; + coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + point_set(start, count, stride, block, num_points, coords, mode); + file_dataspace = H5Screate_simple(2, dims, NULL); VRFY((file_dataspace >= 0), "file dataspace created succeeded"); + if(ALL != mem_selection) { + mem_dataspace = H5Screate_simple(2, dims, NULL); + VRFY((mem_dataspace >= 0), "mem dataspace created succeeded"); + } + else { + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + } + crp_plist = H5Pcreate(H5P_DATASET_CREATE); VRFY((crp_plist >= 0),""); @@ -569,25 +676,67 @@ coll_chunktest(const char* filename, chunk_dims[0] = dims[0]/chunk_factor; /* to decrease the testing time, maintain bigger chunk size */ - (chunk_factor == 1) ? (chunk_dims[1] = SPACE_DIM2) : (chunk_dims[1] = SPACE_DIM2/2); status = H5Pset_chunk(crp_plist, 2, chunk_dims); VRFY((status >= 0),"chunk creation property list succeeded"); dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT, - file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); + file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); VRFY((dataset >= 0),"dataset created succeeded"); status = H5Pclose(crp_plist); VRFY((status >= 0), ""); /*put some trivial data in the data array */ - ccdataset_fill(start, stride, count,block, data_array1); + ccdataset_fill(start, stride, count,block, data_array1, mem_selection); + MESG("data_array initialized"); - status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, - count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + switch (file_selection) { + case HYPER: + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(file_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(file_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + switch (mem_selection) { + case HYPER: + status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(mem_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(mem_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } /* set up the collective transfer property list */ xfer_plist = H5Pcreate(H5P_DATASET_XFER); @@ -604,33 +753,39 @@ coll_chunktest(const char* filename, case API_LINK_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO); VRFY((status>= 0),"collective chunk optimization succeeded"); - break; + break; + case API_MULTI_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO); VRFY((status>= 0),"collective chunk optimization succeeded "); - break; + break; + case API_LINK_TRUE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,2); VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); - break; + break; + case API_LINK_FALSE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,6); VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); - break; + break; + case API_MULTI_COLL: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50); VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); - break; + break; + case API_MULTI_IND: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100); VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); - break; + break; + default: - ; + ; } #ifdef H5_HAVE_INSTRUMENTED_LIBRARY @@ -641,44 +796,42 @@ coll_chunktest(const char* filename, status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - - break; + break; case API_MULTI_HARD: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - break; + break; case API_LINK_TRUE: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - - break; + break; case API_LINK_FALSE: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - break; + break; case API_MULTI_COLL: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - break; + break; case API_MULTI_IND: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - break; + break; default: ; @@ -687,7 +840,7 @@ coll_chunktest(const char* filename, #endif /* write data collectively */ - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, file_dataspace, + status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); VRFY((status >= 0),"dataset write succeeded"); @@ -698,32 +851,38 @@ coll_chunktest(const char* filename, status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_HARD_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO directly succeeded"); - break; + break; + case API_MULTI_HARD: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO optimization succeeded"); - break; + break; + case API_LINK_TRUE: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO succeeded"); - break; + break; + case API_LINK_FALSE: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set LINK IO transferring to multi-chunk IO succeeded"); - break; + break; + case API_MULTI_COLL: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO with optimization succeeded"); - break; + break; + case API_MULTI_IND: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set MULTI-CHUNK IO transferring to independent IO succeeded"); - break; + break; + default: ; } @@ -739,12 +898,15 @@ coll_chunktest(const char* filename, status = H5Sclose(file_dataspace); VRFY((status >= 0),""); + status = H5Sclose(mem_dataspace); + VRFY((status >= 0),""); + + status = H5Fclose(file); VRFY((status >= 0),""); if (data_array1) HDfree(data_array1); - /* Use collective read to verify the correctness of collective write. */ /* allocate memory for data buffer */ @@ -755,7 +917,7 @@ coll_chunktest(const char* filename, data_origin1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); - acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_plist = create_faccess_plist(comm, info, facc_type); VRFY((acc_plist >= 0),"MPIO creation property list succeeded"); file = H5Fopen(filename,H5F_ACC_RDONLY,acc_plist); @@ -771,15 +933,68 @@ coll_chunktest(const char* filename, /* set up dimensions of the slab this process accesses */ ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); - /* obtain the file dataspace*/ + /* obtain the file and mem dataspace*/ file_dataspace = H5Dget_space (dataset); VRFY((file_dataspace >= 0), ""); - status=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0), ""); + if (ALL != mem_selection) { + mem_dataspace = H5Dget_space (dataset); + VRFY((mem_dataspace >= 0), ""); + } + else { + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + } + + switch (file_selection) { + case HYPER: + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(file_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(file_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + switch (mem_selection) { + case HYPER: + status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(mem_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(mem_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } /* fill dataset with test data */ - ccdataset_fill(start, stride,count,block, data_origin1); + ccdataset_fill(start, stride,count,block, data_origin1, mem_selection); xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0),""); @@ -790,13 +1005,12 @@ coll_chunktest(const char* filename, VRFY((status>= 0),"set independent IO collectively succeeded"); } - - status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, file_dataspace, + status = H5Dread(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); VRFY((status >=0),"dataset read succeeded"); /* verify the read data with original expected data */ - status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1); + status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1, mem_selection); if (status) nerrors++; status = H5Pclose(xfer_plist); @@ -804,17 +1018,23 @@ coll_chunktest(const char* filename, /* close dataset collectively */ status=H5Dclose(dataset); - VRFY((status >= 0), ""); + VRFY((status >= 0), "H5Dclose"); /* release all IDs created */ - H5Sclose(file_dataspace); + status = H5Sclose(file_dataspace); + VRFY((status >= 0),"H5Sclose"); + + status = H5Sclose(mem_dataspace); + VRFY((status >= 0),"H5Sclose"); /* close the file collectively */ - H5Fclose(file); + status = H5Fclose(file); + VRFY((status >= 0),"H5Fclose"); /* release data buffers */ - if (data_array1) HDfree(data_array1); - if (data_origin1) HDfree(data_origin1); + if(coords) HDfree(coords); + if(data_array1) HDfree(data_array1); + if(data_origin1) HDfree(data_origin1); } @@ -933,12 +1153,12 @@ ccdataset_fill(hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[], - DATATYPE * dataset) + DATATYPE * dataset, + int mem_selection) { DATATYPE *dataptr = dataset; DATATYPE *tmptr; - hsize_t i,j,k1,k2; - + hsize_t i,j,k1,k2,k=0; /* put some trivial data in the data_array */ tmptr = dataptr; @@ -950,10 +1170,16 @@ ccdataset_fill(hsize_t start[], for(k2 = 0; k2 < count[1]; k2++) { for(j = 0;j < block[1]; j++) { - dataptr = tmptr + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ - start[1]+k2*stride[1]+j); + if (ALL != mem_selection) { + dataptr = tmptr + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ + start[1]+k2*stride[1]+j); + } + else { + dataptr = tmptr + k; + k++; + } - *dataptr = (DATATYPE)(k1+k2+i+j); + *dataptr = (DATATYPE)(k1+k2+i+j); } } } @@ -1000,9 +1226,10 @@ ccdataset_vrfy(hsize_t start[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, - DATATYPE *original) + DATATYPE *original, + int mem_selection) { - hsize_t i, j,k1,k2; + hsize_t i, j,k1,k2,k=0; int vrfyerrs; DATATYPE *dataptr,*oriptr; @@ -1020,26 +1247,31 @@ ccdataset_vrfy(hsize_t start[], vrfyerrs = 0; - for (k1 = 0; k1 < count[0];k1++) { - for(i = 0;i < block[0];i++) { - for(k2 = 0; k2<count[1];k2++) { - for(j=0;j<block[1];j++) { - - dataptr = dataset + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ - start[1]+k2*stride[1]+j); - oriptr = original + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ - start[1]+k2*stride[1]+j); - - if (*dataptr != *oriptr){ - if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ - printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n", - (unsigned long)i, (unsigned long)j, - *(original), *(dataset)); - } - } - } - } - } + for (k1=0;k1<count[0];k1++) { + for(i=0;i<block[0];i++) { + for(k2=0; k2<count[1];k2++) { + for(j=0;j<block[1];j++) { + if (ALL != mem_selection) { + dataptr = dataset + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ + start[1]+k2*stride[1]+j); + oriptr = original + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ + start[1]+k2*stride[1]+j); + } + else { + dataptr = dataset + k; + oriptr = original + k; + k++; + } + if (*dataptr != *oriptr){ + if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ + printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n", + (unsigned long)i, (unsigned long)j, + *(original), *(dataset)); + } + } + } + } + } } if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 246d2d9..2bc3b09 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -118,6 +118,54 @@ if(VERBOSE_MED){ } } +/* + * Setup the coordinates for point selection. + */ +void point_set(hsize_t start[], + hsize_t count[], + hsize_t stride[], + hsize_t block[], + size_t num_points, + hsize_t coords[], + int order) +{ + hsize_t i,j, k = 0, m ,n, s1 ,s2; + + HDcompile_assert(RANK == 2); + + if(OUT_OF_ORDER == order) + k = (num_points * RANK) - 1; + else if(IN_ORDER == order) + k = 0; + + s1 = start[0]; + s2 = start[1]; + + for(i = 0 ; i < count[0]; i++) + for(j = 0 ; j < count[1]; j++) + for(m = 0 ; m < block[0]; m++) + for(n = 0 ; n < block[1]; n++) + if(OUT_OF_ORDER == order) { + coords[k--] = s2 + (stride[1] * j) + n; + coords[k--] = s1 + (stride[0] * i) + m; + } + else if(IN_ORDER == order) { + coords[k++] = s1 + stride[0] * i + m; + coords[k++] = s2 + stride[1] * j + n; + } + + if(VERBOSE_MED) { + printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], + (unsigned long)(block[0] * block[1] * count[0] * count[1])); + k = 0; + for(i = 0; i < num_points ; i++) { + printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]); + k += 2; + } + } +} /* * Fill the dataset with trivial data for testing. @@ -231,7 +279,6 @@ dataset_writeInd(void) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ DATATYPE *data_array1 = NULL; /* data buffer */ const char *filename; @@ -262,7 +309,7 @@ dataset_writeInd(void) * CREATE AN HDF5 FILE WITH PARALLEL ACCESS * ---------------------------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* create the file collectively */ @@ -377,7 +424,6 @@ dataset_readInd(void) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ DATATYPE *data_array1 = NULL; /* data buffer */ DATATYPE *data_origin1 = NULL; /* expected data buffer */ const char *filename; @@ -407,7 +453,7 @@ dataset_readInd(void) VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ @@ -501,9 +547,9 @@ dataset_writeAll(void) hid_t sid; /* Dataspace ID */ hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ - hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */ + hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */ + hid_t dataset5, dataset6, dataset7; /* Dataset ID */ hid_t datatype; /* Datatype ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ DATATYPE *data_array1 = NULL; /* data buffer */ const char *filename; @@ -512,6 +558,11 @@ dataset_writeAll(void) hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i; + herr_t ret; /* Generic return value */ int mpi_size, mpi_rank; @@ -526,6 +577,11 @@ dataset_writeAll(void) MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + /* set up the coords array selection */ + num_points = dim1; + coords = (hsize_t *)HDmalloc(dim1 * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + /* allocate memory for data buffer */ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); @@ -534,7 +590,7 @@ dataset_writeAll(void) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* create the file collectively */ @@ -573,6 +629,13 @@ dataset_writeAll(void) dataset3 = H5Dcreate2(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((dataset3 >= 0), "H5Dcreate2 succeeded"); + dataset5 = H5Dcreate2(fid, DATASETNAME7, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset5 >= 0), "H5Dcreate2 succeeded"); + dataset6 = H5Dcreate2(fid, DATASETNAME8, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset6 >= 0), "H5Dcreate2 succeeded"); + dataset7 = H5Dcreate2(fid, DATASETNAME9, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset7 >= 0), "H5Dcreate2 succeeded"); + /* release 2-D space ID created */ H5Sclose(sid); @@ -827,8 +890,6 @@ dataset_writeAll(void) VRFY((ret>= 0),"set independent IO collectively succeeded"); } - - /* write data collectively */ MESG("writeAll with scalar dataspace"); ret = H5Dwrite(dataset4, H5T_NATIVE_INT, mem_dataspace, file_dataspace, @@ -846,6 +907,137 @@ dataset_writeAll(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + block[0] = 1; + block[1] = dim1; + stride[0] = 1; + stride[1] = dim1; + count[0] = 1; + count[1] = 1; + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + + dataset_fill(start, block, data_array1); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, data_array1); + } + + /* Dataset5: point selection in File - Hyperslab selection in Memory*/ + /* create a file dataspace independently */ + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + file_dataspace = H5Dget_space (dataset5); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + mem_dataspace = H5Dget_space (dataset5); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset5, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset5 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + /* Dataset6: point selection in File - Point selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + file_dataspace = H5Dget_space (dataset6); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + mem_dataspace = H5Dget_space (dataset6); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset6, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset6 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + /* Dataset7: point selection in File - All selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + file_dataspace = H5Dget_space (dataset7); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + + ret = H5Sselect_all(mem_dataspace); + VRFY((ret >= 0), "H5Sselect_all succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset7, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset7 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + /* * All writes completed. Close datasets collectively */ @@ -856,12 +1048,19 @@ dataset_writeAll(void) ret = H5Dclose(dataset3); VRFY((ret >= 0), "H5Dclose3 succeeded"); ret = H5Dclose(dataset4); - VRFY((ret >= 0), "H5Dclose3 succeeded"); + VRFY((ret >= 0), "H5Dclose4 succeeded"); + ret = H5Dclose(dataset5); + VRFY((ret >= 0), "H5Dclose5 succeeded"); + ret = H5Dclose(dataset6); + VRFY((ret >= 0), "H5Dclose6 succeeded"); + ret = H5Dclose(dataset7); + VRFY((ret >= 0), "H5Dclose7 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ + if(coords) HDfree(coords); if(data_array1) HDfree(data_array1); } @@ -882,8 +1081,7 @@ dataset_readAll(void) hid_t xfer_plist; /* Dataset transfer properties list */ hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ - hid_t dataset1, dataset2; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ + hid_t dataset1, dataset2, dataset5, dataset6, dataset7; /* Dataset ID */ DATATYPE *data_array1 = NULL; /* data buffer */ DATATYPE *data_origin1 = NULL; /* expected data buffer */ const char *filename; @@ -892,6 +1090,11 @@ dataset_readAll(void) hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i,j,k; + herr_t ret; /* Generic return value */ int mpi_size, mpi_rank; @@ -906,6 +1109,11 @@ dataset_readAll(void) MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + /* set up the coords array selection */ + num_points = dim1; + coords = (hsize_t *)HDmalloc(dim0 * dim1 * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + /* allocate memory for data buffer */ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); @@ -916,7 +1124,7 @@ dataset_readAll(void) * OPEN AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ @@ -939,6 +1147,14 @@ dataset_readAll(void) dataset2 = H5Dopen2(fid, DATASETNAME2, H5P_DEFAULT); VRFY((dataset2 >= 0), "H5Dopen2 2 succeeded"); + /* open another dataset collectively */ + dataset5 = H5Dopen2(fid, DATASETNAME7, H5P_DEFAULT); + VRFY((dataset5 >= 0), "H5Dopen2 5 succeeded"); + dataset6 = H5Dopen2(fid, DATASETNAME8, H5P_DEFAULT); + VRFY((dataset6 >= 0), "H5Dopen2 6 succeeded"); + dataset7 = H5Dopen2(fid, DATASETNAME9, H5P_DEFAULT); + VRFY((dataset7 >= 0), "H5Dopen2 7 succeeded"); + /* * Set up dimensions of the slab this process accesses. */ @@ -1077,6 +1293,162 @@ dataset_readAll(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); + if(data_array1) free(data_array1); + if(data_origin1) free(data_origin1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + + block[0] = 1; + block[1] = dim1; + stride[0] = 1; + stride[1] = dim1; + count[0] = 1; + count[1] = 1; + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + + dataset_fill(start, block, data_origin1); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, data_origin1); + } + + /* Dataset5: point selection in memory - Hyperslab selection in file*/ + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset5); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + mem_dataspace = H5Dget_space (dataset5); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset5, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset5 succeeded"); + + + ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + /* Dataset6: point selection in File - Point selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + file_dataspace = H5Dget_space (dataset6); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + mem_dataspace = H5Dget_space (dataset6); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset6, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset6 succeeded"); + + ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + /* Dataset7: point selection in memory - All selection in file*/ + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset7); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_all(file_dataspace); + VRFY((ret >= 0), "H5Sselect_all succeeded"); + + num_points = dim0 * dim1; + k=0; + for (i=0 ; i<dim0; i++) { + for (j=0 ; j<dim1; j++) { + coords[k++] = i; + coords[k++] = j; + } + } + mem_dataspace = H5Dget_space (dataset7); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset7, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset7 succeeded"); + + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + ret = dataset_vrfy(start, count, stride, block, data_array1+(dim0/mpi_size * dim1 * mpi_rank), data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); /* * All reads completed. Close datasets collectively @@ -1085,11 +1457,18 @@ dataset_readAll(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); + ret = H5Dclose(dataset5); + VRFY((ret >= 0), "H5Dclose5 succeeded"); + ret = H5Dclose(dataset6); + VRFY((ret >= 0), "H5Dclose6 succeeded"); + ret = H5Dclose(dataset7); + VRFY((ret >= 0), "H5Dclose7 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ + if(coords) HDfree(coords); if(data_array1) HDfree(data_array1); if(data_origin1) HDfree(data_origin1); } @@ -1116,7 +1495,6 @@ extend_writeInd(void) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ const char *filename; hsize_t dims[RANK]; /* dataset dim sizes */ hsize_t max_dims[RANK] = @@ -1156,7 +1534,7 @@ extend_writeInd(void) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* Reduce the number of metadata cache slots, so that there are cache @@ -1347,7 +1725,6 @@ extend_writeInd2(void) hid_t fs; /* File dataspace ID */ hid_t ms; /* Memory dataspace ID */ hid_t dataset; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t orig_size=10; /* Original dataset dim size */ hsize_t new_size=20; /* Extended dataset dim size */ hsize_t one=1; @@ -1372,7 +1749,7 @@ extend_writeInd2(void) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); VRFY((fapl >= 0), "create_faccess_plist succeeded"); /* create the file collectively */ @@ -1509,7 +1886,6 @@ extend_readInd(void) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ DATATYPE *data_array1 = NULL; /* data buffer */ DATATYPE *data_array2 = NULL; /* data buffer */ @@ -1546,7 +1922,7 @@ extend_readInd(void) * OPEN AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ @@ -1690,7 +2066,6 @@ extend_writeAll(void) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ const char *filename; hsize_t dims[RANK]; /* dataset dim sizes */ hsize_t max_dims[RANK] = @@ -1730,7 +2105,7 @@ extend_writeAll(void) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* Reduce the number of metadata cache slots, so that there are cache @@ -1941,7 +2316,6 @@ extend_readAll(void) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ const char *filename; hsize_t dims[RANK]; /* dataset dim sizes */ DATATYPE *data_array1 = NULL; /* data buffer */ @@ -1978,7 +2352,7 @@ extend_readAll(void) * OPEN AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ @@ -2142,7 +2516,6 @@ compress_readAll(void) int rank=1; /* Dataspace rank */ hsize_t dim=dim0; /* Dataspace dimensions */ unsigned u; /* Local index variable */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ DATATYPE *data_read = NULL; /* data buffer */ DATATYPE *data_orig = NULL; /* expected data buffer */ const char *filename; @@ -2223,7 +2596,7 @@ compress_readAll(void) * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ @@ -2308,7 +2681,6 @@ none_selection_chunk(void) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ const char *filename; hsize_t dims[RANK]; /* dataset dim sizes */ DATATYPE *data_origin = NULL; /* data buffer */ @@ -2344,7 +2716,7 @@ none_selection_chunk(void) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* create the file collectively */ @@ -2599,7 +2971,6 @@ test_actual_io_mode(int selection_mode) { hsize_t stride[RANK]; hsize_t count[RANK]; hsize_t block[RANK]; - hbool_t use_gpfs = FALSE; char message[256]; herr_t ret; @@ -2639,7 +3010,7 @@ test_actual_io_mode(int selection_mode) { HDassert(filename != NULL); /* Setup the file access template */ - fapl = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); + fapl = create_faccess_plist(mpi_comm, mpi_info, facc_type); VRFY((fapl >= 0), "create_faccess_plist() succeeded"); /* Create the file */ @@ -2830,13 +3201,6 @@ test_actual_io_mode(int selection_mode) { break; } - /* Reset the expected values to defulats if the MPI_POSIX driver is in use. - * This property is defined only for mpio, not MPI POSIX. */ - if (facc_type == FACC_MPIPOSIX) { - actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION; - actual_io_mode_expected = H5D_MPIO_NO_COLLECTIVE; - } - ret = H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); @@ -3067,15 +3431,9 @@ actual_io_mode_tests(void) { * TEST_DATA_TRANSFORMS: * Test for Data Transfrom feature as the cause of breaking collective I/O. * - * TEST_SET_MPIPOSIX: - * Test for MPI Posix as the cause of breaking collective I/O. - * * TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES: * Test for NULL dataspace as the cause of breaking collective I/O. * - * TEST_POINT_SELECTIONS: - * Test for selecting elements of dataspce as the cause of breaking collective I/O. - * * TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT: * Test for Compact layout as the cause of breaking collective I/O. * @@ -3128,7 +3486,6 @@ test_no_collective_cause_mode(int selection_mode) hid_t mem_space = -1; hid_t file_space = -1; hsize_t chunk_dims[RANK]; - hbool_t use_gpfs = FALSE; herr_t ret; #ifdef H5_HAVE_FILTER_FLETCHER32 H5Z_filter_t filter_info; @@ -3152,35 +3509,30 @@ test_no_collective_cause_mode(int selection_mode) dcpl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dcpl >= 0), "dataset creation plist created successfully"); - if (selection_mode & TEST_SET_MPIPOSIX) { - l_facc_type = FACC_MPIPOSIX; + if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT) { + ret = H5Pset_layout (dcpl, H5D_COMPACT); + VRFY((ret >= 0),"set COMPACT layout succeeded"); + is_chunked = 0; } - else { - if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT) { - ret = H5Pset_layout (dcpl, H5D_COMPACT); - VRFY((ret >= 0),"set COMPACT layout succeeded"); - is_chunked = 0; - } - if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) { - ret = H5Pset_external (dcpl, FILE_EXTERNAL, (off_t) 0, H5F_UNLIMITED); - VRFY((ret >= 0),"set EXTERNAL file layout succeeded"); - is_chunked = 0; - } + if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) { + ret = H5Pset_external (dcpl, FILE_EXTERNAL, (off_t) 0, H5F_UNLIMITED); + VRFY((ret >= 0),"set EXTERNAL file layout succeeded"); + is_chunked = 0; + } #ifdef H5_HAVE_FILTER_FLETCHER32 - if (selection_mode & TEST_FILTERS) { - ret = H5Zfilter_avail(H5Z_FILTER_FLETCHER32); - VRFY ((ret >=0 ), "Fletcher32 filter is available.\n"); + if (selection_mode & TEST_FILTERS) { + ret = H5Zfilter_avail(H5Z_FILTER_FLETCHER32); + VRFY ((ret >=0 ), "Fletcher32 filter is available.\n"); - ret = H5Zget_filter_info (H5Z_FILTER_FLETCHER32, &filter_info); - VRFY ( ( (filter_info & H5Z_FILTER_CONFIG_ENCODE_ENABLED) || (filter_info & H5Z_FILTER_CONFIG_DECODE_ENABLED) ) , "Fletcher32 filter encoding and decoding available.\n"); + ret = H5Zget_filter_info (H5Z_FILTER_FLETCHER32, &filter_info); + VRFY ( ( (filter_info & H5Z_FILTER_CONFIG_ENCODE_ENABLED) || (filter_info & H5Z_FILTER_CONFIG_DECODE_ENABLED) ) , "Fletcher32 filter encoding and decoding available.\n"); - ret = H5Pset_fletcher32(dcpl); - VRFY((ret >= 0),"set filter (flecher32) succeeded"); - } -#endif /* H5_HAVE_FILTER_FLETCHER32 */ + ret = H5Pset_fletcher32(dcpl); + VRFY((ret >= 0),"set filter (flecher32) succeeded"); } +#endif /* H5_HAVE_FILTER_FLETCHER32 */ if (selection_mode & TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES) { sid = H5Screate(H5S_NULL); @@ -3200,7 +3552,7 @@ test_no_collective_cause_mode(int selection_mode) HDassert(filename != NULL); /* Setup the file access template */ - fapl = create_faccess_plist(mpi_comm, mpi_info, l_facc_type, use_gpfs); + fapl = create_faccess_plist(mpi_comm, mpi_info, l_facc_type); VRFY((fapl >= 0), "create_faccess_plist() succeeded"); /* Create the file */ @@ -3247,12 +3599,6 @@ test_no_collective_cause_mode(int selection_mode) no_collective_cause_global_expected |= H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES; } - if (selection_mode & TEST_POINT_SELECTIONS ) { - test_name = "Broken Collective I/O - Point Selection"; - no_collective_cause_local_expected |= H5D_MPIO_POINT_SELECTIONS; - no_collective_cause_global_expected |= H5D_MPIO_POINT_SELECTIONS; - } - if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT || selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) { test_name = "Broken Collective I/O - No CONTI or CHUNKED Dataset"; @@ -3268,12 +3614,6 @@ test_no_collective_cause_mode(int selection_mode) } #endif /* H5_HAVE_FILTER_FLETCHER32 */ - if (selection_mode & TEST_SET_MPIPOSIX) { - test_name = "Broken Collective I/O - MPIO POSIX"; - no_collective_cause_local_expected |= H5D_MPIO_SET_MPIPOSIX; - no_collective_cause_global_expected |= H5D_MPIO_SET_MPIPOSIX; - } - if (selection_mode & TEST_COLLECTIVE) { test_name = "Broken Collective I/O - Not Broken"; no_collective_cause_local_expected = H5D_MPIO_COLLECTIVE; @@ -3288,13 +3628,6 @@ test_no_collective_cause_mode(int selection_mode) is_independent = 1; } - /* Add MPIPOSIX cause to expected cause if MPI_POSIX driver is in use '-p'. - * Exception to the independent cause.*/ - if (facc_type == FACC_MPIPOSIX && !(selection_mode & TEST_SET_INDEPENDENT)) { - no_collective_cause_local_expected |= H5D_MPIO_SET_MPIPOSIX; - no_collective_cause_global_expected |= H5D_MPIO_SET_MPIPOSIX; - } - /* use all spaces for certain tests */ if (selection_mode & TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES || selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) { @@ -3311,17 +3644,6 @@ test_no_collective_cause_mode(int selection_mode) VRFY((mem_space >= 0), "mem_space created"); } - if (selection_mode & TEST_POINT_SELECTIONS) { - coord[0][0] = 0; coord[0][1] = 0; - coord[1][0] = 1; coord[1][1] = 1; - ret = H5Sselect_elements (file_space, H5S_SELECT_SET, NELM, (const hsize_t *)coord); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); - - ret = H5Sselect_elements (mem_space, H5S_SELECT_SET, NELM, (const hsize_t *)coord); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); - } - - /* Get the number of elements in the selection */ length = dim0 * dim1; @@ -3437,7 +3759,7 @@ test_no_collective_cause_mode(int selection_mode) * have the correct values. * * NOTE: - * This is a temprary function. + * This is a temporary function. * test_no_collective_cause_mode(TEST_FILTERS) will replace this when * H5Dcreate and H5write support for mpio and filter feature. * @@ -3478,7 +3800,6 @@ test_no_collective_cause_mode_filter(int selection_mode) hid_t mem_space = -1; hid_t file_space = -1; hsize_t chunk_dims[RANK]; - hbool_t use_gpfs = FALSE; herr_t ret; #ifdef H5_HAVE_FILTER_FLETCHER32 H5Z_filter_t filter_info; @@ -3527,7 +3848,7 @@ test_no_collective_cause_mode_filter(int selection_mode) HDassert(filename != NULL); /* Setup the file access template */ - fapl_write = create_faccess_plist(mpi_comm, mpi_info, FACC_DEFAULT, use_gpfs); + fapl_write = create_faccess_plist(mpi_comm, mpi_info, FACC_DEFAULT); VRFY((fapl_write >= 0), "create_faccess_plist() succeeded"); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_write); @@ -3555,13 +3876,6 @@ test_no_collective_cause_mode_filter(int selection_mode) no_collective_cause_global_expected = H5D_MPIO_FILTERS; #endif - /* Ignore above expected cause and reset cause to MPIPOSIX if - * the MPI_POSIX driver is in use.*/ - if (facc_type == FACC_MPIPOSIX) { - no_collective_cause_local_expected = H5D_MPIO_SET_MPIPOSIX; - no_collective_cause_global_expected = H5D_MPIO_SET_MPIPOSIX; - } - /* Get the file dataspace */ file_space = H5Dget_space(dataset); VRFY((file_space >= 0), "H5Dget_space succeeded"); @@ -3620,7 +3934,7 @@ test_no_collective_cause_mode_filter(int selection_mode) *---------------------*/ /* Setup the file access template */ - fapl_read = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); + fapl_read = create_faccess_plist(mpi_comm, mpi_info, facc_type); VRFY((fapl_read >= 0), "create_faccess_plist() succeeded"); fid = H5Fopen (filename, H5F_ACC_RDONLY, fapl_read); @@ -3686,9 +4000,7 @@ no_collective_cause_tests(void) test_no_collective_cause_mode (TEST_SET_INDEPENDENT); test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION); test_no_collective_cause_mode (TEST_DATA_TRANSFORMS); - test_no_collective_cause_mode (TEST_SET_MPIPOSIX); test_no_collective_cause_mode (TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES); - test_no_collective_cause_mode (TEST_POINT_SELECTIONS); 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 @@ -3702,9 +4014,9 @@ no_collective_cause_tests(void) /* * Test combined causes */ - test_no_collective_cause_mode (TEST_SET_MPIPOSIX | TEST_DATATYPE_CONVERSION); + test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL | TEST_DATATYPE_CONVERSION); test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS); - test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS | TEST_POINT_SELECTIONS); + test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL | TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS); return; } @@ -3727,7 +4039,6 @@ dataset_atomicity(void) hid_t acc_tpl; /* File access templates */ hid_t sid; /* Dataspace ID */ hid_t dataset1; /* Dataset IDs */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ int *write_buf = NULL; /* data buffer */ int *read_buf = NULL; /* data buffer */ @@ -3769,7 +4080,7 @@ dataset_atomicity(void) VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* create the file collectively */ @@ -3832,7 +4143,7 @@ dataset_atomicity(void) MPI_Barrier (comm); /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ diff --git a/testpar/t_file.c b/testpar/t_file.c index 5cd3e9d..70ca60e 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -40,7 +40,6 @@ test_split_comm_access(void) int newrank, newprocs; hid_t fid; /* file IDs */ hid_t acc_tpl; /* File access properties */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ herr_t ret; /* generic return value */ const char *filename; @@ -68,7 +67,7 @@ test_split_comm_access(void) MPI_Comm_rank(comm,&sub_mpi_rank); /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(comm, info, facc_type); VRFY((acc_tpl >= 0), ""); /* create the file collectively */ diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 516cc2f..fa1a980 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -88,7 +88,6 @@ void multiple_dset_write(void) int i, j, n, mpi_size, mpi_rank, size; hid_t iof, plist, dataset, memspace, filespace; hid_t dcpl; /* Dataset creation property list */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t chunk_origin [DIM]; hsize_t chunk_dims [DIM], file_dims [DIM]; hsize_t count[DIM]={1,1}; @@ -112,7 +111,7 @@ void multiple_dset_write(void) outme = HDmalloc((size_t)(size * size * sizeof(double))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); VRFY((plist>=0), "create_faccess_plist succeeded"); iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); VRFY((iof>=0), "H5Fcreate succeeded"); @@ -175,7 +174,6 @@ void multiple_dset_write(void) void compact_dataset(void) { int i, j, mpi_size, mpi_rank, size, err_num=0; - hbool_t use_gpfs = FALSE; hid_t iof, plist, dcpl, dxpl, dataset, filespace; hsize_t file_dims [DIM]; double * outme; @@ -201,7 +199,7 @@ void compact_dataset(void) filename = GetTestParameters(); VRFY((mpi_size <= size), "mpi_size <= size"); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); /* Define data space */ @@ -244,7 +242,7 @@ void compact_dataset(void) H5Fclose(iof); /* Open the file and dataset, read and compare the data. */ - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); iof = H5Fopen(filename, H5F_ACC_RDONLY, plist); VRFY((iof >= 0), "H5Fopen succeeded"); @@ -295,7 +293,6 @@ void compact_dataset(void) void null_dataset(void) { int mpi_size, mpi_rank; - hbool_t use_gpfs = FALSE; hid_t iof, plist, dxpl, dataset, attr, sid; unsigned uval=2; /* Buffer for writing to dataset */ int val=1; /* Buffer for writing to attribute */ @@ -310,8 +307,7 @@ void null_dataset(void) filename = GetTestParameters(); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, - facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); /* Define data space */ @@ -355,7 +351,7 @@ void null_dataset(void) H5Fclose(iof); /* Open the file and dataset, read and compare the data. */ - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); iof = H5Fopen(filename, H5F_ACC_RDONLY, plist); VRFY((iof >= 0), "H5Fopen succeeded"); @@ -409,7 +405,6 @@ void null_dataset(void) void big_dataset(void) { int mpi_size, mpi_rank; /* MPI info */ - hbool_t use_gpfs = FALSE; /* Don't use GPFS stuff for this test */ hid_t iof, /* File ID */ fapl, /* File access property list ID */ dataset, /* Dataset ID */ @@ -428,7 +423,7 @@ void big_dataset(void) filename = GetTestParameters(); - fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); VRFY((fapl >= 0), "create_faccess_plist succeeded"); /* @@ -540,7 +535,6 @@ void big_dataset(void) void dataset_fillvalue(void) { int mpi_size, mpi_rank; /* MPI info */ - hbool_t use_gpfs = FALSE; /* Don't use GPFS stuff for this test */ int err_num; /* Number of errors */ hid_t iof, /* File ID */ fapl, /* File access property list ID */ @@ -575,7 +569,7 @@ void dataset_fillvalue(void) wdata=HDmalloc((size_t)(dset_size*sizeof(int))); VRFY((wdata != NULL), "HDmalloc succeeded for write buffer"); - fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); VRFY((fapl >= 0), "create_faccess_plist succeeded"); /* @@ -656,7 +650,7 @@ void dataset_fillvalue(void) ret = H5Dwrite(dataset, H5T_NATIVE_INT, memspace, filespace, dxpl, wdata); VRFY((ret >= 0), "H5Dwrite succeeded"); - /* Barrier here, to allow MPI-posix I/O to sync */ + /* Barrier here, to allow processes to sync */ MPI_Barrier(MPI_COMM_WORLD); /* @@ -731,7 +725,6 @@ void collective_group_write(void) { int mpi_rank, mpi_size, size; int i, j, m; - hbool_t use_gpfs = FALSE; char gname[64], dname[32]; hid_t fid, gid, did, plist, dcpl, memspace, filespace; DATATYPE * outme = NULL; @@ -758,7 +751,7 @@ void collective_group_write(void) outme = HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); H5Pclose(plist); @@ -827,7 +820,6 @@ void independent_group_read(void) { int mpi_rank, m; hid_t plist, fid; - hbool_t use_gpfs = FALSE; const H5Ptest_param_t *pt; char *filename; int ngroups; @@ -838,7 +830,7 @@ void independent_group_read(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); fid = H5Fopen(filename, H5F_ACC_RDONLY, plist); H5Pclose(plist); @@ -950,7 +942,6 @@ void multiple_group_write(void) { int mpi_rank, mpi_size, size; int m; - hbool_t use_gpfs = FALSE; char gname[64]; hid_t fid, gid, plist, memspace, filespace; hsize_t chunk_origin[DIM]; @@ -969,7 +960,7 @@ void multiple_group_write(void) size = get_size(); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); H5Pclose(plist); @@ -1120,7 +1111,6 @@ void multiple_group_read(void) { int mpi_rank, mpi_size, error_num, size; int m; - hbool_t use_gpfs = FALSE; char gname[64]; hid_t plist, fid, gid, memspace, filespace; hsize_t chunk_origin[DIM]; @@ -1138,7 +1128,7 @@ void multiple_group_read(void) size = get_size(); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); fid = H5Fopen(filename, H5F_ACC_RDONLY, plist); H5Pclose(plist); diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 1e5d3b3..76eeaef 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -191,117 +191,3 @@ test_fapl_mpio_dup(void) } } - -/*------------------------------------------------------------------------- - * Function: test_fapl_mpiposix_dup - * - * Purpose: Test if fapl_mpiposix property list keeps a duplicate of the - * communicator object given when set; and returns a duplicate - * of its component when H5Pget_fapl_mpiposix is called. - * Note that fapl_mpiposix does not use INFO object. - * - * Return: Success: None - * - * Failure: Abort - * - * Programmer: Albert Cheng - * January 9, 2003 - * - * Modifications: - *------------------------------------------------------------------------- - */ -void -test_fapl_mpiposix_dup(void) -{ - int mpi_size, mpi_rank; - MPI_Comm comm, comm_tmp; - int mpi_size_old, mpi_rank_old; - int mpi_size_tmp, mpi_rank_tmp; - int mrc; /* MPI return value */ - hid_t acc_pl; /* File access properties */ - hbool_t use_gpfs = FALSE; - herr_t ret; /* hdf5 return value */ - - if (VERBOSE_MED) - printf("Verify fapl_mpiposix duplicates communicator object\n"); - - /* set up MPI parameters */ - MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); - if (VERBOSE_MED) - printf("rank/size of MPI_COMM_WORLD are %d/%d\n", mpi_rank, mpi_size); - - /* Create a new communicator that has the same processes as MPI_COMM_WORLD. - * Use MPI_Comm_split because it is simplier than MPI_Comm_create - */ - mrc = MPI_Comm_split(MPI_COMM_WORLD, 0, 0, &comm); - VRFY((mrc==MPI_SUCCESS), "MPI_Comm_split"); - MPI_Comm_size(comm,&mpi_size_old); - MPI_Comm_rank(comm,&mpi_rank_old); - if (VERBOSE_MED) - printf("rank/size of comm are %d/%d\n", mpi_rank_old, mpi_size_old); - - acc_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_pl >= 0), "H5P_FILE_ACCESS"); - - ret = H5Pset_fapl_mpiposix(acc_pl, comm, use_gpfs); - VRFY((ret >= 0), ""); - - /* Case 1: - * Free the created communicator object. - * Check if the access property list is still valid and can return - * valid communicator object. - */ - mrc = MPI_Comm_free(&comm); - VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free"); - - ret = H5Pget_fapl_mpiposix(acc_pl, &comm_tmp, &use_gpfs); - VRFY((ret >= 0), "H5Pget_fapl_mpiposix"); - MPI_Comm_size(comm_tmp,&mpi_size_tmp); - MPI_Comm_rank(comm_tmp,&mpi_rank_tmp); - if (VERBOSE_MED) - printf("After H5Pget_fapl_mpiposix: rank/size of comm are %d/%d\n", - mpi_rank_tmp, mpi_size_tmp); - VRFY((mpi_size_tmp==mpi_size), "MPI_Comm_size"); - VRFY((mpi_rank_tmp==mpi_rank), "MPI_Comm_rank"); - - /* Case 2: - * Free the retrieved communicator object. - * Check if the access property list is still valid and can return - * valid communicator object. - * Also verify the NULL argument option. - */ - mrc = MPI_Comm_free(&comm_tmp); - VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free"); - - /* check NULL argument options. */ - ret = H5Pget_fapl_mpiposix(acc_pl, NULL, NULL); - VRFY((ret >= 0), "H5Pget_fapl_mpiposix neither"); - - /* now get it again and check validity too. */ - /* Don't free the returned object which is used in the next case. */ - ret = H5Pget_fapl_mpiposix(acc_pl, &comm_tmp, &use_gpfs); - VRFY((ret >= 0), "H5Pget_fapl_mpiposix"); - MPI_Comm_size(comm_tmp,&mpi_size_tmp); - MPI_Comm_rank(comm_tmp,&mpi_rank_tmp); - if (VERBOSE_MED) - printf("After second H5Pget_fapl_mpiposix: rank/size of comm are %d/%d\n", - mpi_rank_tmp, mpi_size_tmp); - VRFY((mpi_size_tmp==mpi_size), "MPI_Comm_size"); - VRFY((mpi_rank_tmp==mpi_rank), "MPI_Comm_rank"); - - /* Case 3: - * Close the property list and verify the retrieved communicator - * object is still valid. - */ - H5Pclose(acc_pl); - MPI_Comm_size(comm_tmp,&mpi_size_tmp); - MPI_Comm_rank(comm_tmp,&mpi_rank_tmp); - if (VERBOSE_MED) - printf("After Property list closed: rank/size of comm are %d/%d\n", - mpi_rank_tmp, mpi_size_tmp); - - /* clean up */ - mrc = MPI_Comm_free(&comm_tmp); - VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free"); -} diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c deleted file mode 100644 index 207f07e..0000000 --- a/testpar/t_posix_compliant.c +++ /dev/null @@ -1,927 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* A series of tests for posix compliance - * - * These tests do increasingly complicated sets of writes followed by reads. - * POSIX standards say that any read that can be proven to occur after a write - * must include the data in that write. These tests attempt to verify whether the - * underlying filesystem and i/o layer provide such guarantees. - * - * There are two sets of tests, one which uses POSIX i/o (fread, fwrite) and one which - * uses MPI I/O (MPI_File_read, MPI_File_write). Each set has multiple sub-tests, which - * test varying patters of writes and reads. - * - * - * TODO: - * Add corresponding posix i/o tests for each MPI i/o test. Currently, not all of the - * MPI IO tests are implemented using fwrite/fread. - * - * Leon Arber - * larber@ncsa.uiuc.edu -*/ - -/* To compile this outside of the HDF5 library, you can do so by defining the - * macro STANDALONE. E.g., - * mpicc -DSTANDALONE t_posix_compliant.c -o t_posix_compliant - * then run it as an MPI application. E.g., - * mpiexec -np 3 ./t_posix_compliant - */ - -#ifdef H5_HAVE_UNISTD_H -#include <unistd.h> -#endif -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <mpi.h> -#ifndef STANDALONE -#include "h5test.h" -#else -#define HDmalloc(sz) malloc(sz) -#define HDfree(p) free(p) -#define getenv_all(comm, root, name) getenv(name) -#endif -#define TESTFNAME "posix_test" /* test file name */ - -static char* testfile = NULL; -static int err_flag = 0; -static int max_err_print = 5; -int nmismatches = 0; /* warnings encountered */ - -/* globals needed for getopt - * Although they *should* be defined in unistd.h */ -extern char *optarg; -extern int optind, opterr; - - -#define CHECK_SUCCESS(res) \ -{ \ - char err_got[MPI_MAX_ERROR_STRING]; \ - int err_len; \ - if(res != MPI_SUCCESS) \ - { \ - MPI_Error_string(res, err_got, &err_len); \ - fprintf(stderr, "Line %d, Error: %s\n", __LINE__, err_got); \ - MPI_Abort(MPI_COMM_WORLD, -2); \ - } \ -} - -#define PRINT_RESULT() \ -{ \ - int err_result; \ - MPI_Reduce(&err_flag, &err_result, 1, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD); \ - if( (rank == 0) && (err_result == 0) ) \ - printf("PASSED\n"); \ - fflush(stdout); \ - fflush(stderr); \ - err_flag = 0; \ -} - -static void vrfy_elements(int* a, int* b, int size, int rank); -static int find_writesize(int rank, int numprocs, int write_size); - - -/* All writes are to non-overlapping locations in the file - * Then, each task reads another tasks' data - * */ - -static int allwrite_allread_blocks(int numprocs, int rank, int write_size) -{ - MPI_File fh = MPI_FILE_NULL; - int mpio_result; - int amode, i; - MPI_Offset offset = rank*write_size*sizeof(int); - MPI_Status Status; - int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); - int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); - - for(i=0; i<write_size; i++) - writebuf[i] = i; - - amode = MPI_MODE_CREATE | MPI_MODE_RDWR | MPI_MODE_DELETE_ON_CLOSE; - - mpio_result = MPI_File_open(MPI_COMM_WORLD, testfile, amode, - MPI_INFO_NULL, &fh); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_File_write_at(fh, offset, writebuf, write_size, MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - - MPI_Barrier(MPI_COMM_WORLD); - - offset = ( (rank+(numprocs-1)) % numprocs)*write_size*sizeof(int); - - mpio_result = MPI_File_read_at(fh, offset, readbuf, write_size, MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - - vrfy_elements(writebuf, readbuf, write_size, rank); - - mpio_result = MPI_File_close(&fh); - CHECK_SUCCESS(mpio_result); - HDfree(writebuf); - HDfree(readbuf); - - return err_flag; - -} - -static int posix_allwrite_allread_blocks(int numprocs, int rank, int write_size) -{ - int ret; - int i; - int offset = rank*write_size*sizeof(int); - int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); - int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); - FILE* file = NULL; - - for(i=0; i<write_size; i++) - writebuf[i] = i; - - if(rank==0) - file = fopen(testfile, "w+"); - MPI_Barrier(MPI_COMM_WORLD); - if(rank != 0) - file = fopen(testfile, "r+"); - - if(file == NULL) - { - fprintf(stderr, "Could not create testfile\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - ret = fseek(file, offset, SEEK_SET); - if(ret == -1) - { - perror("fseek"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - - ret = fwrite(writebuf, sizeof(int), write_size, file); - if(ret != write_size) - { - perror("fwrite"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - MPI_Barrier(MPI_COMM_WORLD); - - offset = ( (rank+(numprocs-1)) % numprocs)*write_size*sizeof(int); - - ret = fseek(file, offset, SEEK_SET); - if(ret == -1) - { - perror("fseek"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - ret = fread(readbuf, sizeof(int), write_size, file); - if( (ret == 0) && feof(file)) - printf("Process %d: Error. Prematurely reached end of file\n", rank); - else if( (ret != write_size) && ferror(file)) - { - perror("Error encountered in fread"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - vrfy_elements(writebuf, readbuf, write_size, rank); - - fclose(file); - - MPI_Barrier(MPI_COMM_WORLD); - if(rank == 0) - unlink(testfile); - - HDfree(writebuf); - HDfree(readbuf); - return err_flag; - -} - -static int posix_onewrite_allread_blocks(int numprocs, int rank, int write_size) -{ - int ret; - int i; - int offset = rank*write_size*sizeof(int); - int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); - int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); - FILE* file = NULL; - - for(i=0; i<write_size; i++) - writebuf[i] = i; - - if(rank==0) - file = fopen(testfile, "w+"); - MPI_Barrier(MPI_COMM_WORLD); - if(rank != 0) - file = fopen(testfile, "r+"); - - if(file == NULL) - { - fprintf(stderr, "Could not create testfile\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if(rank == 0) - { - for(offset = 0; offset<numprocs*write_size*sizeof(int); offset+=(write_size*sizeof(int))) - { - ret = fseek(file, offset, SEEK_SET); - if(ret == -1) - { - perror("fseek"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - - ret = fwrite(writebuf, sizeof(int), write_size, file); - if(ret != write_size) - { - perror("fwrite"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - } - - } - MPI_Barrier(MPI_COMM_WORLD); - - offset = rank*write_size*sizeof(int); - - ret = fseek(file, offset, SEEK_SET); - if(ret == -1) - { - perror("fseek"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - ret = fread(readbuf, sizeof(int), write_size, file); - if( (ret == 0) && feof(file)) - printf("Process %d: Error. Prematurely reached end of file\n", rank); - else if( (ret != write_size) && ferror(file)) - { - perror("Error encountered in fread"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - vrfy_elements(writebuf, readbuf, write_size, rank); - - fclose(file); - - MPI_Barrier(MPI_COMM_WORLD); - if(rank == 0) - unlink(testfile); - - HDfree(writebuf); - HDfree(readbuf); - return err_flag; - -} - -static int posix_onewrite_allread_interlaced(int numprocs, int rank, int write_size) -{ - int ret; - int i, fill, index; - int offset = rank*write_size*sizeof(int); - int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); - int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); - FILE* file = NULL; - - if(rank==0) - file = fopen(testfile, "w+"); - MPI_Barrier(MPI_COMM_WORLD); - if(rank != 0) - file = fopen(testfile, "r+"); - - if(file == NULL) - { - fprintf(stderr, "Could not create testfile\n"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - if(rank == 0) - { - for(offset = 0; offset<numprocs*write_size*sizeof(int); offset+=(numprocs*sizeof(int))) - { - ret = fseek(file, offset, SEEK_SET); - if(ret == -1) - { - perror("fseek"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - fill = offset / (numprocs*sizeof(int)); - for(i=0; i<numprocs; i++) - writebuf[i] = fill; - - - ret = fwrite(writebuf, sizeof(int), numprocs, file); - if(ret != numprocs) - { - perror("fwrite"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - } - - } - MPI_Barrier(MPI_COMM_WORLD); - - index = 0; - for(offset = rank*sizeof(int); offset<numprocs*write_size*sizeof(int); offset+=(numprocs*sizeof(int))) - { - - ret = fseek(file, offset, SEEK_SET); - if(ret == -1) - { - perror("fseek"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - ret = fread(readbuf+index, sizeof(int), 1, file); - if( (ret == 0) && feof(file)) - printf("Process %d: Error. Prematurely reached end of file\n", rank); - else if( (ret != 1) && ferror(file)) - { - perror("Error encountered in fread"); - MPI_Abort(MPI_COMM_WORLD, 1); - } - - index++; - } - - for(i=0; i<write_size; i++) - writebuf[i] = i; - - vrfy_elements(writebuf, readbuf, write_size, rank); - - fclose(file); - - MPI_Barrier(MPI_COMM_WORLD); - if(rank == 0) - unlink(testfile); - - HDfree(writebuf); - HDfree(readbuf); - return err_flag; - -} -/* Each proc wites out 0 1 2 3 with displacement i, so file contents are: - * 0000 1111 2222 3333 etc. (with 4 procs) - * - * Each proc then reads in the whole file and verifies that the data is what it is supposed to be*/ - -static int allwrite_allread_interlaced(int numprocs, int rank, int write_size) -{ - MPI_File fh = MPI_FILE_NULL; - int mpio_result; - int amode, i, counter = 0; - MPI_Datatype filetype; - MPI_Status Status; - int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); - int* readbuf = (int*) HDmalloc(numprocs*sizeof(int)); - int offset=0; - - for(i=0; i<write_size; i++) - writebuf[i] = i; - - - amode = MPI_MODE_CREATE | MPI_MODE_RDWR | MPI_MODE_DELETE_ON_CLOSE; - mpio_result = MPI_File_open(MPI_COMM_WORLD, testfile, amode, MPI_INFO_NULL, &fh); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_Type_vector(write_size, 1, numprocs, MPI_INT, &filetype); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_Type_commit(&filetype); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_File_set_view(fh, rank*sizeof(int), MPI_INT, filetype, "native", MPI_INFO_NULL); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_File_write(fh, writebuf, write_size, MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - - MPI_Barrier(MPI_COMM_WORLD); - - mpio_result = MPI_File_set_view(fh, 0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL); - CHECK_SUCCESS(mpio_result); - - for(offset = 0; offset<(write_size*numprocs*sizeof(int)); offset+=(numprocs*sizeof(int))) - { - mpio_result = MPI_File_read_at(fh, offset, readbuf, numprocs, MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - - for(i=0; i<numprocs; i++) - { - if(writebuf[offset/(numprocs*sizeof(int))] != readbuf[i]) - { - if( (rank == 0) && (counter == 0)) - printf("\n"); - if(counter++ < max_err_print) - fprintf(stderr, "Arrays do not match! Prcoess %d, element %d: [%d, %d]\n", rank, i, writebuf[offset/(numprocs*sizeof(int))], readbuf[i]); - else if(counter++ == max_err_print+1) - fprintf(stderr, "Printed %d errors. Omitting the rest\n", max_err_print); - err_flag = -1; - } - - } - } - nmismatches += counter; - mpio_result = MPI_File_close(&fh); - CHECK_SUCCESS(mpio_result); - - HDfree(writebuf); - HDfree(readbuf); - return err_flag; - - -} - -/* Overlapping pattern works as follows (this test requires at least 2 procs: - * Writes: - * Task 0: 0 2 4 6 etc... - * Task 1: 1 3 5 7 etc... - * Task 2: 0 3 6 etc.. - * Task 3: 0 4 8 etc... - * - * The above describes only the pattern of the elements being written. The actual - * number of elements written is going to be: - * - * Task i where i=(numprocs-1) writes write_size elements. All other tasks do: - * x = ((write_size-1)*numprocs) - * Task i's write_size is the smallest multiple of i<=x divided by i, with the exception - * of tasks 0 and 1, for whom i is 2, since they are writing the even and odd multiples. - * - * So, if there are 5 tasks with write_size=4, the resulting pattern of writes is: - * - * Task 0: 0 2 4 6 8 10 12 14 - * Task 1: 1 3 5 7 9 11 13 15 - * Task 2: 0 3 6 9 12 15 - * Task 3: 0 4 8 12 - * Task 4: 0 5 10 15 - * - * - * - * * * All the entires that overlap will therefore be writing the same value - * - * At the end, all tasks read in the file and verify that it is correct should be - * (1,2...((numprocs-1)*WRTE_SIZE). - * */ - -static int allwrite_allread_overlap(int numprocs, int rank, int write_size) -{ - - MPI_File fh = MPI_FILE_NULL; - int mpio_result; - int amode, i, counter = 0; - MPI_Datatype filetype; - MPI_Status Status; - int* writebuf = (int*) HDmalloc(write_size*(numprocs-1)*sizeof(int)); /* An upper bound...not all the elements will be written */ - int* readbuf = (int*) HDmalloc(write_size*(numprocs-1)*sizeof(int)); - - if(numprocs < 2) - { - fprintf(stderr, "The allwrite_allread_overlap test requires at least 2 procs\n"); - return -1; - } - - if(rank == 0) - { - for(i=0; i<write_size*(numprocs-1); i++) - writebuf[i] = 2*i; - } - else if(rank == 1) - { - for(i=0; i<write_size*(numprocs-1); i++) - writebuf[i] = (2*i)+1; - } - else - { - for(i=0; i<write_size*(numprocs-1); i++) - writebuf[i] = (rank+1)*i; - } - - amode = MPI_MODE_CREATE | MPI_MODE_RDWR | MPI_MODE_DELETE_ON_CLOSE; - mpio_result = MPI_File_open(MPI_COMM_WORLD, testfile, amode, MPI_INFO_NULL, &fh); - CHECK_SUCCESS(mpio_result); - - if( (rank == 0) || (rank == 1) ) - mpio_result = MPI_Type_vector(write_size*(numprocs-1), 1, 2, MPI_INT, &filetype); - else - mpio_result = MPI_Type_vector(write_size*(numprocs-1), 1, rank+1, MPI_INT, &filetype); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_Type_commit(&filetype); - CHECK_SUCCESS(mpio_result); - - if( rank == 1) - mpio_result = MPI_File_set_view(fh, sizeof(int), MPI_INT, filetype, "native", MPI_INFO_NULL); - else - mpio_result = MPI_File_set_view(fh, 0, MPI_INT, filetype, "native", MPI_INFO_NULL); - CHECK_SUCCESS(mpio_result); - - if( rank == (numprocs - 1)) - mpio_result = MPI_File_write(fh, writebuf, write_size, MPI_INT, &Status); - else - mpio_result = MPI_File_write(fh, writebuf, find_writesize(rank, numprocs, write_size), MPI_INT, &Status); - - CHECK_SUCCESS(mpio_result); - - MPI_Barrier(MPI_COMM_WORLD); - mpio_result = MPI_File_set_view(fh, 0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_File_read_at(fh, 0, readbuf, write_size*(numprocs-1), MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - - for(i=0; i<write_size*(numprocs-1); i++) - { - if(i != readbuf[i]) - { - if( (rank == 0) && (counter == 0)) - printf("\n"); - if(counter++ < max_err_print) - fprintf(stderr, "Arrays do not match! Prcoess %d, element %d: [%d, %d]\n", rank, i, i, readbuf[i]); - else if(counter++ == max_err_print+1) - fprintf(stderr, "Printed %d errors. Omitting the rest\n", max_err_print); - err_flag = -1; - } - } - - nmismatches += counter; - mpio_result = MPI_File_close(&fh); - CHECK_SUCCESS(mpio_result); - HDfree(writebuf); - HDfree(readbuf); - - return err_flag; - -} - -/* A random process writes out the following to the file: - * 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 (assuming write_size=5, and numprocs=3) - * - * Process i read's in write_size bytes at offset=i*write_size - */ -static int onewrite_allread_blocks(int numprocs, int rank, int write_size) -{ - MPI_File fh = MPI_FILE_NULL; - int mpio_result; - int amode, i; - MPI_Status Status; - int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); - int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); - - for(i=0; i<write_size; i++) - writebuf[i] = i; - - amode = MPI_MODE_CREATE | MPI_MODE_RDWR | MPI_MODE_DELETE_ON_CLOSE; - - mpio_result = MPI_File_open(MPI_COMM_WORLD, testfile, amode, - MPI_INFO_NULL, &fh); - CHECK_SUCCESS(mpio_result); - - /* A random process writes out all the data */ - if(rank == (rand() % numprocs)) - { - for(i=0; i<numprocs; i++) - { - mpio_result = MPI_File_write_at(fh, write_size*i*sizeof(int), writebuf, write_size, MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - } - } - - MPI_Barrier(MPI_COMM_WORLD); - - mpio_result = MPI_File_read_at(fh, write_size*rank*sizeof(int), readbuf, write_size, MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - - vrfy_elements(writebuf, readbuf, write_size, rank); - - mpio_result = MPI_File_close(&fh); - CHECK_SUCCESS(mpio_result); - HDfree(writebuf); - HDfree(readbuf); - - return err_flag; - - - -} - -/* Process zero writes out: - * 0000 1111 2222 3333 etc. (with 4 procs) - * - * Each proc reads out 0 1 2 3 starting at displacement i */ -static int onewrite_allread_interlaced(int numprocs, int rank, int write_size) -{ - MPI_File fh = MPI_FILE_NULL; - int mpio_result; - int amode, i; - MPI_Datatype filetype; - MPI_Status Status; - int* writebuf = (int*) HDmalloc(numprocs*write_size*sizeof(int)); /* Upper bound, not all used */ - int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); - - - amode = MPI_MODE_CREATE | MPI_MODE_RDWR; - amode = MPI_MODE_CREATE | MPI_MODE_RDWR | MPI_MODE_DELETE_ON_CLOSE; - mpio_result = MPI_File_open(MPI_COMM_WORLD, testfile, amode, MPI_INFO_NULL, &fh); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_Type_vector(write_size, 1, numprocs, MPI_INT, &filetype); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_Type_commit(&filetype); - CHECK_SUCCESS(mpio_result); - - if(rank == (rand() % numprocs)) - { - for(i=0; i<write_size; i++) - { - int j; - for(j=0; j<numprocs; j++) - writebuf[j] = i; - - mpio_result = MPI_File_write_at(fh, i*numprocs*sizeof(int), writebuf, numprocs, MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - } - } - - MPI_Barrier(MPI_COMM_WORLD); - - mpio_result = MPI_File_set_view(fh, rank*sizeof(int), MPI_INT, filetype, "native", MPI_INFO_NULL); - CHECK_SUCCESS(mpio_result); - - mpio_result = MPI_File_read_at(fh, 0, readbuf, write_size, MPI_INT, &Status); - CHECK_SUCCESS(mpio_result); - - for(i=0; i<write_size; i++) - writebuf[i] = i; - - vrfy_elements(writebuf, readbuf, write_size, rank); - - mpio_result = MPI_File_close(&fh); - CHECK_SUCCESS(mpio_result); - HDfree(writebuf); - HDfree(readbuf); - - return err_flag; - -} - -static int find_writesize(int rank, int numprocs, int size) -{ - /* Largest number in the file */ - int tmp = (size-1)*numprocs; - int x = 0; - int write_size = 0; - - /* Find largest multiple not greater than tmp */ - while(x <= tmp) - { - if( (rank == 0) || (rank == 1) ) - x+=2; - else - x += (rank+1); - - write_size++; - } - - return write_size; -} - -static void -vrfy_elements(int* a, int* b, int size, int rank) -{ - int i, counter = 0; - - for(i=0; i<size; i++) - { - if(a[i] != b[i]) - { - if( (rank == 0) && (counter == 0)) - printf("\n"); - if(counter++ < max_err_print) - fprintf(stderr, "Arrays do not match! Prcoess %d, element %d: [%d, %d]\n", rank, i, a[i], b[i]); - else if(counter++ == max_err_print+1) - fprintf(stderr, "Printed %d errors. Omitting the rest\n", max_err_print); - err_flag = -1; - } - } - nmismatches += counter; - fflush(stderr); - fflush(stdout); -} - -/* print an explanation message by MAIN (0) process. - */ -static void -header_msg(void) -{ - printf( -"Purpose:\n" -"This tests if the file system is posix compliant when POSIX and MPI IO APIs\n" -"are used. This is for information only and always exits with 0 even when\n" -"non-compliance errors are encounter. This is to prevent this test from\n" -"aborting the remaining parallel HDF5 tests unnecessarily.\n\n" - ); -} - -int -main(int argc, char* argv[]) -{ - - int numprocs, rank, opt, mpi_tests=1, posix_tests=1; - int lb, ub, inc; - int write_size = 0; - char optstring[] = "h x m p: s: v:"; - char *prefix; - - err_flag = 0; - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &numprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - if (rank == 0) - header_msg(); - while((opt = getopt(argc, argv, optstring)) != -1) - { - switch(opt) - { - case 'h': - if(rank == 0) - printf("Usage: %s [options]\n" - "-h prints this help message\n" - "-x run the posix i/o tests ONLY (default: posix and MPI)\n" - "-m run the mpi i/o tests ONLY (default: posix and MPI)\n" - "-s size Run the test for the specific size. Default is 1024, 4096, 16384, ..., 1048576\n" - "-p path specifies path for test file. Default is current directory\n" - "-v num Specifies number of unmatching entries to print (default 10, pass -1 for all)\n", argv[0]); - goto done; - case 'x': - mpi_tests = 0; - posix_tests = 1; - break; - case 'm': - mpi_tests = 1; - posix_tests = 0; - break; - case 'p': - /* need 2 extra--1 for the / and 1 for the terminating NULL. */ - testfile = (char*) HDmalloc(strlen(optarg) + 2 + strlen(TESTFNAME)); - strcpy(testfile, optarg); - /* Append a / just in case they didn't end their path with one */ - strcat(testfile, "/" TESTFNAME); - break; - case 's': - write_size = atoi(optarg); - break; - case 'v': - max_err_print = atoi(optarg); - break; - } - } - - if( (optind < argc) && (rank == 0)) - fprintf(stderr, "Unkown command-line argument passed. Continuing anyway...\n"); - - if (!testfile){ - /* Try environment variable if not given as option. */ - prefix = getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX"); - if (prefix) - { - /* need 2 extra--1 for the / and 1 for the terminating NULL. */ - testfile = (char*) HDmalloc(strlen(prefix) + 2 + strlen(TESTFNAME)); - strcpy(testfile, prefix); - /* Append a / just in case they didn't end their path with one */ - strcat(testfile, "/" TESTFNAME); - } - else - { - testfile = strdup(TESTFNAME); - } - } - printf("Process %d: testfile=%s\n", rank, testfile); - fflush(stdout); - MPI_Barrier(MPI_COMM_WORLD); - - if(write_size == 0) - { - lb = 16*numprocs*sizeof(int); - /* 1MB MPIO-IO overlapping is failing in copper. Lower it now pending - permenant fix for copper.*/ - /* ub = 1024*1024;*/ - ub = lb*128; - inc = 4; - } - else - { - lb = write_size; - ub = write_size+1; - inc = 2; - } - -#ifndef STANDALONE - /* set alarm. */ - ALARM_ON; -#endif - - for(write_size = lb; write_size <= ub; write_size*=inc) - { - if(rank == 0) - printf("\nTesting size %d\n", write_size); - - if(mpi_tests) - { - if(rank == 0) - printf("Testing allwrite_allread_blocks with MPI IO\t\t"); fflush(stdout); - allwrite_allread_blocks(numprocs, rank, write_size/(numprocs*sizeof(int))); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); - - if(rank == 0) - printf("Testing allwrite_allread_interlaced with MPI IO\t\t"); fflush(stdout); - allwrite_allread_interlaced(numprocs, rank, write_size/(numprocs*sizeof(int))); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); - - if(rank == 0) - printf("Testing allwrite_allread_overlap with MPI IO\t\t"); fflush(stdout); - allwrite_allread_overlap(numprocs, rank, write_size); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); - - if(rank == 0) - printf("Testing onewrite_allread_blocks with MPI IO\t\t"); fflush(stdout); - onewrite_allread_blocks(numprocs, rank, write_size/(numprocs*sizeof(int))); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); - - if(rank == 0) - printf("Testing onewrite_allread_interlaced with MPI IO\t\t"); fflush(stdout); - onewrite_allread_interlaced(numprocs, rank, write_size/(numprocs*sizeof(int))); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); - } - - if(posix_tests) - { - if(rank == 0) - printf("Testing allwrite_allread_blocks with POSIX IO\t\t"); fflush(stdout); - posix_allwrite_allread_blocks(numprocs, rank, write_size/(numprocs*sizeof(int))); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); - - if(rank == 0) - printf("Testing onewrite_allread_blocks with POSIX IO\t\t"); fflush(stdout); - posix_onewrite_allread_blocks(numprocs, rank, write_size/(numprocs*sizeof(int))); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); - - if(rank == 0) - printf("Testing onewrite_allread_interlaced with POSIX IO\t"); fflush(stdout); - posix_onewrite_allread_interlaced(numprocs, rank, write_size/(numprocs*sizeof(int))); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); - - /* if(rank == 0) - printf("Testing allwrite_allread_overlap with POSIX IO\t\t"); fflush(stdout); - posix_allwrite_allread_overlap(numprocs, rank, write_size); - PRINT_RESULT(); - MPI_Barrier(MPI_COMM_WORLD); -*/ - } - } - -#ifndef STANDALONE - /* turn off alarm */ - ALARM_OFF; -#endif - -done: - if (testfile) - HDfree(testfile); - if (rank == 0){ - printf("\nSummary:\n"); - fflush(stdout); - } - MPI_Barrier(MPI_COMM_WORLD); - printf("Process %d: encountered %d mismatches.\n", rank, nmismatches); - MPI_Finalize(); - - return 0; -} diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 2d379d6..1a74295 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -139,7 +139,6 @@ hs_dr_pio_test__setup(const int test_num, const char *fcnName = "hs_dr_pio_test__setup()"; #endif /* CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG */ const char *filename; - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hbool_t mis_match = FALSE; int i; int mrc; @@ -282,7 +281,7 @@ hs_dr_pio_test__setup(const int test_num, * CREATE AN HDF5 FILE WITH PARALLEL ACCESS * ---------------------------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(tv_ptr->mpi_comm, tv_ptr->mpi_info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(tv_ptr->mpi_comm, tv_ptr->mpi_info, facc_type); VRFY((acc_tpl >= 0), "create_faccess_plist() succeeded"); /* set the alignment -- need it large so that we aren't always hitting the @@ -4789,7 +4788,6 @@ usage(void) "\tset number of groups for the multiple group test\n"); printf("\t-f <prefix>\tfilename prefix\n"); printf("\t-2\t\tuse Split-file together with MPIO\n"); - printf("\t-p\t\tuse combo MPI-POSIX driver\n"); printf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n", ROW_FACTOR, COL_FACTOR); printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n"); @@ -4840,9 +4838,6 @@ parse_options(int argc, char **argv) } paraprefix = *argv; break; - case 'p': /* Use the MPI-POSIX driver access */ - facc_type = FACC_MPIPOSIX; - break; case 'i': /* Collective MPI-IO access with independent IO */ dxfer_coll_type = DXFER_INDEPENDENT_IO; break; @@ -4928,8 +4923,7 @@ parse_options(int argc, char **argv) * Create the appropriate File access property list */ hid_t -create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, - hbool_t use_gpfs) +create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) { hid_t ret_pl = -1; herr_t ret; /* generic return value */ @@ -4970,13 +4964,6 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, return(ret_pl); } - if (l_facc_type == FACC_MPIPOSIX) { - /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpiposix(ret_pl, comm, use_gpfs); - VRFY((ret >= 0), "H5Pset_fapl_mpiposix succeeded"); - return(ret_pl); - } - /* unknown file access types */ return (ret_pl); } @@ -5108,12 +5095,6 @@ int main(int argc, char **argv) /* Parse command line arguments */ TestParseCmdLine(argc, argv); - if (facc_type == FACC_MPIPOSIX && MAINPROCESS){ - printf("===================================\n" - " Using MPIPOSIX driver\n" - "===================================\n"); - } - if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){ printf("===================================\n" " Using Independent I/O with file set view to replace collective I/O \n" diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 2730ea2..6e233a9 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -261,7 +261,6 @@ void coll_write_test(int chunk_factor) int *matrix_out, *matrix_out1, *vector; - hbool_t use_gpfs = FALSE; int mpi_size,mpi_rank; MPI_Comm comm = MPI_COMM_WORLD; @@ -293,7 +292,7 @@ void coll_write_test(int chunk_factor) for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) vector[i] = i; /* Grab file access property list */ - facc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); + facc_plist = create_faccess_plist(comm, info, facc_type); VRFY((facc_plist >= 0),""); /* @@ -474,7 +473,7 @@ void coll_write_test(int chunk_factor) ***/ /* Obtain file access property list with MPI-IO driver */ - facc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); + facc_plist = create_faccess_plist(comm, info, facc_type); VRFY((facc_plist >= 0),""); file = H5Fopen(filename, H5F_ACC_RDONLY, facc_plist); @@ -724,7 +723,6 @@ coll_read_test(int chunk_factor) dataset */ #endif - hbool_t use_gpfs = FALSE; int mpi_size,mpi_rank; MPI_Comm comm = MPI_COMM_WORLD; @@ -749,7 +747,7 @@ coll_read_test(int chunk_factor) /*** For testing collective hyperslab selection read ***/ /* Obtain file access property list */ - facc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); + facc_plist = create_faccess_plist(comm, info, facc_type); VRFY((facc_plist >= 0),""); /* @@ -1582,7 +1580,6 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, hsize_t max_dims[32]; #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ const char *filename; - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hbool_t data_ok = FALSE; hbool_t mis_match = FALSE; int i; @@ -1717,7 +1714,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, * CREATE AN HDF5 FILE WITH PARALLEL ACCESS * ---------------------------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type); VRFY((acc_tpl >= 0), "create_faccess_plist() succeeded"); /* create the file collectively */ @@ -2681,7 +2678,6 @@ link_chunk_collective_io_test(void) /* const char *fcnName = "link_chunk_collective_io_test()"; */ const char *filename; hbool_t mis_match = FALSE; - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ int i; int mrc; int mpi_rank; @@ -2718,7 +2714,7 @@ link_chunk_collective_io_test(void) HDassert( filename != NULL ); /* setup file access template */ - acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type); VRFY((acc_tpl >= 0), "create_faccess_plist() succeeded"); /* create the file collectively */ diff --git a/testpar/testph5.sh.in b/testpar/testph5.sh.in deleted file mode 100644 index 83327ca..0000000 --- a/testpar/testph5.sh.in +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -# -# 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. -# - -# Scripts for running testphdf5 program with a variety of parameters -top_srcdir=@top_srcdir@ -top_builddir=.. -srcdir=@srcdir@ - -TEST_APP=testphdf5 # The tool name -TEST_APP_BIN=`pwd`/$TEST_APP # The path of the tool binary - -nerrors=0 -verbose=yes - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# Run a test. If a test fails then increment the `nerrors' global variable. -# -TOOLTEST() { - # Run test. - echo $RUNPARALLEL $TEST_APP_BIN "$@" - eval $RUNPARALLEL $TEST_APP_BIN "$@" - - # Check if the command failed and increment nerrors if so. - if test $? -ne 0 ; then - nerrors="`expr $nerrors + 1`" - fi -} - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - -# testphdf5 test using the MPI-POSIX VFL driver -TOOLTEST -p - -# Temporary patch: -# Run t_shapesame this way. Need more permanent solution. -echo $RUNPARALLEL ./t_shapesame -p -eval $RUNPARALLEL ./t_shapesame -p - -# Check if the command failed and increment nerrors if so. -if test $? -ne 0 ; then - nerrors="`expr $nerrors + 1`" -fi -# Temporary patch ended. - -# Emit message about testing status -if test $nerrors -eq 0 ; then - echo "All $TEST_APP tests passed." -else - echo "ERROR! One or more $TEST_APP tests failed." -fi - -# Propagate a useful exit code -exit $nerrors diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 3419977..0b97c03 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -118,7 +118,6 @@ usage(void) "\tset number of groups for the multiple group test\n"); printf("\t-f <prefix>\tfilename prefix\n"); printf("\t-2\t\tuse Split-file together with MPIO\n"); - printf("\t-p\t\tuse combo MPI-POSIX driver\n"); printf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n", ROW_FACTOR, COL_FACTOR); printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n"); @@ -169,9 +168,6 @@ parse_options(int argc, char **argv) } paraprefix = *argv; break; - case 'p': /* Use the MPI-POSIX driver access */ - facc_type = FACC_MPIPOSIX; - break; case 'i': /* Collective MPI-IO access with independent IO */ dxfer_coll_type = DXFER_INDEPENDENT_IO; break; @@ -257,8 +253,7 @@ parse_options(int argc, char **argv) * Create the appropriate File access property list */ hid_t -create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, - hbool_t use_gpfs) +create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) { hid_t ret_pl = -1; herr_t ret; /* generic return value */ @@ -299,13 +294,6 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, return(ret_pl); } - if (l_facc_type == FACC_MPIPOSIX) { - /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpiposix(ret_pl, comm, use_gpfs); - VRFY((ret >= 0), "H5Pset_fapl_mpiposix succeeded"); - return(ret_pl); - } - /* unknown file access types */ return (ret_pl); } @@ -353,8 +341,6 @@ int main(int argc, char **argv) /* Tests are generally arranged from least to most complexity... */ AddTest("mpiodup", test_fapl_mpio_dup, NULL, "fapl_mpio duplicate", NULL); - AddTest("posixdup", test_fapl_mpiposix_dup, NULL, - "fapl_mpiposix duplicate", NULL); AddTest("split", test_split_comm_access, NULL, "dataset using split communicators", PARATESTFILE); @@ -552,12 +538,6 @@ int main(int argc, char **argv) /* Parse command line arguments */ TestParseCmdLine(argc, argv); - if (facc_type == FACC_MPIPOSIX && MAINPROCESS){ - printf("===================================\n" - " Using MPIPOSIX driver\n" - "===================================\n"); - } - if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){ printf("===================================\n" " Using Independent I/O with file set view to replace collective I/O \n" diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 15ff884..f313073 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -45,6 +45,13 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define DATASETNAME4 "Data4" #define DATASETNAME5 "Data5" #define DATASETNAME6 "Data6" +#define DATASETNAME7 "Data7" +#define DATASETNAME8 "Data8" +#define DATASETNAME9 "Data9" + +/* point selection order */ +#define IN_ORDER 1 +#define OUT_OF_ORDER 2 /* Hyperslab layout styles */ #define BYROW 1 /* divide into slabs of rows */ @@ -56,8 +63,6 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define FACC_DEFAULT 0x0 /* default */ #define FACC_MPIO 0x1 /* MPIO */ #define FACC_SPLIT 0x2 /* Split File */ -#define FACC_MULTI 0x4 /* Multi File */ -#define FACC_MPIPOSIX 0x8 /* MPIPOSIX */ #define DXFER_COLLECTIVE_IO 0x1 /* Collective IO*/ #define DXFER_INDEPENDENT_IO 0x2 /* Independent IO collectively */ @@ -179,15 +184,13 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define TEST_SET_INDEPENDENT 0x002 #define TEST_DATATYPE_CONVERSION 0x004 #define TEST_DATA_TRANSFORMS 0x008 -#define TEST_SET_MPIPOSIX 0x010 -#define TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES 0x020 -#define TEST_POINT_SELECTIONS 0x040 -#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT 0x080 -#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL 0x100 -#define TEST_FILTERS 0x200 +#define TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES 0x010 +#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT 0x020 +#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL 0x040 +#define TEST_FILTERS 0x080 /* TEST_FILTERS will take place of this after supporting mpio + filter for * H5Dcreate and H5Dwrite */ -#define TEST_FILTERS_READ 0x400 +#define TEST_FILTERS_READ 0x100 /* Don't erase these lines, they are put here for debugging purposes */ /* @@ -240,7 +243,6 @@ void multiple_group_read(void); void collective_group_write(void); void independent_group_read(void); void test_fapl_mpio_dup(void); -void test_fapl_mpiposix_dup(void); void test_split_comm_access(void); void dataset_atomicity(void); void dataset_writeInd(void); @@ -292,9 +294,10 @@ void compress_readAll(void); void test_dense_attr(void); /* commonly used prototypes */ -hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs); +hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type); MPI_Offset h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info); int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original); - +void point_set (hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], + size_t num_points, hsize_t coords[], int order); #endif /* PHDF5TEST_H */ |