summaryrefslogtreecommitdiffstats
path: root/fortran/src
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2005-06-30 23:35:32 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2005-06-30 23:35:32 (GMT)
commit43f091f462202a84a863f000582e75fd6c04e6f4 (patch)
tree00bd95eeb9f866516324e4481a78174e6628d651 /fortran/src
parentafcd1ddb398e04006da8b11a95a60cec61da7349 (diff)
downloadhdf5-43f091f462202a84a863f000582e75fd6c04e6f4.zip
hdf5-43f091f462202a84a863f000582e75fd6c04e6f4.tar.gz
hdf5-43f091f462202a84a863f000582e75fd6c04e6f4.tar.bz2
[svn-r11008] Purpose:
Feature: tests now use parallel make and only run once Description: When make is invoked in parallel (using the -j option), several tests will now be run simultaneously. This should speed up testing on a number of systems. When a test passes, it creates a foo.chkexe or foo.chksh file, which prevents the test from running again unless the test or library changes. Solution: Most of the changes live in config/conclude.am. Added *.chkexe and *.chksh files to the list of files to be cleaned at "make mostlyclean" time. Parallel tests still run one at a time, but use the same make instructions as serial tests. Platforms tested: mir, eirene, sleipnir, pommier, copper, modi4 (some errors occurred, probably due to the test being run before updating hdf5. Will re-run tests after checkin.)
Diffstat (limited to 'fortran/src')
-rw-r--r--fortran/src/Makefile.am2
-rw-r--r--fortran/src/Makefile.in179
2 files changed, 86 insertions, 95 deletions
diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am
index 52dee19..83e71e8 100644
--- a/fortran/src/Makefile.am
+++ b/fortran/src/Makefile.am
@@ -55,7 +55,7 @@ DISTCLEANFILES=h5fc libhdf5_fortran.settings
# H5fortran_types.f90 and H5f90i.h are automatically generaed by
# H5match_types, and must be cleaned explicitly. H5fort_type_defines.h
# is generated by H5fortran_detect
-MOSTLYCLEANFILES=H5fortran_types.f90 H5f90i_gen.h H5fort_type_defines.h \
+MOSTLYCLEANFILES+=H5fortran_types.f90 H5f90i_gen.h H5fort_type_defines.h \
H5fortran_detect.f90
# Fortran module files can have different extensions and different names
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 7f54f68..dc7bf96 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -339,6 +339,14 @@ H5CC_PP = $(bindir)/h5pcc
H5FC = $(bindir)/h5fc
H5FC_PP = $(bindir)/h5pfc
+# .chkexe and .chksh files are used to mark tests that have run successfully.
+
+# H5fortran_types.f90 and H5f90i.h are automatically generaed by
+# H5match_types, and must be cleaned explicitly. H5fort_type_defines.h
+# is generated by H5fortran_detect
+MOSTLYCLEANFILES = *.chkexe *.chksh H5fortran_types.f90 H5f90i_gen.h \
+ H5fort_type_defines.h H5fortran_detect.f90
+
# Include src directory in both Fortran and C flags (C compiler is used
# for linking)
INCLUDES = -I$(top_srcdir)/src
@@ -369,13 +377,6 @@ libhdf5_fortran_la_SOURCES = H5fortran_flags.f90 H5f90global.f90 \
# Remove them only when distclean.
DISTCLEANFILES = h5fc libhdf5_fortran.settings
-# H5fortran_types.f90 and H5f90i.h are automatically generaed by
-# H5match_types, and must be cleaned explicitly. H5fort_type_defines.h
-# is generated by H5fortran_detect
-MOSTLYCLEANFILES = H5fortran_types.f90 H5f90i_gen.h H5fort_type_defines.h \
- H5fortran_detect.f90
-
-
# Install libhdf5_fortran.settings in lib directory
settingsdir = $(libdir)
settings_DATA = libhdf5_fortran.settings
@@ -413,6 +414,10 @@ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_)
+TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_)
+TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chksh_)
+TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chksh_)
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -843,9 +848,9 @@ build-lib: $(LIB)
build-progs: $(LIB) $(PROGS)
build-tests: $(LIB) $(PROGS) $(TESTS)
-lib progs tests ::
- @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; \
- for d in X $(SUBDIRS); do \
+lib progs tests check-s check-p ::
+ @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1;
+ @for d in X $(SUBDIRS); do \
if test $$d != X -a $$d != .; then \
(set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
fi; \
@@ -872,71 +877,83 @@ install-doc uninstall-doc:
check-TESTS: test
test _test:
- $(MAKE) _check-s
- $(MAKE) _check-p
-
-# Run check-s/check-p recursively down SUBDIRS
-check-s check-p:
- @$(MAKE) $(AM_MAKEFLAGS) _$@ || exit 1; \
- for d in X $(SUBDIRS); do \
- if test $$d != X -a $$d != .; then \
- (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
- fi; \
- done
+ @$(MAKE) build-check-s
+ @$(MAKE) build-check-p
# Actual execution of check-s.
-_check-s: $(LIB) $(PROGS) $(TESTS)
+build-check-s: $(LIB) $(PROGS) $(TESTS)
@if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \
echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
- fi
- @for test in $(TEST_PROG) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- if test "X$(HDF_FORTRAN)" = "Xyes"; then \
- echo "Fortran API: Testing $$test $(TEST_FLAGS)"; \
- elif test "X$(HDF_CXX)" = "Xyes"; then \
- echo "C++ API: Testing $$test $(TEST_FLAGS)"; \
- else \
- echo "Testing $$test $(TEST_FLAGS)"; \
- fi; \
- echo "============================"; \
- srcdir="$(srcdir)" \
- $(RUNTESTS) ./$$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
- @for test in $(TEST_SCRIPT) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- if test "X$(HDF_FORTRAN)" = "Xyes"; then \
- echo "Fortran API: Testing $$test $(TEST_FLAGS)"; \
- elif test "X$(HDF_CXX)" = "Xyes"; then \
- echo "C++ API: Testing $$test $(TEST_FLAGS)"; \
- else \
- echo "Testing $$test $(TEST_FLAGS)"; \
- fi; \
- echo "============================"; \
- RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
- srcdir="$(srcdir)" \
- /bin/sh $$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
+ fi
+ @$(MAKE) $(AM_MAKEFLAGS) _exec_check-s
@if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \
echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
fi
+_exec_check-s: $(TEST_PROG_CHKEXE) $(TEST_SCRIPT_CHKSH)
+
+# The .chkexe_ here is the "dummy" that prevents the target from being
+# empty if there are no tests in the current directory.
+$(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) .chkexe_:
+ @if test "X$@" != "X.chkexe_"; then \
+ echo "============================"; \
+ if test -e $(@:.chkexe_=.chkexe) && \
+ test $(@:.chkexe_=.chkexe) -nt $(@:.chkexe_=)$(EXEEXT); then \
+ echo "No need to test $(@:.chkexe_=)$(EXEEXT) again."; \
+ else \
+ if test "X$(HDF_FORTRAN)" = "Xyes"; then \
+ echo "Fortran API: Testing $(@:.chkexe_=)$(EXEEXT) $(TEST_FLAGS)"; \
+ elif test "X$(HDF_CXX)" = "Xyes"; then \
+ echo "C++ API: Testing $(@:.chkexe_=)$(EXEEXT) $(TEST_FLAGS)"; \
+ else \
+ echo "Testing $(@:.chkexe_=)$(EXEEXT) $(TEST_FLAGS)"; \
+ fi; \
+ echo "============================"; \
+ srcdir="$(srcdir)" \
+ $(RUNTESTS) ./$(@:.chkexe_=)$(EXEEXT) $(TEST_FLAGS) \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ exit 1; \
+ echo ""; \
+ echo "Finished testing $(@:.chkexe_=)$(EXEEXT) $(TEST_FLAGS)"; \
+ fi; \
+ echo "============================"; \
+ fi
+
+# The .chksh_ here is the "dummy" that prevents the target from being
+# empty if there are no tests in the current directory.
+$(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) .chksh_:
+ @if test "X$@" != "X.chksh_"; then \
+ echo "============================"; \
+ if test -e $(@:.chksh_=.chksh) && \
+ test $(@:.chksh_=.chksh) -nt $(@:.chksh_=); then \
+ echo "No need to test $(@:.chksh_=) again."; \
+ else \
+ if test "X$(HDF_FORTRAN)" = "Xyes"; then \
+ echo "Fortran API: Testing $(@:.chksh_=) $(TEST_FLAGS)"; \
+ elif test "X$(HDF_CXX)" = "Xyes"; then \
+ echo "C++ API: Testing $(@:.chksh_=) $(TEST_FLAGS)"; \
+ else \
+ echo "Testing $(@:.chksh_=) $(TEST_FLAGS)"; \
+ fi; \
+ echo "============================"; \
+ RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
+ srcdir="$(srcdir)" \
+ $(SHELL) ./$(@:.chksh_=) $(TEST_FLAGS) \
+ && touch $(@:.chksh_=.chksh) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ exit 1; \
+ echo ""; \
+ echo "Finished testing $(@:.chksh_=) $(TEST_FLAGS)"; \
+ fi; \
+ echo "============================"; \
+ fi
+
# Actual execution of check-p.
-_check-p: $(LIB) $(PROGS) $(TESTS)
+build-check-p: $(LIB) $(PROGS) $(TESTS)
@if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \
echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
- fi
+ fi
@if test -n "$(TEST_PROG_PARA)"; then \
echo "**** Hint ****"; \
echo "Parallel test files reside in the current directory" \
@@ -949,40 +966,14 @@ _check-p: $(LIB) $(PROGS) $(TESTS)
fi
@for test in $(TEST_PROG_PARA) dummy; do \
if test $$test != dummy; then \
- echo "============================"; \
- if test "X$(HDF_FORTRAN)" = "Xyes"; then \
- echo "Fortran API: Testing $$test $(TEST_FLAGS)"; \
- elif test "X$(HDF_CXX)" = "Xyes"; then \
- echo "C++ API: Testing $$test $(TEST_FLAGS)"; \
- else \
- echo "Testing $$test $(TEST_FLAGS)"; \
- fi; \
- echo "============================"; \
- srcdir="$(srcdir)" \
- $(RUNPARALLEL) ./$$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
+ RUNTESTS="$(RUNPARALLEL)"; \
fi; \
done; \
test $$test = dummy || false
@for test in $(TEST_SCRIPT_PARA) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- if test "X$(HDF_FORTRAN)" = "Xyes"; then \
- echo "Fortran API: Testing $$test $(TEST_FLAGS)"; \
- elif test "X$(HDF_CXX)" = "Xyes"; then \
- echo "C++ API: Testing $$test $(TEST_FLAGS)"; \
- else \
- echo "Testing $$test $(TEST_FLAGS)"; \
- fi; \
- echo "============================"; \
- RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
- srcdir="$(srcdir)" \
- /bin/sh $$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chksh_; \
fi; \
done; \
test $$test = dummy || false