From 9a2bea02e7f12453c591045594b8238cc4f5eeae Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr> Date: Fri, 13 Apr 2018 11:57:00 +0200 Subject: [PATCH] shortened advection tests --- ci/scripts/test.sh | 5 ++++- hysop/__init__.py | 4 ++-- hysop/__init__.py.in | 4 ++-- hysop/core/arrays/tests/test_array.py | 5 +++-- hysop/operator/tests/test_directional_advection.py | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ci/scripts/test.sh b/ci/scripts/test.sh index 729b3837e..65adde1d2 100644 --- a/ci/scripts/test.sh +++ b/ci/scripts/test.sh @@ -32,9 +32,12 @@ fi export PYTHONPATH="$INSTALL_DIR/lib/python2.7/site-packages" python -c 'import hysop; print hysop' -$HYSOP_DIR/fields/tests/test_cartesian.sh +# long backend dependent tests #python "$HYSOP_DIR/backend/device/codegen/kernels/tests/test_directional_advection.py" #python "$HYSOP_DIR/backend/device/codegen/kernels/tests/test_directional_remesh.py" + +python "$HYSOP_DIR/core/arrays/tests/test_array.py" +$HYSOP_DIR/fields/tests/test_cartesian.sh python "$HYSOP_DIR/operator/tests/test_analytic.py" python "$HYSOP_DIR/operator/tests/test_transpose.py" python "$HYSOP_DIR/operator/tests/test_derivative.py" diff --git a/hysop/__init__.py b/hysop/__init__.py index 3d8587513..5002ef3da 100644 --- a/hysop/__init__.py +++ b/hysop/__init__.py @@ -45,8 +45,8 @@ __TEST_ALL_OPENCL_PLATFORMS__ = get_env('TEST_ALL_OPENCL_PLATFORMS', False) __ENABLE_LONG_TESTS__ = get_env('ENABLE_LONG_TESTS', ("OFF" is "ON")) # OpenCL -__DEFAULT_PLATFORM_ID__ = get_env('DEFAULT_PLATFORM_ID', 0) -__DEFAULT_DEVICE_ID__ = get_env('DEFAULT_DEVICE_ID', 0) +__DEFAULT_PLATFORM_ID__ = int(get_env('DEFAULT_PLATFORM_ID', 0)) +__DEFAULT_DEVICE_ID__ = int(get_env('DEFAULT_DEVICE_ID', 0)) if __MPI_ENABLED__: diff --git a/hysop/__init__.py.in b/hysop/__init__.py.in index 803773195..f63bf48fa 100644 --- a/hysop/__init__.py.in +++ b/hysop/__init__.py.in @@ -45,8 +45,8 @@ __TEST_ALL_OPENCL_PLATFORMS__ = get_env('TEST_ALL_OPENCL_PLATFORMS', False) __ENABLE_LONG_TESTS__ = get_env('ENABLE_LONG_TESTS', ("@ENABLE_LONG_TESTS@" is "ON")) # OpenCL -__DEFAULT_PLATFORM_ID__ = get_env('DEFAULT_PLATFORM_ID', @OPENCL_DEFAULT_OPENCL_PLATFORM_ID@) -__DEFAULT_DEVICE_ID__ = get_env('DEFAULT_DEVICE_ID', @OPENCL_DEFAULT_OPENCL_DEVICE_ID@) +__DEFAULT_PLATFORM_ID__ = int(get_env('DEFAULT_PLATFORM_ID', @OPENCL_DEFAULT_OPENCL_PLATFORM_ID@)) +__DEFAULT_DEVICE_ID__ = int(get_env('DEFAULT_DEVICE_ID', @OPENCL_DEFAULT_OPENCL_DEVICE_ID@)) if __MPI_ENABLED__: from hysop.core.mpi import MPI, main_rank, main_size, \ diff --git a/hysop/core/arrays/tests/test_array.py b/hysop/core/arrays/tests/test_array.py index 39eaf54d0..ef66f3e42 100644 --- a/hysop/core/arrays/tests/test_array.py +++ b/hysop/core/arrays/tests/test_array.py @@ -546,14 +546,15 @@ class TestArray(object): tol = atol[0] if not close: close = allclose(r0,r1,relaxed_precision=True,ignore_mask=mask) - tol = 1e-2 + tol = 1e-1 if close: msg='WARNING: test passed with relaxed precision for {}::{}.' msg=msg.format(backend.__class__.__name__, opname) print msg if not close: msg = '\n{}::{} returned dtypes did match (got {}) ' - msg+= 'but failed to match numpy output,\n absolute tolerance was set to {}.' + msg+= 'but failed to match numpy output,' + msg+='\n absolute tolerance was set to {}.' msg=msg.format(backend.__class__.__name__,opname,r1.dtype,tol) print msg if isinstance(r0, np.ndarray) and isinstance(r1, np.ndarray): diff --git a/hysop/operator/tests/test_directional_advection.py b/hysop/operator/tests/test_directional_advection.py index 6e5c440c5..f64496d4f 100644 --- a/hysop/operator/tests/test_directional_advection.py +++ b/hysop/operator/tests/test_directional_advection.py @@ -59,8 +59,8 @@ class TestDirectionalAdvectionOperator(object): else: flt_types = (npw.float,) time_integrators = (RK2,) - remesh_kernels = (Remesh.L4_2, Remesh.L4_2s,) - velocity_cfls = (0.62, 1.89) + remesh_kernels = (Remesh.L4_2,) + velocity_cfls = (1.89,) domain = Box(length=(2*npw.pi,)*dim) for dtype in flt_types: -- GitLab