Commit fd4c4c78 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added test/threads.test

parent 9c167b0f
......@@ -822,6 +822,7 @@ test/data/sp2gp_ref -text
test/data/sp2gpl_ref -text
test/data/t21_geosp_tsurf.grb -text
test/data/testfile01c.nc -text
test/data/thread1_ref -text
test/data/timavg_ref -text
test/data/timmax_ref -text
test/data/timmean_ref -text
......@@ -916,4 +917,5 @@ test/test_diff.py -text
test/test_info.py -text
test/test_intgridbil.py -text
test/test_operators -text
test/threads.test.in -text
test/wildcard.test.in -text
......@@ -250,6 +250,7 @@ ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_SERVICE = @ENABLE_SERVICE@
ENABLE_THREADS = @ENABLE_THREADS@
EXEEXT = @EXEEXT@
FCFLAGS = @FCFLAGS@
FGREP = @FGREP@
......
......@@ -672,6 +672,7 @@ ZLIB_LIBS
ZLIB_INCLUDE
THREADS_LIBS
THREADS_INCLUDE
ENABLE_THREADS
PTHREAD_CFLAGS
PTHREAD_LIBS
PTHREAD_CC
......@@ -17787,6 +17788,7 @@ CFLAGS="$CFLAGS ${OPENMP_CFLAGS}"
 
# ----------------------------------------------------------------------
# Checks for multithreaded compiling + linking
ENABLE_THREADS=no
 
# Check whether --with-threads was given.
if test "${with_threads+set}" = set; then :
......@@ -18234,6 +18236,7 @@ if test x"$ax_pthread_ok" = xyes; then
 
$as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h
 
ENABLE_THREADS=yes
:
else
ax_pthread_ok=no
......@@ -18311,6 +18314,7 @@ _ACEOF
 
fi
 
ENABLE_THREADS=yes
THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
THREADS_INCLUDE=" -I$THREADS_ROOT/include" ;; #(
*) :
......@@ -18318,6 +18322,7 @@ fi
esac
 
 
# ----------------------------------------------------------------------
# Link application to ZLIB library, needed for netcdf
ZLIB_INCLUDE=''
......@@ -21315,7 +21320,7 @@ ac_config_files="$ac_config_files test/Ymonstat.test test/Fldstat.test test/Fldp
 
ac_config_files="$ac_config_files test/Afterburner.test test/Detrend.test test/Arith.test test/Expr.test"
 
ac_config_files="$ac_config_files test/Gradsdes.test test/Collgrid.test test/wildcard.test"
ac_config_files="$ac_config_files test/Gradsdes.test test/Collgrid.test test/threads.test test/wildcard.test"
 
ac_config_files="$ac_config_files Makefile src/Makefile contrib/Makefile test/Makefile test/data/Makefile cdo.spec cdo.settings"
 
......@@ -22489,6 +22494,7 @@ do
"test/Expr.test") CONFIG_FILES="$CONFIG_FILES test/Expr.test" ;;
"test/Gradsdes.test") CONFIG_FILES="$CONFIG_FILES test/Gradsdes.test" ;;
"test/Collgrid.test") CONFIG_FILES="$CONFIG_FILES test/Collgrid.test" ;;
"test/threads.test") CONFIG_FILES="$CONFIG_FILES test/threads.test" ;;
"test/wildcard.test") CONFIG_FILES="$CONFIG_FILES test/wildcard.test" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
......@@ -24005,6 +24011,7 @@ _LT_EOF
"test/Expr.test":F) chmod a+x "$ac_file" ;;
"test/Gradsdes.test":F) chmod a+x "$ac_file" ;;
"test/Collgrid.test":F) chmod a+x "$ac_file" ;;
"test/threads.test":F) chmod a+x "$ac_file" ;;
"test/wildcard.test":F) chmod a+x "$ac_file" ;;
 
