summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
Diffstat (limited to 'testpar')
-rwxr-xr-xtestpar/COPYING2
-rw-r--r--testpar/Makefile.am5
-rw-r--r--testpar/Makefile.in142
-rw-r--r--testpar/t_cache.c326
-rw-r--r--testpar/t_chunk_alloc.c129
-rw-r--r--testpar/t_coll_chunk.c229
-rw-r--r--testpar/t_dset.c2
-rw-r--r--testpar/t_file.c8
-rw-r--r--testpar/t_filter_read.c74
-rw-r--r--testpar/t_mdset.c83
-rw-r--r--testpar/t_mpi.c36
-rw-r--r--testpar/t_pflush1.c50
-rw-r--r--testpar/t_pflush2.c17
-rw-r--r--testpar/t_posix_compliant.c13
-rw-r--r--testpar/t_span_tree.c62
-rw-r--r--testpar/testphdf5.c52
-rw-r--r--testpar/testphdf5.h2
17 files changed, 686 insertions, 546 deletions
diff --git a/testpar/COPYING b/testpar/COPYING
index ef0cbaf..6903daf 100755
--- a/testpar/COPYING
+++ b/testpar/COPYING
@@ -1,5 +1,5 @@
- Copyright by The HDF Group (THG) and
+ Copyright by The HDF Group and
The Board of Trustees of the University of Illinois.
All rights reserved.
diff --git a/testpar/Makefile.am b/testpar/Makefile.am
index 02cf742..3c39989 100644
--- a/testpar/Makefile.am
+++ b/testpar/Makefile.am
@@ -40,7 +40,8 @@ LDADD = $(LIBH5TEST) $(LIBHDF5)
# Temporary files
# MPItest.h5 is from t_mpi
# Para*.h5 are from testphdf
-CHECK_CLEANFILES+=MPItest.h5 Para*.h5
-DISTCLEANFILES=go Makefile testph5.sh
+# 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 b84f6fb..c06e6d4 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -32,8 +33,9 @@
#
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -61,6 +63,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
CONFIG_CLEAN_FILES = testph5.sh
+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)
@@ -94,6 +97,7 @@ testphdf5_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/bin/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -109,11 +113,23 @@ DIST_SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c \
t_posix_compliant.c $(testphdf5_SOURCES)
ETAGS = etags
CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
am__EXEEXT_2 =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
AMTAR = @AMTAR@
+
+# H5_CFLAGS holds flags that should be used when building hdf5,
+# but which should not be exported to h5cc for building other programs.
+# AM_CFLAGS is an automake construct which should be used by Makefiles
+# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
+AM_LDFLAGS = @AM_LDFLAGS@
AM_MAKEFLAGS = @AM_MAKEFLAGS@
AR = @AR@
@@ -127,21 +143,18 @@ BYTESEX = @BYTESEX@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
-
-# H5_CFLAGS holds flags that should be used as CFLAGS when building hdf5,
-# but which shouldn't be exported to h5cc for building other programs.
-CFLAGS = @CFLAGS@ @H5_CFLAGS@
+CFLAGS = @CFLAGS@
CLEARFILEBUF = @CLEARFILEBUF@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
CONFIG_USER = @CONFIG_USER@
CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@ @H5_CPPFLAGS@
+CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@ @H5_CXXFLAGS@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG_PKG = @DEBUG_PKG@
DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
@@ -164,7 +177,7 @@ F9XMODEXT = @F9XMODEXT@
F9XMODFLAG = @F9XMODFLAG@
F9XSUFFIXFLAG = @F9XSUFFIXFLAG@
FC = @FC@
-FCFLAGS = @FCFLAGS@ @H5_FCFLAGS@
+FCFLAGS = @FCFLAGS@
FCFLAGS_f90 = @FCFLAGS_f90@
FCLIBS = @FCLIBS@
FGREP = @FGREP@
@@ -202,6 +215,8 @@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LINUX_LFS = @LINUX_LFS@
+LIPO = @LIPO@
+LL_PATH = @LL_PATH@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_STATIC_EXEC = @LT_STATIC_EXEC@
@@ -212,13 +227,17 @@ MPE = @MPE@
MPI_GET_SIZE = @MPI_GET_SIZE@
NM = @NM@
NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@
OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
@@ -234,12 +253,7 @@ SEARCH = @SEARCH@
SED = @SED@
SETX = @SETX@
SET_MAKE = @SET_MAKE@
-
-# Hardcode SHELL to be /bin/sh. Most machines have this shell, and
-# on at least one machine configure fails to detect its existence (janus).
-# Also, when HDF5 is configured on one machine but run on another,
-# configure's automatic SHELL detection may not work on the build machine.
-SHELL = /bin/sh
+SHELL = @SHELL@
SIZE_T = @SIZE_T@
STATIC_EXEC = @STATIC_EXEC@
STATIC_SHARED = @STATIC_SHARED@
@@ -259,6 +273,7 @@ USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
VERSION = @VERSION@
+WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -281,6 +296,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -292,9 +309,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
@@ -314,6 +329,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@@ -361,7 +377,9 @@ TRACE = perl $(top_srcdir)/bin/trace
# Temporary files
# MPItest.h5 is from t_mpi
# Para*.h5 are from testphdf
-CHECK_CLEANFILES = *.chkexe *.chklog *.clog MPItest.h5 Para*.h5
+# 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.
@@ -375,7 +393,7 @@ testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_mdset.c t_ph5basic.c \
# The tests all depend on the hdf5 library and the test library
LDADD = $(LIBH5TEST) $(LIBHDF5)
-DISTCLEANFILES = go Makefile testph5.sh
+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.,
@@ -400,14 +418,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testpar/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign testpar/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testpar/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign testpar/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -425,15 +443,18 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(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)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ 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)
@rm -f t_cache$(EXEEXT)
$(LINK) $(t_cache_OBJECTS) $(t_cache_LDADD) $(LIBS)
@@ -476,21 +497,21 @@ distclean-compile:
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
@@ -506,14 +527,14 @@ ID: $(HEADERS) $(SOURCES) $(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; nonemtpy = 1; } \
+ $(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)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -521,29 +542,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
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; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -564,13 +590,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -600,6 +630,7 @@ 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:
@@ -622,6 +653,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -630,18 +663,28 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -664,7 +707,7 @@ ps-am:
uninstall-am:
-.MAKE: install-am install-strip
+.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 ctags \
@@ -886,6 +929,7 @@ check-vfd: $(LIB) $(PROGS) $(TESTS)
HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
fi; \
done
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index dc047ed..7fb7100 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -98,8 +98,8 @@ long local_pins = 0;
* value must be positive, and may not be larger than len.
*
* The field exists to allow us change the sizes of entries
- * in the cache without upsetting the server. This value
- * is only used locally, and is never sent to the server.
+ * in the cache without upsetting the server. This value
+ * is only used locally, and is never sent to the server.
*
* ver: Version number of the entry. This number is initialize
* to zero, and incremented each time the entry is modified.
@@ -129,6 +129,12 @@ long local_pins = 0;
* processes, and thus cannot be marked as dirty unless they
* happen to overlap some collective operation.
*
+ * cleared: Boolean flag that is set to true whenever the entry is
+ * dirty, and is cleared via a call to clear_datum().
+ *
+ * flushed: Boolean flag that is set to true whenever the entry is
+ * dirty, and is flushed via a call to flush_datum().
+ *
* index: Index of this instance of datum in the data_index[] array
* discussed below.
*
@@ -146,6 +152,8 @@ struct datum
hbool_t locked;
hbool_t global_pinned;
hbool_t local_pinned;
+ hbool_t cleared;
+ hbool_t flushed;
int index;
};
@@ -268,52 +276,51 @@ MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */
/* stats functions */
-void print_stats(void);
-void reset_stats(void);
+static void reset_stats(void);
/* MPI setup functions */
-hbool_t set_up_file_communicator(void);
+static hbool_t set_up_file_communicator(void);
/* data array manipulation functions */
-int addr_to_datum_index(haddr_t base_addr);
-void init_data(void);
+static int addr_to_datum_index(haddr_t base_addr);
+static void init_data(void);
/* test coodination related functions */
-int do_express_test(void);
-void do_sync(void);
-int get_max_nerrors(void);
+static int do_express_test(void);
+static void do_sync(void);
+static int get_max_nerrors(void);
/* mssg xfer related functions */
-hbool_t recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset);
-hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag);
-hbool_t setup_derived_types(void);
-hbool_t takedown_derived_types(void);
+static hbool_t recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset);
+static hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag);
+static hbool_t setup_derived_types(void);
+static hbool_t takedown_derived_types(void);
/* server functions */
-hbool_t server_main(void);
-hbool_t serve_read_request(struct mssg_t * mssg_ptr);
-hbool_t serve_sync_request(struct mssg_t * mssg_ptr);
-hbool_t serve_write_request(struct mssg_t * mssg_ptr);
+static hbool_t server_main(void);
+static hbool_t serve_read_request(struct mssg_t * mssg_ptr);
+static hbool_t serve_sync_request(struct mssg_t * mssg_ptr);
+static hbool_t serve_write_request(struct mssg_t * mssg_ptr);
/* call back functions & related data structures */
-herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest);
-herr_t destroy_datum(H5F_t UNUSED * f, void * thing);
-herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr,
+static herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest);
+static herr_t destroy_datum(H5F_t UNUSED * f, void * thing);
+static herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr,
void *thing);
-void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr,
+static void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr,
const void UNUSED *udata1, void UNUSED *udata2);
-herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr);
+static herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr);
#define DATUM_ENTRY_TYPE H5AC_TEST_ID
@@ -327,6 +334,7 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] =
(H5C_flush_func_t)flush_datum,
(H5C_dest_func_t)destroy_datum,
(H5C_clear_func_t)clear_datum,
+ (H5C_notify_func_t)NULL,
(H5C_size_func_t)size_datum
}
};
@@ -363,7 +371,7 @@ void pin_protected_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
int32_t idx, hbool_t global);
void rename_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
int32_t old_idx, int32_t new_idx);
-void resize_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
+void resize_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
int32_t idx, size_t new_size);
hbool_t setup_cache_for_test(hid_t * fid_ptr, H5F_t ** file_ptr_ptr,
H5C_t ** cache_ptr_ptr);
@@ -390,6 +398,7 @@ hbool_t trace_file_check(void);
/****************************** stats functions ******************************/
/*****************************************************************************/
+#ifdef UNUSED
/*****************************************************************************
*
* Function: print_stats()
@@ -409,7 +418,7 @@ hbool_t trace_file_check(void);
*
*****************************************************************************/
-void
+static void
print_stats(void)
{
HDfprintf(stdout,
@@ -428,6 +437,7 @@ print_stats(void)
return;
} /* print_stats() */
+#endif /* UNUSED */
/*****************************************************************************
*
@@ -445,7 +455,7 @@ print_stats(void)
*
*****************************************************************************/
-void
+static void
reset_stats(void)
{
datum_clears = 0;
@@ -486,7 +496,7 @@ reset_stats(void)
*
*****************************************************************************/
-hbool_t
+static hbool_t
set_up_file_communicator(void)
{
const char * fcn_name = "set_up_file_communicator()";
@@ -639,7 +649,7 @@ set_up_file_communicator(void)
*
*****************************************************************************/
-int
+static int
addr_to_datum_index(haddr_t base_addr)
{
/* const char * fcn_name = "addr_to_datum_index()"; */
@@ -691,9 +701,16 @@ addr_to_datum_index(haddr_t base_addr)
* JRM -- 7/11/06
* Added support for the local_len field.
*
+ * JRM -- 2/4/09
+ * Added initialization for the cleared and flushed fields.
+ *
+ * Mike McGreevy, July 2, 2009
+ * Changed base address from 0 to 512 since the superblock will
+ * always be at address 0.
+ *
*****************************************************************************/
-void
+static void
init_data(void)
{
/* const char * fcn_name = "init_data()"; */
@@ -711,7 +728,7 @@ init_data(void)
1974, 3194, 5168, 8362, 13539};
int i;
int j = 0;
- haddr_t addr = 0;
+ haddr_t addr = 512;
/* this must hold so renames don't change entry size. */
HDassert( (NUM_DATA_ENTRIES / 2) % 20 == 0 );
@@ -728,6 +745,8 @@ init_data(void)
data[i].locked = FALSE;
data[i].global_pinned = FALSE;
data[i].local_pinned = FALSE;
+ data[i].cleared = FALSE;
+ data[i].flushed = FALSE;
data[i].index = i;
data_index[i] = i;
@@ -772,7 +791,7 @@ init_data(void)
*
*****************************************************************************/
-int
+static int
do_express_test(void)
{
const char * fcn_name = "do_express_test()";
@@ -826,7 +845,7 @@ do_express_test(void)
*
*****************************************************************************/
-void
+static void
do_sync(void)
{
const char * fcn_name = "do_sync()";
@@ -902,7 +921,7 @@ do_sync(void)
*
*****************************************************************************/
-int
+static int
get_max_nerrors(void)
{
const char * fcn_name = "get_max_nerrors()";
@@ -957,7 +976,7 @@ get_max_nerrors(void)
#define CACHE_TEST_TAG 99 /* different from any used by the library */
-hbool_t
+static hbool_t
recv_mssg(struct mssg_t *mssg_ptr,
int mssg_tag_offset)
{
@@ -1042,7 +1061,7 @@ recv_mssg(struct mssg_t *mssg_ptr,
*
*****************************************************************************/
-hbool_t
+static hbool_t
send_mssg(struct mssg_t *mssg_ptr,
hbool_t add_req_to_tag)
{
@@ -1116,7 +1135,7 @@ send_mssg(struct mssg_t *mssg_ptr,
*
*****************************************************************************/
-hbool_t
+static hbool_t
setup_derived_types(void)
{
const char * fcn_name = "setup_derived_types()";
@@ -1210,7 +1229,7 @@ setup_derived_types(void)
*
*****************************************************************************/
-hbool_t
+static hbool_t
takedown_derived_types(void)
{
const char * fcn_name = "takedown_derived_types()";
@@ -1262,7 +1281,7 @@ takedown_derived_types(void)
*
*****************************************************************************/
-hbool_t
+static hbool_t
server_main(void)
{
const char * fcn_name = "server_main()";
@@ -1369,7 +1388,7 @@ server_main(void)
*
*****************************************************************************/
-hbool_t
+static hbool_t
serve_read_request(struct mssg_t * mssg_ptr)
{
const char * fcn_name = "serve_read_request()";
@@ -1475,7 +1494,7 @@ serve_read_request(struct mssg_t * mssg_ptr)
*
*****************************************************************************/
-hbool_t
+static hbool_t
serve_sync_request(struct mssg_t * mssg_ptr)
{
const char * fcn_name = "serve_sync_request()";
@@ -1543,7 +1562,7 @@ serve_sync_request(struct mssg_t * mssg_ptr)
*
*****************************************************************************/
-hbool_t
+static hbool_t
serve_write_request(struct mssg_t * mssg_ptr)
{
const char * fcn_name = "serve_write_request()";
@@ -1662,13 +1681,17 @@ serve_write_request(struct mssg_t * mssg_ptr)
* length of the entry, while retaining the original
* value for communications with the server.
*
+ * JRM -- 2/4/09
+ * Added code to set the cleared flag when a dirty entry is
+ * cleared.
+ *
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
clear_datum(H5F_t * f,
void * thing,
- hbool_t dest)
+ hbool_t dest)
{
int idx;
struct datum * entry_ptr;
@@ -1688,6 +1711,13 @@ clear_datum(H5F_t * f,
HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
( entry_ptr->header.size == entry_ptr->local_len ) );
+ HDassert( entry_ptr->header.is_dirty == entry_ptr->dirty );
+
+ if ( entry_ptr->header.is_dirty ) {
+
+ entry_ptr->cleared = TRUE;
+ }
+
entry_ptr->header.is_dirty = FALSE;
entry_ptr->dirty = FALSE;
@@ -1732,7 +1762,7 @@ clear_datum(H5F_t * f,
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
destroy_datum(H5F_t UNUSED * f,
void * thing)
{
@@ -1791,10 +1821,14 @@ destroy_datum(H5F_t UNUSED * f,
* length of the entry, while retaining the original
* value for communications with the server.
*
+ * JRM -- 2/4/09
+ * Added code to set the flushed flag when a dirty entry
+ * is flushed.
+ *
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
flush_datum(H5F_t *f,
hid_t UNUSED dxpl_id,
hbool_t dest,
@@ -1859,6 +1893,7 @@ flush_datum(H5F_t *f,
{
entry_ptr->header.is_dirty = FALSE;
entry_ptr->dirty = FALSE;
+ entry_ptr->flushed = TRUE;
}
}
}
@@ -1930,7 +1965,7 @@ flush_datum(H5F_t *f,
*-------------------------------------------------------------------------
*/
-void *
+static void *
load_datum(H5F_t UNUSED *f,
hid_t UNUSED dxpl_id,
haddr_t addr,
@@ -2092,15 +2127,15 @@ load_datum(H5F_t UNUSED *f,
* JRM -- 7/11/06
* Modified function to return the local_len field instead
* of the len field. These two fields usually contain the
- * same value, but if the size of an entry is changed, we
- * store the altered size in local_len without changing
+ * same value, but if the size of an entry is changed, we
+ * store the altered size in local_len without changing
* len. Note that local_len must be positive, and may
* not exceed len.
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
size_datum(H5F_t UNUSED * f,
void * thing,
size_t * size_ptr)
@@ -2175,12 +2210,10 @@ expunge_entry(H5C_t * cache_ptr,
HDassert( !(entry_ptr->global_pinned) );
HDassert( !(entry_ptr->local_pinned) );
- entry_ptr->dirty = TRUE;
-
if ( nerrors == 0 ) {
- result = H5AC_expunge_entry(file_ptr, -1, &(types[0]),
- entry_ptr->header.addr);
+ result = H5AC_expunge_entry(file_ptr, -1, &(types[0]),
+ entry_ptr->header.addr, H5AC__NO_FLAGS_SET);
if ( result < 0 ) {
@@ -2195,7 +2228,7 @@ expunge_entry(H5C_t * cache_ptr,
HDassert( ! ((entry_ptr->header).is_dirty) );
result = H5C_get_entry_status(cache_ptr, entry_ptr->base_addr,
- NULL, &in_cache, NULL, NULL, NULL);
+ NULL, &in_cache, NULL, NULL, NULL, NULL, NULL);
if ( result < 0 ) {
@@ -2683,7 +2716,7 @@ lock_and_unlock_random_entry(H5C_t * cache_ptr,
* Modifications:
*
* JRM -- 7/11/06
- * Modified asserts to handle the new local_len field in
+ * Modified asserts to handle the new local_len field in
* datum.
*
*****************************************************************************/
@@ -2989,7 +3022,7 @@ pin_protected_entry(H5C_t * cache_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: Error in H5AC_pin_protected entry().\n",
world_mpi_rank, fcn_name);
}
@@ -3004,7 +3037,7 @@ pin_protected_entry(H5C_t * cache_ptr,
} else {
entry_ptr->local_pinned = TRUE;
-
+
local_pins++;
}
@@ -3034,7 +3067,7 @@ pin_protected_entry(H5C_t * cache_ptr,
*
* Modifications:
*
- * 7/11/06 -- JRM
+ * 7/11/06 -- JRM
* Added support for the phony_len field in datum.
*
*****************************************************************************/
@@ -3168,14 +3201,14 @@ resize_entry(H5C_t * cache_ptr,
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
HDassert( !(entry_ptr->header.is_protected) );
HDassert( !(entry_ptr->locked) );
- HDassert( ( entry_ptr->global_pinned ) &&
+ HDassert( ( entry_ptr->global_pinned ) &&
( ! entry_ptr->local_pinned ) );
HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
( entry_ptr->header.size == entry_ptr->local_len ) );
HDassert( new_size > 0 );
HDassert( new_size <= entry_ptr->len );
- result = H5AC_resize_pinned_entry(file_ptr, (void *)entry_ptr,
+ result = H5AC_resize_pinned_entry(file_ptr, (void *)entry_ptr,
new_size);
if ( result < 0 ) {
@@ -3492,7 +3525,7 @@ setup_rand(void)
const char * fcn_name = "setup_rand()";
hbool_t use_predefined_seeds = FALSE;
int num_predefined_seeds = 3;
- unsigned predefined_seeds[3] = {18669, 89925, 12577};
+ unsigned predefined_seeds[3] = {33402, 33505, 33422};
unsigned seed;
struct timeval tv;
struct timezone tz;
@@ -3665,9 +3698,14 @@ unlock_entry(H5C_t * cache_ptr,
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
- if ( ( flags & H5AC__DIRTIED_FLAG ) != 0
- && ( (flags & H5C__DELETED_FLAG) == 0 ) ) {
-
+ if ( ( (flags & H5AC__DIRTIED_FLAG) != 0 ) &&
+ ( (flags & H5C__DELETED_FLAG) == 0 ) &&
+ ( ! ( ( ( world_mpi_rank == 0 ) && ( entry_ptr->flushed ) )
+ ||
+ ( ( world_mpi_rank != 0 ) && ( entry_ptr->cleared ) )
+ )
+ )
+ ) {
HDassert( entry_ptr->header.is_dirty );
HDassert( entry_ptr->dirty );
}
@@ -3740,7 +3778,7 @@ unpin_entry(H5C_t * cache_ptr,
if ( dirty ) {
- mark_pinned_entry_dirty(cache_ptr, file_ptr, idx, FALSE,
+ mark_pinned_entry_dirty(cache_ptr, file_ptr, idx, FALSE,
(size_t)0);
}
@@ -4414,6 +4452,8 @@ smoke_check_3(void)
{
const char * fcn_name = "smoke_check_3()";
hbool_t success = TRUE;
+ hbool_t verbose = FALSE;
+ int cp = 0;
int i;
int max_nerrors;
int min_count;
@@ -4430,12 +4470,18 @@ smoke_check_3(void)
TESTING("smoke check #3");
}
+ /* 0 */
+ if ( verbose ) { HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); }
+
nerrors = 0;
init_data();
reset_stats();
if ( world_mpi_rank == world_server_mpi_rank ) {
+ /* 1 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
if ( ! server_main() ) {
/* some error occured in the server -- report failure */
@@ -4445,9 +4491,15 @@ smoke_check_3(void)
world_mpi_rank, fcn_name);
}
}
+
+ /* 2 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
}
else /* run the clients */
{
+ /* 1 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
if ( ! setup_cache_for_test(&fid, &file_ptr, &cache_ptr) ) {
nerrors++;
@@ -4459,6 +4511,9 @@ smoke_check_3(void)
}
}
+ /* 2 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
min_count = 100 / ((file_mpi_rank + 1) * (file_mpi_rank + 1));
max_count = min_count + 50;
@@ -4474,6 +4529,9 @@ smoke_check_3(void)
}
}
+ /* 3 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
min_count = 100 / ((file_mpi_rank + 2) * (file_mpi_rank + 2));
max_count = min_count + 50;
@@ -4514,6 +4572,9 @@ smoke_check_3(void)
}
+ /* 4 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
/* flush the file to be sure that we have no problems flushing
* pinned entries
@@ -4526,6 +4587,9 @@ smoke_check_3(void)
}
}
+ /* 5 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
min_idx = 0;
max_idx = ((virt_num_data_entries / 10) /
@@ -4560,6 +4624,9 @@ smoke_check_3(void)
}
}
+ /* 6 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
min_idx = 0;
max_idx = ((virt_num_data_entries / 10) /
((file_mpi_rank + 3) * (file_mpi_rank + 3))) - 1;
@@ -4576,6 +4643,9 @@ smoke_check_3(void)
min_idx, max_idx, 0, 100);
}
+ /* 7 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
/* we can't rename pinned entries, so release any local pins now. */
local_unpin_all_entries(cache_ptr, file_ptr, FALSE);
@@ -4594,6 +4664,9 @@ smoke_check_3(void)
min_count, max_count);
}
+ /* 8 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
/* ...and then rename them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
@@ -4606,6 +4679,9 @@ smoke_check_3(void)
min_count, max_count);
}
+ /* 9 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
/* finally, do some dirty lock/unlocks while we give the cache
* a chance t reduce its size.
*/
@@ -4629,6 +4705,9 @@ smoke_check_3(void)
}
}
+ /* 10 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
/* release any local pins before we take down the cache. */
local_unpin_all_entries(cache_ptr, file_ptr, FALSE);
@@ -4644,6 +4723,9 @@ smoke_check_3(void)
}
}
+ /* 11 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
+
/* verify that all instances of datum are back where the started
* and are clean.
*/
@@ -4678,6 +4760,9 @@ smoke_check_3(void)
}
}
}
+
+ /* 12 */
+ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
}
max_nerrors = get_max_nerrors();
@@ -4813,7 +4898,7 @@ smoke_check_4(void)
/* Insert some entries pinned, and then unpin them
* immediately. We have tested pinned entries elsewhere,
- * so it should be sufficient to verify that the
+ * so it should be sufficient to verify that the
* entries are in fact pinned (which unpin_entry() should do).
*/
insert_entry(cache_ptr, file_ptr, i, H5C__PIN_ENTRY_FLAG);
@@ -5035,7 +5120,7 @@ smoke_check_4(void)
* Modifications:
*
* JRM -- 7/12/06
- * Added test code for H5AC_expunge_entry() and
+ * Added test code for H5AC_expunge_entry() and
* H5AC_resize_pinned_entry().
*
*****************************************************************************/
@@ -5045,6 +5130,8 @@ smoke_check_5(void)
{
const char * fcn_name = "smoke_check_5()";
hbool_t success = TRUE;
+ hbool_t verbose = FALSE;
+ int cp = 0;
int i;
int max_nerrors;
hid_t fid = -1;
@@ -5057,12 +5144,20 @@ smoke_check_5(void)
TESTING("smoke check #5");
}
+ /* 0 */
+ if ( verbose ) { HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); }
+
nerrors = 0;
init_data();
reset_stats();
if ( world_mpi_rank == world_server_mpi_rank ) {
+ /* 1 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
if ( ! server_main() ) {
/* some error occured in the server -- report failure */
@@ -5072,9 +5167,20 @@ smoke_check_5(void)
world_mpi_rank, fcn_name);
}
}
+
+ /* 2 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
}
else /* run the clients */
{
+
+ /* 1 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
if ( ! setup_cache_for_test(&fid, &file_ptr, &cache_ptr) ) {
nerrors++;
@@ -5086,11 +5192,21 @@ smoke_check_5(void)
}
}
+ /* 2 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
}
+ /* 3 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
/* flush the file so we can lock known clean entries. */
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
@@ -5100,6 +5216,11 @@ smoke_check_5(void)
}
}
+ /* 4 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
for ( i = 0; i < (virt_num_data_entries / 4); i++ )
{
lock_entry(cache_ptr, file_ptr, i);
@@ -5123,6 +5244,11 @@ smoke_check_5(void)
}
}
+ /* 5 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
for ( i = (virt_num_data_entries / 2) - 1;
i >= (virt_num_data_entries / 4);
i-- )
@@ -5156,6 +5282,11 @@ smoke_check_5(void)
unpin_entry(cache_ptr, file_ptr, i, TRUE, FALSE, FALSE);
}
+ /* 6 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
if ( fid >= 0 ) {
if ( ! take_down_cache(fid) ) {
@@ -5168,6 +5299,11 @@ smoke_check_5(void)
}
}
+ /* 7 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
/* verify that all instance of datum are back where the started
* and are clean.
*/
@@ -5178,6 +5314,11 @@ smoke_check_5(void)
HDassert( ! (data[i].dirty) );
}
+ /* 8 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
+
/* compose the done message */
mssg.req = DONE_REQ_CODE;
mssg.src = world_mpi_rank;
@@ -5201,6 +5342,11 @@ smoke_check_5(void)
}
}
}
+
+ /* 9 */
+ if ( verbose ) {
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ }
}
max_nerrors = get_max_nerrors();
@@ -5237,7 +5383,7 @@ smoke_check_5(void)
* H5AC level, so all calls have to go through H5AC. Thus it
* is more convenient to test trace file capabilities in the
* parallel cache test which works at the H5AC level, instead
- * of in the serial test code which does everything at the
+ * of in the serial test code which does everything at the
* H5C level.
*
* The function must test trace file output in the following
@@ -5267,9 +5413,9 @@ smoke_check_5(void)
* Modifications:
*
* JRM -- 7/11/06
- * Updated fro H5AC_expunge_entry() and
+ * Updated fro H5AC_expunge_entry() and
* H5AC_resize_pinned_entry().
- *
+ *
*****************************************************************************/
hbool_t
@@ -5305,7 +5451,7 @@ trace_file_check(void)
"H5AC_unpin_entry 4 0\n",
"H5AC_rename 0 8a65 15 0\n",
"H5AC_rename 8a65 0 15 0\n",
- "H5AC_flush 0x0 0\n",
+ "H5AC_flush 0\n",
NULL
};
char buffer[256];
@@ -5365,12 +5511,12 @@ trace_file_check(void)
config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
+ if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
!= SUCCEED ) {
nerrors++;
- HDfprintf(stdout,
- "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
+ HDfprintf(stdout,
+ "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
world_mpi_rank, fcn_name);
} else {
@@ -5378,11 +5524,11 @@ trace_file_check(void)
config.open_trace_file = TRUE;
strcpy(config.trace_file_name, "t_cache_trace.txt");
- if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
+ if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
!= SUCCEED ) {
nerrors++;
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
world_mpi_rank, fcn_name);
}
@@ -5419,7 +5565,7 @@ trace_file_check(void)
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5428,12 +5574,12 @@ trace_file_check(void)
config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
+ if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
!= SUCCEED ) {
nerrors++;
- HDfprintf(stdout,
- "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
+ HDfprintf(stdout,
+ "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
world_mpi_rank, fcn_name);
} else {
@@ -5442,11 +5588,11 @@ trace_file_check(void)
config.close_trace_file = TRUE;
config.trace_file_name[0] = '\0';
- if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
+ if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
!= SUCCEED ) {
nerrors++;
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
world_mpi_rank, fcn_name);
}
@@ -5465,7 +5611,7 @@ trace_file_check(void)
}
}
- /* verify that all instance of datum are back where the started
+ /* verify that all instance of datum are back where the started
* and are clean.
*/
@@ -5493,22 +5639,22 @@ trace_file_check(void)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
world_mpi_rank, fcn_name);
}
}
}
if ( nerrors == 0 ) {
-
- sprintf(trace_file_name, "t_cache_trace.txt.%d",
+
+ sprintf(trace_file_name, "t_cache_trace.txt.%d",
(int)file_mpi_rank);
if ( (trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: HDfopen failed.\n",
+ HDfprintf(stdout, "%d:%s: HDfopen failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5544,7 +5690,7 @@ trace_file_check(void)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: Unexpected data in trace file line %d.\n",
world_mpi_rank, fcn_name, i);
HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n",
@@ -5785,10 +5931,10 @@ main(int argc, char **argv)
#endif
#if 1
smoke_check_5();
-#endif
+#endif
#if 1
trace_file_check();
-#endif
+#endif
finish:
/* make sure all processes are finished before final report, cleanup
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c
index 5d02822..4c581f6 100644
--- a/testpar/t_chunk_alloc.c
+++ b/testpar/t_chunk_alloc.c
@@ -24,9 +24,9 @@
#include "testphdf5.h"
static int mpi_size, mpi_rank;
-#define DATASETNAME "ExtendibleArray"
-#define CHUNKSIZE 1000 /* #elements per chunk */
-#define DSETCHUNKS 20000
+#define DSET_NAME "ExtendibleArray"
+#define CHUNK_SIZE 1000 /* #elements per chunk */
+#define CHUNK_FACTOR 200 /* default dataset size in terms of chunks */
#define CLOSE 1
#define NO_CLOSE 0
@@ -78,12 +78,12 @@ typedef enum access_ {
/*
- * This creates a dataset serially with 'nchunks' chunks, each of CHUNKSIZE
+ * This creates a dataset serially with chunks, each of CHUNK_SIZE
* elements. The allocation time is set to H5D_ALLOC_TIME_EARLY. Another
* routine will open this in parallel for extension test.
*/
-void
-create_chunked_dataset(const char *filename, int nchunks, write_type write_pattern)
+static void
+create_chunked_dataset(const char *filename, int chunk_factor, write_type write_pattern)
{
hid_t file_id, dataset; /* handles */
hid_t dataspace,memspace;
@@ -91,15 +91,14 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
hsize_t dims[1];
hsize_t maxdims[1] = {H5S_UNLIMITED};
- hsize_t chunk_dims[1] ={CHUNKSIZE};
+ hsize_t chunk_dims[1] ={CHUNK_SIZE};
hsize_t count[1];
hsize_t stride[1];
hsize_t block[1];
hsize_t offset[1]; /* Selection offset within dataspace */
/* Variables used in reading data back */
- char buffer[CHUNKSIZE];
- int i;
-
+ char buffer[CHUNK_SIZE];
+ long nchunks;
herr_t hrc;
MPI_Offset filesize, /* actual file size */
@@ -111,8 +110,8 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
/* Only MAINPROCESS should create the file. Others just wait. */
if (MAINPROCESS){
-
- dims[0]=nchunks*CHUNKSIZE;
+ nchunks=chunk_factor*mpi_size;
+ dims[0]=nchunks*CHUNK_SIZE;
/* Create the data space with unlimited dimensions. */
dataspace = H5Screate_simple (1, dims, maxdims);
VRFY((dataspace >= 0), "");
@@ -136,11 +135,11 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
VRFY((hrc >= 0), "");
/* Create a new dataset within the file using cparms creation properties. */
- dataset = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
+ dataset = H5Dcreate2(file_id, DSET_NAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
VRFY((dataset >= 0), "");
if(write_pattern == sec_last) {
- HDmemset(buffer, 100, CHUNKSIZE);
+ HDmemset(buffer, 100, CHUNK_SIZE);
count[0] = 1;
stride[0] = 1;
@@ -175,7 +174,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
/* verify file size */
filesize = get_filesize(filename);
- est_filesize = nchunks * CHUNKSIZE * sizeof(unsigned char);
+ est_filesize = nchunks * CHUNK_SIZE * sizeof(unsigned char);
VRFY((filesize >= est_filesize), "file size check");
}
@@ -191,38 +190,41 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
/*
* This program performs three different types of parallel access. It writes on
- * the entire dataset, it extends the dataset to nchunks*CHUNKSIZE, and it only
+ * the entire dataset, it extends the dataset to nchunks*CHUNK_SIZE, and it only
* opens the dataset. At the end, it verifies the size of the dataset to be
- * consistent with argument 'nchunks'.
+ * consistent with argument 'chunk_factor'.
*/
-void
-parallel_access_dataset(const char *filename, int nchunks, access_type action, hid_t *file_id, hid_t *dataset)
+static void
+parallel_access_dataset(const char *filename, int chunk_factor, access_type action, hid_t *file_id, hid_t *dataset)
{
/* HDF5 gubbins */
hid_t memspace, dataspace; /* HDF5 file identifier */
hid_t access_plist; /* HDF5 ID for file access property list */
herr_t hrc; /* HDF5 return code */
hsize_t size[1];
- hsize_t dim_size;
- hsize_t chunk_dims[1] ={CHUNKSIZE};
+ hsize_t chunk_dims[1] ={CHUNK_SIZE};
hsize_t count[1];
hsize_t stride[1];
hsize_t block[1];
hsize_t offset[1]; /* Selection offset within dataspace */
+ hsize_t dims[1];
+ hsize_t maxdims[1];
+
/* Variables used in reading data back */
- char buffer[CHUNKSIZE];
+ char buffer[CHUNK_SIZE];
int i;
-
+ long nchunks;
/* MPI Gubbins */
MPI_Offset filesize, /* actual file size */
est_filesize; /* estimated file size */
- int mpierr;
/* Initialize MPI */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
+ nchunks=chunk_factor*mpi_size;
+
/* Set up MPIO file access property lists */
access_plist = H5Pcreate(H5P_FILE_ACCESS);
VRFY((access_plist >= 0), "");
@@ -238,7 +240,7 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
/* Open dataset*/
if (*dataset<0){
- *dataset = H5Dopen2(*file_id, DATASETNAME, H5P_DEFAULT);
+ *dataset = H5Dopen2(*file_id, DSET_NAME, H5P_DEFAULT);
VRFY((*dataset >= 0), "");
}
@@ -248,19 +250,18 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
dataspace = H5Dget_space(*dataset);
VRFY((dataspace >= 0), "");
- size[0] = nchunks*CHUNKSIZE;
+ size[0] = nchunks*CHUNK_SIZE;
switch (action) {
/* all chunks are written by all the processes in an interleaved way*/
case write_all:
- memset(buffer, mpi_rank+1, CHUNKSIZE);
+ memset(buffer, mpi_rank+1, CHUNK_SIZE);
count[0] = 1;
stride[0] = 1;
block[0] = chunk_dims[0];
- for (i=0; i<(nchunks+mpi_size-1)/mpi_size; i++){
- if (i*mpi_size+mpi_rank < nchunks){
+ for (i=0; i<nchunks/mpi_size; i++){
offset[0] = (i*mpi_size+mpi_rank)*chunk_dims[0];
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
@@ -269,21 +270,24 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
/* Write the buffer out */
hrc = H5Dwrite(*dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
VRFY((hrc >= 0), "H5Dwrite");
- }
-
}
break;
/* only extends the dataset */
case extend_only:
- /* Extend dataset*/
- hrc = H5Dset_extent(*dataset, size);
+ /* check if new size is larger than old size */
+ hrc = H5Sget_simple_extent_dims(dataspace, dims, maxdims);
VRFY((hrc >= 0), "");
+ /* Extend dataset*/
+ if (size[0] > dims[0]) {
+ hrc = H5Dset_extent(*dataset, size);
+ VRFY((hrc >= 0), "");
+ }
break;
- /* only opens the dataset */
+ /* only opens the *dataset */
case open_only:
break;
@@ -295,10 +299,10 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
*dataset = -1;
hrc = H5Sclose (dataspace);
- VRFY((hrc >= 0), "");
+ VRFY((hrc >= 0), "");
- hrc = H5Sclose (memspace);
- VRFY((hrc >= 0), "");
+ hrc = H5Sclose (memspace);
+ VRFY((hrc >= 0), "");
hrc = H5Fclose(*file_id);
VRFY((hrc >= 0), "");
@@ -306,7 +310,7 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
/* verify file size */
filesize = get_filesize(filename);
- est_filesize = nchunks*CHUNKSIZE*sizeof(unsigned char);
+ est_filesize = nchunks*CHUNK_SIZE*sizeof(unsigned char);
VRFY((filesize >= est_filesize), "file size check");
/* Can close some plists */
@@ -328,32 +332,30 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
* 3. it returns correct values when the whole dataset has been written in an
* interleaved pattern.
*/
-void verify_data(const char *filename, int nchunks, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset)
+static void
+verify_data(const char *filename, int chunk_factor, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset)
{
/* HDF5 gubbins */
hid_t dataspace, memspace; /* HDF5 file identifier */
hid_t access_plist; /* HDF5 ID for file access property list */
herr_t hrc; /* HDF5 return code */
- hsize_t chunk_dims[1] ={CHUNKSIZE};
+ hsize_t chunk_dims[1] ={CHUNK_SIZE};
hsize_t count[1];
hsize_t stride[1];
hsize_t block[1];
hsize_t offset[1]; /* Selection offset within dataspace */
/* Variables used in reading data back */
- char buffer[CHUNKSIZE];
+ char buffer[CHUNK_SIZE];
int value, i;
- int index, current;
-
- /* MPI Gubbins */
- MPI_Offset filesize, /* actual file size */
- est_filesize; /* estimated file size */
- int mpierr;
-
+ int index;
+ long nchunks;
/* Initialize MPI */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
+ nchunks=chunk_factor*mpi_size;
+
/* Set up MPIO file access property lists */
access_plist = H5Pcreate(H5P_FILE_ACCESS);
VRFY((access_plist >= 0), "");
@@ -369,7 +371,7 @@ void verify_data(const char *filename, int nchunks, write_type write_pattern, in
/* Open dataset*/
if (*dataset<0){
- *dataset = H5Dopen2(*file_id, DATASETNAME, H5P_DEFAULT);
+ *dataset = H5Dopen2(*file_id, DSET_NAME, H5P_DEFAULT);
VRFY((*dataset >= 0), "");
}
@@ -385,7 +387,7 @@ void verify_data(const char *filename, int nchunks, write_type write_pattern, in
block[0] = chunk_dims[0];
for (i=0; i<nchunks; i++){
/* reset buffer values */
- memset(buffer, -1, CHUNKSIZE);
+ memset(buffer, -1, CHUNK_SIZE);
offset[0] = i*chunk_dims[0];
@@ -405,16 +407,15 @@ void verify_data(const char *filename, int nchunks, write_type write_pattern, in
value = 0;
break;
case sec_last:
- if (i==(nchunks-2))
+ if (i==nchunks-2)
value = 100;
else
value = 0;
}
/* verify content of the chunk */
- for (index = 0; index < CHUNKSIZE; index++)
+ for (index = 0; index < CHUNK_SIZE; index++)
VRFY((buffer[index] == value), "data verification");
-
}
hrc = H5Sclose (dataspace);
@@ -472,6 +473,10 @@ test_chunk_alloc(void)
hid_t file_id, dataset;
file_id = dataset = -1;
+
+ /* Initialize MPI */
+ MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
filename = GetTestParameters();
if (VERBOSE_MED)
@@ -479,28 +484,28 @@ test_chunk_alloc(void)
/* Case 1 */
/* Create chunked dataset without writing anything.*/
- create_chunked_dataset(filename, DSETCHUNKS, none);
+ create_chunked_dataset(filename, CHUNK_FACTOR, none);
/* reopen dataset in parallel and check for file size */
- parallel_access_dataset(filename, DSETCHUNKS, open_only, &file_id, &dataset);
+ parallel_access_dataset(filename, CHUNK_FACTOR, open_only, &file_id, &dataset);
/* reopen dataset in parallel, read and verify the data */
- verify_data(filename, DSETCHUNKS, none, CLOSE, &file_id, &dataset);
+ verify_data(filename, CHUNK_FACTOR, none, CLOSE, &file_id, &dataset);
/* Case 2 */
/* Create chunked dataset without writing anything */
create_chunked_dataset(filename, 20, none);
/* reopen dataset in parallel and only extend it */
- parallel_access_dataset(filename, DSETCHUNKS, extend_only, &file_id, &dataset);
+ parallel_access_dataset(filename, CHUNK_FACTOR, extend_only, &file_id, &dataset);
/* reopen dataset in parallel, read and verify the data */
- verify_data(filename, DSETCHUNKS, none, CLOSE, &file_id, &dataset);
+ verify_data(filename, CHUNK_FACTOR, none, CLOSE, &file_id, &dataset);
/* Case 3 */
/* Create chunked dataset and write in the second to last chunk */
- create_chunked_dataset(filename, DSETCHUNKS, sec_last);
+ create_chunked_dataset(filename, CHUNK_FACTOR, sec_last);
/* Reopen dataset in parallel, read and verify the data. The file and dataset are not closed*/
- verify_data(filename, DSETCHUNKS, sec_last, NO_CLOSE, &file_id, &dataset);
+ verify_data(filename, CHUNK_FACTOR, sec_last, NO_CLOSE, &file_id, &dataset);
/* All processes write in all the chunks in a interleaved way */
- parallel_access_dataset(filename, DSETCHUNKS, write_all, &file_id, &dataset);
+ parallel_access_dataset(filename, CHUNK_FACTOR, write_all, &file_id, &dataset);
/* reopen dataset in parallel, read and verify the data */
- verify_data(filename, DSETCHUNKS, all, CLOSE, &file_id, &dataset);
+ verify_data(filename, CHUNK_FACTOR, all, CLOSE, &file_id, &dataset);
}
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index 8f4fdf2..61e7bfd 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -36,7 +36,7 @@ static void coll_chunktest(const char* filename,int chunk_factor,int select_fact
/*-------------------------------------------------------------------------
* Function: coll_chunk1
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with a single chunk
*
* Return: Success: 0
@@ -53,7 +53,7 @@ static void coll_chunktest(const char* filename,int chunk_factor,int select_fact
/* ------------------------------------------------------------------------
* Descriptions for the selection: One big singluar selection inside one chunk
- * Two dimensions,
+ * Two dimensions,
*
* dim1 = SPACE_DIM1(5760)*mpi_size
* dim2 = SPACE_DIM2(3)
@@ -71,19 +71,16 @@ static void coll_chunktest(const char* filename,int chunk_factor,int select_fact
void
coll_chunk1(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
-
- filename = GetTestParameters();
- coll_chunktest(filename,1,BYROW_CONT,API_NONE);
-
+ coll_chunktest(filename, 1, BYROW_CONT, API_NONE);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk2
*
- * Purpose: Wrapper to test the collective chunk IO for regular DISJOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular DISJOINT
selection with a single chunk
*
* Return: Success: 0
@@ -100,7 +97,7 @@ coll_chunk1(void)
/* ------------------------------------------------------------------------
* Descriptions for the selection: many disjoint selections inside one chunk
- * Two dimensions,
+ * Two dimensions,
*
* dim1 = SPACE_DIM1*mpi_size(5760)
* dim2 = SPACE_DIM2(3)
@@ -112,25 +109,22 @@ coll_chunk1(void)
* count1 = SPACE_DIM2/stride(3/3 = 1)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk2(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
-
- filename = GetTestParameters();
- coll_chunktest(filename,1,BYROW_DISCONT,API_NONE);
-
+ coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk3
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
* Return: Success: 0
@@ -159,29 +153,24 @@ coll_chunk2(void)
* count1 = SPACE_DIM2(3)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk3(void)
{
+ const char *filename = GetTestParameters();
+ int mpi_size;
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
- MPI_Comm_size(comm,&mpi_size);
-
- filename = GetTestParameters();
- coll_chunktest(filename,mpi_size,BYROW_CONT,API_NONE);
-
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk4
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
* Return: Success: 0
@@ -210,28 +199,22 @@ coll_chunk3(void)
* count1 = SPACE_DIM2(3)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk4(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,1,BYROW_SELECTNONE,API_NONE);
-
+ coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk4
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
* Return: Success: 0
@@ -260,28 +243,22 @@ coll_chunk4(void)
* count1 = SPACE_DIM2(3)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk5(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_HARD);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk6
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
* Return: Success: 0
@@ -310,28 +287,22 @@ coll_chunk5(void)
* count1 = SPACE_DIM2(3)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk6(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_MULTI_HARD);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk7
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
* Return: Success: 0
@@ -360,28 +331,22 @@ coll_chunk6(void)
* count1 = SPACE_DIM2(3)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk7(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_TRUE);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk8
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
* Return: Success: 0
@@ -410,28 +375,22 @@ coll_chunk7(void)
* count1 = SPACE_DIM2(3)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk8(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_FALSE);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk9
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
* Return: Success: 0
@@ -460,28 +419,22 @@ coll_chunk8(void)
* count1 = SPACE_DIM2(3)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk9(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_MULTI_COLL);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL);
}
/*-------------------------------------------------------------------------
* Function: coll_chunk10
*
- * Purpose: Wrapper to test the collective chunk IO for regular JOINT
+ * Purpose: Wrapper to test the collective chunk IO for regular JOINT
selection with at least number of 2*mpi_size chunks
*
* Return: Success: 0
@@ -510,22 +463,16 @@ coll_chunk9(void)
* count1 = SPACE_DIM2(3)
* start0 = mpi_rank*SPACE_DIM1
* start1 = 0
- *
+ *
* ------------------------------------------------------------------------
*/
void
coll_chunk10(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTINCHUNK,API_MULTI_IND);
-
+ coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND);
}
@@ -535,7 +482,7 @@ coll_chunk10(void)
* Purpose: The real testing routine for regular selection of collective
chunking storage
testing both write and read,
- If anything fails, it may be read or write. There is no
+ If anything fails, it may be read or write. There is no
separation test between read and write.
*
* Return: Success: 0
@@ -555,8 +502,8 @@ static void
coll_chunktest(const char* filename,
int chunk_factor,
int select_factor,
- int api_option) {
-
+ int api_option)
+{
hid_t file,dataset, file_dataspace;
hid_t acc_plist,xfer_plist,crp_plist;
@@ -614,7 +561,7 @@ 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");
@@ -676,8 +623,8 @@ coll_chunktest(const char* filename,
break;
default:
;
- }
-
+ }
+
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
if(facc_type == FACC_MPIO) {
switch(api_option) {
@@ -686,38 +633,50 @@ 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");
+
+ prop_value = H5D_XFER_COLL_CHUNK_FIX;
+ status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_TO_MULTI, H5D_XFER_COLL_CHUNK_SIZE, &prop_value,
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ VRFY((status >= 0),"testing property list inserted succeeded");
+
break;
case API_MULTI_HARD:
- prop_value = H5D_XFER_COLL_CHUNK_DEF;
+ 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;
case API_LINK_TRUE:
- prop_value = H5D_XFER_COLL_CHUNK_DEF;
+ 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");
+
+ prop_value = H5D_XFER_COLL_CHUNK_FIX;
+ status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_TO_MULTI_OPT, H5D_XFER_COLL_CHUNK_SIZE, &prop_value,
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ VRFY((status >= 0),"testing property list inserted succeeded");
+
break;
case API_LINK_FALSE:
- prop_value = H5D_XFER_COLL_CHUNK_DEF;
+ 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;
case API_MULTI_COLL:
- prop_value = H5D_XFER_COLL_CHUNK_DEF;
+ 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;
case API_MULTI_IND:
- prop_value = H5D_XFER_COLL_CHUNK_DEF;
+ 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");
@@ -725,10 +684,10 @@ coll_chunktest(const char* filename,
default:
;
- }
+ }
}
#endif
-
+
/* write data collectively */
status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, file_dataspace,
xfer_plist, data_array1);
@@ -740,7 +699,11 @@ coll_chunktest(const char* filename,
case API_LINK_HARD:
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 without optimization succeeded");
+ if(prop_value !=0){/*double check if the option is switched to multiple chunk internally.*/
+ status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_TO_MULTI, &prop_value);
+ VRFY((status >= 0),"testing property list get succeeded");
+ VRFY((prop_value == 1),"API to set LINK COLLECTIVE IO without optimization succeeded");
+ }
break;
case API_MULTI_HARD:
status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME,&prop_value);
@@ -750,7 +713,11 @@ coll_chunktest(const char* filename,
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 with true optimization succeeded");
+ if(prop_value !=0){/*double check if the option is switched to multiple chunk internally.*/
+ status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_TO_MULTI_OPT, &prop_value);
+ VRFY((status >= 0),"testing property list get succeeded");
+ VRFY((prop_value == 1),"API to set LINK COLLECTIVE IO without optimization succeeded");
+ }
break;
case API_LINK_FALSE:
status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME,&prop_value);
@@ -769,7 +736,7 @@ coll_chunktest(const char* filename,
break;
default:
;
- }
+ }
}
#endif
@@ -787,7 +754,7 @@ coll_chunktest(const char* filename,
if (data_array1) HDfree(data_array1);
-
+
/* Use collective read to verify the correctness of collective write. */
/* allocate memory for data buffer */
@@ -864,12 +831,12 @@ coll_chunktest(const char* filename,
/* Set up the selection */
static void
-ccslab_set(int mpi_rank,
- int mpi_size,
- hsize_t start[],
+ccslab_set(int mpi_rank,
+ int mpi_size,
+ hsize_t start[],
hsize_t count[],
- hsize_t stride[],
- hsize_t block[],
+ hsize_t stride[],
+ hsize_t block[],
int mode)
{
@@ -918,7 +885,7 @@ ccslab_set(int mpi_rank,
case BYROW_SELECTUNBALANCE:
/* The first one-third of the number of processes only
select top half of the domain, The rest will select the bottom
- half of the domain. */
+ half of the domain. */
block[0] = 1;
count[0] = 2;
@@ -928,9 +895,9 @@ ccslab_set(int mpi_rank,
start[1] = 0;
stride[1] = 1;
if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank;
- else start[0] = 1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3);
+ else start[0] = 1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3);
break;
-
+
case BYROW_SELECTINCHUNK:
/* Each process will only select one chunk */
@@ -972,10 +939,10 @@ ccslab_set(int mpi_rank,
* Assume dimension rank is 2.
*/
static void
-ccdataset_fill(hsize_t start[],
+ccdataset_fill(hsize_t start[],
hsize_t stride[],
- hsize_t count[],
- hsize_t block[],
+ hsize_t count[],
+ hsize_t block[],
DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
@@ -1007,8 +974,8 @@ ccdataset_fill(hsize_t start[],
* Print the first block of the content of the dataset.
*/
static void
-ccdataset_print(hsize_t start[],
- hsize_t block[],
+ccdataset_print(hsize_t start[],
+ hsize_t block[],
DATATYPE * dataset)
{
@@ -1038,11 +1005,11 @@ ccdataset_print(hsize_t start[],
* Print the content of the dataset.
*/
static int
-ccdataset_vrfy(hsize_t start[],
- hsize_t count[],
- hsize_t stride[],
- hsize_t block[],
- DATATYPE *dataset,
+ccdataset_vrfy(hsize_t start[],
+ hsize_t count[],
+ hsize_t stride[],
+ hsize_t block[],
+ DATATYPE *dataset,
DATATYPE *original)
{
hsize_t i, j,k1,k2;
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index ce4742b..21e25b6 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -827,7 +827,7 @@ dataset_writeAll(void)
VRFY((ret>= 0),"set independent IO collectively succeeded");
}
-
+
/* write data collectively */
MESG("writeAll with scalar dataspace");
diff --git a/testpar/t_file.c b/testpar/t_file.c
index 9de4e0e..ff983a9 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -36,7 +36,7 @@ test_split_comm_access(void)
int mpi_size, mpi_rank;
MPI_Comm comm;
MPI_Info info = MPI_INFO_NULL;
- int color, mrc;
+ int is_old, mrc;
int newrank, newprocs;
hid_t fid; /* file IDs */
hid_t acc_tpl; /* File access properties */
@@ -52,13 +52,13 @@ test_split_comm_access(void)
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
- color = mpi_rank%2;
- mrc = MPI_Comm_split (MPI_COMM_WORLD, color, mpi_rank, &comm);
+ is_old = mpi_rank%2;
+ mrc = MPI_Comm_split (MPI_COMM_WORLD, is_old, mpi_rank, &comm);
VRFY((mrc==MPI_SUCCESS), "");
MPI_Comm_size(comm,&newprocs);
MPI_Comm_rank(comm,&newrank);
- if (color){
+ if (is_old){
/* odd-rank processes */
mrc = MPI_Barrier(comm);
VRFY((mrc==MPI_SUCCESS), "");
diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c
index e2d39c3..f38b30e 100644
--- a/testpar/t_filter_read.c
+++ b/testpar/t_filter_read.c
@@ -15,7 +15,7 @@
/*
* This verifies the correctness of parallel reading of a dataset that has been
- * written serially using filters.
+ * written serially using filters.
*
* Created by: Christian Chilan
* Date: 2007/05/15
@@ -31,11 +31,11 @@
static int mpi_size, mpi_rank;
/* Chunk sizes */
-#define CHUNK_DIM1 7
+#define CHUNK_DIM1 7
#define CHUNK_DIM2 27
/* Sizes of the vertical hyperslabs. Total dataset size is
- {HS_DIM1, HS_DIM2 * mpi_size } */
+ {HS_DIM1, HS_DIM2 * mpi_size } */
#define HS_DIM1 200
#define HS_DIM2 100
@@ -44,16 +44,16 @@ static int mpi_size, mpi_rank;
* Function: filter_read_internal
*
* Purpose: Tests parallel reading of a 2D dataset written serially using
- * filters. During the parallel reading phase, the dataset is
- * divided evenly among the processors in vertical hyperslabs.
+ * filters. During the parallel reading phase, the dataset is
+ * divided evenly among the processors in vertical hyperslabs.
*
- * Programmer: Christian Chilan
- * Tuesday, May 15, 2007
+ * Programmer: Christian Chilan
+ * Tuesday, May 15, 2007
*
*-------------------------------------------------------------------------
*/
-static void
-filter_read_internal(const char *filename, hid_t dcpl,
+static void
+filter_read_internal(const char *filename, hid_t dcpl,
hsize_t *dset_size)
{
hid_t file, dataset; /* HDF5 IDs */
@@ -65,14 +65,14 @@ filter_read_internal(const char *filename, hid_t dcpl,
size_t i, j; /* Local index variables */
char name[32] = "dataset";
herr_t hrc; /* Error status */
- int *points = NULL; /* Writing buffer for entire dataset */
+ int *points = NULL; /* Writing buffer for entire dataset */
int *check = NULL; /* Reading buffer for selected hyperslab */
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
- /* set sizes for dataset and hyperslabs */
+ /* set sizes for dataset and hyperslabs */
hs_size[0] = size[0] = HS_DIM1;
hs_size[1] = HS_DIM2;
@@ -80,7 +80,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
hs_offset[0] = 0;
hs_offset[1] = hs_size[1] * mpi_rank;
-
+
/* Create the data space */
sid = H5Screate_simple(2, size, NULL);
VRFY(sid>=0, "H5Screate_simple");
@@ -89,7 +89,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
points = (int *)HDmalloc(size[0] * size[1] * sizeof(int));
VRFY(points!=NULL, "HDmalloc");
- check = (int *)HDmalloc(hs_size[0] * hs_size[1] * sizeof(int));
+ check = (int *)HDmalloc(hs_size[0] * hs_size[1] * sizeof(int));
VRFY(check!=NULL, "HDmalloc");
/* Initialize writing buffer with random data */
@@ -124,7 +124,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
MPI_Barrier(MPI_COMM_WORLD);
- /* Parallel read phase */
+ /* Parallel read phase */
/* Set up MPIO file access property lists */
access_plist = H5Pcreate(H5P_FILE_ACCESS);
VRFY((access_plist >= 0), "H5Pcreate");
@@ -144,7 +144,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
memspace = H5Screate_simple(2, hs_size, NULL);
VRFY(memspace>=0, "H5Screate_simple");
-
+
hrc = H5Dread (dataset, H5T_NATIVE_INT, memspace, sid, H5P_DEFAULT, check);
VRFY(hrc>=0, "H5Dread");
@@ -179,13 +179,13 @@ filter_read_internal(const char *filename, hid_t dcpl,
hrc = H5Sclose (memspace);
VRFY(hrc>=0, "H5Sclose");
-
+
hrc = H5Pclose (access_plist);
VRFY(hrc>=0, "H5Pclose");
-
+
hrc = H5Fclose (file);
VRFY(hrc>=0, "H5Fclose");
-
+
free(points);
free(check);
@@ -194,10 +194,10 @@ filter_read_internal(const char *filename, hid_t dcpl,
/*-------------------------------------------------------------------------
- * Function: test_filter_read
+ * Function: test_filter_read
*
* Purpose: Tests parallel reading of datasets written serially using
- * several (combinations of) filters.
+ * several (combinations of) filters.
*
* Programmer: Christian Chilan
* Tuesday, May 15, 2007
@@ -210,7 +210,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
void
test_filter_read(void)
{
- hid_t dc,file; /* HDF5 IDs */
+ hid_t dc; /* HDF5 IDs */
const hsize_t chunk_size[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */
hsize_t null_size; /* Size of dataset without filters */
herr_t hrc;
@@ -247,16 +247,16 @@ test_filter_read(void)
*----------------------------------------------------------
*/
dc = H5Pcreate(H5P_DATASET_CREATE);
- VRFY(dc>=0,"H5Pcreate");
+ VRFY(dc>=0,"H5Pcreate");
hrc = H5Pset_chunk (dc, 2, chunk_size);
- VRFY(hrc>=0,"H5Pset_chunk");
+ VRFY(hrc>=0,"H5Pset_chunk");
filter_read_internal(filename,dc,&null_size);
/* Clean up objects used for this test */
hrc = H5Pclose (dc);
- VRFY(hrc>=0,"H5Pclose");
+ VRFY(hrc>=0,"H5Pclose");
/*----------------------------------------------------------
* STEP 1: Test Fletcher32 Checksum by itself.
@@ -265,13 +265,13 @@ test_filter_read(void)
#ifdef H5_HAVE_FILTER_FLETCHER32
dc = H5Pcreate(H5P_DATASET_CREATE);
- VRFY(dc>=0,"H5Pset_filter");
-
+ VRFY(dc>=0,"H5Pset_filter");
+
hrc = H5Pset_chunk (dc, 2, chunk_size);
- VRFY(hrc>=0,"H5Pset_filter");
-
+ VRFY(hrc>=0,"H5Pset_filter");
+
hrc = H5Pset_filter (dc,H5Z_FILTER_FLETCHER32,0,0,NULL);
- VRFY(hrc>=0,"H5Pset_filter");
+ VRFY(hrc>=0,"H5Pset_filter");
filter_read_internal(filename,dc,&fletcher32_size);
VRFY(fletcher32_size > null_size,"Size after checksumming is incorrect.");
@@ -296,7 +296,7 @@ test_filter_read(void)
hrc = H5Pset_deflate (dc, 6);
VRFY(hrc>=0, "H5Pset_deflate");
-
+
filter_read_internal(filename,dc,&deflate_size);
/* Clean up objects used for this test */
@@ -344,7 +344,7 @@ test_filter_read(void)
filter_read_internal(filename,dc,&shuffle_size);
VRFY(shuffle_size==null_size,"Shuffled size not the same as uncompressed size.");
-
+
/* Clean up objects used for this test */
hrc = H5Pclose (dc);
VRFY(hrc>=0, "H5Pclose");
@@ -362,13 +362,13 @@ test_filter_read(void)
hrc = H5Pset_chunk (dc, 2, chunk_size);
VRFY(hrc>=0, "H5Pset_chunk");
-
+
hrc = H5Pset_fletcher32 (dc);
VRFY(hrc>=0, "H5Pset_fletcher32");
-
+
hrc = H5Pset_shuffle (dc);
VRFY(hrc>=0, "H5Pset_shuffle");
-
+
hrc = H5Pset_deflate (dc, 6);
VRFY(hrc>=0, "H5Pset_deflate");
@@ -381,7 +381,7 @@ test_filter_read(void)
/* Testing shuffle+deflate+checksum filters (checksum last) */
dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0, "H5Pcreate");
-
+
hrc = H5Pset_chunk (dc, 2, chunk_size);
VRFY(hrc>=0, "H5Pset_chunk");
@@ -408,7 +408,7 @@ test_filter_read(void)
*/
#if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
- /* Testing shuffle+szip(with encoder)+checksum filters(checksum first) */
+ /* Testing shuffle+szip(with encoder)+checksum filters(checksum first) */
dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0, "H5Pcreate");
@@ -433,7 +433,7 @@ test_filter_read(void)
hrc = H5Pclose (dc);
VRFY(hrc>=0, "H5Pclose");
- /* Testing shuffle+szip(with encoder)+checksum filters(checksum last) */
+ /* Testing shuffle+szip(with encoder)+checksum filters(checksum last) */
/* Make sure encoding is enabled */
if(h5_szip_can_encode() == 1) {
dc = H5Pcreate(H5P_DATASET_CREATE);
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 2559d3e..51f06d7 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -22,16 +22,16 @@
enum obj_type { is_group, is_dset };
-int get_size(void);
-void write_dataset(hid_t, hid_t, hid_t);
-int read_dataset(hid_t, hid_t, hid_t);
-void create_group_recursive(hid_t, hid_t, hid_t, int);
-void recursive_read_group(hid_t, hid_t, hid_t, int);
-void group_dataset_read(hid_t fid, int mpi_rank, int m);
-void write_attribute(hid_t, int, int);
-int read_attribute(hid_t, int, int);
-int check_value(DATATYPE *, DATATYPE *, int);
-void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int);
+static int get_size(void);
+static void write_dataset(hid_t, hid_t, hid_t);
+static int read_dataset(hid_t, hid_t, hid_t);
+static void create_group_recursive(hid_t, hid_t, hid_t, int);
+static void recursive_read_group(hid_t, hid_t, hid_t, int);
+static void group_dataset_read(hid_t fid, int mpi_rank, int m);
+static void write_attribute(hid_t, int, int);
+static int read_attribute(hid_t, int, int);
+static int check_value(DATATYPE *, DATATYPE *, int);
+static void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int);
/*
@@ -44,7 +44,8 @@ void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int);
* JRM - 8/11/04
*/
-int get_size(void)
+static int
+get_size(void)
{
int mpi_rank;
int mpi_size;
@@ -368,7 +369,7 @@ void null_dataset(void)
VRFY((ret>= 0),"set independent IO collectively succeeded");
}
-
+
dataset = H5Dopen2(iof, dname, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dopen2 succeeded");
@@ -456,8 +457,8 @@ void big_dataset(void)
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
- file_size=h5_get_file_size(filename);
- VRFY((file_size == 2147485696ULL), "File is correct size(~2GB)");
+ file_size = h5_get_file_size(filename, fapl);
+ VRFY((file_size == 2147485792ULL), "File is correct size(~2GB)");
/*
* Create >4GB HDF5 file
@@ -485,8 +486,8 @@ void big_dataset(void)
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
- file_size=h5_get_file_size(filename);
- VRFY((file_size == 4294969344ULL), "File is correct size(~4GB)");
+ file_size = h5_get_file_size(filename, fapl);
+ VRFY((file_size == 4294969440ULL), "File is correct size(~4GB)");
/*
* Create >8GB HDF5 file
@@ -514,8 +515,8 @@ void big_dataset(void)
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
- file_size=h5_get_file_size(filename);
- VRFY((file_size == 8589936640ULL), "File is correct size(~8GB)");
+ file_size = h5_get_file_size(filename, fapl);
+ VRFY((file_size == 8589936736ULL), "File is correct size(~8GB)");
/* Close fapl */
ret = H5Pclose(fapl);
@@ -867,7 +868,8 @@ void independent_group_read(void)
*
* JRM - 8/16/04
*/
-void group_dataset_read(hid_t fid, int mpi_rank, int m)
+static void
+group_dataset_read(hid_t fid, int mpi_rank, int m)
{
int ret, i, j, size;
char gname[64], dname[32];
@@ -1035,7 +1037,8 @@ void multiple_group_write(void)
*
* JRM - 8/16/04
*/
-void write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
+static void
+write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
{
int i, j, n, size;
int mpi_rank, mpi_size;
@@ -1074,8 +1077,8 @@ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
* Creates subgroups of depth GROUP_DEPTH recursively. Also writes datasets
* in parallel in each group.
*/
-void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid,
- int counter)
+static void
+create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, int counter)
{
hid_t child_gid;
int mpi_rank;
@@ -1196,7 +1199,8 @@ void multiple_group_read(void)
*
* JRM - 8/11/04
*/
-int read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
+static int
+read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
{
int i, j, n, mpi_rank, mpi_size, size, attr_errors=0, vrfy_errors=0;
char dname[32];
@@ -1250,8 +1254,8 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
* This recursive function opens all the groups in vertical direction and
* checks the data.
*/
-void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid,
- int counter)
+static void
+recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, int counter)
{
hid_t child_gid;
int mpi_rank, err_num=0;
@@ -1278,7 +1282,8 @@ void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid,
/* Create and write attribute for a group or a dataset. For groups, attribute
* is a scalar datum; for dataset, it is a one-dimensional array.
*/
-void write_attribute(hid_t obj_id, int this_type, int num)
+static void
+write_attribute(hid_t obj_id, int this_type, int num)
{
hid_t sid, aid;
hsize_t dspace_dims[1]={8};
@@ -1309,7 +1314,8 @@ void write_attribute(hid_t obj_id, int this_type, int num)
}
/* Read and verify attribute for group or dataset. */
-int read_attribute(hid_t obj_id, int this_type, int num)
+static int
+read_attribute(hid_t obj_id, int this_type, int num)
{
hid_t aid;
hsize_t group_block[2]={1,1}, dset_block[2]={1, 8};
@@ -1351,7 +1357,8 @@ int read_attribute(hid_t obj_id, int this_type, int num)
*
* JRM - 8/16/04
*/
-int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
+static int
+check_value(DATATYPE *indata, DATATYPE *outdata, int size)
{
int mpi_rank, mpi_size, err_num=0;
hsize_t i, j;
@@ -1387,11 +1394,9 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
* JRM - 8/11/04
*/
-void get_slab(hsize_t chunk_origin[],
- hsize_t chunk_dims[],
- hsize_t count[],
- hsize_t file_dims[],
- int size)
+static void
+get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[],
+ hsize_t file_dims[], int size)
{
int mpi_rank, mpi_size;
@@ -1450,10 +1455,6 @@ void io_mode_confusion(void)
hsize_t dimsf[1]; /* dataset dimensions */
int data[N] = {1}; /* pointer to data buffer to write */
hsize_t coord[N] = {0L,1L,2L,3L};
- hsize_t start[1];
- hsize_t stride[1];
- hsize_t count[1];
- hsize_t block[1];
hid_t plist_id; /* property list identifier */
herr_t status;
@@ -1579,11 +1580,6 @@ void io_mode_confusion(void)
VRFY((filespace >= 0 ), "H5Dget_space() failed");
- start[0] = 0L;
- stride[0] = 1;
- count[0] = 1;
- block[0] = N;
-
/* select all */
if(mpi_rank == 0 ) {
if(verbose )
@@ -1591,8 +1587,7 @@ void io_mode_confusion(void)
"%0d:%s: Calling H5Sselect_elements() -- set up hang?\n",
mpi_rank, fcn_name);
- status = H5Sselect_elements(filespace, H5S_SELECT_SET, N,
- &coord);
+ status = H5Sselect_elements(filespace, H5S_SELECT_SET, N, (const hsize_t *)&coord);
VRFY((status >= 0 ), "H5Sselect_elements() failed");
} else { /* select nothing */
if(verbose )
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index f68c92b..9033e70 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -286,8 +286,9 @@ test_mpio_gb_file(char *filename)
VRFY((buf!=NULL), "malloc succeed");
/* open a new file. Remove it first in case it exists. */
- if (MAINPROCESS)
- remove(filename);
+ /* Must delete because MPI_File_open does not have a Truncate mode. */
+ /* Don't care if it has error. */
+ MPI_File_delete(filename, MPI_INFO_NULL);
MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE|MPI_MODE_RDWR,
@@ -379,10 +380,10 @@ test_mpio_gb_file(char *filename)
mrc = MPI_Barrier(MPI_COMM_WORLD);
VRFY((mrc==MPI_SUCCESS), "Sync before leaving test");
- /*
- * Check if MPI_File_get_size works correctly. Some systems (only SGI Altix
+ /*
+ * Check if MPI_File_get_size works correctly. Some systems (only SGI Altix
* Propack 4 so far) return wrong file size. It can be avoided by reconfiguring
- * with "--disable-mpi-size".
+ * with "--disable-mpi-size".
*/
#ifdef H5_HAVE_MPI_GET_SIZE
printf("Test if MPI_File_get_size works correctly with %s\n", filename);
@@ -396,7 +397,7 @@ test_mpio_gb_file(char *filename)
mrc=stat(filename, &stat_buf);
VRFY((mrc==0), "");
-
+
/* Hopefully this casting is safe */
if(size != (MPI_Offset)(stat_buf.st_size)) {
printf("Warning: MPI_File_get_size doesn't return correct file size. To avoid using it in the library, reconfigure and rebuild the library with --disable-mpi-size.\n");
@@ -490,6 +491,7 @@ test_mpio_1wMr(char *filename, int special_request)
/* Must delete because MPI_File_open does not have a Truncate mode. */
/* Don't care if it has error. */
MPI_File_delete(filename, MPI_INFO_NULL);
+ MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
MPI_MODE_RDWR | MPI_MODE_CREATE ,
@@ -697,10 +699,10 @@ static int test_mpio_derived_dtype(char *filename) {
MPI_Datatype etype,filetype;
MPI_Datatype adv_filetype,bas_filetype[2];
MPI_Datatype etypenew, filetypenew;
- MPI_Offset disp,dispnew;
+ MPI_Offset disp;
MPI_Status Status;
MPI_Aint adv_disp[2];
- MPI_Aint offsets[1],adv_offsets[2];
+ MPI_Aint offsets[1];
int blocklens[1],adv_blocklens[2];
int count,outcount;
int retcode;
@@ -847,7 +849,7 @@ static int test_mpio_derived_dtype(char *filename) {
printf("Complicated derived datatype is NOT working at this platform\n");
printf("Go back to hdf5/config and find the corresponding\n");
printf("configure-specific file (for example, powerpc-ibm-aix5.x) and add\n");
- printf("hdf5_mpi_complex_derived_datatype_works=${hdf5_mpi_complex_derived_datatype-works='no'}\n");
+ printf("hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype-works='no'}\n");
printf(" at the end of the file.\n");
printf(" Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n");
}
@@ -860,7 +862,7 @@ static int test_mpio_derived_dtype(char *filename) {
printf("Complicated derived datatype is WORKING at this platform\n");
printf(" Go back to hdf5/config and find the corresponding \n");
printf(" configure-specific file (for example, powerpc-ibm-aix5.x) and delete the line\n");
- printf("hdf5_mpi_complex_derived_datatype_works=${hdf5_mpi_complex_derived_datatype-works='no'}\n");
+ printf("hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype-works='no'}\n");
printf(" at the end of the file.\n");
printf("Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n");
}
@@ -896,9 +898,9 @@ If it turns out that the previous working MPI-IO package no longer works, this t
we can turn off the support for special collective IO; currently only special collective IO.
*/
-static int test_mpio_special_collective(char *filename) {
-
- char hostname[128];
+static int
+test_mpio_special_collective(char *filename)
+{
int mpi_size, mpi_rank;
MPI_File fh;
MPI_Datatype etype,buftype,filetype;
@@ -907,12 +909,10 @@ static int test_mpio_special_collective(char *filename) {
int mpi_err;
char writedata[2];
char *buf;
- char expect_val;
- int i, irank;
+ int i;
int count,bufcount;
int blocklens[2];
MPI_Aint offsets[2];
- int nerrors = 0; /* number of errors */
MPI_Offset mpi_off;
MPI_Status mpi_stat;
int retcode;
@@ -1018,7 +1018,7 @@ static int test_mpio_special_collective(char *filename) {
printf("special collective IO is NOT working at this platform\n");
printf("Go back to hdf5/config and find the corresponding\n");
printf("configure-specific file (for example, powerpc-ibm-aix5.x) and add\n");
- printf("hdf5_mpi_special_collective_io_works=${hdf5_mpi_special_collective_io_works='no'}\n");
+ printf("hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'}\n");
printf(" at the end of the file.\n");
printf(" Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n");
}
@@ -1031,7 +1031,7 @@ static int test_mpio_special_collective(char *filename) {
printf("special collective IO is WORKING at this platform\n");
printf(" Go back to hdf5/config and find the corresponding \n");
printf(" configure-specific file (for example, powerpc-ibm-aix5.x) and delete the line\n");
- printf("hdf5_mpi_special_collective_io_works=${hdf5_mpi_special_collective_io_works='no'}\n");
+ printf("hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'}\n");
printf(" at the end of the file.\n");
printf("Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n");
}
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c
index e8f3f6c..ebe5c38 100644
--- a/testpar/t_pflush1.c
+++ b/testpar/t_pflush1.c
@@ -50,13 +50,14 @@ static double the_data[100][100];
*
*-------------------------------------------------------------------------
*/
-hid_t create_file(char* name, hid_t fapl)
-{
+static hid_t
+create_file(char* name, hid_t fapl)
+{
hid_t file, dcpl, space, dset, groups, grp, plist;
hsize_t ds_size[2] = {100, 100};
hsize_t ch_size[2] = {5, 5};
hsize_t i, j;
-
+
if((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
@@ -70,8 +71,8 @@ hid_t create_file(char* name, hid_t fapl)
plist = H5Pcreate(H5P_DATASET_XFER);
H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE);
-
-
+
+
/* Write some data */
for(i = 0; i < ds_size[0]; i++) {
/*
@@ -113,7 +114,7 @@ error:
* Modifications:
* Leon Arber
* Sept. 26, 2006, expand test to check for failure if H5Fflush is not called.
- *
+ *
*
*-------------------------------------------------------------------------
*/
@@ -121,7 +122,7 @@ int
main(int argc, char* argv[])
{
hid_t file1, file2, fapl;
- int *mpifh_p = NULL;
+ MPI_File *mpifh_p = NULL;
char name[1024];
const char *envval = NULL;
int mpi_size, mpi_rank;
@@ -130,15 +131,15 @@ main(int argc, char* argv[])
MPI_Init(&argc, &argv);
MPI_Comm_size(comm, &mpi_size);
- MPI_Comm_rank(comm, &mpi_rank);
+ MPI_Comm_rank(comm, &mpi_rank);
fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_mpio(fapl, comm, info);
- if(mpi_rank == 0)
+ if(mpi_rank == 0)
TESTING("H5Fflush (part1)");
envval = HDgetenv("HDF5_DRIVER");
- if(envval == NULL)
+ if(envval == NULL)
envval = "nomatch";
if(HDstrcmp(envval, "split")) {
/* Create the file */
@@ -152,17 +153,16 @@ main(int argc, char* argv[])
file2 = create_file(name, fapl);
- if(mpi_rank == 0)
+ if(mpi_rank == 0)
PASSED();
fflush(stdout);
fflush(stderr);
- }
- else
- {
+ } /* end if */
+ else {
SKIPPED();
puts(" Test not compatible with current Virtual File Driver");
- }
-
+ } /* end else */
+
/*
* Some systems like Linux with mpich, if you just _exit without MPI_Finalize
* called, it would terminate but left the launching process waiting forever.
@@ -173,25 +173,25 @@ main(int argc, char* argv[])
* Note that MPIO VFD returns the address of the file-handle in the VFD struct
* because MPI_File_close wants to modify the file-handle variable.
*/
-
+
/* close file1 */
- if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0){
+ if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0) {
printf("H5Fget_vfd_handle for file1 failed\n");
goto error;
- }
- if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){
+ } /* end if */
+ if(MPI_File_close(mpifh_p) != MPI_SUCCESS) {
printf("MPI_File_close for file1 failed\n");
goto error;
- }
+ } /* end if */
/* close file2 */
- if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0){
+ if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0) {
printf("H5Fget_vfd_handle for file2 failed\n");
goto error;
- }
- if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){
+ } /* end if */
+ if(MPI_File_close(mpifh_p) != MPI_SUCCESS) {
printf("MPI_File_close for file2 failed\n");
goto error;
- }
+ } /* end if */
fflush(stdout);
fflush(stderr);
diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c
index 4ca6a96..a570d4c 100644
--- a/testpar/t_pflush2.c
+++ b/testpar/t_pflush2.c
@@ -49,7 +49,8 @@ static double the_data[100][100];
*
*-------------------------------------------------------------------------
*/
-int check_file(char* name, hid_t fapl)
+static int
+check_file(char* name, hid_t fapl)
{
hid_t file, space, dset, groups, grp, plist;
hsize_t ds_size[2];
@@ -144,7 +145,7 @@ main(int argc, char* argv[])
MPI_Init(&argc, &argv);
MPI_Comm_size(comm, &mpi_size);
- MPI_Comm_rank(comm, &mpi_rank);
+ MPI_Comm_rank(comm, &mpi_rank);
fapl1 = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_mpio(fapl1, comm, info);
@@ -152,10 +153,10 @@ main(int argc, char* argv[])
fapl2 = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_mpio(fapl2, comm, info);
-
+
if(mpi_rank == 0)
TESTING("H5Fflush (part2 with flush)");
-
+
/* Don't run this test using the core or split file drivers */
envval = HDgetenv("HDF5_DRIVER");
if (envval == NULL)
@@ -168,14 +169,14 @@ main(int argc, char* argv[])
H5_FAILED()
goto error;
}
- else if(mpi_rank == 0)
+ else if(mpi_rank == 0)
{
PASSED()
}
-
+
/* Check the case where the file was not flushed. This should give an error
* so we turn off the error stack temporarily */
- if(mpi_rank == 0)
+ if(mpi_rank == 0)
TESTING("H5Fflush (part2 without flush)");
H5Eget_auto2(H5E_DEFAULT,&func,NULL);
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
@@ -183,7 +184,7 @@ main(int argc, char* argv[])
h5_fixname(FILENAME[1], fapl2, name, sizeof name);
if(check_file(name, fapl2))
{
- if(mpi_rank == 0)
+ if(mpi_rank == 0)
{
PASSED()
}
diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c
index 3c7a2b3..af0e6bc 100644
--- a/testpar/t_posix_compliant.c
+++ b/testpar/t_posix_compliant.c
@@ -701,7 +701,8 @@ static int find_writesize(int rank, int numprocs, int size)
return write_size;
}
-static void vrfy_elements(int* a, int* b, int size, int rank)
+static void
+vrfy_elements(int* a, int* b, int size, int rank)
{
int i, counter = 0;
@@ -725,7 +726,8 @@ static void vrfy_elements(int* a, int* b, int size, int rank)
/* print an explanation message by MAIN (0) process.
*/
-void header_msg(void)
+static void
+header_msg(void)
{
printf(
"Purpose:\n"
@@ -736,7 +738,8 @@ void header_msg(void)
);
}
-int main(int argc, char* argv[])
+int
+main(int argc, char* argv[])
{
int numprocs, rank, opt, mpi_tests=1, posix_tests=1;
@@ -816,11 +819,11 @@ int main(int argc, char* argv[])
if(write_size == 0)
{
- lb = 1024;
+ 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 = 1024*512;
+ ub = lb*128;
inc = 4;
}
else
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index 71d526b..667872c 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -46,7 +46,7 @@ static void coll_read_test(int chunk_factor);
/*-------------------------------------------------------------------------
* Function: coll_irregular_cont_write
*
- * Purpose: Wrapper to test the collectively irregular hyperslab write in
+ * Purpose: Wrapper to test the collectively irregular hyperslab write in
contiguous storage
*
* Return: Success: 0
@@ -73,7 +73,7 @@ coll_irregular_cont_write(void)
/*-------------------------------------------------------------------------
* Function: coll_irregular_cont_read
*
- * Purpose: Wrapper to test the collectively irregular hyperslab read in
+ * Purpose: Wrapper to test the collectively irregular hyperslab read in
contiguous storage
*
* Return: Success: 0
@@ -99,7 +99,7 @@ coll_irregular_cont_read(void)
/*-------------------------------------------------------------------------
* Function: coll_irregular_simple_chunk_write
*
- * Purpose: Wrapper to test the collectively irregular hyperslab write in
+ * Purpose: Wrapper to test the collectively irregular hyperslab write in
chunk storage(1 chunk)
*
* Return: Success: 0
@@ -207,7 +207,7 @@ coll_irregular_complex_chunk_read(void)
* Purpose: To test the collectively irregular hyperslab write in chunk
storage
* Input: number of chunks on each dimension
- if number is equal to 0, contiguous storage
+ if number is equal to 0, contiguous storage
* Return: Success: 0
*
* Failure: -1
@@ -248,7 +248,7 @@ void coll_write_test(int chunk_factor)
hsize_t chunk_dims[2];
herr_t ret;
- unsigned i,j;
+ unsigned i;
int fillvalue = 0; /* Fill value for the dataset */
#if 0
@@ -283,7 +283,7 @@ void coll_write_test(int chunk_factor)
mdim[1] = MSPACE_DIM2*mpi_size;
fsdim[0] = FSPACE_DIM1;
fsdim[1] = FSPACE_DIM2*mpi_size;
-
+
vector = (int*)HDmalloc(sizeof(int)*mdim1[0]*mpi_size);
matrix_out = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size);
matrix_out1 = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size);
@@ -342,7 +342,7 @@ void coll_write_test(int chunk_factor)
/* The First selection for FILE
*
* block (3,2)
- * stride(4,3)
+ * stride(4,3)
* count (1,768/mpi_size)
* start (0,1+768*3*mpi_rank/mpi_size)
*
@@ -361,10 +361,10 @@ void coll_write_test(int chunk_factor)
VRFY((ret >= 0),"hyperslab selection succeeded");
/* The Second selection for FILE
- *
+ *
* block (3,768)
* stride (1,1)
- * count (1,1)
+ * count (1,1)
* start (4,768*mpi_rank/mpi_size)
*
*/
@@ -460,11 +460,11 @@ void coll_write_test(int chunk_factor)
* Open the file.
*/
- /***
-
- For testing collective hyperslab selection write
+ /***
+
+ For testing collective hyperslab selection write
In this test, we are using independent read to check
- the correctedness of collective write compared with
+ the correctedness of collective write compared with
independent write,
In order to throughly test this feature, we choose
@@ -502,7 +502,7 @@ void coll_write_test(int chunk_factor)
/* The First selection for FILE to read
*
* block (1,1)
- * stride(1.1)
+ * stride(1.1)
* count (3,768/mpi_size)
* start (1,2+768*mpi_rank/mpi_size)
*
@@ -528,7 +528,7 @@ void coll_write_test(int chunk_factor)
/* The Second selection for FILE to read
*
* block (1,1)
- * stride(1.1)
+ * stride(1.1)
* count (3,1536/mpi_size)
* start (2,4+1536*mpi_rank/mpi_size)
*
@@ -566,7 +566,7 @@ void coll_write_test(int chunk_factor)
* Only the starting point is different.
* The first selection
* block (1,1)
- * stride(1.1)
+ * stride(1.1)
* count (3,768/mpi_size)
* start (0,768*mpi_rank/mpi_size)
*
@@ -591,7 +591,7 @@ void coll_write_test(int chunk_factor)
* Only the starting point is different.
* The second selection
* block (1,1)
- * stride(1,1)
+ * stride(1,1)
* count (3,1536/mpi_size)
* start (1,2+1536*mpi_rank/mpi_size)
*
@@ -622,7 +622,7 @@ void coll_write_test(int chunk_factor)
H5P_DEFAULT, matrix_out);
VRFY((ret >= 0),"H5D independent read succeed");
-
+
ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid,
H5P_DEFAULT, matrix_out1);
VRFY((ret >= 0),"H5D independent read succeed");
@@ -633,7 +633,7 @@ void coll_write_test(int chunk_factor)
if(matrix_out[i]!=matrix_out1[i]) ret = -1;
if(ret < 0) break;
}
-
+
VRFY((ret >= 0),"H5D irregular collective write succeed");
/*
@@ -676,7 +676,7 @@ void coll_write_test(int chunk_factor)
* Purpose: To test the collectively irregular hyperslab read in chunk
storage
* Input: number of chunks on each dimension
- if number is equal to 0, contiguous storage
+ if number is equal to 0, contiguous storage
* Return: Success: 0
*
* Failure: -1
@@ -685,11 +685,12 @@ void coll_write_test(int chunk_factor)
* Dec 2nd, 2004
*
* Modifications: Oct 18th, 2005
- * Note: This test must be used with the correpsonding
- coll_write_test.
+ * Note: This test must be used with the correpsonding
+ coll_write_test.
*-------------------------------------------------------------------------
*/
-void coll_read_test(int chunk_factor)
+static void
+coll_read_test(int chunk_factor)
{
const char *filename;
@@ -706,14 +707,14 @@ void coll_read_test(int chunk_factor)
dataset on the disk */
#endif
- hsize_t mdim[2];
+ hsize_t mdim[2];
hsize_t start[2]; /* Start of hyperslab */
hsize_t stride[2]; /* Stride of hyperslab */
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
herr_t ret;
- unsigned i,j;
+ unsigned i;
int *matrix_out;
int *matrix_out1;
@@ -739,7 +740,7 @@ void coll_read_test(int chunk_factor)
/* Initialize the buffer */
-
+
mdim[0] = MSPACE_DIM1;
mdim[1] = MSPACE_DIM2*mpi_size;
matrix_out =(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
@@ -772,7 +773,7 @@ void coll_read_test(int chunk_factor)
/* The First selection for FILE to read
*
* block (1,1)
- * stride(1.1)
+ * stride(1.1)
* count (3,768/mpi_size)
* start (1,2+768*mpi_rank/mpi_size)
*
@@ -792,7 +793,7 @@ void coll_read_test(int chunk_factor)
/* The Second selection for FILE to read
*
* block (1,1)
- * stride(1.1)
+ * stride(1.1)
* count (3,1536/mpi_size)
* start (2,4+1536*mpi_rank/mpi_size)
*
@@ -821,7 +822,7 @@ void coll_read_test(int chunk_factor)
* Only the starting point is different.
* The first selection
* block (1,1)
- * stride(1.1)
+ * stride(1.1)
* count (3,768/mpi_size)
* start (0,768*mpi_rank/mpi_size)
*
@@ -844,7 +845,7 @@ void coll_read_test(int chunk_factor)
* Only the starting point is different.
* The second selection
* block (1,1)
- * stride(1,1)
+ * stride(1,1)
* count (3,1536/mpi_size)
* start (1,2+1536*mpi_rank/mpi_size)
*
@@ -932,3 +933,4 @@ void coll_read_test(int chunk_factor)
return ;
}
+
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index 2760a8b..4dabada 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -24,8 +24,8 @@
#endif /* !PATH_MAX */
/* global variables */
-int dim0 = DIM0;
-int dim1 = DIM1;
+int dim0;
+int dim1;
int chunkdim0;
int chunkdim1;
int nerrors = 0; /* errors count */
@@ -119,8 +119,8 @@ usage(void)
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 <dim0> <dim1>\tdataset dimensions. Defaults (%d,%d)\n",
- DIM0, DIM1);
+ 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");
printf("\n");
}
@@ -138,6 +138,7 @@ parse_options(int argc, char **argv)
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
/* setup default chunk-size. Make sure sizes are > 0 */
+
chunkdim0 = (dim0+9)/10;
chunkdim1 = (dim1+9)/10;
@@ -184,9 +185,9 @@ parse_options(int argc, char **argv)
nerrors++;
return(1);
}
- dim0 = atoi(*(++argv));
+ dim0 = atoi(*(++argv))*mpi_size;
argc--;
- dim1 = atoi(*(++argv));
+ dim1 = atoi(*(++argv))*mpi_size;
/* set default chunkdim sizes too */
chunkdim0 = (dim0+9)/10;
chunkdim1 = (dim1+9)/10;
@@ -325,6 +326,9 @@ int main(int argc, char **argv)
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ dim0 = ROW_FACTOR*mpi_size;
+ dim1 = COL_FACTOR*mpi_size;
+
if (MAINPROCESS){
printf("===================================\n");
printf("PHDF5 TESTS START\n");
@@ -367,7 +371,6 @@ int main(int argc, char **argv)
"extendible dataset independent write #2", PARATESTFILE);
AddTest("selnone", none_selection_chunk, NULL,
"chunked dataset with none-selection", PARATESTFILE);
-
AddTest("calloc", test_chunk_alloc, NULL,
"parallel extend Chunked allocation on serial file", PARATESTFILE);
AddTest("fltread", test_filter_read, NULL,
@@ -399,7 +402,7 @@ int main(int argc, char **argv)
"collective group and dataset write", &collngroups_params);
AddTest("ingrpr", independent_group_read, NULL,
"independent group and dataset read", &collngroups_params);
- AddTest("bigdset", big_dataset, NULL,
+ AddTest("bigdset", big_dataset, NULL,
"big dataset test", PARATESTFILE);
AddTest("fill", dataset_fillvalue, NULL,
"dataset fill value", PARATESTFILE);
@@ -436,8 +439,8 @@ int main(int argc, char **argv)
AddTest((mpi_size < 3)? "-cchunk10" : "cchunk10",
coll_chunk10,NULL,
"multiple chunk collective IO transferring to independent IO",PARATESTFILE);
-
-
+
+
/* irregular collective IO tests*/
AddTest("ccontw",
@@ -460,35 +463,6 @@ int main(int argc, char **argv)
"collective irregular complex chunk read",PARATESTFILE);
-#if 0
- if((mpi_size > 3) && MAINPROCESS) {
- printf("Collective irregular chunk IO tests haven't been tested \n");
- printf(" for the number of process greater than 3.\n");
- printf("Please try with the number of process \n");
- printf(" no greater than 3 for collective irregular chunk IO test.\n");
- printf("Collective irregular chunk tests will be skipped \n");
- }
- AddTest((mpi_size > 3) ? "-ccontw" : "ccontw",
- coll_irregular_cont_write,NULL,
- "collective irregular contiguous write",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-ccontr" : "ccontr",
- coll_irregular_cont_read,NULL,
- "collective irregular contiguous read",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-cschunkw" : "cschunkw",
- coll_irregular_simple_chunk_write,NULL,
- "collective irregular simple chunk write",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-cschunkr" : "cschunkr",
- coll_irregular_simple_chunk_read,NULL,
- "collective irregular simple chunk read",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-ccchunkw" : "ccchunkw",
- coll_irregular_complex_chunk_write,NULL,
- "collective irregular complex chunk write",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-ccchunkr" : "ccchunkr",
- coll_irregular_complex_chunk_read,NULL,
- "collective irregular complex chunk read",PARATESTFILE);
-#endif
-
-
AddTest("null", null_dataset, NULL,
"null dataset test", PARATESTFILE);
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index 81ad0f5..24c4432 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -36,6 +36,8 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
/* Constants definitions */
#define DIM0 600 /* Default dataset sizes. */
#define DIM1 1200 /* Values are from a monitor pixel sizes */
+#define ROW_FACTOR 8 /* Nominal row factor for dataset size */
+#define COL_FACTOR 16 /* Nominal column factor for dataset size */
#define RANK 2
#define DATASETNAME1 "Data1"
#define DATASETNAME2 "Data2"