esac
......
......@@ -252,7 +252,7 @@ AC_CONFIG_FILES([test/Cat.test test/Gridarea.test test/Genweights.test test/Rema
AC_CONFIG_FILES([test/Select.test test/Spectral.test test/Timstat.test test/Vertint.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Ymonstat.test test/Fldstat.test test/Fldpctl.test test/Ensstat.test test/Enspctl.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Afterburner.test test/Detrend.test test/Arith.test test/Expr.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Gradsdes.test test/Collgrid.test test/wildcard.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Gradsdes.test test/Collgrid.test test/threads.test test/wildcard.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile test/Makefile test/data/Makefile cdo.spec cdo.settings])
AC_OUTPUT
......
......@@ -161,6 +161,7 @@ ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_SERVICE = @ENABLE_SERVICE@
ENABLE_THREADS = @ENABLE_THREADS@
EXEEXT = @EXEEXT@
FCFLAGS = @FCFLAGS@
FGREP = @FGREP@
......
......@@ -2,6 +2,7 @@ AC_DEFUN([ACX_OPTIONS],
[
# ----------------------------------------------------------------------
# Checks for multithreaded compiling + linking
ENABLE_THREADS=no
AC_ARG_WITH([threads],
[AC_HELP_STRING([--with-threads=<yes/no/directory>],
[Compile + link for multithreading [default=yes]])],
......@@ -12,7 +13,8 @@ THREADS_LIBS=''
AS_CASE([$with_threads],
[no],[AC_MSG_CHECKING([multithreading])
AC_MSG_RESULT([suppressed])],
[yes],[AX_PTHREAD([AC_DEFINE([HAVE_LIBPTHREAD],[1],[Define 1 for multithread support])],[AC_MSG_ERROR([multithreaded settings NOT found])])
[yes],[AX_PTHREAD([AC_DEFINE([HAVE_LIBPTHREAD],[1],[Define 1 for multithread support])
ENABLE_THREADS=yes],[AC_MSG_ERROR([multithreaded settings NOT found])])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
......@@ -22,8 +24,10 @@ AS_CASE([$with_threads],
CPPFLAGS="-I$THREADS_ROOT/include $CPPFLAGS "
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB([pthread],[pthread_create])
ENABLE_THREADS=yes
THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
THREADS_INCLUDE=" -I$THREADS_ROOT/include"])
AC_SUBST([ENABLE_THREADS])
AC_SUBST([THREADS_INCLUDE])
AC_SUBST([THREADS_LIBS])
# ----------------------------------------------------------------------
......
......@@ -369,6 +369,7 @@ ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_SERVICE = @ENABLE_SERVICE@
ENABLE_THREADS = @ENABLE_THREADS@
EXEEXT = @EXEEXT@
FCFLAGS = @FCFLAGS@
FGREP = @FGREP@
......
......@@ -7,7 +7,6 @@ test -n "$DATAPATH" || DATAPATH=./data
CDOOUT=cout
CDOERR=cerr
FORMAT="-f srv -b 32"
STATS="add sub mul div"
#
IFILE=$DATAPATH/pl_data
NTEST=1
......
......@@ -11,10 +11,10 @@ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/config/tap-driver.sh
# tests which should pass
TESTS = File.test Read_grib.test Read_netcdf.test Copy_netcdf.test Cat.test Gridarea.test Detrend.test \
TESTS = threads.test wildcard.test File.test Read_grib.test Read_netcdf.test Copy_netcdf.test Cat.test Gridarea.test Detrend.test \
Genweights.test Remap.test Select.test Spectral.test Ymonstat.test Timstat.test Ensstat.test \
Enspctl.test Fldstat.test Fldpctl.test Vertint.test Afterburner.test Arith.test Expr.test \
Gradsdes.test Collgrid.test wildcard.test
Gradsdes.test Collgrid.test
# tests which should fail
XFAIL_TESTS =
......
......@@ -92,7 +92,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/Afterburner.test.in $(srcdir)/Detrend.test.in \
$(srcdir)/Arith.test.in $(srcdir)/Expr.test.in \
$(srcdir)/Gradsdes.test.in $(srcdir)/Collgrid.test.in \
$(srcdir)/wildcard.test.in README
$(srcdir)/threads.test.in $(srcdir)/wildcard.test.in README
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
......@@ -108,7 +108,8 @@ CONFIG_CLEAN_FILES = File.test Read_grib.test Read_netcdf.test \
Remap.test Select.test Spectral.test Timstat.test Vertint.test \
Ymonstat.test Fldstat.test Fldpctl.test Ensstat.test \
Enspctl.test Afterburner.test Detrend.test Arith.test \
Expr.test Gradsdes.test Collgrid.test wildcard.test
Expr.test Gradsdes.test Collgrid.test threads.test \
wildcard.test
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
......@@ -379,6 +380,7 @@ ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_SERVICE = @ENABLE_SERVICE@
ENABLE_THREADS = @ENABLE_THREADS@
EXEEXT = @EXEEXT@
FCFLAGS = @FCFLAGS@
FGREP = @FGREP@
......@@ -518,10 +520,10 @@ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
# tests which should pass
TESTS = File.test Read_grib.test Read_netcdf.test Copy_netcdf.test Cat.test Gridarea.test Detrend.test \
TESTS = threads.test wildcard.test File.test Read_grib.test Read_netcdf.test Copy_netcdf.test Cat.test Gridarea.test Detrend.test \
Genweights.test Remap.test Select.test Spectral.test Ymonstat.test Timstat.test Ensstat.test \
Enspctl.test Fldstat.test Fldpctl.test Vertint.test Afterburner.test Arith.test Expr.test \
Gradsdes.test Collgrid.test wildcard.test
Gradsdes.test Collgrid.test
# $(top_srcdir)/test/test_Remap.sh \
......@@ -616,6 +618,8 @@ Gradsdes.test: $(top_builddir)/config.status $(srcdir)/Gradsdes.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Collgrid.test: $(top_builddir)/config.status $(srcdir)/Collgrid.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
threads.test: $(top_builddir)/config.status $(srcdir)/threads.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
wildcard.test: $(top_builddir)/config.status $(srcdir)/wildcard.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
......
......@@ -17,6 +17,7 @@ REMAP_REF = n16_bic_ref n16_bil_ref n16_con_ref n16_ycon_ref n16_laf_ref n16_
SELECT_REF = select1_ref select2_ref select3_ref select4_ref select5_ref
DETREND_REF = detrend_ref
EXPR_REF = expr1_ref aexpr1_ref expr2_ref aexpr2_ref
THREAD_REF = thread1_ref
GRADSDES_REF = pl_data.ctl pl_data.gmp
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(EXPR_REF) $(GRADSDES_REF)
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF)
......@@ -160,6 +160,7 @@ ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_SERVICE = @ENABLE_SERVICE@
ENABLE_THREADS = @ENABLE_THREADS@
EXEEXT = @EXEEXT@
FCFLAGS = @FCFLAGS@
FGREP = @FGREP@
......@@ -306,8 +307,9 @@ REMAP_REF = n16_bic_ref n16_bil_ref n16_con_ref n16_ycon_ref n16_laf_ref n16_nn_
SELECT_REF = select1_ref select2_ref select3_ref select4_ref select5_ref
DETREND_REF = detrend_ref
EXPR_REF = expr1_ref aexpr1_ref expr2_ref aexpr2_ref
THREAD_REF = thread1_ref
GRADSDES_REF = pl_data.ctl pl_data.gmp
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(EXPR_REF) $(GRADSDES_REF)
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF)
all: all-am
.SUFFIXES:
......
#! @SHELL@
echo 1..1 # Number of tests to be executed.
#
test -n "$CDO" || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
CDOOUT=cout
CDOERR=cerr
FORMAT="-f srv -b 32"
#
IFILE=$DATAPATH/pl_data
NTEST=1
function testfunc()
{
RSTAT=0
CDOTEST="chaining set $NTEST"
echo "Running test: $NTEST - $CDOTEST"
RFILE=$DATAPATH/thread${NTEST}_ref
OFILE=thread${NTEST}_res
CDOCOMMAND="$CDO $FORMAT $INSTR $IFILE $OFILE"
echo "$CDOCOMMAND"
if [ "@ENABLE_THREADS@" = yes ] ; then
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
$CDO diff $RFILE $OFILE > $CDOOUT 2> $CDOERR
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
rm -f $OFILE
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
else
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST # SKIP threads not enabled"
fi
let NTEST+=1
rm -f $OFILE
}
INSTR="-fldmean -timmean -select,code=,129,130,152"
testfunc
#
rm -f $CDOOUT $CDOERR
#
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment